Add facility for summing series of doubles using Kahan summation
When adding longer series of n Doubles the worst-case error can grow proportionally to n. The Kahan summation algorithm is a simple way to keep the error bounded and independent of n.
Here is an implementation in Java: https://github.com/jenetics/jpx/blob/master/jpx/src/main/java/io/jenetics/jpx/geom/DoubleAdder.java
It looks like this is something that spire could easily provide as well out of the box.
Hi, and thanks for the proposal! Keep in mind that Spire is 50kloc already and its migration to Scala 3 will require major refactoring. Thus, at the time, we won't be adding features or accepting PRs in that direction. Keeping the issue open, so that such requests can be consolidated.
If you wish to keep an eye on the development, join https://gitter.im/typelevel/spire-dev
Thank you, @denisrosset, that is absolutely understandable. 👍 Hopefully the Scala 3 migration will go relatively smoothly.