Chapter 9: Special Functions

log_gamma

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

Synopsis

#include <imsl.h>

float imsl_f_log_gamma (float x)

The type double procedure is imsl_d_log_gamma.

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 (x)|.

Description

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

Figure 9- 7   Plot of log |Γ(x)|

Example

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

#include <stdio.h>
#include <imsl.h>

main()
{
    float       x = 3.5;
    float       ans;

    ans = imsl_f_log_gamma(x);
    printf("log gamma(%f) = %f\n", x, ans);
}

Output

log gamma(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.


Visual Numerics, Inc.
Visual Numerics - Developers of IMSL and PV-WAVE
http://www.vni.com/
PHONE: 713.784.3131
FAX:713.781.9260