I need a procedure to calculate the incomplete Gamma function. Of course, I've tried the netlib route and found the dgamic function. However, after compiling the following test program
program test_dgamic
implicit none
interface
double precision function dgamic(in1,in2)
double precision, intent(in) :: in1,in2
end function dgamic
end interface
print *, 'dgamic:', dgamic(1.d0,1.d0)
end program test_dgamic
with gfortran version 6.2.0 like this
gfortran main.f90 -o main dgamic.f d9lgic.f d9lgit.f d9gmic.f d9gmit.f dlgams.f dlngam.f dgamma.f d9lgmc.f dcsevl.f dgamlm.f initds.f d1mach.f xerclr.f xermsg.f xerprn.f xersve.f xgetua.f i1mach.f j4save.f xerhlt.f xercnt.f fdump.f
and running, I get the following slatec error message
***MESSAGE FROM ROUTINE INITDS IN LIBRARY SLATEC.
***POTENTIALLY RECOVERABLE ERROR, PROG ABORTED, TRACEBACK REQUESTED
* Chebyshev series too short for specified accuracy
* ERROR NUMBER = 1
*
***END OF MESSAGE
***JOB ABORT DUE TO UNRECOVERED ERROR.
0 ERROR MESSAGE SUMMARY
LIBRARY SUBROUTINE MESSAGE START NERR LEVEL COUNT
SLATEC INITDS Chebyshev series too 1 1 1
Note: The following floating-point exceptions are signalling: IEEE_DIVIDE_BY_ZERO
Has anyone got a clue how to avoid this? From the looks of the error, it looks like a design flaw.