pub fn sample_var(data: &[f64]) -> f64
Calculates the sample variance from an array of data points in a numerically stable manner using the Welford algorithm.