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).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"expression": "<expression>",
"x": "<x>"
},
"name": "numerical_diff"
}
}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'). |