Precision Showdown: Kahan vs. Naive vs. Pairwise Sums

While naive summation error grows with 'n' terms, Kahan summation's worst-case error is nearly constant, effectively independent of 'n'. Pairwise summation offers an intermediate improvement, with error growing logarithmically (O(ε log n)), making it more accurate than naive but typically less so than Kahan (O(ε)).

Sources

Open the full topic