The IMSL_LNGAMMA function evaluates the logarithm of the absolute value of the gamma function log|Γ(x)|.

This routine requires an IDL Advanced Math and Stats license. For more information, contact your sales or technical support representative.

The logarithm of the absolute value of the gamma function log|Γ(x)| is computed.

Example


In this example, log|Γ(3.5)| is computed and printed.

PM, IMSL_LNGAMMA(3.5)
  1.20097

Errors


Warning Errors

MATH_NEAR_NEG_INT_WARN: Result is accurate to less than one-half precision because x is too close to a negative integer.

Fatal Errors

MATH_NEGATIVE_INTEGER: Parameter for the function cannot be a negative integer.

MATH_NEAR_NEG_INT_FATAL: Parameter for the function is too close to a negative integer.

MATH_LARGE_ABS_ARG_OVERFLOW: Parameter |x| must not be so large that the result overflows.

Syntax


Result = IMSL_LNGAMMA(x [, /DOUBLE])

Return Value


The value of the logarithm of gamma function log|Γ(x)|.

Arguments


X

Expression for which the logarithm of the absolute value of the gamma function is to be evaluated.

Keywords


DOUBLE (optional)

If present and nonzero, double precision is used.

Version History


6.4

Introduced