-
Notifications
You must be signed in to change notification settings - Fork 243
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
Add Marsaglias and Tsangs Ziggurat algorithm #266
Conversation
Hi @dusank. I think the tests are failing for another reason. I'm going to confirm that these tests pass and then merge this manually. |
I can confirm that the test failure was unrelated to this branch. Looking at this more closely, there are three changes I'd like you to make:
What do you think? Do these make sense to you? |
Fixed 1) by importing from |
Regarding 2) The
IMHO: For all practical purposes we can |
Oh, that's great. I hadn't realized it. I am pretty sure object construction is threadsafe so you're right! :) |
With 1) and 2) out of the way: Regarding 3)
I wonder where to best place such code in the spire project tree hierarchy as well as where to output the generated files ( |
Here's my opinion: I'm reluctant to create a new top-level location just for this code. There is already some code for testing trigonometry functions on I am fine with using any existing top-level project (excluding |
Done: 3) So @non, how do you like the code / performance / generation quality? Would you like to hook it up with |
Yes, please go for it! I haven't written a benchmark for it yet, but I think this is the strategy we'll want to use. Once it's merged we can do profiling and optimize more as necessary, but it's looking really good already! 👍 |
Add Marsaglias and Tsangs Ziggurat algorithm
Benchmark: #270 |
For generating random variables from decreasing densities:
Includes generator of MATLAB files for data analysis via histogram and Distribution Fitting App (dfittool).
MATLAB analysis looks good. 😅