fn quantile_with_scratch( values: &[f64], quantile: f64, scratch: &mut Vec<f64>, ) -> Option<f64>
Same as quantile_impl but reuses a caller-provided scratch buffer to avoid per-call allocation.