38#define BEGIN blockDim.x *blockIdx.x + threadIdx.x
39#define STEP blockDim.x *gridDim.x
54 for (
int pdf = 1; pdf <
nPdfs; pdf++) {
68 const double t =
m[i] / m0[i];
69 const double u = 1 - t * t;
99 const int degree =
nCoef - 1;
105 double binomial = 1.0;
106 for (
int k = 0; k <
nCoef; k++) {
108 binomial = (binomial * (degree - k)) / (k + 1);
124 for (
int k = 2; k <= degree; k += 2) {
129 if (degree % 2 == 1) {
138 for (
int k = 0; k <
nCoef; k++) {
153 for (
int k = 1; k <= degree; k++)
155 const double _1_X = 1 / (1 -
X);
156 for (
int k = 0; k <
nCoef; k++) {
166 for (
int k = 0; k <
nCoef; k++) {
168 binomial = (binomial * (degree - k)) / (k + 1);
179 double arg =
X[i] - M[i];
195 const double arg =
X[i] - M[i];
196 batches.output[i] = 1 / (arg * arg + 0.25 *
W[i] *
W[i]);
208 const double r3 = log(2.0);
209 const double r6 = exp(-6.0);
210 const double r7 = 2 * sqrt(2 * log(2.0));
215 const double hp = 1 / (SP[i] *
r7);
216 const double x1 =
XP[i] + 0.5 * SP[i] *
r7 * (
r1 - 1);
217 const double x2 =
XP[i] + 0.5 * SP[i] *
r7 * (
r1 + 1);
224 double y =
X[i] -
x1;
237 if (
X[i] >=
x1 &&
X[i] <
x2) {
257 const double t = (M[i] -
M0[i]) / S[i];
258 if ((A[i] > 0 && t >= -A[i]) || (A[i] < 0 && -t >= A[i])) {
259 batches.output[i] = -0.5 * t * t;
261 batches.output[i] =
N[i] / (
N[i] - A[i] * A[i] - A[i] * t);
264 batches.output[i] -= 0.5 * A[i] * A[i];
285 prev[i][0] =
batches.output[i] = 1.0;
288 for (
int k = 0; k <
nCoef; k++) {
293 const double next = 2 *
X[i] * prev[i][1] - prev[i][0];
294 prev[i][0] = prev[i][1];
304 for (
int k = 0; k <
nCoef; k++) {
319 const double ndof =
batches.extra[0];
320 const double gamma = 1 / std::tgamma(ndof / 2.0);
324 constexpr double ln2 = 0.693147180559945309417232121458;
326 double arg = (ndof - 2) *
fast_log(
X[i]) -
X[i] - ndof *
ln2;
346 const double ratio =
DM[i] /
DM0[i];
347 const double arg1 = (
DM0[i] -
DM[i]) / C[i];
360 int lowestOrder =
batches.extra[0];
366 double xTmp = std::pow(
x[i], lowestOrder);
367 for (
int k = 0; k <
nTerms; ++k) {
399 double gamma = -std::lgamma(
G[0]);
402 batches.output[i] = (
G[i] == 1.0) / B[i];
403 }
else if (
G._isVector) {
404 batches.output[i] = -std::lgamma(
G[i]);
412 const double invBeta = 1 / B[i];
413 double arg = (
X[i] - M[i]) *
invBeta;
416 batches.output[i] += arg * (
G[i] - 1);
425 const double root2 = std::sqrt(2.);
426 const double root2pi = std::sqrt(2. * std::atan2(0., -1.));
433 const double x =
batches.args[0][i];
436 const double tau =
batches.args[5][i];
447 const double xprime = (
x - mean) / tau;
467 const double arg =
x[i] - mean[i];
502 const double arg = (mass[i] - mu[i]) / lambda[i];
523 auto case0 = [](
double x) {
524 const double a1[3] = {0.04166666667, -0.01996527778, 0.02709538966};
526 return 0.3989422803 *
fast_exp(-1 /
u - 0.5 * (
x + 1)) * (1 + (
a1[0] + (
a1[1] +
a1[2] *
u) *
u) *
u);
528 auto case1 = [](
double x) {
529 constexpr double p1[5] = {0.4259894875, -0.1249762550, 0.03984243700, -0.006298287635, 0.001511162253};
530 constexpr double q1[5] = {1.0, -0.3388260629, 0.09594393323, -0.01608042283, 0.003778942063};
535 auto case2 = [](
double x) {
536 constexpr double p2[5] = {0.1788541609, 0.1173957403, 0.01488850518, -0.001394989411, 0.0001283617211};
537 constexpr double q2[5] = {1.0, 0.7428795082, 0.3153932961, 0.06694219548, 0.008790609714};
538 return (
p2[0] + (
p2[1] + (
p2[2] + (
p2[3] +
p2[4] *
x) *
x) *
x) *
x) /
541 auto case3 = [](
double x) {
542 constexpr double p3[5] = {0.1788544503, 0.09359161662, 0.006325387654, 0.00006611667319, -0.000002031049101};
543 constexpr double q3[5] = {1.0, 0.6097809921, 0.2560616665, 0.04746722384, 0.006957301675};
544 return (
p3[0] + (
p3[1] + (
p3[2] + (
p3[3] +
p3[4] *
x) *
x) *
x) *
x) /
547 auto case4 = [](
double x) {
548 constexpr double p4[5] = {0.9874054407, 118.6723273, 849.2794360, -743.7792444, 427.0262186};
549 constexpr double q4[5] = {1.0, 106.8615961, 337.6496214, 2016.712389, 1597.063511};
550 const double u = 1 /
x;
551 return u *
u * (
p4[0] + (
p4[1] + (
p4[2] + (
p4[3] +
p4[4] *
u) *
u) *
u) *
u) /
554 auto case5 = [](
double x) {
555 constexpr double p5[5] = {1.003675074, 167.5702434, 4789.711289, 21217.86767, -22324.94910};
556 constexpr double q5[5] = {1.0, 156.9424537, 3745.310488, 9834.698876, 66924.28357};
557 const double u = 1 /
x;
558 return u *
u * (
p5[0] + (
p5[1] + (
p5[2] + (
p5[3] +
p5[4] *
u) *
u) *
u) *
u) /
561 auto case6 = [](
double x) {
562 constexpr double p6[5] = {1.000827619, 664.9143136, 62972.92665, 475554.6998, -5743609.109};
563 constexpr double q6[5] = {1.0, 651.4101098, 56974.73333, 165917.4725, -2815759.939};
564 const double u = 1 /
x;
565 return u *
u * (
p6[0] + (
p6[1] + (
p6[2] + (
p6[3] +
p6[4] *
u) *
u) *
u) *
u) /
568 auto case7 = [](
double x) {
569 const double a2[2] = {-1.845568670, -4.284640743};
571 return u *
u * (1 + (
a2[0] +
a2[1] *
u) *
u);
579 batches.output[i] = (
X[i] - M[i]) / S[i];
584 }
else if (
batches.output[i] < -5.5) {
586 }
else if (
batches.output[i] < -1.0) {
588 }
else if (
batches.output[i] < 1.0) {
590 }
else if (
batches.output[i] < 5.0) {
592 }
else if (
batches.output[i] < 12.0) {
594 }
else if (
batches.output[i] < 50.0) {
596 }
else if (
batches.output[i] < 300.) {
609 constexpr double rootOf2pi = 2.506628274631000502415765284811;
626 constexpr double rootOf2pi = 2.506628274631000502415765284811;
654 }
else if (
rawVal[i] < 0.) {
658 }
else if (std::isnan(
rawVal[i])) {
690 constexpr double xi = 2.3548200450309494;
696 double argln2 = 1 - (
X[i] - P[i]) * T[i] /
W[i];
700 batches.output[i] -= 2.0 / xi / xi * asinh * asinh;
728 }
else if (
x_i == 0) {
740 const std::size_t nEvents =
batches.nEvents;
743 for (
size_t i =
BEGIN; i < nEvents; i +=
STEP) {
749 for (
int k =
nCoef - 2; k >= 0; k--) {
750 for (
size_t i =
BEGIN; i < nEvents; i +=
STEP) {
763 for (
int k = 0; k <
nCoef; ++k) {
775 for (
int pdf = 0; pdf <
nPdfs; pdf++) {
894 const double invSqrt2 = 0.707106781186547524400844362105;
896 const double arg = (
X[i] - M[i]) * (
X[i] - M[i]);
897 if (S[i] == 0.0 &&
W[i] == 0.0) {
899 }
else if (S[i] == 0.0) {
900 batches.output[i] = 1 / (arg + 0.25 *
W[i] *
W[i]);
901 }
else if (
W[i] == 0.0) {
909 if (S[i] != 0.0 &&
W[i] != 0.0) {
912 const double factor =
W[i] > 0.0 ? 0.5 : -0.5;
913 RooHeterogeneousMath::STD::complex<double> z(
batches.output[i] * (
X[i] - M[i]),
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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 result
Option_t Option_t TPoint TPoint const char x2
Option_t Option_t TPoint TPoint const char x1
__rooglobal__ void computeBreitWigner(Batches &batches)
std::vector< void(*)(Batches &)> getFunctions()
Returns a std::vector of pointers to the compute functions in this file.
__rooglobal__ void computeNovosibirsk(Batches &batches)
__rooglobal__ void computeExpPoly(Batches &batches)
__rooglobal__ void computeChiSquare(Batches &batches)
__rooglobal__ void computeDeltaFunction(Batches &batches)
__rooglobal__ void computeGamma(Batches &batches)
__rooglobal__ void computeTruthModelQuadBasis(Batches &batches)
__rooglobal__ void computeTruthModelExpBasis(Batches &batches)
__rooglobal__ void computeTruthModelLinBasis(Batches &batches)
__rooglobal__ void computeLognormalStandard(Batches &batches)
__rooglobal__ void computeTruthModelCoshBasis(Batches &batches)
__rooglobal__ void computeAddPdf(Batches &batches)
__rooglobal__ void computeBifurGauss(Batches &batches)
__rooglobal__ void computeTruthModelSinhBasis(Batches &batches)
__rooglobal__ void computeLognormal(Batches &batches)
__rooglobal__ void computeArgusBG(Batches &batches)
__rooglobal__ void computeGaussian(Batches &batches)
__rooglobal__ void computeLandau(Batches &batches)
__rooglobal__ void computeTruthModelSinBasis(Batches &batches)
__rooglobal__ void computePower(Batches &batches)
__rooglobal__ void computeExponentialNeg(Batches &batches)
__rooglobal__ void computePoisson(Batches &batches)
__rooglobal__ void computeJohnson(Batches &batches)
__rooglobal__ void computeBMixDecay(Batches &batches)
__rooglobal__ void computeChebychev(Batches &batches)
__rooglobal__ void computeNormalizedPdf(Batches &batches)
__rooglobal__ void computeBernstein(Batches &batches)
__rooglobal__ void computeRatio(Batches &batches)
__rooglobal__ void computePolynomial(Batches &batches)
__rooglobal__ void computeExponential(Batches &batches)
__rooglobal__ void computeTruthModelCosBasis(Batches &batches)
__rooglobal__ void computeGaussModelExpBasis(Batches &batches)
__rooglobal__ void computeBukin(Batches &batches)
__rooglobal__ void computeDstD0BG(Batches &batches)
__rooglobal__ void computeNegativeLogarithms(Batches &batches)
__rooglobal__ void computeIdentity(Batches &batches)
__rooglobal__ void computeCBShape(Batches &batches)
__rooglobal__ void computeProdPdf(Batches &batches)
__rooglobal__ void computeVoigtian(Batches &batches)
Namespace for dispatching RooFit computations to various backends.
__roodevice__ double fast_exp(double x)
__roodevice__ double fast_sin(double x)
constexpr std::size_t bufferSize
__roodevice__ double fast_log(double x)
__roodevice__ double fast_cos(double x)
__roodevice__ double fast_isqrt(double x)
STD::complex< double > faddeeva(STD::complex< double > z)
STD::complex< double > evalCerf(double swt, double u, double c)
constexpr Double_t TwoPi()
#define R1(v, w, x, y, z, i)
#define R2(v, w, x, y, z, i)
static double packFloatIntoNaN(float payload)
Pack float into mantissa of a NaN.