Gamma Simple
viewed 1968 times and licensed 78 times
A Sterling series approximation of the gamma function.
Controller:
CodeCogs
Interface
#include <codecogs/maths/special/gamma/gamma_simple.h>
using namespace Maths::Special::Gamma;
| double | gamma_simple (double x)[inline]
A Sterling series approximation of the gamma function. |
These functions are available for Microsoft Excel (
Login to download):
| Real | cc_gamma_simple (Real x) |
Use the following HTML code to embed the calculators within other websites:
| Name | HTML Code |
|---|
gamma_simple
A Sterling series approximation of the gamma function. | |
Gamma Simple
Returns a simple approximation to the gamma functions. If your only interested in low levels of accuracy
(10 significant figures), then this solution is evaluated quickly and is relatively stable.
This approximation of the gamma function is achieved using the exponential of the Stirling series,
where
See also
Maths/Special/Gamma/Gamma and
Maths/Special/Gamma/StirlingExample 1
#include <codecogs/maths/special/gamma/gamma_simple.h>
#include <stdio.h>
int main()
{
for(double x=3; x<7; x+=0.4)
printf("\n x=%lf gamma_simple=%lf",x, Maths::Special::Gamma::gamma_simple(x));
return 0;
}
Output:
x=3.000000 gamma_simple=2.000000
x=3.400000 gamma_simple=2.981206
x=3.800000 gamma_simple=4.694174
x=4.200000 gamma_simple=7.756690
x=4.600000 gamma_simple=13.381286
x=5.000000 gamma_simple=24.000000
x=5.400000 gamma_simple=44.598848
x=5.800000 gamma_simple=85.621738
x=6.200000 gamma_simple=169.406099
x=6.600000 gamma_simple=344.701924
Parameters
Authors
- Tony Ottosson and Pal Frenger
Documention by Will Bateman (August 2005)
Source Code
Source code is available when you agree to a GP Licence or buy a Commercial Licence.
Not a member, then Register with CodeCogs. Already a Member, then Login.
You must login to leave a messge