1#ifndef ROOT_VectorizedTMath
2#define ROOT_VectorizedTMath
7#ifdef R__HAS_STD_EXPERIMENTAL_SIMD
13template <
class T,
class Abi>
14auto Log2(std::experimental::simd<T, Abi> &
x)
20template <
class T,
class Abi>
21auto BreitWigner(std::experimental::simd<T, Abi> &
x,
double mean = 0,
double gamma = 1)
29template <
class T,
class Abi>
30auto Gaus(std::experimental::simd<T, Abi> &
x,
double mean = 0,
double sigma = 1,
Bool_t norm =
false)
33 return std::experimental::simd<T, Abi>{1.e30};
36 auto arg = (
x - std::experimental::simd<T, Abi>(mean)) *
inv_sigma;
39 std::experimental::simd<T, Abi> out{};
40 where(
abs(arg) < 39.0, out) =
exp(std::experimental::simd<T, Abi>(-0.5) * arg * arg);
53template <
class T,
class Abi>
54auto LaplaceDist(std::experimental::simd<T, Abi> &
x,
double alpha = 0,
double beta = 1)
56 auto beta_v_inv = std::experimental::simd<T, Abi>(1.0 / beta);
68template <
class T,
class Abi>
69auto LaplaceDistI(std::experimental::simd<T, Abi> &
x,
double alpha = 0,
double beta = 1)
71 auto alpha_v = std::experimental::simd<T, Abi>(alpha);
72 auto beta_v_inv = std::experimental::simd<T, Abi>(1.0) / std::experimental::simd<T, Abi>(beta);
74 std::experimental::simd<T, Abi> out{};
84template <
class T,
class Abi>
85auto Freq(std::experimental::simd<T, Abi> &
x)
87 double c1 = 0.56418958354775629;
88 double w2 = 1.41421356237309505;
90 double p10 = 2.4266795523053175e+2,
q10 = 2.1505887586986120e+2,
p11 = 2.1979261618294152e+1,
91 q11 = 9.1164905404514901e+1,
p12 = 6.9963834886191355e+0,
q12 = 1.5082797630407787e+1,
92 p13 = -3.5609843701815385e-2;
94 double p20 = 3.00459261020161601e+2,
q20 = 3.00459260956983293e+2,
p21 = 4.51918953711872942e+2,
95 q21 = 7.90950925327898027e+2,
p22 = 3.39320816734343687e+2,
q22 = 9.31354094850609621e+2,
96 p23 = 1.52989285046940404e+2,
q23 = 6.38980264465631167e+2,
p24 = 4.31622272220567353e+1,
97 q24 = 2.77585444743987643e+2,
p25 = 7.21175825088309366e+0,
q25 = 7.70001529352294730e+1,
98 p26 = 5.64195517478973971e-1,
q26 = 1.27827273196294235e+1,
p27 = -1.36864857382716707e-7;
100 double p30 = -2.99610707703542174e-3,
q30 = 1.06209230528467918e-2,
p31 = -4.94730910623250734e-2,
101 q31 = 1.91308926107829841e-1,
p32 = -2.26956593539686930e-1,
q32 = 1.05167510706793207e+0,
102 p33 = -2.78661308609647788e-1,
q33 = 1.98733201817135256e+0,
p34 = -2.23192459734184686e-2,
q34 = 1;
106 std::experimental::simd<T, Abi>
result{};
134template <
class T,
class Abi>
144 y * (-2.057706e-2 +
y * (2.635537e-2 +
y * (-1.647633e-2 +
y * 3.92377e-3))))))));
147template <
class T,
class Abi>
150 auto y =
x *
x * 0.071111111;
153 y * (3.5156229 +
y * (3.0899424 +
y * (1.2067492 +
y * (0.2659732 +
y * (3.60768e-2 +
y * 4.5813e-3)))));
156template <
class T,
class Abi>
157auto BesselI0(std::experimental::simd<T, Abi> &
x)
167template <
class T,
class Abi>
177 y * (2.282967e-2 +
y * (-2.895312e-2 +
y * (1.787654e-2 +
y * -4.20059e-3))))))));
182template <
class T,
class Abi>
185 auto y =
x *
x * 0.071111111;
187 return x * (0.5 +
y * (0.87890594 +
188 y * (0.51498869 +
y * (0.15084934 +
y * (2.658733e-2 +
y * (3.01532e-3 +
y * 3.2411e-4))))));
191template <
class T,
class Abi>
192auto BesselI1(std::experimental::simd<T, Abi> &
x)
202template <
class T,
class Abi>
207 auto xx =
ax - 0.785398164;
208 auto result1 = 1 +
y * (-0.1098628627e-2 +
y * (0.2734510407e-4 +
y * (-0.2073370639e-5 +
y * 0.2093887211e-6)));
210 -0.1562499995e-1 +
y * (0.1430488765e-3 +
y * (-0.6911147651e-5 +
y * (0.7621095161e-6 -
y * 0.934935152e-7)));
214template <
class T,
class Abi>
218 return (57568490574.0 +
219 y * (-13362590354.0 +
y * (651619640.7 +
y * (-11214424.18 +
y * (77392.33017 +
y * -184.9052456))))) /
220 (57568490411.0 +
y * (1029532985.0 +
y * (9494680.718 +
y * (59272.64853 +
y * (267.8532712 +
y)))));
223template <
class T,
class Abi>
224auto BesselJ0(std::experimental::simd<T, Abi> &
x)
233template <
class T,
class Abi>
238 auto xx =
ax - 2.356194491;
239 auto result1 = 1 +
y * (0.183105e-2 +
y * (-0.3516396496e-4 +
y * (0.2457520174e-5 +
y * -0.240337019e-6)));
241 0.04687499995 +
y * (-0.2002690873e-3 +
y * (0.8449199096e-5 +
y * (-0.88228987e-6 -
y * 0.105787412e-6)));
247template <
class T,
class Abi>
253 y * (-7895059235.0 +
y * (242396853.1 +
y * (-2972611.439 +
y * (15704.48260 +
y * -30.16036606))))) /
254 (144725228442.0 +
y * (2300535178.0 +
y * (18583304.74 +
y * (99447.43394 +
y * (376.9991397 +
y)))));
257template <
class T,
class Abi>
258auto BesselJ1(std::experimental::simd<T, Abi> &
x)
bool Bool_t
Boolean (0=false, 1=true) (bool)
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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 result
RVec< PromoteType< T > > abs(const RVec< T > &v)
RVec< PromoteType< T > > log2(const RVec< T > &v)
RVec< PromoteType< T > > cos(const RVec< T > &v)
RVec< PromoteType< T > > exp(const RVec< T > &v)
RVec< PromoteType< T > > sin(const RVec< T > &v)
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.
Double_t Log2(Double_t x)
Returns the binary (base-2) logarithm of x.
Double_t BesselI1(Double_t x)
Modified Bessel function K_0(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 ...
Double_t BreitWigner(Double_t x, Double_t mean=0, Double_t gamma=1)
Calculates a Breit Wigner function with mean and gamma.
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...
Double_t BesselJ0(Double_t x)
Modified Bessel function K_1(x)
Double_t BesselJ1(Double_t x)
Bessel function J0(x) for any real x.
Double_t Freq(Double_t x)
Computation of the normal frequency function freq(x).
Double_t BesselI0(Double_t x)
Integer order modified Bessel function K_n(x)