Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixes
- Avoid returning negative values in `InverseGaussian::sample`; this is a Value-breaking change ([#56])
- Fix Zipf returning values larger than `n` in rare cases ([#57])
- Changed threshold for Ahrens-Dieter PD algorithm to >=10, matching the suggested value in the original 1982 paper

## [0.6.0] — 2026-02-10
- Bump to MSRV 1.85.0 and Edition 2024 in line with `rand` ([#28])
Expand Down
4 changes: 3 additions & 1 deletion src/poisson.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ where
}

// Use the Knuth method only for low expected values
let method = if lambda < F::from(12.0).unwrap() {
// Per Ahrens-Dieter, the rejection sampling algorithm is
// only designed for values >= 10
let method = if lambda < F::from(10.0).unwrap() {
Method::Knuth(KnuthMethod::new(lambda))
} else {
if lambda > F::from(Self::MAX_LAMBDA).unwrap() {
Expand Down
Loading