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

Implement the Ratio method #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Implement the Ratio method #2

wants to merge 2 commits into from

Conversation

camel-cdr
Copy link

The ratio method is in total slower than the polar method, but only produces one output. This can be very nice for libraries as the normal distribution function doesn't require any state and is fast and accurate.
I couldn't get the AVX code to compile, so I couldn't update the timing tables.

The ratio method is in total slower than the polar method, but only produces one output. This can be very nice for libraries as the normal distribution function doesn't require any state and is fast and accurate.
I couldn't get the AVX code to compile, so I couldn't update the timing tables.
@camel-cdr
Copy link
Author

camel-cdr commented Dec 19, 2020

Just to clarify the expected performance:

  • One call to the polar method generates two normal distributed numbers.
  • One call to the ratio method is approximately 80% faster but only produce one normal distributed number.

The measurements are from: https://github.com/ampl/gsl/blob/master/randist/gauss.c

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

Successfully merging this pull request may close these issues.

1 participant