ATLAS Offline Software
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
ReweightUtils
Root
MathTools.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#define MathTools_cxx
6
#include "
ReweightUtils/MathTools.h
"
7
8
#include <cmath>
9
10
double
ln_factorial
(
unsigned
int
value) {
11
double
result
= 0.;
12
for
(
int
k = value ; k > 0 ; --k) {
13
result
+= std::log(k);
14
}
15
return
result
;
16
}
17
18
double
ln_factorialApp
(
unsigned
int
value) {
19
return
0.5*std::log(1.04719755119659763+6.28318530717958623*value) + value*(std::log(value)-1.);
20
}
ln_factorial
double ln_factorial(unsigned int value)
Logarithmic factorial (precise).
Definition
MathTools.cxx:10
ln_factorialApp
double ln_factorialApp(unsigned int value)
Logarithmic factorial (approximative).
Definition
MathTools.cxx:18
MathTools.h
result
Generated on
for ATLAS Offline Software by
1.14.0