3 ms·
Compensated summation (aka Kahan summation) is a great algorithm. Interestingly, pairwise summation [1] is almost as accurate as the compensated algorithm, whil
by StefanKarpinski 13y ago
Compensated summation (aka Kahan summation) is a great algorithm. Interestingly, pairwise summation [1] is almost as accurate as the compensated algorithm, while being nearly as fast as naïve linear scanning summation. This makes it a great default summation algorithm since it does so well in terms of both accuracy and performance.
[1] https://en.wikipedia.org/wiki/Pairwise_summation https://en.wikipedia.org/wiki/Pairwise_summation