Skip to content

Commit 9a98b60

Browse files
committed
Replace constants with more precise values
1 parent 49cad1f commit 9a98b60

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

rand_distr/src/gamma.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,8 @@ where
605605
let beta = F::one() / b;
606606
let delta = F::one() + a - b;
607607
let kappa1 = delta
608-
* (F::from(0.0138889).unwrap() + F::from(0.0416667).unwrap()*b)
609-
/ (a*beta - F::from(0.777778).unwrap());
608+
* (F::from(1. / 18. / 4.).unwrap() + F::from(3. / 18. / 4.).unwrap()*b)
609+
/ (a*beta - F::from(14. / 18.).unwrap());
610610
let kappa2 = F::from(0.25).unwrap()
611611
+ (F::from(0.5).unwrap() + F::from(0.25).unwrap()/delta)*b;
612612

@@ -691,7 +691,7 @@ where
691691
let v = algo.beta * (u1 / (F::one() - u1)).ln();
692692
w = self.a * v.exp();
693693
if !(algo.alpha * ((algo.alpha / (self.b + w)).ln() + v)
694-
- F::from(1.3862944).unwrap() < z.ln()) {
694+
- F::from(4.).unwrap().ln() < z.ln()) {
695695
break;
696696
};
697697
}

0 commit comments

Comments
 (0)