Skip to content

Commit

Permalink
Binomial: Use correct sign for stirling correction
Browse files Browse the repository at this point in the history
This was noted by the GSL implementors. The new signs were confirmed by
one of the authors publishing the original algorithm.
  • Loading branch information
vks committed Mar 13, 2019
1 parent f1d2eb0 commit a40b52d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/distributions/binomial.rs
Expand Up @@ -233,7 +233,7 @@ impl Distribution<u64> for Binomial {
if alpha > x_m * (f1 / x1).ln()
+ (n - (m as f64) + 0.5) * (z / w).ln()
+ ((y - m) as f64) * (w * p / (x1 * q)).ln()
+ stirling(f1) + stirling(z) + stirling(x1) + stirling(w)
+ stirling(f1) + stirling(z) - stirling(x1) - stirling(w)
{
continue;
}
Expand Down

0 comments on commit a40b52d

Please sign in to comment.