PDFxTMDLib  1.0.0
MathUtils.h
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef M_PI
4 #define M_PI 3.14159265358979323846
5 #endif
6 
7 #include <cmath>
8 #include <iostream>
9 
10 // taken form LHAPDF
11 namespace PDFxTMD
12 {
13 static const double CL1SIGMA = 100 * std::erf(1 / std::sqrt(2));
14 
17 
18 static const double kMACHEP = 1.11022302462515654042363166809e-16;
19 static const double kMAXLOG = 709.782712893383973096206318587;
20 static const double kBig = 4.503599627370496e15;
21 static const double kBiginv = 2.22044604925031308085e-16;
22 
23 double igamc(double a, double x);
24 double igam(double a, double x);
25 
35 double igamc(double a, double x);
36 
40 double igam(double a, double x);
41 
45 double norm_quantile(double p);
54 double chisquared_quantile(double p, double ndf);
56 template <typename N> inline int sgn(N val)
57 {
58  return (N(0) < val) - (val < N(0));
59 }
60 } // namespace PDFxTMD
Definition: AllFlavorsShape.h:14
double igamc(double a, double x)
Incomplete gamma function (complement integral)
double norm_quantile(double p)
Compute quantiles for standard normal distribution N(0, 1) at probability p.
double chisquared_quantile(double p, double ndf)
Compute quantiles of the chi-squared probability distribution function.
double igam(double a, double x)
Left tail of incomplete gamma function.
int sgn(N val)
Get the sign of a number.
Definition: MathUtils.h:56