-
Notifications
You must be signed in to change notification settings - Fork 432
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
Poisson sample() hangs when lambda is close to max of the float type. #1312
Comments
Related to #1290? |
The problem is that when rand/rand_distr/src/poisson.rs Line 84 in b593db6
will be Then down at rand/rand_distr/src/poisson.rs Lines 141 to 144 in b593db6
When rand/rand_distr/src/poisson.rs Lines 134 to 139 in b593db6
can also overflow, because There is another problem with large I've looked into modifying the calculation when A different approach to avoiding the problem would be switch to a normal distribution when |
Depending on how large a value we are talking about, another solution is simply to return an error in the constructor. |
I would go for using the normal approximation with lambda bigger than numpy does reject lambda bigger than |
If we don't care about higher precision than |
Solved with #1498 by introducing maximum lambda. |
The follow programs appear to hang indefinitely in the call
poisson.sample(&mut rng)
:f32
f64
I ran into this issue while testing gh-1296.
The text was updated successfully, but these errors were encountered: