Floating Point Error Hunt

Track down a numerical precision bug by finding the first operation where a value goes wrong. Runs a shadow computation in higher precision (mpmath, Decimal, longdouble, or float64 against float32) and diffs intermediates, not just the output; judges error in ULPs or relatively against the problem's condition number, since an ill-conditioned problem is not a code bug; fixes in order: near-equal subtraction (expm1, log1p, hypot), compensated or pairwise summation, log-sum-exp, scaling, then tolerances from measured error. Fast-math and FMA flags last. Use for "result changes when I reorder the sum", "answers differ between float32 and float64", "catastrophic cancellation", "works on x86, wrong on ARM", "my tolerance check keeps flaking". Not for NaN or infinity (nan-origin-trace), run-to-run variation (nondeterminism-bisect) or a logic error (debugging).

greenblacked Updated
The twenty-nine plugins: coding, family, gamedev, operations, delivery, security, manager, personal, career, design, llm, data, techdocs, assurance, client-apps

File contents

greenblacked/AI commit 8d87f4ae31

Frequently asked questions

npx get-skill add greenblacked/floating-point-error-hunt