Skip to main content

central_difference

Function central_difference 

pub fn central_difference<F>(
    function: F,
    at: f64,
    step: f64,
) -> Result<f64, CalculusError>
where F: FnMut(f64) -> f64,
Expand description

Approximates the first derivative with a central difference.

ยงErrors

Returns CalculusError when step is invalid, at is not finite, or sampled evaluations are not finite.