fn quantile_bisect(p: f64, lo: f64, hi: f64, cdf: impl Fn(f64) -> f64) -> f64
Bisection-based quantile finder given a CDF. Finds x such that cdf(x) = p.