Loss of Significance (Absorption)

Goal

Understand the mechanism by which loss of significance (absorption) causes the smaller operand's information to vanish when adding numbers of very different magnitudes. Master the difference from catastrophic cancellation, and countermeasures such as Kahan compensated summation and pairwise summation.

Prerequisites

Table of Contents

1. Definition

Loss of significance (also called absorption) occurs when adding or subtracting two floating-point numbers of vastly different magnitudes. The trailing digits (some or all significant digits) of the smaller number are lost.

Essence of Loss of Significance

In floating-point addition, the significand of the smaller operand is right-shifted to align exponents. Digits pushed beyond the significand width are truncated, and information is lost.

2. Mechanism

Consider $1.000 \times 10^4 + 5.678 \times 10^0$ in 4-digit decimal floating-point:

Align exponents: $5.678 \times 10^0 = 0.000\,5678 \times 10^4$

Fits in 4-digit significand: $0.000\,5 \times 10^4$ (last 3 digits $678$ lost)

Addition: $1.000 \times 10^4 + 0.000 \times 10^4 = 1.000 \times 10^4$

The smaller number $5.678$ is completely absorbed, and the addition has no effect.

← 4-digit significand → beyond significand Large number: 1 0 0 0 × 10⁴ Small number: 0 0 0 0 5 6 7 8 × 10⁴ Lost! Result: 1 0 0 0 × 10⁴ Small number absorbed Aligning exponents shifts the small number's significant digits beyond the significand width
Figure 1. Loss of significance mechanism. Aligning exponents shifts the smaller number's significand, pushing digits beyond the representable width.

3. Loss of Significance in Summation

When computing the sum of many numbers, loss of significance worsens as the running total grows. For example, computing $\displaystyle\sum_{k=1}^{n} 1/k$ from $k = 1$ forward, the running sum eventually dwarfs $1/k$ for large $k$. Summing in reverse ($k = n$ to $1$) is more accurate because small values are added together first.

4. Countermeasures

Sorted Summation

Sum values in order of increasing absolute value to minimize the scale difference between the running total and each term. Simple to implement but not optimal.

Kahan Compensated Summation

Accumulate the lost trailing digits in a compensation variable $c$ and apply it in the next addition:

function kahanSum(values):
    sum = 0.0
    c   = 0.0
    for v in values:
        y = v - c         // apply previous compensation
        t = sum + y       // sum is large, so y's low digits are lost
        c = (t - sum) - y // record what was lost in c
        sum = t
    return sum

The compensation variable $c$ records the low-order digits of $y$ that were absorbed by the running total when computing $\text{sum} + y$. In the next iteration, $y = v - c$ subtracts back the lost portion before adding, recovering the precision. Kahan summation has $O(\varepsilon_{\text{mach}})$ error, independent of the number of terms $n$.

Pairwise Summation

Split the array in half and recursively sum each half, then add the two sums. Error is $O(\log n \cdot \varepsilon_{\text{mach}})$ with good cache efficiency. NumPy's sum uses pairwise summation.

Sign-Separated Summation

When the data contains both positive and negative values, any of the methods above can still produce catastrophic cancellation whenever the running sum crosses near zero. A better approach is to separate positives from negatives, sum each group in increasing absolute value, and subtract once at the end:

  1. Accumulate positive values in increasing absolute value → $P$
  2. Accumulate negative values in increasing absolute value → $N$
  3. Compute $P + N$ (a single subtraction)

Each partial sum has a fixed sign, so cancellation between nearly equal values cannot occur during accumulation; cancellation is concentrated in the final subtraction alone. Loss of significance (small low-order digits being absorbed by a growing running total) can still occur within each partial sum. Kahan and pairwise summation are effective against loss of significance but powerless against cancellation when the running sum crosses zero; sign separation covers exactly that gap, so combining them yields complementary protection:

  • Sign-separated + Kahan: compute $P$ and $N$ each via Kahan summation. Loss of significance within each partial sum is compensated, leaving an error of $O(\varepsilon_{\text{mach}})$; only the final subtraction contributes a single cancellation event.
  • Sign-separated + pairwise: compute $P$ and $N$ each by recursively halving the sequence. The error of each partial sum is $O(\log n \cdot \varepsilon_{\text{mach}})$, faster than the Kahan variant (no compensation arithmetic).

5. Comparison with Catastrophic Cancellation

PropertyLoss of SignificanceCatastrophic Cancellation
CauseAdding/subtracting numbers of very different magnitudesSubtracting nearly equal values
What is lostTrailing digits of the smaller operandLeading significant digits of the result
Occurs withAddition or subtractionSubtraction only
EffectSmall value's contribution vanishesExplosive increase in relative error
CountermeasuresSummation order, compensated summationFormula reformulation, Taylor expansion

6. Worked Examples

Example 1: Adding a Small Number to a Large Number

In double precision (~15 significant digits):

a = 1.0e16
b = 1.0
print(a + b)      // Output: 10000000000000000.0 (b absorbed)
print(a + b == a) // Output: true

$10^{16}$ has 17 digits, but the significand holds only ~15 digits, so adding 1 requires a 17th digit that cannot be represented.

Example 2: Harmonic Series Partial Sum

Computing $H_n = \displaystyle\sum_{k=1}^{n} 1/k$ for $n = 10^7$:

  • Forward ($k = 1, 2, \ldots, n$): increasing loss of significance as the running sum grows
  • Reverse ($k = n, n-1, \ldots, 1$): small values are added together first, improving accuracy
  • Kahan summation: high accuracy regardless of direction

7. Frequently Asked Questions

Q1. What is loss of significance?

A phenomenon where the trailing digits of the smaller operand are lost when adding or subtracting floating-point numbers of vastly different magnitudes. The smaller number is "absorbed" by the larger one.

Q2. How does it differ from catastrophic cancellation?

Loss of significance involves numbers of very different magnitudes where the smaller is absorbed; catastrophic cancellation involves subtracting nearly equal values where leading digits cancel. Loss of significance occurs with addition too.

Q3. What are the countermeasures?

Sum smallest values first (sorted summation), use Kahan compensated summation to track lost digits, use pairwise summation for $O(\log n)$ error, or reformulate to avoid operations on numbers of vastly different scales.

8. References

  • Wikipedia, "Catastrophic cancellation" (English Wikipedia merges "Loss of significance" into this article)
  • Wikipedia, "Kahan summation algorithm"
  • D. Goldberg, "What Every Computer Scientist Should Know About Floating-Point Arithmetic," ACM Computing Surveys, 23(1), 1991.
  • N. J. Higham, Accuracy and Stability of Numerical Algorithms, 2nd ed., SIAM, 2002.