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

mean vs welfordMean #10

Open
harendra-kumar opened this issue Dec 25, 2021 · 2 comments
Open

mean vs welfordMean #10

harendra-kumar opened this issue Dec 25, 2021 · 2 comments

Comments

@harendra-kumar
Copy link
Member

Add tests to demonstrate the difference between mean and welfordMean. We can use alternate small and large numbers with a high dynamic range for testing the loss of precision. A Double has 52 significand bits and 10 exponent bits. We can design a test based on that knowledge. See https://en.wikipedia.org/wiki/Floating-point_arithmetic .

It would be nice to have sum operations that works on a wider range possibly by sacrificing some computational complexity e.g. multiple buckets for different precision levels.

@harendra-kumar
Copy link
Member Author

As per the current benchmarks welfordMean is significantly faster than mean:

      mean:                     OK (0.20s)
        3.08 ms ± 173 μs
      welfordMean:              OK (0.22s)
        859  μs ±  44 μs

@harendra-kumar
Copy link
Member Author

The perf situation has changed after recent changes, mean is faster now.

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

No branches or pull requests

1 participant