Kahan Compensated Summation

Add a million numbers the naive way and against Kahan compensation, and watch the error grow or stay flat.

Math & convertNumbersFloatingError
Kahan Compensated Summation screenshot

Paste any float series and get the naive left-to-right sum beside Kahan's compensated sum, with the exact double-precision reference and the relative error each one leaves behind. FLOATPRECISIONCOMPENSATION

0.1 x 1000 1e100, -1e100, 1 0.1 + 0.2 + 0.3 alternating harmonic, 10 terms 1e16, 1, 1, -1e16
Naive left-to-right sum
-
-
Kahan compensated sum
-
-
-

More tools