Google
Math.GammaLn Method
Class
Pascal
class function GammaLn(X: float): float;
Description

"For arguments greater than 13, the logarithm of the gamma function is approximated by the logarithmic version of Stirling's formula using a polynomial approximation of degree 4. Arguments between -33 and +33 are reduced by recurrence to the interval [2,3] of a rational approximation. The cosecant reflection formula is employed for arguments less than -33. 

Arguments greater than MAXLGM return MAXNUM and an error message." 

Algorithm translated into Delphi from Cephes C library with permission from Stephen L. Moshier .

Related Information