42 return 3.14159265358979323846;
91 return 1.4142135623730950488016887242097;
98 return 2.71828182845904523536;
105 return 2.30258509299404568402;
112 return 0.43429448190325182765;
193 return 6.62607015e-34;
216 return 1.054571817e-34;
223 return 1.0e7 *
Hbar();
289 return 6.02214076e+23;
330 return (1000.0 *
R()) /
MWair();
337 return 0.577215664901532860606512090082402431042;
344 return 1.602176634e-19;
411 inline static T
Min();
412 inline static T
Max();
444 template <
typename Iterator> Iterator
LocMin(Iterator first, Iterator last);
446 template <
typename Iterator> Iterator
LocMax(Iterator first, Iterator last);
449 template <
typename T>
451 template <
typename T>
474 template <
typename T> T *
Cross(
const T
v1[3],
const T
v2[3], T out[3]);
480 template <
typename T>
inline T
NormCross(
const T
v1[3],
const T
v2[3],T out[3]);
483 template <
typename T> T *
Normal2Plane(
const T
v1[3],
const T
v2[3],
const T
v3[3], T normal[3]);
526 template <
typename Iterator>
Double_t Mean(Iterator first, Iterator last);
527 template <
typename Iterator,
typename WeightIterator>
Double_t Mean(Iterator first, Iterator last, WeightIterator wfirst);
530 template <
typename Iterator>
Double_t GeomMean(Iterator first, Iterator last);
533 template <
typename Iterator>
Double_t RMS(Iterator first, Iterator last);
534 template <
typename Iterator,
typename WeightIterator>
Double_t RMS(Iterator first, Iterator last, WeightIterator wfirst);
537 template <
typename Iterator>
Double_t StdDev(Iterator first, Iterator last) {
return RMS<Iterator>(first,last); }
538 template <
typename Iterator,
typename WeightIterator>
Double_t StdDev(Iterator first, Iterator last, WeightIterator wfirst) {
return RMS<Iterator,WeightIterator>(first,last,wfirst); }
544 template <
class Element,
typename Size> Element
KOrdStat(Size
n,
const Element *
a, Size k, Size *work = 0);
582 void KNNDensity(std::span<const double> observations, std::span<const double> queries, std::span<double>
result,
583 int k,
double dmin = 0.0);
594# define finite _finite
660 {
if (
x != 0)
return atan2(
y,
x);
661 if (
y == 0)
return 0;
662 if (
y > 0)
return Pi()/2;
711 if ( i & 1 &&
x + 0.5 == T(i) ) i--;
714 if ( i & 1 &&
x - 0.5 == T(i) ) i++;
729 {
return ldexp(
x, exp); }
735 {
return std::pow(
x,
y); }
747 {
return std::pow(
x,
y); }
753 {
return pow(
x,
y); }
760 return std::pow(
x,
y);
784#if defined(R__FAST_MATH)
787 const unsigned long long mask = 0x7FF0000000000000LL;
788 union {
unsigned long long l;
double d;}
v;
793# if defined(R__HPUX11)
794 {
return isfinite(
x); }
795# elif defined(R__MACOSX)
798 {
return isfinite(
x); }
801 {
return std::isfinite(
x); }
804 {
return finite(
x); }
814#if defined(R__FAST_MATH)
817 const unsigned int mask = 0x7f800000;
818 union {
unsigned int l;
float d;}
v;
823{
return std::isfinite(
x); }
831#if defined (R__FAST_MATH)
858 } ieee_double_shape_type;
860#define EXTRACT_WORDS(ix0,ix1,d) \
862 ieee_double_shape_type ew_u; \
864 (ix0) = ew_u.parts.msw; \
865 (ix1) = ew_u.parts.lsw; \
872 EXTRACT_WORDS(hx, lx,
x);
876 return (hx == 0x7ff00000) && (lx != 0);
882 } ieee_float_shape_type;
884#define GET_FLOAT_WORD(i,d) \
886 ieee_float_shape_type gf_u; \
894 GET_FLOAT_WORD (wx,
x);
896 return (
Bool_t)(wx > 0x7f800000);
901#if defined(R__FAST_MATH)
917 return std::numeric_limits<Double_t>::quiet_NaN();
924 return std::numeric_limits<Double_t>::signaling_NaN();
931 return std::numeric_limits<Double_t>::infinity();
939 return (std::numeric_limits<T>::min)();
947 return (std::numeric_limits<T>::max)();
955 return std::numeric_limits<T>::epsilon();
974 return *std::min_element(
a,
a+
n);
982 return *std::max_element(
a,
a+
n);
996 if (
n <= 0 || !
a)
return -1;
1012template <
typename Iterator>
1015 return std::min_element(first, last);
1032template <
typename T>
1036 ::Error(
"TMath::Gradient",
"Input parameter f is empty.");
1039 ::Error(
"TMath::Gradient",
"Input parameter n=%lld is smaller than 2.",
n);
1050 result[i] = (
f[i + 1] -
f[i - 1]) / (2 *
h);
1072template <
typename T>
1076 ::Error(
"TMath::Laplacian",
"Input parameter f is empty.");
1079 ::Error(
"TMath::Laplacian",
"Need at least four elements, got %lld",
n);
1086 result[0] = (4 *
f[2] + 2 *
f[0] - 5 *
f[1] -
f[3]) / (
h *
h);
1090 result[i] = (
f[i + 1] +
f[i - 1] - 2 *
f[i]) / (
h *
h);
1094 result[i] = (2 *
f[i] - 5 *
f[i - 1] + 4 *
f[i - 2] -
f[i - 3]) / (
h *
h);
1104template <
typename T>
1106 if (
n <= 0 || !
a)
return -1;
1122template <
typename Iterator>
1126 return std::max_element(first, last);
1132template <
typename Iterator>
1137 while ( first != last )
1152template <
typename Iterator,
typename WeightIterator>
1159 while ( first != last ) {
1161 ::Error(
"TMath::Mean",
"w[%d] = %.4e < 0 ?!",i,*
w);
1164 sum += (*w) * (*first);
1171 ::Error(
"TMath::Mean",
"sum of weights == 0 ?!");
1181template <
typename T>
1195template <
typename Iterator>
1200 while ( first != last ) {
1201 if (*first == 0)
return 0.;
1215template <
typename T>
1230template <
typename Iterator>
1238 while ( first != last ) {
1240 tot += (
x - mean)*(
x - mean);
1255template <
typename Iterator,
typename WeightIterator>
1262 while ( first != last ) {
1265 sumw2 += (*w) * (*w);
1266 tot += (*w) * (
x - mean)*(
x - mean);
1280template <
typename T>
1292 out[0] =
v1[1] *
v2[2] -
v1[2] *
v2[1];
1293 out[1] =
v1[2] *
v2[0] -
v1[0] *
v2[2];
1294 out[2] =
v1[0] *
v2[1] -
v1[1] *
v2[0];
1309 v1[0] = p2[0] - p1[0];
1310 v1[1] = p2[1] - p1[1];
1311 v1[2] = p2[2] - p1[2];
1313 v2[0] = p3[0] - p1[0];
1314 v2[1] = p3[1] - p1[1];
1315 v2[2] = p3[2] - p1[2];
1331 for (i=0; i<
np; i++) {
1332 if ((
y[i]<yp &&
y[j]>=yp) || (
y[j]<yp &&
y[i]>=yp)) {
1333 if constexpr (std::numeric_limits<T>::is_integer) {
1342 if ((dy > 0 && lhs < rhs) || (dy < 0 && lhs > rhs)) {
1343 oddNodes = !oddNodes;
1346 if (
x[i]+(yp-
y[i])/(
y[j]-
y[i])*(
x[j]-
x[i])<xp) {
1347 oddNodes = !oddNodes;
1382 const Int_t kWorkMax = 100;
1384 if (
n <= 0 || !
a)
return 0;
1395 isAllocated =
kTRUE;
1402 for (
Int_t j = 0; j <
n; j++) {
1404 ::Error(
"TMath::Median",
"w[%d] = %.4e < 0 ?!",j,
w[j]);
1405 if (isAllocated)
delete [] ind;
1417 for (jl = 0; jl <
n; jl++) {
1419 if (
sum >= sumTot2)
break;
1424 for (jh =
n-1; jh >= 0; jh--) {
1426 if (
sum <= sumTot2)
break;
1429 median = 0.5*(
a[ind[jl]]+
a[ind[jh]]);
1476 if (
w && std::adjacent_find(
w,
w +
n, std::not_equal_to<>()) ==
w +
n)
1480 std::vector<T> values;
1481 std::vector<Double_t> weights;
1487 const auto vstart = values.begin();
1488 const auto vstop = values.end();
1489 const auto viter = std::lower_bound(vstart, vstop,
value);
1490 const auto vidx = std::distance(vstart, viter);
1491 if (viter != vstop &&
w) {
1492 weights[vidx] += weight;
1494 values.insert(viter,
value);
1495 weights.insert(weights.begin() + vidx, weight);
1499 const size_t sn = values.size();
1505 return TMath::Mean(sn, values.data(), weights.data());
1508 const double d1_0 = values[1] - values[0];
1509 const double d2_1 = values[2] - values[1];
1511 return TMath::Mean(2, values.data() + 1, weights.data() + 1);
1512 else if (d2_1 > d1_0)
1513 return TMath::Mean(2, values.data(), weights.data());
1518 const auto wstart = weights.begin();
1519 const auto wstop = weights.end();
1520 if (std::adjacent_find(wstart, wstop, std::not_equal_to<>()) != wstop) {
1522 const auto wmaxiter = std::max_element(wstart, wstop);
1523 const auto wmaxidx = std::distance(wstart, wmaxiter);
1524 return values[wmaxidx];
1535 Double_t min_v_range = values[jMin +
n - 1] - values[jMin];
1536 const size_t N = std::ceil(
n * 0.5);
1537 const size_t start = jMin;
1538 const size_t stop = start +
n -
N + 1;
1540 for (
size_t i = start; i < stop; i++) {
1541 Double_t range = values[i +
N - 1] - values[i];
1542 if (range < min_v_range) {
1543 min_v_range = range;
1551 const double d1_0 = values[jMin + 1] - values[jMin + 0];
1552 const double d2_1 = values[jMin + 2] - values[jMin + 1];
1554 return (values[jMin + 1] + values[jMin + 2]) * 0.5;
1555 else if (d2_1 > d1_0)
1556 return (values[jMin] + values[jMin + 1]) * 0.5;
1558 return values[jMin + 1];
1559 }
else if (
n == 2) {
1560 return (values[jMin] + values[jMin + 1]) * 0.5;
1562 Error(
"ModeHalfSample",
"Error in recursive algorithm, returning NaN");
1587template <
class Element,
typename Size>
1591 const Int_t kWorkMax = 100;
1596 Size i, ir, j,
l, mid;
1599 Index workLocal[kWorkMax];
1607 isAllocated =
kTRUE;
1612 for (Size ii=0; ii<
n; ii++) {
1620 if (ir ==
l+1 &&
a[ind[ir]]<
a[ind[
l]])
1621 {temp = ind[
l]; ind[
l]=ind[ir]; ind[ir]=temp;}
1622 Element tmp =
a[ind[rk]];
1628 {temp = ind[mid]; ind[mid]=ind[
l+1]; ind[
l+1]=temp;}
1629 if (
a[ind[
l]]>
a[ind[ir]])
1630 {temp = ind[
l]; ind[
l]=ind[ir]; ind[ir]=temp;}
1632 if (
a[ind[
l+1]]>
a[ind[ir]])
1633 {temp=ind[
l+1]; ind[
l+1]=ind[ir]; ind[ir]=temp;}
1635 if (
a[ind[
l]]>
a[ind[
l+1]])
1636 {temp = ind[
l]; ind[
l]=ind[
l+1]; ind[
l+1]=temp;}
1642 do i++;
while (
a[ind[i]]<
a[arr]);
1643 do j--;
while (
a[ind[j]]>
a[arr]);
1645 {temp=ind[i]; ind[i]=ind[j]; ind[j]=temp;}
1649 if (j>=rk) ir = j-1;
bool Bool_t
Boolean (0=false, 1=true) (bool)
int Int_t
Signed integer 4 bytes (int)
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int)
float Float_t
Float 4 bytes (float)
double Double_t
Double 8 bytes.
long double LongDouble_t
Long Double (not portable)
long long Long64_t
Portable signed long integer 8 bytes.
const char Option_t
Option string (const char)
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
TGLVector3 Cross(const TGLVector3 &v1, const TGLVector3 &v2)
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t mask
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t np
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Namespace for new Math classes and functions.
Double_t FDistI(Double_t F, Double_t N, Double_t M)
Calculates the cumulative distribution function of F-distribution (see ROOT::Math::fdistribution_cdf)...
Double_t GeomMean(Long64_t n, const T *a)
Returns the geometric mean of an array a of size n.
Double_t LogNormal(Double_t x, Double_t sigma, Double_t theta=0, Double_t m=1)
Computes the density of LogNormal distribution at point x.
constexpr Double_t G()
Gravitational constant in: .
Double_t CosH(Double_t)
Returns the hyperbolic cosine of x.
T * Normal2Plane(const T v1[3], const T v2[3], const T v3[3], T normal[3])
Calculates a normal vector of a plane.
Double_t DiLog(Double_t x)
Modified Struve functions of order 1.
Double_t BetaDist(Double_t x, Double_t p, Double_t q)
Computes the probability density function of the Beta distribution (the cumulative distribution funct...
void KNNDensity(std::span< const double > observations, std::span< const double > queries, std::span< double > result, int k, double dmin=0.0)
Computes a 1D k-nearest neighbor density estimate for a set of query points.
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
Double_t BesselI(Int_t n, Double_t x)
Computes the Integer Order Modified Bessel function I_n(x) for n=0,1,2,... and any real x.
Element KOrdStat(Size n, const Element *a, Size k, Size *work=0)
Returns k_th order statistic of the array a of size n (k_th smallest element out of n elements).
Double_t Gaus(Double_t x, Double_t mean=0, Double_t sigma=1, Bool_t norm=kFALSE)
Calculates a gaussian function with mean and sigma.
constexpr Double_t GUncertainty()
Gravitational constant uncertainty.
constexpr Double_t C()
Velocity of light in .
Double_t Factorial(Int_t i)
Computes factorial(n).
Double_t RMS(Long64_t n, const T *a, const Double_t *w=nullptr)
Returns the Standard Deviation of an array a with length n.
Double_t KolmogorovTest(Int_t na, const Double_t *a, Int_t nb, const Double_t *b, Option_t *option)
Statistical test whether two one-dimensional sets of points are compatible with coming from the same ...
constexpr Double_t GhbarCUncertainty()
uncertainty.
Long64_t LocMin(Long64_t n, const T *a)
Returns index of array with the minimum element.
constexpr Double_t Ccgs()
constexpr Double_t SigmaUncertainty()
Stefan-Boltzmann constant uncertainty.
Int_t Nint(T x)
Round to nearest integer. Rounds half integers to the nearest even integer.
Double_t ModeHalfSample(Long64_t n, const T *a, const Double_t *w=nullptr)
Returns the half-sample mode of the array a where each entry i has weight w[i].
Double_t BinomialI(Double_t p, Int_t n, Int_t k)
Suppose an event occurs with probability p per trial Then the probability P of its occurring k or mor...
Double_t Vavilov(Double_t x, Double_t kappa, Double_t beta2)
Returns the value of the Vavilov probability density function.
Double_t Binomial(Int_t n, Int_t k)
Calculates the binomial coefficient n over k.
Float_t Normalize(Float_t v[3])
Normalize a vector v in place.
constexpr Double_t NaUncertainty()
Avogadro constant (Avogadro's Number) uncertainty.
Double_t Prob(Double_t chi2, Int_t ndf)
Computation of the probability for a certain Chi-squared (chi2) and number of degrees of freedom (ndf...
Bool_t IsInside(T xp, T yp, Int_t np, T *x, T *y)
Function which returns kTRUE if point xp,yp lies inside the polygon defined by the np points in array...
Double_t ASin(Double_t)
Returns the principal value of the arc sine of x, expressed in radians.
Double_t Log2(Double_t x)
Returns the binary (base-2) logarithm of x.
Double_t BesselK1(Double_t x)
Modified Bessel function I_1(x)
Double_t Median(Long64_t n, const T *a, const Double_t *w=nullptr, Long64_t *work=nullptr)
Returns the median of the array a where each entry i has weight w[i] .
void BubbleHigh(Int_t Narr, Double_t *arr1, Int_t *arr2)
Bubble sort variant to obtain the order of an array's elements into an index in order to do more usef...
Double_t Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.
Double_t BesselI1(Double_t x)
Modified Bessel function K_0(x)
Double_t Erf(Double_t x)
Computation of the error function erf(x).
Bool_t Permute(Int_t n, Int_t *a)
Simple recursive algorithm to find the permutations of n natural numbers, not necessarily all distinc...
Double_t QuietNaN()
Returns a quiet NaN as defined by IEEE 754.
Double_t Floor(Double_t x)
Rounds x downward, returning the largest integral value that is not greater than x.
Double_t PoissonI(Double_t x, Double_t par)
Computes the Discrete Poisson distribution function for (x,par).
Double_t CauchyDist(Double_t x, Double_t t=0, Double_t s=1)
Computes the density of Cauchy distribution at point x by default, standard Cauchy distribution is us...
Double_t ATan(Double_t)
Returns the principal value of the arc tangent of x, expressed in radians.
Double_t StruveL1(Double_t x)
Modified Struve functions of order 0.
constexpr Double_t Gn()
Standard acceleration of gravity in .
Double_t ASinH(Double_t)
Returns the area hyperbolic sine of x.
Double_t LaplaceDistI(Double_t x, Double_t alpha=0, Double_t beta=1)
Computes the cumulative distribution function (lower tail integral) of Laplace distribution at point ...
ULong_t Hash(const void *txt, Int_t ntxt)
Calculates hash index from any char string.
constexpr Double_t QeUncertainty()
Elementary charge uncertainty.
constexpr Double_t K()
Boltzmann's constant in : .
Double_t BreitWigner(Double_t x, Double_t mean=0, Double_t gamma=1)
Calculates a Breit Wigner function with mean and gamma.
constexpr Double_t Sqrt2()
constexpr Double_t KUncertainty()
Boltzmann's constant uncertainty.
constexpr Double_t Hbarcgs()
Double_t Landau(Double_t x, Double_t mpv=0, Double_t sigma=1, Bool_t norm=kFALSE)
The LANDAU function.
Double_t Voigt(Double_t x, Double_t sigma, Double_t lg, Int_t r=4)
Computation of Voigt function (normalised).
Double_t Student(Double_t T, Double_t ndf)
Computes density function for Student's t- distribution.
constexpr Double_t CUncertainty()
Speed of light uncertainty.
constexpr Double_t Qe()
Elementary charge in .
Double_t Ceil(Double_t x)
Rounds x upward, returning the smallest integral value that is not less than x.
constexpr Double_t PiOver2()
constexpr Double_t HCcgs()
T MinElement(Long64_t n, const T *a)
Returns minimum of array a of length n.
Double_t BetaDistI(Double_t x, Double_t p, Double_t q)
Computes the cumulative distribution function of the Beta distribution, i.e.
T NormCross(const T v1[3], const T v2[3], T out[3])
Calculates the Normalized Cross Product of two vectors.
Int_t Finite(Double_t x)
Check if it is finite with a mask in order to be consistent in presence of fast math.
Double_t TanH(Double_t)
Returns the hyperbolic tangent of x.
Int_t FloorNint(Double_t x)
Returns the nearest integer of TMath::Floor(x).
Double_t ACosH(Double_t)
Returns the nonnegative area hyperbolic cosine of x.
Double_t BesselK0(Double_t x)
Modified Bessel function I_0(x)
Double_t BesselY0(Double_t x)
Bessel function J1(x) for any real x.
Double_t ATan2(Double_t y, Double_t x)
Returns the principal value of the arc tangent of y/x, expressed in radians.
constexpr Double_t RUncertainty()
Universal gas constant uncertainty.
Double_t BetaCf(Double_t x, Double_t a, Double_t b)
Continued fraction evaluation by modified Lentz's method used in calculation of incomplete Beta funct...
Long64_t LocMax(Long64_t n, const T *a)
Returns index of array with the maximum element.
Double_t ErfInverse(Double_t x)
Returns the inverse error function.
Double_t LaplaceDist(Double_t x, Double_t alpha=0, Double_t beta=1)
Computes the probability density function of Laplace distribution at point x, with location parameter...
constexpr Double_t E()
Base of natural log: .
constexpr Double_t GnUncertainty()
Standard acceleration of gravity uncertainty.
constexpr Double_t Hcgs()
constexpr Double_t HUncertainty()
Planck's constant uncertainty.
Double_t Log(Double_t x)
Returns the natural logarithm of x.
constexpr Double_t DegToRad()
Conversion from degree to radian: .
Double_t Erfc(Double_t x)
Computes the complementary error function erfc(x).
Double_t VavilovI(Double_t x, Double_t kappa, Double_t beta2)
Returns the value of the Vavilov cumulative distribution function (lower tail integral of the probabi...
constexpr Double_t Sigma()
Stefan-Boltzmann constant in : .
Double_t Beta(Double_t p, Double_t q)
Calculates Beta-function Gamma(p)*Gamma(q)/Gamma(p+q).
T * Laplacian(Long64_t n, T const *f, double h=1)
Calculate second-order finite differences of an array with length n at second-order accuracy.
constexpr Double_t Kcgs()
Double_t Sq(Double_t x)
Returns x*x.
Double_t Poisson(Double_t x, Double_t par)
Computes the Poisson distribution function for (x,par).
constexpr Double_t H()
Planck's constant in : .
Double_t Sqrt(Double_t x)
Returns the square root of x.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Returns x raised to the power y.
Int_t CeilNint(Double_t x)
Returns the nearest integer of TMath::Ceil(x).
Double_t Ldexp(Double_t x, Int_t exp)
Returns the result of multiplying x (the significant) by 2 raised to the power of exp (the exponent).
Double_t BesselJ0(Double_t x)
Modified Bessel function K_1(x)
constexpr Double_t LogE()
Base-10 log of e (to convert ln to log)
Double_t Gamma(Double_t z)
Computation of gamma(z) for all z.
constexpr Double_t MWair()
Molecular weight of dry air 1976 US Standard Atmosphere in or
constexpr Double_t Gcgs()
Double_t StruveL0(Double_t x)
Struve functions of order 1.
Double_t NormQuantile(Double_t p)
Computes quantiles for standard normal distribution N(0, 1) at probability p.
constexpr Double_t Ln10()
Natural log of 10 (to convert log to ln)
Double_t Hypot(Double_t x, Double_t y)
Returns sqrt(x*x + y*y)
constexpr Double_t EulerGamma()
Euler-Mascheroni Constant.
constexpr Double_t PiOver4()
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
void Quantiles(Int_t n, Int_t nprob, Double_t *x, Double_t *quantiles, Double_t *prob, Bool_t isSorted=kTRUE, Int_t *index=nullptr, Int_t type=7)
Computes sample quantiles, corresponding to the given probabilities.
Double_t StruveH0(Double_t x)
Bessel function Y1(x) for positive x.
constexpr Double_t R()
Universal gas constant ( ) in
Double_t LnGamma(Double_t z)
Computation of ln[gamma(z)] for all z.
Bool_t AreEqualRel(Double_t af, Double_t bf, Double_t relPrec)
Comparing floating points.
Bool_t AreEqualAbs(Double_t af, Double_t bf, Double_t epsilon)
Comparing floating points.
Double_t Mean(Long64_t n, const T *a, const Double_t *w=nullptr)
Returns the weighted mean of an array a with length n.
Double_t KolmogorovProb(Double_t z)
Calculates the Kolmogorov distribution function,.
constexpr Double_t InvPi()
Bool_t RootsCubic(const Double_t coef[4], Double_t &a, Double_t &b, Double_t &c)
Calculates roots of polynomial of 3rd order a*x^3 + b*x^2 + c*x + d, where.
Double_t ChisquareQuantile(Double_t p, Double_t ndf)
Evaluate the quantiles of the chi-squared probability distribution function.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Double_t FDist(Double_t F, Double_t N, Double_t M)
Computes the density function of F-distribution (probability function, integral of density,...
Double_t SignalingNaN()
Returns a signaling NaN as defined by IEEE 754.
Double_t BreitWignerRelativistic(Double_t x, Double_t median=0, Double_t gamma=1)
Calculates a Relativistic Breit Wigner function with median and gamma.
void Sort(Index n, const Element *a, Index *index, Bool_t down=kTRUE)
Sort the n elements of the array a of generic templated type Element.
T * Cross(const T v1[3], const T v2[3], T out[3])
Calculates the Cross Product of two vectors: out = [v1 x v2].
void BubbleLow(Int_t Narr, Double_t *arr1, Int_t *arr2)
Opposite ordering of the array arr2[] to that of BubbleHigh.
Double_t BesselK(Int_t n, Double_t x)
Integer order modified Bessel function I_n(x)
constexpr Double_t Na()
Avogadro constant (Avogadro's Number) in .
T MaxElement(Long64_t n, const T *a)
Returns maximum of array a of length n.
Double_t BesselJ1(Double_t x)
Bessel function J0(x) for any real x.
Double_t BetaIncomplete(Double_t x, Double_t a, Double_t b)
Calculates the incomplete Beta-function.
constexpr Double_t Rgair()
Dry Air Gas Constant (R / MWair) in
constexpr Double_t Hbar()
in :
Double_t StruveH1(Double_t x)
Struve functions of order 0.
Double_t Freq(Double_t x)
Computation of the normal frequency function freq(x).
Double_t Tan(Double_t)
Returns the tangent of an angle of x radians.
Double_t LandauI(Double_t x)
Returns the cumulative (lower tail integral) of the Landau distribution function at point x.
Double_t StdDev(Long64_t n, const T *a, const Double_t *w=nullptr)
Same as RMS.
Double_t ATanH(Double_t)
Returns the area hyperbolic tangent of x.
constexpr Double_t RadToDeg()
Conversion from radian to degree: .
Double_t BesselI0(Double_t x)
Integer order modified Bessel function K_n(x)
T * Gradient(Long64_t n, T const *f, double h=1)
Calculate the one-dimensional finite gradient of an array with length n.
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Double_t StudentI(Double_t T, Double_t ndf)
Calculates the cumulative distribution function of Student's t-distribution second parameter stands f...
Double_t StudentQuantile(Double_t p, Double_t ndf, Bool_t lower_tail=kTRUE)
Computes quantiles of the Student's t-distribution 1st argument is the probability,...
Double_t BesselY1(Double_t x)
Bessel function Y0(x) for positive x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Double_t GammaDist(Double_t x, Double_t gamma, Double_t mu=0, Double_t beta=1)
Computes the density function of Gamma distribution at point x.
constexpr Double_t GhbarC()
in
constexpr Double_t HC()
in
constexpr Double_t TwoPi()
constexpr Double_t HbarUncertainty()
uncertainty.
Double_t Infinity()
Returns an infinity as defined by the IEEE standard.
Double_t ErfcInverse(Double_t x)
Returns the inverse of the complementary error function.
Double_t SinH(Double_t)
Returns the hyperbolic sine of x.
static T Min()
Returns maximum representation for type T.
static T Epsilon()
Returns minimum double representation.
static T Max()
Returns minimum double representation.
static uint64_t sum(uint64_t i)