logGamma

Evaluates the logarithm of the absolute value of the gamma function \(\log |\Gamma(x)|\).

Synopsis

logGamma (x)

Required Arguments

float x (Input)
Point at which the logarithm of the absolute value of the gamma function is to be evaluated.

Return Value

The value of the logarithm of gamma function, \(\log |\Gamma(x)|\).

Description

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

../../_images/Fig9-7.png

Figure 9.14 — Plot of \(\log |\Gamma(x)|\)

Example

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

from __future__ import print_function
from numpy import *
from pyimsl.math.logGamma import logGamma

x = 3.5
ans = logGamma(x)
print("logGamma(%f) = %f" % (x, ans))

Output

logGamma(3.500000) = 1.200974

Warning Errors

IMSL_NEAR_NEG_INT_WARN The result is accurate to less than one-half precision because x is too close to a negative integer.

Fatal Errors

IMSL_NEGATIVE_INTEGER The argument for the function cannot be a negative integer.
IMSL_NEAR_NEG_INT_FATAL The argument for the function is too close to a negative integer.
IMSL_LARGE_ABS_ARG_OVERFLOW |x| must not be so large that the result overflows.