log gamma stirling
Natural Logarithm of Gamma function
Controller: CodeCogs
Dependents
Interface
C++
Log Gamma Stirling
doublelog_gamma_stirling( | double | x | |
int* | sign = NULL | ) |
Accuracy:
<pre> domain # trials peak rms 0, 3 28000 5.4e-16 1.1e-16 2.718, 2.556e305 40000 3.5e-16 8.3e-17 </pre> The error criterion was relative when the function magnitude was greater than one but absolute when it was less than one.Example:
#include <codecogs/maths/special/gamma/log_gamma_stirling.h> #include <stdio.h> int main() { for(double x=10; x<=20; x+=0.5) printf("\n x=%lf log_gamma_stirling(x)=%lf",x, Maths::Special::Gamma::log_gamma_stirling(x)); }
Output:
x=10.000000 log_gamma_stirling(x)=12.801827 x=10.500000 log_gamma_stirling(x)=13.940625 x=11.000000 log_gamma_stirling(x)=15.104413 x=11.500000 log_gamma_stirling(x)=16.292000 x=12.000000 log_gamma_stirling(x)=17.502308 x=12.500000 log_gamma_stirling(x)=18.734348 x=13.000000 log_gamma_stirling(x)=19.987214 x=13.500000 log_gamma_stirling(x)=21.260076 x=14.000000 log_gamma_stirling(x)=22.552164 x=14.500000 log_gamma_stirling(x)=23.862766 x=15.000000 log_gamma_stirling(x)=25.191221 x=15.500000 log_gamma_stirling(x)=26.536914 x=16.000000 log_gamma_stirling(x)=27.899271 x=16.500000 log_gamma_stirling(x)=29.277755 x=17.000000 log_gamma_stirling(x)=30.671860 x=17.500000 log_gamma_stirling(x)=32.081115 x=18.000000 log_gamma_stirling(x)=33.505073 x=18.500000 log_gamma_stirling(x)=34.943316 x=19.000000 log_gamma_stirling(x)=36.395445 x=19.500000 log_gamma_stirling(x)=37.861087 x=20.000000 log_gamma_stirling(x)=39.339884
References:
- Cephes Math Library Release 2.8: June, 2000
- http://mathworld.wolfram.com/LogGammaFunction.html
Parameters
x is primary argument. sign is a pointer to a variable, into which the sign of the solution is placed, if sign not equal to NULL (default=NULL).
Authors
- Stephen L.Moshier. Copyright 1984, 1987, 1989, 1992, 2000
Updated by Will Bateman
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.