Returns the logarithm of the absolute value of the gamma function and the sign of gamma.
X — Argument for which the logarithm of the absolute value of the gamma function is desired. (Input)
ALGM — Result of the calculation. (Output)
S — Sign of
gamma(X).
(Output)
If gamma(X) is greater than or
equal to zero, S = 1.0. If gamma(X) is less than zero,
S = -1.0.
Generic: CALL ALGAMS (X, ALGM, S)
Specific: The specific interface names are S_ALGAMS and D_ALGAMS.
Single: CALL ALGAMS (X, ALGM, S)
Double: The double precision function name is DLGAMS.
The function ALGAMS computes ln |G(x)| and the sign of G(x). See GAMMA for the definition of G(x).
The result overflows if |x| is too large. The accuracy is worse than half precision if x is too close to a negative integer.
3 2 Result of ALGAMS is accurate to less than one-half precision because X is too near a negative integer.
In this example, ln |G(1.85)| and the sign of G(1.85) are computed and printed.
99998 FORMAT (' Log Abs(Gamma(', F6.3, ')) = ', F6.3)
99999 FORMAT (' Sign(Gamma(', F6.3, ')) = ', F6.2)
Log Abs(Gamma( 1.850)) = -0.056
|
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |