10
1 Gamma Functions, Beta Functions, and Related
Similar for
1 F 1 (a; 1 + a; z) = 1 +
a
(1 + a) · 1
z +
a(a + 1)
(1 + a)(2 + a) · 1 · 2
z
2
+
a(a + 1)(a + 2)
(1 + a)(2 + a)(3 + a) · 1 · 2 · 3
z
3
+ · · ·
(1.23)
which will diverge as well for a negative integers. The single terms of the sum can
be computed via
t 0 = 1 , t n =
a + n − 1
(n + a) · n
t n−1
n = 1, 2, 3, · · · .
(1.24)
Thus together with Eqs. (1.19) and (1.20) we can approximately calculate the value
of the incomplete gamma function.
To avoid a loss of significance the single terms of the sum are split in their
real and imaginary part and each of them in its positive and negative part. Each
of these positive subparts will be sorted in ascending order and the negative
ones in descending order and summed individually before put together. The upper
summation limit depends on |z| to avoid overflow.
For (a) large it turns out that the series expansions above converge slowly. In
this case an approximation by continued fraction [1] 6.5.31 is more favorable:
γ (z, a) = Γ (a) − exp(−z)z
a
1
z+
1 − a
1+
1
z+
2 − a
1+
2
z+
· · ·
1
cf (z,a)
.
(1.25)
Therefore we have to compute
cf (z, a) = z +
1 − a
1 +
1
z+
2−a
1+
2
z+ 3−a
1+···
.
(1.26)
In the final computation convergence is no longer tested. Because the computation for the series expansion is very quick, the number of terms in the
sum is by default very high, in most cases unnecessarily high; similar for the
continued fraction. Tests on convergence were performed in developing the toolbox
functionalities.
Even if the recurrence equations (1.16) are analytic equations, they are numerically of limited stability. For a = 1 the incomplete gamma function equals to
γ (1, z) = 1 − exp(z).
(1.27)
Précédent

- 26/287

Suivant