C334: Incomplete Gamma Functions

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

displaymath138

and the complementary incomplete gamma function

displaymath140

respectively, for real arguments tex2html_wrap_inline142 and a. M(a,b,x) 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 tex2html_wrap_inline148 RGAPNC, GAGNC tex2html_wrap_inline150 RGAGNC
Files Referenced: Unit 6
External References: ALGAMA, DLGAMA, MTLMTR, ABEND

Usage:

In any arithmetic expression,

RGAPNC(A,X) or DGAPNC(A,X) has the value tex2html_wrap_inline152 ,
RGAGNC(A,X) or DGAGNC(A,X) has the value tex2html_wrap_inline154 ,

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 P(a,x): Either (i) tex2html_wrap_inline158 , or (ii) tex2html_wrap_inline160 and tex2html_wrap_inline162 .
For G(a,x): Either (i) tex2html_wrap_inline166 , or (ii) tex2html_wrap_inline168 and tex2html_wrap_inline170 .

Error handling:

Error C334.1: tex2html_wrap_inline172 .
Error C334.2: For RGAPNC and DGAPNC: tex2html_wrap_inline174 and tex2html_wrap_inline176 ; for RGAGNC and DGAGNC: tex2html_wrap_inline178 .
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 P(a,x). 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:

  1. W. Gautschi, A computational procedure for incomplete gamma functions, ACM Trans. Math. Software 5 (1979) 466-481.
  2. W. Gautschi, Algorithm 542, Incomplete gamma functions, Collected Algorithms from CACM (1979).
  3. M. Abramowitz and I.A. Stegun (Eds.), Handbook of Mathematical Functions, Chapter 13, Confluent Hypergeometric Functions, 9th printing with corrections, (Dover, New York 1972).
tex2html_wrap_inline182

Michel Goossens Tue Jun 4 22:18:01 METDST 1996