Skip to main content

backward_difference

Function backward_difference 

Source
pub fn backward_difference<F>(f: F, x: f64, h: f64) -> f64
where F: Fn(f64) -> f64,
Expand description

Approximates the first derivative with a backward difference.

This computes (f(x) - f(x - h)) / h. When h == 0.0, the result may be infinite or NaN according to normal floating-point behavior.