root_bisection
Find a root of f(x) = 0 on a given interval using the bisection method, requiring opposite signs at the endpoints to guarantee convergence.
Instructions
Find a root of f(x) = 0 in [a, b] using the bisection method.
Requires f(a) and f(b) to have opposite signs (Bolzano's theorem).
Args: func_str: Math expression in x, e.g. "x**2 - 4". a: Left endpoint of the interval. b: Right endpoint of the interval (must be > a). tol: Convergence tolerance on the residual/error. max_iter: Maximum number of iterations. precision: Rounding digits for the reported root.
Returns: Dict with the root, convergence flag, iteration table and errors.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| a | Yes | ||
| b | Yes | ||
| tol | No | ||
| func_str | Yes | ||
| max_iter | No | ||
| precision | No |