Skip to content
This repository has been archived by the owner on May 9, 2022. It is now read-only.

Sum weights in ascending order, not random or descending order #25

Open
riastradh-brave opened this issue Mar 14, 2018 · 0 comments
Open

Comments

@riastradh-brave
Copy link
Contributor

upper += results[i].weight

All of the weights presumably have the same magnitude. The current logic sums them in descending order, adding highest weights first, which maximizes the approximation error of floating-point arithmetic. With #24 as it stands now, they will be summed in randomized order. To minimize the approximation error, the smallest terms should be added first.

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

No branches or pull requests

1 participant