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
)
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
- Will panic if NAN, INFINITY, or NEG_INFINITY is found
- Will panic if the absolute difference of derivative values is greater than the tolerance
- Will panic if the function
f
returns an error