IMSL Statistics Reference Guide > Utilities > GAMMA_ADV Function (PV-WAVE Advantage)
  

GAMMA_ADV Function (PV-WAVE Advantage)
Evaluates the real gamma function.
Usage
result = GAMMA_ADV(x)
Input Parameters
x—Point at which the gamma function is to be evaluated.
Returned Value
result—The value of the gamma function Γ(x).
Input Keywords
Double—If present and nonzero, double precision is used.
Discussion
The gamma function, Γ(x), is defined to be:
For x < 0, the above definition is extended by analytic continuation.
The gamma function is not defined for integers less than or equal to zero. It underflows for x << 0 and overflows for large x. It also overflows for values near negative integers.
Example
In this example, Γ(1.5) is computed and printed.
x  =  1.5
ans  =  GAMMA_ADV(x)
PRINT, 'Gamma(', x, ') =', ans
; PV-WAVE prints: Gamma( 1.50000) = 0.886227
Alert Errors
STAT_SMALL_ARG_UNDERFLOWThe parameter x must be large enough that Γ(x) does not underflow. The underflow limit occurs first for parameters close to large negative half integers. Even though other parameters away from these half integers may yield machine-representable values of Γ(x), such parameters are considered illegal.
Warning Errors
STAT_NEARR_NEG_INT_WARNThe result is accurate to less than one-half precision because x is too close to a negative integer.
Fatal Errors
STAT_ZERO_ARG_OVERFLOWThe parameter for the gamma function is too close to zero.
STAT_NEAR_NEG_INT_FATALThe parameter for the function is too close to a negative integer.
STAT_LARGE_ARG_OVERFLOWThe function overflows because x is too large.
STAT_CANNOT_FIND_XMINThe algorithm used to find xmin failed. This error should never occur.
STAT_CANNOT_FIND_XMAXThe algorithm used to find xmax failed. This error should never occur.

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.