# gamic.f

          REAL FUNCTION GAMIC (A, X)
    C***BEGIN PROLOGUE  GAMIC
    C***PURPOSE  Calculate the complementary incomplete Gamma function.
    C***LIBRARY   SLATEC (FNLIB)
    C***CATEGORY  C7E
    C***TYPE      SINGLE PRECISION (GAMIC-S, DGAMIC-D)
    C***KEYWORDS  COMPLEMENTARY INCOMPLETE GAMMA FUNCTION, FNLIB,
    C             SPECIAL FUNCTIONS
    C***AUTHOR  Fullerton, W., (LANL)
    C***DESCRIPTION
    C
    C   Evaluate the complementary incomplete gamma function
    C
    C   GAMIC = integral from X to infinity of EXP(-T) * T**(A-1.)  .
    C
    C   GAMIC is evaluated for arbitrary real values of A and for non-
    C   negative values of X (even though GAMIC is defined for X .LT.
    C   0.0), except that for X = 0 and A .LE. 0.0, GAMIC is undefined.
    C
    C   GAMIC, A, and X are REAL.
    C
    C   A slight deterioration of 2 or 3 digits accuracy will occur when
    C   GAMIC is very large or very small in absolute value, because log-
    C   arithmic variables are used.  Also, if the parameter A is very close
    C   to a negative integer (but not a negative integer), there is a loss
    C   of accuracy, which is reported if the result is less than half
    C   machine precision.
    C
    C***REFERENCES  W. Gautschi, A computational procedure for incomplete
    C                 gamma functions, ACM Transactions on Mathematical
    C                 Software 5, 4 (December 1979), pp. 466-481.
    C               W. Gautschi, Incomplete gamma functions, Algorithm 542,
    C                 ACM Transactions on Mathematical Software 5, 4
    C                 (December 1979), pp. 482-489.
    C***ROUTINES CALLED  ALGAMS, ALNGAM, R1MACH, R9GMIC, R9GMIT, R9LGIC,
    C                    R9LGIT, XERCLR, XERMSG
    C***REVISION HISTORY  (YYMMDD)
    C   770701  DATE WRITTEN
    C   890531  Changed all specific intrinsics to generic.  (WRB)
    C   890531  REVISION DATE from Version 3.2
    C   891214  Prologue converted to Version 4.0 format.  (BAB)
    C   900315  CALLs to XERROR changed to CALLs to XERMSG.  (THJ)
    C   920528  DESCRIPTION and REFERENCES sections revised.  (WRB)
    C***END PROLOGUE  GAMIC