public static double LogGamma(
double x
)
Public Shared Function LogGamma (
x As Double
) As Double
public:
static double LogGamma(
double x
)
static member LogGamma :
x : float -> float
Mathematically, this this just the natural logarithm of the value of Γ(x), the function that is computed by Gamma(Double).
Because Γ(x) grows rapidly for increasing positive x, the function Gamma(Double) overflows even for moderatlely large arguments. This function provides accurate values of ln(Γ(x)) even for values for which Γ(x) would overflow. Additionally, Γ(x) ~ 1 near x ~ 1 and x ~ 2. This function provides fully accurate values of ln(Γ(x)) even for those values of x for which Γ(x) is indistinguishable from one or only distinguished by the last few digits.
If you need to compute a product or quotient of several Gamma functions, computing it by exponentiating a sum or difference of evaluations of this function will allow computation of the ratio even in cases for which an individual Gamma function overflows. However, if the value you want is either a Pochhammer(Double, Double) function (the ratio of two Gamma functions) or a Beta(Double, Double) function, it will be more efficient and more accurate to use those specific functions.
ArgumentOutOfRangeException | x is negative. |