Monday, October 6, 2014

Kahan or Compensated Summation

Wikipedia describes this as follows:
In numerical analysis, the Kahan summation algorithm (also known as compensated summation [1]) significantly reduces the numerical error in the total obtained by adding a sequence of finite precision floating point numbers, compared to the obvious approach. This is done by keeping a separate running compensation (a variable to accumulate small errors).
Here are a couple of links (postscript document) which argue that this relatively simple method ought to be better known.

An Octave program to sum \(s = x_1 + x_2 + ... + x_n\) is (embedded):

No comments: