ocaml-batteries-team/batteries-included — pull request #459 by gasche (2013-10-26 16:35:39+00:00)
Title: Kahan Summation in `Array`, `List` and `Enum`

Kahan summation has less rounding errors that existing `fsum` method (except for Enum where it was already implemented). It does 4 float operations on each element instead of one, so there is a noticeable 4x slowdown on arrays -- which strongly decreases with List and Enum as it gets dominated by the element access overhead.

This was inspired by [this Factor blogpost](http://re-factor.blogspot.fr/2013/10/kahan-summation.html), itself coming from [a clojure blogpost](http://adereth.github.io/blog/2013/10/10/add-it-up/).

Do you think exposing such a function to our users is useful?