Evaluates the incomplete gamma function g(a, x).
#include <imsl.h>
float imsl_f_gamma_incomplete (float a, float x)
The type double procedure is imsl_d_gamma_incomplete.
float a
(Input)
Parameter of the incomplete gamma function is to be evaluated. It
must be positive.
float x
(Input)
Point at which the incomplete gamma function is to be evaluated. It
must be nonnegative.
The value of the incomplete gamma function γ(a, x).
The incomplete gamma function, γ(a, x), is defined to be

The incomplete gamma function is
defined only for a > 0. Although γ(a, x) is well
defined for x > -¥,
this algorithm does not calculate γ(a, x) for
negative x.
For large
a and sufficiently large x,
γ(a, x)
may overflow. γ(a, x) is
bounded by Γ (a),
and users may find this bound a useful guide in determining legal values for
a.

Figure 9- 8 Plot of γ(a, x)
Evaluate the incomplete gamma function at a = 1 and x = 3.
#include <stdio.h>
#include
<imsl.h>
main()
{
float x = 3.0;
float a = 1.0;
float ans;
ans =
imsl_f_gamma_incomplete(a, x);
printf("incomplete
gamma(%f,%f) = %f\n", a, x, ans);
}
incomplete gamma(1.000000,3.000000) = 0.950213
IMSL_NO_CONV_200_TS_TERMS The function did not converge in 200 terms of Taylor series.
IMSL_NO_CONV_200_CF_TERMS The function did not converge in 200 terms of the continued fraction.
|
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |