fn prctile(sorted: &[f64], p: f64) -> f64
Percentile with linear interpolation (matching MATLAB’s prctile)
Input must be a sorted slice. Returns the p-th percentile (p in [0, 100]).