Function russell_lab::check::deriv1_approx_eq_fw

source ·
pub fn deriv1_approx_eq_fw<F, A>(
    dfdx: f64,
    at_x: f64,
    args: &mut A,
    tol: f64,
    f: F
)
where F: FnMut(f64, &mut A) -> Result<f64, StrError>,
Expand description

Panics if the first derivative is not approximately equal to a numerical derivative (forward differences)

Verifies:

df │   
—— │   
dx │x=at_x

The numerical derivative is computed using a using forward differences with 7 points

§Panics

  1. Will panic if NAN, INFINITY, or NEG_INFINITY is found
  2. Will panic if the absolute difference of derivative values is greater than the tolerance
  3. Will panic if the function f returns an error