[][src]Function bacon_sci::differentiate::derivative

pub fn derivative<N: ComplexField>(
    f: fn(_: N::RealField) -> N,
    x: N::RealField,
    h: N::RealField
) -> N

Numerically find the derivative of a function at a point.

Given a function of a real field to a complex field, an input point x, and a step size h, calculate the derivative of f at x using the five-point method.

Making h too small will lead to round-off error.