# WritersLogic Float Stability Analyzer

> WritersLogic Float Stability Analyzer is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

Evaluates a floating-point expression on a grid, compares it against an arbitrary-precision reference, and reports digits lost to cancellation plus suggested numerically stable rewrites

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/float-stability?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-float-stability-analyzer-5b739728
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_7QJPyQhlU2EG3NOOp_ndC

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability writerslogic-float-stability-analyzer-5b739728 -d '<json body>'
```

Example prompt: Check whether my binary64 expression 'exp(x) - 1' loses more than 4 decimal digits of precision for x in the range [1e-10, 1], and if so suggest a numerically stable rewrite.

## When to prefer this

Use this endpoint when you need to detect catastrophic cancellation or precision loss in a specific mathematical expression before deploying it in numerical code, especially for formulas involving subtraction of nearly-equal quantities, expressions near zero, or compound functions like exp, log, or sqrt. It is particularly valuable when you suspect a known numerically unstable pattern (quadratic formula, log(1+x), etc.) and want an automated rewrite recommendation. Prefer it over manual analysis or symbolic algebra tools when you need quantitative digit-loss measurements across a range of inputs.

## Known failure modes

- Expression grammar violation if unsupported operators or functions are used
- Variable count exceeds maximum of 6
- Expression string exceeds 500-character limit
- min equals max or non-finite values in variable range causing invalid grid
- Division by zero or domain error in reference evaluation at a grid point

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

Returns the maximum number of decimal digits lost across the sampled grid, the specific input values that produced the worst error, any overflow/underflow/NaN conditions encountered, an automatically detected numerically stable rewrite (if one is recognized) with its own digit-loss score, and optionally a score for the caller-supplied alternative expression.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "precision": {
   "enum": [
    "binary64",
    "binary32"
   ],
   "type": "string",
   "description": "Arithmetic of the code under test. Default binary64."
  },
  "variables": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "name",
     "min",
     "max"
    ],
    "properties": {
     "max": {
      "type": "number",
      "description": "Largest value."
     },
     "min": {
      "type": "number",
      "description": "Smallest value the variable takes (finite binary64)."
     },
     "name": {
      "type": "string",
      "pattern": "^[A-Za-z_][A-Za-z0-9_]*$",
      "maxLength": 32
     },
     "scale": {
      "enum": [
       "linear",
       "log"
      ],
      "type": "string",
      "description": "Grid spacing. Default: log when 0 < min and max/min >= 1000, else linear (with probes near 0 when the range contains it)."
     }
    }
   },
   "maxItems": 6,
   "minItems": 1,
   "description": "Range of every free variable."
  },
  "expression": {
   "type": "string",
   "maxLength": 500,
   "description": "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": {
   "type": "string",
   "maxLength": 500,
   "description": "Optional algebraically equal expression to score on the same grid."
  },
  "maxDigitsLost": {
   "type": "integer",
   "maximum": 16,
   "minimum": 0,
   "description": "Fail above this many lost digits. Default 4."
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-float-stability-analyzer-5b739728/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
