float-stability
Floating-point stability of an expression over variable ranges — Evaluates a real-valued expression in binary64 (or binary32) on a deterministic grid over the caller's variable ranges and compares each point with a certified arbitrary-precision reference, reporting the decimal digits lost, the worst input, and overflow, underflow or NaN. Recognises and rewrites exp(x)-1, 1-cos(x), log(1+x), sqrt(a)-sqrt(b), a^2-b^2, the quadratic formula, sqrt(x^2+y^2) and log-
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>",
"variables": "<variables>"
},
"name": "float-stability"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| precision | No | Arithmetic of the code under test. Default binary64. | |
| variables | Yes | Range of every free variable. | |
| expression | Yes | Expression in the declared variables, e.g. 'exp(x) - 1'. Operators + - * / ^ (or **); functions sqrt exp expm1 log log1p log2 log10 sin cos tan atan sinh cosh tanh abs pow hypot min max; constants pi, e. | |
| alternative | No | Optional algebraically equal expression to score on the same grid. | |
| maxDigitsLost | No | Fail above this many lost digits. Default 4. |