Evaluates the logarithm of the absolute value of the gamma function log |Γ(x)|.
#include <imsls.h>
float imsls_f_log_gamma (float x)
The type double procedure is imsls_d_log_gamma.
float x
(Input)
Point at which the logarithm of the absolute value of the gamma
function is to be evaluated.
The value of the logarithm of gamma function log |Γ(x)|.
The logarithm of the absolute value of the gamma function log |Γ(x)| is computed.
Figure 15- 4 Plot of log|Γ(x)|
In this example, log |Γ(3.5)| is computed and printed.
#include <stdio.h>
#include <imsls.h>
int main()
{
float x = 3.5;
float ans;
ans = imsls_f_log_gamma(x);
printf("log gamma(%f) = %f\n", x, ans);
}
log gamma(3.500000) = 1.200974
IMSLS_NEAR_NEG_INT_WARN The result is accurate to less than one-half precision because x is too close to a negative integer.
IMSLS_NEGATIVE_INTEGER The argument for the function cannot be a negative integer.
IMSLS_NEAR_NEG_INT_FATAL The argument for the function is too close to a negative integer.
IMSLS_LARGE_ABS_ARG_OVERFLOW |x| must not be so large that the result overflows.