ATLAS Offline Software
Loading...
Searching...
No Matches
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
7
8#include <cmath>
9
10double 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
18double ln_factorialApp(unsigned int value) {
19 return 0.5*std::log(1.04719755119659763+6.28318530717958623*value) + value*(std::log(value)-1.);
20}
double ln_factorial(unsigned int value)
Logarithmic factorial (precise).
Definition MathTools.cxx:10
double ln_factorialApp(unsigned int value)
Logarithmic factorial (approximative).
Definition MathTools.cxx:18