Skip to content

Commit

Permalink
fix typo in sample_unchecked() of gamma
Browse files Browse the repository at this point in the history
  • Loading branch information
doraneko94 committed Apr 12, 2021
1 parent 9905d43 commit 1b9f9ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/distribution/gamma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ pub fn sample_unchecked<R: Rng + ?Sized>(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;
}
}
Expand Down

0 comments on commit 1b9f9ff

Please # to comment.