Computes the natural logarithm of the gamma function.
lgamma, lgammal, and gamma:
IEEE Math Library (libm.a)
or System V Math Library (libmsaa.a)
#include <math.h>
extern int signgam;
double lgamma (x) double x;
long double lgammal (x) long double x;
double gamma (x) double x;
The subroutine names lgamma and gamma are different names for the same function. The lgammal subroutine provides the same function for numbers in long double format.
The lgamma subroutine returns the natural logarithm of the absolute value of the gamma function of the x parameter.
G(x) = integral [0 to INF] of ((e**(-t) * t**(x-1) dt)
The sign of lgamma of x is stored in the external integer variable signgam. The x parameter may not be a non-positive integer.
g = exp(lgamma(x)) * signgam
to compute g = G(x) . Instead, use a sequence such as:
lg = lgamma(x); g = exp(lg) * signgam;
Note: Compile any routine that uses subroutines from the libm.a with the -lm flag. To compile the lgamma.c file, enter:
cc lgamma.c -lm
x | For the lgamma and gamma subroutines, specifies a double-precision floating-point value. For the lgammal subroutine, specifies a long double-precision floating-point value. |
When using the libmsaa.a library with the -lmsaa flag:
Note: These error-handling procedures may be changed with the matherr subroutine when using libmsaa.a (-lmsaa).
These subroutines are part of Base Operating System (BOS) Runtime.
The exp, expm1, log, log10, log1p or pow subroutine, matherr subroutine.
Subroutines Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.
128-Bit long double Floating-Point Format in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.