pub fn finite_diff_gradient( f: &dyn Fn(&[f64]) -> f64, x: &[f64], h: f64, ) -> Vec<f64>
Compute finite-difference gradient of f at x with step h.