1.5 The Incomplete Gamma Functions
11
This equation will be used for computing the a = 1 results, and serves as a starting
value for the recurrence equation (1.16). The computation based on this equation
will be limited for a positive integer and 1 < a ≤ 7.
1.5.3 Related Programs
Incomplete Gamma Functions
MATLAB comes with the functions gammainc for the incomplete gamma function
and gammaincinv for the inverse incomplete gamma function. Note, gammainc
returns the normalized functions, Eq. (1.15a), and is restricted to positive real
values for “a” and real values for “z”. The SPECFUNPHYS-class incgammaC
computes the (non-normalized) incomplete gamma function, Eqs. (1.12), and (1.13),
therefore differs by the scaling factor Γ (a), but is not restricted to real values.
The SPECFUNPHYS-class [obj, erg] = incgammaC(z,a,lu,nm,method) computes the incomplete gamma function in the complex plane. (z,a)
are the same variables as in Eq. (1.12), they must be the same size or either
scalar. All other variables are optional. “lu” specifies the integral tail and has
the values “lower” (default) or “upper”. “nm” is the upper bound of summations for
series based computations. The default value depends on |z| to avoid overflow
with a maximum number of 500. The default depth is 10 for the continued
fraction (10th-approximant). “method” can have the values “m1” for computations
based on Eq. (1.19), “m2” for Eq. (1.20), and “m3” for continued fraction based
computations. The method is selected in dependence of the values of a, z
and z/a. For a = 1 Eq. (1.27) will be used and for a positive integer and
a ≤ 7 the evaluation will be based on the recurrence equation (1.16). The
object “obj” comes with the properties value (function value), info (information
about computational method used and upper or lower tail), ina (numerical
input a), and inz (numerical input z), and “erg” is the computational value in
doubles.
incgammaC supports the following methods: “abs” for for computing the
absolute value, “real” for the real and “imag” for the imaginary value, “angle” for
the phase angle in radians, and “conj” for the complex conjugate value. Each of the
methods can be applied either on the values (value, default) or on the input variables
z (inz) or a (ina), e.g.,
>> obj=incgammaC(randn * exp(i * randn), rand);
>> abs_a=obj.abs(’ina’);
% or
>> abs_a=abs(obj,’ina’);
The second argument (here “ina”) of the methods is optional.
Derivatives of the Incomplete Gamma Functions
The 1st and 2nd derivatives of the incomplete gamma function are given by
Eqs. (1.18a) and (1.18b). The corresponding class is diincgammaC with integral-
11
This equation will be used for computing the a = 1 results, and serves as a starting
value for the recurrence equation (1.16). The computation based on this equation
will be limited for a positive integer and 1 < a ≤ 7.
1.5.3 Related Programs
Incomplete Gamma Functions
MATLAB comes with the functions gammainc for the incomplete gamma function
and gammaincinv for the inverse incomplete gamma function. Note, gammainc
returns the normalized functions, Eq. (1.15a), and is restricted to positive real
values for “a” and real values for “z”. The SPECFUNPHYS-class incgammaC
computes the (non-normalized) incomplete gamma function, Eqs. (1.12), and (1.13),
therefore differs by the scaling factor Γ (a), but is not restricted to real values.
The SPECFUNPHYS-class [obj, erg] = incgammaC(z,a,lu,nm,method) computes the incomplete gamma function in the complex plane. (z,a)
are the same variables as in Eq. (1.12), they must be the same size or either
scalar. All other variables are optional. “lu” specifies the integral tail and has
the values “lower” (default) or “upper”. “nm” is the upper bound of summations for
series based computations. The default value depends on |z| to avoid overflow
with a maximum number of 500. The default depth is 10 for the continued
fraction (10th-approximant). “method” can have the values “m1” for computations
based on Eq. (1.19), “m2” for Eq. (1.20), and “m3” for continued fraction based
computations. The method is selected in dependence of the values of a, z
and z/a. For a = 1 Eq. (1.27) will be used and for a positive integer and
a ≤ 7 the evaluation will be based on the recurrence equation (1.16). The
object “obj” comes with the properties value (function value), info (information
about computational method used and upper or lower tail), ina (numerical
input a), and inz (numerical input z), and “erg” is the computational value in
doubles.
incgammaC supports the following methods: “abs” for for computing the
absolute value, “real” for the real and “imag” for the imaginary value, “angle” for
the phase angle in radians, and “conj” for the complex conjugate value. Each of the
methods can be applied either on the values (value, default) or on the input variables
z (inz) or a (ina), e.g.,
>> obj=incgammaC(randn * exp(i * randn), rand);
>> abs_a=obj.abs(’ina’);
% or
>> abs_a=abs(obj,’ina’);
The second argument (here “ina”) of the methods is optional.
Derivatives of the Incomplete Gamma Functions
The 1st and 2nd derivatives of the incomplete gamma function are given by
Eqs. (1.18a) and (1.18b). The corresponding class is diincgammaC with integral-
