Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add facility for summing series of doubles using Kahan summation #815

Open
sirthias opened this issue Jun 28, 2019 · 2 comments
Open

Add facility for summing series of doubles using Kahan summation #815

sirthias opened this issue Jun 28, 2019 · 2 comments

Comments

@sirthias
Copy link

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.

@denisrosset
Copy link
Collaborator

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

@sirthias
Copy link
Author

Thank you, @denisrosset, that is absolutely understandable. 👍
Hopefully the Scala 3 migration will go relatively smoothly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants