pub fn linear_fit<X, F: FnMut(&X, &mut [f64]) -> Result<()>>( p: usize, x: &[X], y: &[f64], f: F, ) -> Result<FitResult>