Skip to content

Floating-Point Arithmetic Pitfalls

Floating-point operations are not associative; operation order affects results. Catastrophic cancellation, absorption, and accumulation patterns can amplify small errors into large ones.

Tension Addressed

Precision vs. Performance

Recognizable As

Kahan summation, numerically stable algorithms, condition number analysis, reordering operations for precision, different results on different hardware.

Canonical Sources

Goldberg, "What Every Computer Scientist Should Know About Floating-Point Arithmetic" (1991); Higham, Accuracy and Stability of Numerical Algorithms

Transfers To

Scientific computing, machine learning training, financial calculations, physics simulations

(a + b) + c may not equal a + (b + c) in floating-point. This seemingly minor detail has crashed financial systems, produced incorrect scientific results, and caused debugging nightmares. Numerical stability is a discipline.