CLHEP VERSION Reference Documentation
CLHEP Home Page
CLHEP Documentation
CLHEP Bug Reports
Main Page
Namespaces
Classes
Files
File List
File Members
GenericFunctions
src
LogGamma.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
// $Id: LogGamma.cc,v 1.4 2003/10/10 17:40:39 garren Exp $
3
// ---------------------------------------------------------------------------
4
5
#include "
CLHEP/GenericFunctions/LogGamma.hh
"
6
#include <cmath>
// for log()
7
8
namespace
Genfun {
9
FUNCTION_OBJECT_IMP
(LogGamma)
10
11
const
double
LogGamma::_coefficient[6]={
12
+76.18009172947146,
13
-86.50532032941677,
14
+24.01409824083091,
15
-1.231739572450155,
16
0.1208650973866179E-2,
17
-0.5395239384953E-5};
18
19
LogGamma::LogGamma
()
20
{}
21
22
LogGamma::LogGamma
(
const
LogGamma
& right)
23
{}
24
25
LogGamma::~LogGamma
() {
26
}
27
28
double
LogGamma::operator()
(
double
x)
const
{
29
double
y=x,tmp=x+5.5,ser=1.000000000190015,c=2.5066282746310005;
30
tmp -= (x+0.5)*log(tmp);
31
for
(
int
j=0;j<6;j++) ser += _coefficient[j]/++y;
32
return
-tmp+log(c*ser/x);
33
}
34
35
}
// namespace Genfun
Generated on Sun Jun 17 2012 08:08:26 for CLHEP by
1.8.1.1