File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1212### Fixes
1313- Avoid returning negative values in ` InverseGaussian::sample ` ; this is a Value-breaking change ([ #56 ] )
1414- Fix Zipf returning values larger than ` n ` in rare cases ([ #57 ] )
15+ - Changed threshold for Ahrens-Dieter PD algorithm to >=10, matching the suggested value in the original 1982 paper
1516
1617## [ 0.6.0] — 2026-02-10
1718- Bump to MSRV 1.85.0 and Edition 2024 in line with ` rand ` ([ #28 ] )
Original file line number Diff line number Diff line change @@ -161,7 +161,9 @@ where
161161 }
162162
163163 // Use the Knuth method only for low expected values
164- let method = if lambda < F :: from ( 12.0 ) . unwrap ( ) {
164+ // Per Ahrens-Dieter, the rejection sampling algorithm is
165+ // only designed for values >= 10
166+ let method = if lambda < F :: from ( 10.0 ) . unwrap ( ) {
165167 Method :: Knuth ( KnuthMethod :: new ( lambda) )
166168 } else {
167169 if lambda > F :: from ( Self :: MAX_LAMBDA ) . unwrap ( ) {
You can’t perform that action at this time.
0 commit comments