pub fn variance(data: &[f64]) -> f64
Compute the variance (population) of a slice.
Returns 0.0 for slices with fewer than 2 elements.