Kahan's summation algorithm is a method to compute sums:

$$\sum x_i$$

with many terms, without significant error.

I want to do this with very large numbers, and instead of the numbers themselves, I am given their logarithms, $\log x_i$ ($x_i > 0$), and instead of the sum, I want to compute the logarithm of the sum,

$$\log \sum x_i$$

Is there a variation of Kahan's summation for this case?

  • $\begingroup$ Check out this related post. Also worth looking up logsumexp. $\endgroup$ – GoHokies Aug 4 '16 at 17:37
  • $\begingroup$ @GoHokies I think the logexpsum trick doesn't work well if you have a single very large term and many very small terms. $\endgroup$ – becko Aug 4 '16 at 19:22
  • $\begingroup$ scicomp.stackexchange.com/q/24624/988 $\endgroup$ – becko Aug 4 '16 at 19:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.