File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -1837,12 +1837,12 @@ func fastexprand(mean int) int32 {
1837
1837
return 0
1838
1838
}
1839
1839
1840
- // Take a random sample of the exponential distribution exp(-mean*x ).
1841
- // The probability distribution function is mean* exp(-mean*x) , so the CDF is
1842
- // p = 1 - exp(-mean*x ), so
1843
- // q = 1 - p == exp(-mean*x )
1844
- // log_e(q) = -mean*x
1845
- // -log_e(q)/ mean = x
1840
+ // Take a random sample of the exponential distribution exp(-x/mean ).
1841
+ // The probability distribution function is exp(-x/mean)/mean , so the CDF is
1842
+ // p = 1 - exp(-x/mean ), so
1843
+ // q = 1 - p == exp(-x/mean )
1844
+ // log_e(q) = -x/mean
1845
+ // -log_e(q) * mean = x
1846
1846
// x = -log_e(q) * mean
1847
1847
// x = log_2(q) * (-log_e(2)) * mean ; Using log_2 for efficiency
1848
1848
const randomBitCount = 26
You can’t perform that action at this time.
0 commit comments