root_newton_raphson
Find a root of f(x)=0 using Newton-Raphson with numeric derivative, returning the root, convergence status, iteration table, and optional plot.
Instructions
Find a root of f(x) = 0 with the Newton-Raphson method (numeric derivative).
Args: func_str: Math expression in x. x0: Initial guess. tol: Convergence tolerance. max_iter: Maximum iterations. precision: Rounding digits. plot: When True, also return a PNG plot of f(x) and the root.
Returns:
Dict with the root, iteration table and convergence flag. With
plot=True a list [dict, Image] is returned instead.
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": {
"func_str": "<func_str>",
"x0": "<x0>"
},
"name": "root_newton_raphson"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x0 | Yes | ||
| tol | No | ||
| plot | No | ||
| func_str | Yes | ||
| max_iter | No | ||
| precision | No |