Skip to content

Commit 10ad004

Browse files
authored
fix gamma_inc max precision (#210)
1 parent 84f6f55 commit 10ad004

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/gamma_inc.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ function gamma_inc_minimax(a::Float64, x::Float64, z::Float64)
567567
c5 = @horner(z , d50 , d5[1])
568568
c6 = @horner(z , d60 , d6[1])
569569

570-
t = @horner(u , c0 , c1 , c2 , c3 , c4 , c5 , c6 , d70 , d80)
570+
t = @horner(z , c0 , c1 , c2 , c3 , c4 , c5 , c6 , d70 , d80)
571571
if l < 1.0
572572
p = c*(w - rt2pin*t/sqrt(a))
573573
return (p , 1.0 - p)

test/gamma_inc.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
@test gamma_inc(0.9,0.8,0)[1] 0.59832030278768172
3535
@test gamma_inc(1.7,2.5,0)[1] 0.78446115627678957
3636
@test gamma_inc(11.1,0.001,0)[2] 1.0000
37+
@test gamma_inc(1e7, (1e7)+1, 0)[1] 0.5001682088254367
38+
@test gamma_inc(1e7, (1e7)+1, 0)[2] 0.4998317911745633
3739
@test_throws DomainError gamma_inc(-1,2,2)
3840
@test_throws DomainError gamma_inc(0,0,1)
3941
end

0 commit comments

Comments
 (0)