Compensated Summation and Lost Low Bits

Track rounding lost by repeated addition and compare sequential, pairwise, and compensated summation.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. A running total can hide a string of small contributions
  2. Carry an estimate of the last rounding loss

A running total can hide a string of small contributions

When adding many small numbers to a large partial sum, a single addition can round back to that sum. Losing each contribution separately can matter even when their aggregate would be visible. Pairwise summation first combines terms in a balanced tree, reducing the depth at which rounding errors accumulate. For suitably bounded arithmetic, the resulting error analysis depends on logarithmic depth rather than the number of sequential additions.

Carry an estimate of the last rounding loss

In Kahan-style compensation, subtract a stored compensation from the next term before adding it. Recover an estimate of the rounding in the new sum by comparing the apparent increment with the requested increment. Save that estimate for the following iteration. Precise expression order is part of this method, so simplification assuming exact real arithmetic can discard the needed correction. Floating-point rounding explains the lost increment. Cancellation still matters for sums whose exact result is small relative to the absolute term sizes.[1][2]

References

  1. Nicholas J. Higham, Accuracy and Stability of Numerical Algorithms ↩
  2. Jonathan Richard Shewchuk, Adaptive Precision Floating-Point Arithmetic and Fast Robust Geometric Predicates ↩