1.2 Gamma Function
5
.15808870322491248884e-3;
-.21026444172410488319e-3;
.21743961811521264320e-3;
-.16431810653676389022e-3;
.84418223983852743293e-4;
-.26190838401581408670e-4;
.36899182659531622704e-5];
or the coefficients published in [4], γ = 5 and
c = [1.000000000190015
76.18009172947146
-86.50532032941677
24.01409824083091
-1.231739572450155
0.1208650973866179e-02
-0.5395239384953d-05];
The computation based on the second series is less accurate than the computation
based on the first one and serves mainly for testing.
1.2.3 The Class gammalnC and gammaC
The MATLAB-function y = gammaln(a) returns the logarithm of the gamma
function. The input “a” must be non-negative and real. The SPECFUNPHYS-class
[obj, erg] = gammalnC(a,coe) computes the logarithm of the gamma
function for arbitrary complex arrays “a”, where the optional input “coe” is
“default” or “PG” for Lanczos-coefficients based on the work of Paul Godfrey [2],
“NR” for the Lanczos-coefficients as published in the Numerical Recipes [4], and
“ML” if the MATLAB-function gammaln should be used. The return value “obj”
is an object of the class gammalnC with the properties “value” for the values of
gammalnC, “info” for information about the used method, and “ina” with the input
“a”. The second value “erg” are the Γ -values as doubles.
The class gammalnC supports the methods abs for computing the absolute
value, angle to compute the phase angle in radians, conj for complex conjugation, and imag for computing the imaginary part and real for the real part of the
gammalnC object. All methods have two inputs. The first one is the class object and
the second argument (optional) determines whether the method should be applied
on the property “value” (default) or on the input variable “ina”.
The SPECFUNPHYS-class [obj,res] = gammaC(a,coe) returns the
gamma function evaluated at the (complex) elements of “a”. gammaC calls the
class gammalnC and the result is derived with the MATLAB exp-function. “coe”
has exactly the same possible values as gammalnC and gammaC comes with the
same methods as gammalnC.
Example
The following example visualizes the Γ -function.
Précédent

- 21/287

Suivant