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
8namespace Genfun {
10
11const 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
20{}
21
23{}
24
26}
27
28double 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
#define FUNCTION_OBJECT_IMP(classname)
Definition: AbsFunction.hh:149
virtual double operator()(double argument) const override
Definition: LogGamma.cc:28
virtual ~LogGamma()
Definition: LogGamma.cc:25
Definition: Abs.hh:14