Skip to main content

complex_step_derivative

Function complex_step_derivative 

Source
pub fn complex_step_derivative(
    f: &impl Fn(Complex) -> Complex,
    z: Complex,
    h: f64,
) -> Complex
Expand description

Numerically differentiate f at z using the complex-step method.

For analytic functions, f'(z) ≈ Im[f(z + ih)] / h with high accuracy.