I have no idea why that interval might be special here. When I run gamma(a,x) for a < 1/2, I find similar problems which begin at x=3.0 but do not seem to end at x=pi. But I don't see any problem for a > 1/2.
EDIT: Upon a closer look, the problem above actually persists just above a=1/2 but it rapidly goes away. Increasing a by steps of 0.001, for length=100000, the interval of wrong values shrinks until it cannot be seen at a=0.508.
I am using Julia v1.5.3 and SpecialFunctions v1.3.0.
The Problem
When evaluating the upper incomplete gamma function as
gamma(1/2, x)
, the output is simply incorrect for certain values ofx
. Here is an example:This produces the plot: That bump is clearly not right. If I zoom in on it, it seems like the problem begins at 3.0 and ends at pi. From the REPL:
I have no idea why that interval might be special here. When I run
gamma(a,x)
fora
< 1/2, I find similar problems which begin atx
=3.0 but do not seem to end atx
=pi. But I don't see any problem fora
> 1/2.EDIT: Upon a closer look, the problem above actually persists just above
a
=1/2 but it rapidly goes away. Increasinga
by steps of 0.001, forlength=100000
, the interval of wrong values shrinks until it cannot be seen ata
=0.508.