diff --git a/src/distribution/gamma.rs b/src/distribution/gamma.rs index cbdf6d92..e493d24d 100644 --- a/src/distribution/gamma.rs +++ b/src/distribution/gamma.rs @@ -316,7 +316,7 @@ pub fn sample_unchecked(rng: &mut R, shape: f64, rate: f64) -> v *= v * v; x *= x; let u: f64 = rng.gen(); - if u < 1.0 - 0.0331 * x * x || u.ln() < 0.5 * x + d * (1.0 - v - v.ln()) { + if u < 1.0 - 0.0331 * x * x || u.ln() < 0.5 * x + d * (1.0 - v + v.ln()) { return afix * d * v / rate; } }