use statrs::distribution::{ContinuousCDF, FisherSnedecor};
fn main() {
for (d1, d2) in [(0.001, 1000.0), (10.0, 10.0)] {
let f = FisherSnedecor::new(d1, d2).unwrap();
for x in [1e-20, 1e-15, 0.1] {
println!("F({d1}, {d2}) at x = {x:e}: cdf + sf = {}", f.cdf(x) + f.sf(x));
}
}
}
Output:
F(0.001, 1000) at x = 1e-20: cdf + sf = 1.9738106489735783
F(0.001, 1000) at x = 1e-15: cdf + sf = 1.9794325192018662
F(0.001, 1000) at x = 1e-1: cdf + sf = 1.0000000000002767
F(10, 10) at x = 1e-20: cdf + sf = 1
F(10, 10) at x = 1e-15: cdf + sf = 1
F(10, 10) at x = 1e-1: cdf + sf = 1
They should sum to 1, as they do at F(10, 10). sf returns exactly 1 at both small x while cdf is already 0.97.
Same failure as #432 (Beta::sf returning exactly 1 for tiny x), which #438 fixed for Beta only.
Tested on statrs 0.19.1 and current main (50fcf4d).
(This was another bug found using hegel.)
Output:
They should sum to 1, as they do at
F(10, 10).sfreturns exactly 1 at both smallxwhilecdfis already 0.97.Same failure as #432 (
Beta::sfreturning exactly 1 for tinyx), which #438 fixed forBetaonly.Tested on statrs 0.19.1 and current main (50fcf4d).
(This was another bug found using hegel.)