pub fn derivative_stencil<T>(
f: &T,
x: f64,
step_size: Option<f64>,
order: DerivativeStencilOrder,
) -> Result<Vec<f64>, ErrorsJSL>Expand description
A derivative of f at x from the five-point stencil f(x − 2h), …, f(x + 2h). Returns a
one-element vector holding the requested derivative.
step_size is relative, as for derivative_2_point. The default balances truncation against
rounding for each formula: ε^{1/5} for the first and third derivatives and ε^{1/6} for the
second and fourth (around 10⁻³), since higher derivatives divide rounding errors by higher
powers of h.