{
  "aliases": null,
  "backlinks": [
    {
      "field": "defines",
      "target": "49MX22EDS7"
    }
  ],
  "body": "\n## Summary\n\nCatastrophic cancellation is the large loss of relative accuracy when one subtracts two nearly equal numbers that are only known approximately.\nThe leading digits cancel, and what is left is dominated by the errors of the inputs.\nThe subtraction itself is often exact in [[floating-point arithmetic|RTKRSC3KPH]]; the damage comes from earlier [[round-off errors|CPN6SD3BTV]].\nIt is the most common cause of numerically unstable formulas, and it is avoided by rewriting formulas, for example $\\sqrt{x+1} - \\sqrt{x} = 1/(\\sqrt{x+1} + \\sqrt{x})$.\n\n## Explanations\n\n### L1 human\n\nSuppose two lengths are measured as $1.2341$ m and $1.2259$ m, each to the nearest tenth of a millimetre.\nTheir difference $0.0082$ m has only two significant digits, although each length had five.\nIf one first rounds both lengths to three digits, both become $1.23$ and the difference becomes $0$, a $100\\%$ error.\nSubtracting close numbers throws away the digits that agree and keeps the digits that carry the error.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "kind": "concept",
    "msc": [
      "65G50"
    ],
    "name": "Catastrophic cancellation",
    "same_as": {
      "wikidata": "Q104589774",
      "wikipedia": "Catastrophic cancellation"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Catastrophic_cancellation"
      }
    ],
    "tag": "TJPNYW7J8E"
  },
  "kind": "concept",
  "link": "https://tamnd.github.io/math2/node/TJPNYW7J8E/",
  "links": null,
  "markdown": "https://tamnd.github.io/math2/node/TJPNYW7J8E.md",
  "msc": [
    "65G50"
  ],
  "name": "Catastrophic cancellation",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/TJP/TJPNYW7J8E.md",
  "status": null,
  "tag": "TJPNYW7J8E",
  "uri": "m2://TJPNYW7J8E",
  "url": "https://tamnd.github.io/math2/wiki/catastrophic-cancellation/",
  "writing": {
    "tag": "TJPNYW7J8E",
    "kind": "concept",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
