pub type GradientFunction = Box<dyn Fn(&[f64], f64) -> Vec<f64> + Sync + Send>;
Type alias for gradient functions to reduce complexity
pub struct GradientFunction(/* private fields */);