pub fn gradient_descent( f: fn(&[f64]) -> f64, grad: fn(&[f64]) -> Vec<f64>, x0: &[f64], lr: f64, max_iter: usize, tol: f64, ) -> Vec<f64>