pub fn median(xs: &[f64]) -> f64
Compute the median of a slice of floats. Handles even-length lists by averaging the two central values. The input is cloned; the caller’s slice is untouched.