CLHEP
2.4.6.4
C++ Class Library for High Energy Physics
Loading...
Searching...
No Matches
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) :
AbsFunction
(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
FUNCTION_OBJECT_IMP
#define FUNCTION_OBJECT_IMP(classname)
Definition:
AbsFunction.hh:149
Genfun::AbsFunction
Definition:
AbsFunction.hh:48
Genfun::LogGamma
Definition:
LogGamma.hh:19
Genfun::LogGamma::operator()
virtual double operator()(double argument) const override
Definition:
LogGamma.cc:28
Genfun::LogGamma::~LogGamma
virtual ~LogGamma()
Definition:
LogGamma.cc:25
Genfun::LogGamma::LogGamma
LogGamma()
Definition:
LogGamma.cc:19
Genfun
Definition:
Abs.hh:14
CLHEP-CLHEP_2_4_6_4
GenericFunctions
src
LogGamma.cc
Generated by
1.9.6