fn percentile(sorted: &[f64], p: f64) -> f64
Compute a percentile from sorted data using linear interpolation.