{"uid":"cap_7QJPyQhlU2EG3NOOp_ndC","slug":"writerslogic-float-stability-analyzer-5b739728","name":"WritersLogic Float Stability Analyzer","description":"Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.","url":"https://agents.writerslogic.com/api/v1/float-stability?utm_source=zero.xyz","method":"POST","headers":{},"bodySchema":{"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."}}},"responseSchema":{"type":"json"},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.005","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.005/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.005","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_HEdhu87BlGJiLPk7x225y","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.005","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Quadratic formula cancellation check","prompt":"My formula is '(-b + sqrt(b^2 - 4*a*c)) / (2*a)' with a in [0.001, 1], b in [1, 1000], c in [1e-6, 0.001] — can you check how many digits it loses in binary64 and whether a rewrite would help?"},{"title":"Log near zero stability test","prompt":"Analyze the numerical stability of 'log(1 + x)' for x in [1e-15, 0.1] in binary64 precision, and compare it against the built-in log1p(x) alternative."},{"title":"Hypot vs naive sqrt stability","prompt":"I'm computing sqrt(x^2 + y^2) naively with x and y both ranging from 1e-150 to 1e150 — test it in binary64 and tell me the worst digits lost and whether hypot(x, y) is more stable."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-11-19T06:38:59.165Z","isFirstParty":false,"canonicalSlug":"writerslogic-float-stability-analyzer-5b739728"}