gami.f

Go to the documentation of this file.
00001 *DECK GAMI
00002       FUNCTION GAMI (A, X)
00003 C***BEGIN PROLOGUE  GAMI
00004 C***PURPOSE  Evaluate the incomplete Gamma function.
00005 C***LIBRARY   SLATEC (FNLIB)
00006 C***CATEGORY  C7E
00007 C***TYPE      SINGLE PRECISION (GAMI-S, DGAMI-D)
00008 C***KEYWORDS  FNLIB, INCOMPLETE GAMMA FUNCTION, SPECIAL FUNCTIONS
00009 C***AUTHOR  Fullerton, W., (LANL)
00010 C***DESCRIPTION
00011 C
00012 C Evaluate the incomplete gamma function defined by
00013 C
00014 C GAMI = integral from T = 0 to X of EXP(-T) * T**(A-1.0) .
00015 C
00016 C GAMI is evaluated for positive values of A and non-negative values
00017 C of X.  A slight deterioration of 2 or 3 digits accuracy will occur
00018 C when GAMI is very large or very small, because logarithmic variables
00019 C are used.  GAMI, A, and X are single precision.
00020 C
00021 C***REFERENCES  (NONE)
00022 C***ROUTINES CALLED  ALNGAM, GAMIT, XERMSG
00023 C***REVISION HISTORY  (YYMMDD)
00024 C   770701  DATE WRITTEN
00025 C   890531  Changed all specific intrinsics to generic.  (WRB)
00026 C   890531  REVISION DATE from Version 3.2
00027 C   891214  Prologue converted to Version 4.0 format.  (BAB)
00028 C   900315  CALLs to XERROR changed to CALLs to XERMSG.  (THJ)
00029 C***END PROLOGUE  GAMI
00030 C***FIRST EXECUTABLE STATEMENT  GAMI
00031       IF (A .LE. 0.0) CALL XERMSG ('SLATEC', 'GAMI',
00032      +   'A MUST BE GT ZERO', 1, 2)
00033       IF (X .LT. 0.0) CALL XERMSG ('SLATEC', 'GAMI',
00034      +   'X MUST BE GE ZERO', 2, 2)
00035 C
00036       GAMI = 0.0
00037       IF (X.EQ.0.0) RETURN
00038 C
00039 C THE ONLY ERROR POSSIBLE IN THE EXPRESSION BELOW IS A FATAL OVERFLOW.
00040       FACTOR = EXP (ALNGAM(A) + A*LOG(X) )
00041 C
00042       GAMI = FACTOR * GAMIT(A, X)
00043 C
00044       RETURN
00045       END
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines