-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Adding ZigguratGaussianRng<RNG>
#1981
Adding ZigguratGaussianRng<RNG>
#1981
Conversation
…and added some comments
…eature/ZigguratGaussianRng
Thanks! Out of curiosity, how does it compare to our current default, |
That's interesting, @lballabio. On pure Windows, the current default is slightly faster (
|
The default is slightly slower on my Mac as well:
|
Interesting, how differently this pure number crunching behaves on different architectures and compilers... |
The improved Ziggurat method to generate normal random samples is significantly faster than BoxMuller. Therefore, it is e.g. the default generator in
rust-random
forStandardNormal
distributions.As the underlying RNG needs to provide
std::uint64_t nextInt64() const
random numbers, currently it only works in combination withXoshiro256StarStarUniformRng
.On my local machine I get the following benchmark values.
Windows CXX compiler MSVC 19.40.33808.0
approx. two times faster compared to BoxMuller with MersenneTwister:WSL Ubuntu 22.04 CXX compiler GNU 11.4.0
approx. four times faster compared to BoxMuller with MersenneTwister: