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

Improve the Marsaglia Gaussian generator #426

Open
gbaydin opened this issue Apr 22, 2022 · 1 comment
Open

Improve the Marsaglia Gaussian generator #426

gbaydin opened this issue Apr 22, 2022 · 1 comment

Comments

@gbaydin
Copy link
Member

gbaydin commented Apr 22, 2022

The generator for Gaussian random numbers can generate two independent samples, but we are currently discarding one of them. We can improve the code to keep the second sample in memory to return it in the next call to the generator. This should improve efficiency.

static member Normal() =

See https://en.wikipedia.org/wiki/Marsaglia_polar_method

@gbaydin
Copy link
Member Author

gbaydin commented Apr 23, 2022

Note that this is only used by the reference backend.

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

1 participant