Gamma and Related Functions | Extreme Optimization Numerical Libraries for .NET Professional |

The Gamma function, Γ(x) is a generalization of the factorial. It is defined as

The GammaFunctions class provides static methods for evaluating the Gamma function and its variants, including Beta functions and the Digamma function.

The Gamma method evaluates the standard Gamma function. The LogGamma method evaluates the natural logarithm of (the absolute value of) the Gamma function. Both methods have overloads for real and complex arguments. This method has an overload that takes an additional integer out parameter. On exit, this parameter contains the sign of the Gamma function.

The incomplete Gamma function is defined as

It is implemented as the IncompleteGamma method. Allowing the upper bound of the integral to vary as well leads to a second variant of IncompleteGamma that takes three arguments.

The regularized Gamma functions are defined by

and implemented by the RegularizedGammaP and RegularizedGammaQ methods. Table 1 summarizes the methods that implement Gamma functions.

Method | Description |
---|---|

(Overloaded.) Gamma function for real or complex argument. | |

(Overloaded.) Natural logarithm of the Gamma function for real or complex argument. Optionally returns the sign in a second out parameter. | |

(Overloaded.) Incomplete Gamma function for two or three real arguments. | |

Regularized Gamma function of the first kind. | |

Regularized Gamma function of the second kind. | |

Inverse of the regularized Gamma function of the first kind. | |

Inverse of the regularized Gamma function of the second kind. |

The Beta function is closely related to the Gamma function. It is defined as:

The methods that implement the Beta function and related functions are listed below:

Method | Description |
---|---|

Beta function for real arguments. | |

Natural logarithm of the Beta function for real arguments. | |

Regularized Beta function for real arguments. | |

Inverse of the regularized Beta function for real arguments. |

The DiGamma function Psi(x) is the derivative of the logarithm of the Gamma function. It is implemented by the Digamma method, with overloads for real and integer arguments. When the argument is an integer, the following special relation holds:

where ? is EulersConstant and the second term is a so-called harmonic number, also available through the HarmonicNumber method.

The TaylorCoefficient method evaluates the Taylor coefficient of the specified degree for a specified value of the argument.

Copyright © 2004-20116,
Extreme Optimization. All rights reserved.

*Extreme Optimization,* *Complexity made simple*, *M#*, and *M
Sharp* are trademarks of ExoAnalytics Inc.

*Microsoft*, *Visual C#, Visual Basic, Visual Studio*, *Visual
Studio.NET*, and the *Optimized for Visual Studio* logo

are
registered trademarks of Microsoft Corporation.