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

Revise RandomVariates.nextGaussian in ThreadLocalRandom case #317

Closed
cicirello opened this issue May 29, 2024 · 0 comments · Fixed by #318
Closed

Revise RandomVariates.nextGaussian in ThreadLocalRandom case #317

cicirello opened this issue May 29, 2024 · 0 comments · Fixed by #318
Assignees
Labels
enhancement New feature or request refactor

Comments

@cicirello
Copy link
Owner

Summary

Recent experiments (see report below) show that beginning with Java 17, the JDK's Gaussian implementation for all RandomGenerators some of the legacy generators uses a modified ziggurat that is faster than our implementation of the original ziggurat algorithm. The exceptions are the legacy generators Random, SecureRandom, and ThreadLocalRandom that continue to use the old and slow polar method.

Revise the RandomVariates class's static nextGaussian methods that rely on ThreadLocalRandom to use trick described in paper below to use Java 17's modified ziggurat rather than polar.

Report that discusses the experiments mentioned above:

Vincent A. Cicirello. 2024. Fast Gaussian Distributed Pseudorandom Number Generation in Java via the Ziggurat Algorithm. Technical Report ALG-24-009, Cicirello.org, May 2024. [PDF]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor
1 participant