Function russell_lab::check::deriv2_approx_eq_fw

source ·
pub fn deriv2_approx_eq_fw<F, A>(
    d2fdx2: 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 second derivative is not approximately equal to a numerical derivative (forward differences)

Checking:

d²f │   
——— │   
dx² │x=at_x

The numerical derivative is computed using a using forward differences with 8 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