numerical_diff
Compute numerical derivatives of a math expression using a five-point stencil. Specify derivative order 1–4 and evaluation point to get accurate results without symbolic differentiation.
Instructions
Numerical differentiation of a math expression using five-point stencil (1st-4th order).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| h | No | Step size (default 1e-7). | |
| x | Yes | Point to evaluate at. | |
| order | No | Derivative order: 1, 2, 3, or 4 (default 1). | |
| expression | Yes | Math expression in x (e.g. 'x^2 + 3*x'). |