pub fn gradient_3d<F: Fn([f64; 3]) -> f64>( f: F, x: [f64; 3], h: f64, ) -> [f64; 3]
Gradient of f: R^3 → R using central differences.