Click or drag to resize

SpecialFunctionsGammaLn Method

Computes the logarithm of the Gamma function.

Namespace: Altaxo.Calc
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public static double GammaLn(
	double z
)

Parameters

z  Double
The argument of the gamma function.

Return Value

Double
The logarithm of the gamma function.
Remarks

This implementation of the computation of the gamma and logarithm of the gamma function follows the derivation in "An Analysis Of The Lanczos Gamma Approximation", Glendon Ralph Pugh, 2004. We use the implementation listed on p. 116 which achieves an accuracy of 16 floating point digits. Although 16 digit accuracy should be sufficient for double values, improving accuracy is possible (see p. 126 in Pugh).

Our unit tests suggest that the accuracy of the Gamma function is correct up to 14 floating point digits.

See Also