Routine ID: C334 | |
---|---|
Author(s): K.S. Kölbig | Library: MATHLIB |
Submitter: | Submitted: 01.05.1990 |
Language: Fortran | Revised: 01.12.1994 |
Function subprograms RGAPNC, DGAPNC and RGAGNC, DGAGNC calculate the incomplete gamma function
| |
|
and the complementary incomplete gamma function
| |
|
respectively, for real arguments and a. is Kummer's function (see Ref. 3).
On CDC and Cray computers, the double-precision versions DGAPNC and DGAGNC are not available.
Structure:
FUNCTION subprograms
Uses Entry Names:
RGAPNC, RGAGNC, DGAPNC, DGAGNC
Obsolete User Entry Names: GAPNC
RGAPNC,
GAGNC
RGAGNC
Files Referenced: Unit 6
External References: ALGAMA, DLGAMA (C304),
MTLMTR (N002), ABEND (Z035)
Usage:
In any arithmetic expression,
RGAPNC(A,X) or DGAPNC(A,X)
has the value
,
RGAGNC(A,X) or DGAGNC(A,X)
has the value
,
where RGAPNC and RGAGNC are of type REAL, DGAPNC and DGAGNC are of type DOUBLE PRECISION, A and X have the same type as the function name.
Method:
The method is described in Ref. 1.
Accuracy:
RGAPNC and RGAGNC (except on CDC and Cray computers) have full single-precision accuracy. For most values of the arguments, DGAPNC, DGAGNC (and RGAPNC, RGAGNC on CDC and Cray computers) have an accuracy of approximately two significant digits less than the machine precision.
Restrictions:
For
: Either (i)
, or (ii)
and
.
For
: Either (i)
, or (ii)
and
.
Error handling:
Error C334.1:
.
Error C334.2: For RGAPNC and DGAPNC:
and
;
for RGAGNC and DGAGNC:
.
Error C334.3: Problems with convergence (unlikely).
In all cases,
the function value is set equal to zero, and a message is written on
Unit 6, unless subroutine MTLSET (N002) has been called.
Notes:
When speed is more important than accuracy, e.g. for applications in statistics, use GAMDIS (G106) for computing . Note, however, that in this case the arguments A and X must be interchanged.
The subprograms are based on a Fortran program for the incomplete gamma functions published in Ref. 2.
References: