fn apply_p_flags(val: f64, lower_tail: bool, log_p: bool) -> f64
Post-process a probability value: apply lower.tail and log.p.