Closed main-- closed 2 years ago
I'm sorry for late reply (I didn't notice this issue). Thanks to your good point, I can detect errata in source code - Now, I fix it at Ver 0.2.0.
At Ver 0.2.0 :
extern crate puruspe;
use puruspe::*;
fn main() {
let a = 100.;
for x in [1., 10., 50., 75., 99., 100., 101., 110., 1000.] {
println!("{}\t{}", x, gammp(a, x));
}
}
1 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000398128081855225
10 0.000000000000000000000000000000000000000000000000000000000000005398589727602037
50 0.00000000032000653242666364
75 0.0033524414978532177
99 0.47330433035233394
100 0.5132987983276017
101 0.5528962934790187
110 0.8417213299556715
1000 1
Thank you again for your interest and good point! :smile:
There is a bug in the implementation of
gammpapprox
that causes it to return incorrect values (i.e. values that are very far away from the expected values). This also causesinvgammp
to panic in some scenarios (whena >= ASWITCH
).Example: