Function numerical_diff

Source
pub fn numerical_diff(
    func: &dyn Fn(&[f64]) -> f64,
    x: &[f64],
    h: f64,
) -> Vec<f64>
Expand description

Returns the gradients of each inputs.

  • func: Function for differentiate
  • x: Input value
  • h: Width for numerical differential. Just only needed is to be a small value.