◀ THE FOLD0ROOT.AI // WORLD II · GRIND · THE GRINDSTONE◆ .dlw.fold
THE FOLD / GRIND / THE GRINDSTONE / THE CATASTROPHIC CANCELLATION

THE CATASTROPHIC CANCELLATION

the error was there before the subtraction
1 WHAT IT IS · WHAT IT DOES · FACT OR FICTION
Subtracting near-equal numbers does not create error. It reveals error already present, by removing the leading digits that were hiding it.

LIT verified live. solving x² + 108x + 1 = 0 with the naive quadratic formula gives the small root with a relative error of 2.55 × 10-1, while the algebraically identical stable form gives it to machine precision at 0. And b×b is exact here at 1016 — so the information was destroyed by the square root long before the subtraction that exposed it.
2 HOW IT WAS WEAVED · AI + HUMAN
The stable quadratic formula is standard numerical analysis and the example is the classic one.

AVAN (AI) checked where the error enters rather than only that it appears: b×b is exactly representable, the discriminant differs from it by 4, and the square root of that difference rounds to a value indistinguishable from b. By the time the subtraction happens the operands are already equal to working precision — the cancellation reports that fact rather than causing it.
3 ONE DIMENSION
Two algebraically identical formulas, one accurate.
4 TWO DIMENSIONS · INTERACTIVE
Grow the coefficient and watch the naive root collapse.
5 THREE DIMENSIONS + AVAN’S INVERSE
The green forward object.
AVAN’s addition (the inverse-companion): the forward reading is that cancellation reveals rather than creates. The inverse is that this makes it undetectable at the point it matters. If the subtraction merely exposes existing error then no test on the subtraction can find the problem — the operands look fine, the operation is exact, and the result is wrong. Read backwards, the failure lives in an earlier step that appeared to succeed, which is why numerical bugs are diagnosed by reformulating the algebra rather than by instrumenting the code.
LIT solving x squared plus 1e8 x plus 1 with the naive quadratic formula gives the small root with a relative error of 2.55e-1, while the algebraically identical stable form gives it to machine precision at 0; and b times b is EXACT here at 1e16, so the information was destroyed by the square root long before the subtraction that exposed it

FIG The stable quadratic formula is standard numerical analysis and the example is the classic one. AVAN checked WHERE the error enters rather than only that it appears: b*b is exactly representable, the discriminant differs from it by 4, and the square root of that difference rounds to a value indistinguishable from b. By the time the subtraction happens the operands are already equal to working precision - the cancellation REPORTS that fact rather than causing it.
◆ sealed .dlw.fold → folded to ROOT_0 · a sphere of THE GRINDSTONE · David Lee Wise (ROOT0), with AVAN