Contents
ALGORITHMS
Site map
Links
Site and author
News
About the site
FAQ
Contact
TERMS OF USE
Contents - Special functions - Gamma function

Gamma function

Gamma function is an extension of the factorial function for real numbers. In x=0 and negative integer values gamma function has poles. For positive real x or negative non-integer x gamma function is

For positive integer x Γ(n)=(n-1)!

It should be noted that these formula is applicable for the complex argument too. But the gamma function of the complex argument is seldom used, so the algorithm in this module operates with real arguments only. Of course, the integration is not an effective way for gamma function calculation. Instead, it is used as a series of formulas to bring an argument to [2,3] interval in which the rational approximation is built. For big x (more than 33) Stirling's formula is used. This algorithm is implemented in the Gamma subroutine.

Gamma function can possess very big values, so it is often used as a logarithm of the gamma function, which can be calculated by using the LnGamma subroutine.

Report a bug

Source codes

C#

C# 1.0 source.
gammaf.csharp.zip - Gamma function


C++

C++ source.
gammaf.cpp.zip - Gamma function
ablas.zip - optimized basic linear algebra subroutines with SSE2 support (for C++ sources only)


Delphi

Delphi source.
Can be compiled under FPC (in Delphi compatibility mode).
gammaf.delphi.zip - Gamma function


Visual Basic 6

Visual Basic 6 source.
gammaf.vb6.zip - Gamma function


Zonnon beta

Zonnon source.
Zonnon is an experimental language developed at ETH Zurich.
See www.zonnon.ethz.ch for more information.
gammaf.zonnon.zip - Gamma function



 
 
Sergey Bochkanov, Vladimir Bystritsky
Copyright © 1999-2008