22#error "This file must not be included by compiled programs."
25#include <plugins/include/clad/Differentiator/Differentiator.h>
31namespace custom_derivatives {
117template <
typename T,
typename U>
143template <
typename T,
typename U>
153template <
typename T,
typename U,
typename V>
157 *
d_x += t.pushforward *
p;
159 *
d_y += t.pushforward *
p;
209 static double p1[5] = {0.4259894875,-0.1249762550, 0.03984243700, -0.006298287635, 0.001511162253};
210 static double q1[5] = {1.0 ,-0.3388260629, 0.09594393323, -0.01608042283, 0.003778942063};
212 static double p2[5] = {0.1788541609, 0.1173957403, 0.01488850518, -0.001394989411, 0.0001283617211};
213 static double q2[5] = {1.0 , 0.7428795082, 0.3153932961, 0.06694219548, 0.008790609714};
215 static double p3[5] = {0.1788544503, 0.09359161662,0.006325387654, 0.00006611667319,-0.000002031049101};
216 static double q3[5] = {1.0 , 0.6097809921, 0.2560616665, 0.04746722384, 0.006957301675};
218 static double p4[5] = {0.9874054407, 118.6723273, 849.2794360, -743.7792444, 427.0262186};
219 static double q4[5] = {1.0 , 106.8615961, 337.6496214, 2016.712389, 1597.063511};
221 static double p5[5] = {1.003675074, 167.5702434, 4789.711289, 21217.86767, -22324.94910};
222 static double q5[5] = {1.0 , 156.9424537, 3745.310488, 9834.698876, 66924.28357};
224 static double p6[5] = {1.000827619, 664.9143136, 62972.92665, 475554.6998, -5743609.109};
225 static double q6[5] = {1.0 , 651.4101098, 56974.73333, 165917.4725, -2815759.939};
227 static double a1[3] = {0.04166666667,-0.01996527778, 0.02709538966};
229 static double a2[2] = {-1.845568670,-4.284640743};
231 const double _const0 = 0.3989422803;
232 double v = (
x - x0) / xi;
236 double u = ::std::exp(
v + 1.);
239 const double ue = ::std::exp(-1 /
u);
240 const double us = ::std::sqrt(
u);
259 _r4 +=
_r_d2 * clad::custom_derivatives::sqrt_pushforward(
u, 1.).pushforward;
275 double u = ::std::exp(-
v - 1);
278 double _t8 = ::std::exp(-
u);
279 double _t7 = ::std::sqrt(
u);
292 clad::custom_derivatives::sqrt_pushforward(
u, 1.).pushforward;
397 }
else if (
v < 300) {
427 double _t25 = ::std::log(
v);
428 double _t24 = (
v + 1);
457 double _r0 =
_d_v * -((
x - x0) / (xi * xi));
464 static double p1[5] = {0.2514091491e+0,-0.6250580444e-1, 0.1458381230e-1,-0.2108817737e-2, 0.7411247290e-3};
465 static double q1[5] = {1.0 ,-0.5571175625e-2, 0.6225310236e-1,-0.3137378427e-2, 0.1931496439e-2};
467 static double p2[4] = {0.2868328584e+0, 0.3564363231e+0, 0.1523518695e+0, 0.2251304883e-1};
468 static double q2[4] = {1.0 , 0.6191136137e+0, 0.1720721448e+0, 0.2278594771e-1};
470 static double p3[4] = {0.2868329066e+0, 0.3003828436e+0, 0.9950951941e-1, 0.8733827185e-2};
471 static double q3[4] = {1.0 , 0.4237190502e+0, 0.1095631512e+0, 0.8693851567e-2};
473 static double p4[4] = {0.1000351630e+1, 0.4503592498e+1, 0.1085883880e+2, 0.7536052269e+1};
474 static double q4[4] = {1.0 , 0.5539969678e+1, 0.1933581111e+2, 0.2721321508e+2};
476 static double p5[4] = {0.1000006517e+1, 0.4909414111e+2, 0.8505544753e+2, 0.1532153455e+3};
477 static double q5[4] = {1.0 , 0.5009928881e+2, 0.1399819104e+3, 0.4200002909e+3};
479 static double p6[4] = {0.1000000983e+1, 0.1329868456e+3, 0.9162149244e+3,-0.9605054274e+3};
480 static double q6[4] = {1.0 , 0.1339887843e+3, 0.1055990413e+4, 0.5532224619e+3};
482 static double a1[4] = {0 ,-0.4583333333e+0, 0.6675347222e+0,-0.1641741416e+1};
483 static double a2[4] = {0 , 1.0 ,-0.4227843351e+0,-0.2043403138e+1};
486 const double v = (
x - x0) / xi;
490 const double _const0 = 0.3989422803;
491 double u = ::std::exp(
v + 1);
492 double _t3 = ::std::exp(-1. /
u);
493 double _t2 = ::std::sqrt(
u);
496 double _r3 =
_r2 * -(-1. / (
u *
u));
500 clad::custom_derivatives::sqrt_pushforward(
u, 1.).pushforward;
508 double u = ::std::exp(-
v - 1);
509 double _t8 = ::std::exp(-
u);
510 double _t7 = ::std::sqrt(
u);
517 _r8 +=
_r7 * clad::custom_derivatives::sqrt_pushforward(
u, 1.).pushforward;
573 }
else if (
v < 300) {
588 double _t25 = ::std::log(
v);
589 double _t24 = (
v + 1);
591 double u = 1. /
_t23;
616 constexpr double kMACHEP = 1.11022302462515654042363166809e-16;
617 constexpr double kMAXLOG = 709.782712893383973096206318587;
618 constexpr double kMINLOG = -708.396418532264078748994506896;
619 constexpr double kMAXSTIR = 108.116855767857671821730036754;
620 constexpr double kMAXLGM = 2.556348e305;
621 constexpr double kBig = 4.503599627370496e15;
622 constexpr double kBiginv = 2.22044604925031308085e-16;
630 clad::tape<double>
_t7 = {};
631 clad::tape<double>
_t8 = {};
632 clad::tape<double>
_t9 = {};
638 if ((
x > 1.) && (
x >
a)) {
647 ax =
a *
_t1 -
x - ::std::lgamma(
a);
650 *
_d_a +=
_d_ax * (
_t1 - ::clad::custom_derivatives::std::clad_digamma(
663 unsigned long _t6 = 0;
728 *
_d_a +=
_d_ax * (
_t1 - ::clad::custom_derivatives::std::clad_digamma(
737 constexpr double kMACHEP = 1.11022302462515654042363166809e-16;
738 constexpr double kMAXLOG = 709.782712893383973096206318587;
739 constexpr double kMINLOG = -708.396418532264078748994506896;
740 constexpr double kMAXSTIR = 108.116855767857671821730036754;
741 constexpr double kMAXLGM = 2.556348e305;
742 constexpr double kBig = 4.503599627370496e15;
743 constexpr double kBiginv = 2.22044604925031308085e-16;
758 clad::tape<double>
_t12 = {};
759 clad::tape<double>
_t13 = {};
760 clad::tape<double>
_t14 = {};
761 clad::tape<double>
_t15 = {};
762 clad::tape<double>
_t16 = {};
763 clad::tape<double>
_t17 = {};
764 clad::tape<double>
_t19 = {};
765 clad::tape<double>
_t20 = {};
766 clad::tape<double>
_t21 = {};
767 clad::tape<double>
_t22 = {};
768 clad::tape<double>
_t23 = {};
769 clad::tape<double>
_t24 = {};
770 clad::tape<double>
_t25 = {};
771 clad::tape<double>
_t26 = {};
772 clad::tape<double>
_t27 = {};
773 clad::tape<bool>
_t29 = {};
774 clad::tape<double>
_t30 = {};
775 clad::tape<double>
_t31 = {};
776 clad::tape<double>
_t32 = {};
777 clad::tape<double>
_t33 = {};
784 if ((
x < 1.) || (
x <
a)) {
793 ax =
a *
_t1 -
x - ::std::lgamma(
a);
796 *
_d_a +=
_d_ax * (
_t1 - ::clad::custom_derivatives::std::clad_digamma(
840 t = ::std::abs((
ans -
r) /
r);
857 bool _t28 = ::std::abs(
pk) > kBig;
878 if (clad::pop(
_t29)) {
928 if (clad::pop(
_t19)) {
940 _r7 +=
_r_d17 * clad::custom_derivatives::std::abs_pushforward((
ans -
r) /
r, 1.).pushforward;
1058 *
_d_a +=
_d_ax * (
_t1 - ::clad::custom_derivatives::std::clad_digamma(
1072 const float *alpha,
const float *A,
const int *
lda,
const float *B,
const int *
ldb,
1073 const float *beta,
float *C,
const int *
ldc);
1080 const float *A,
const float *B,
float beta,
const float *C,
float *
_d_output,
bool *,
1084 using ::TMVA::Experimental::SOFIE::Gemm_Call;
1088 if (alpha != 1.0f) {
1099 Gemm_Call(
_d_A,
false, !
transb,
m, k,
n,
one,
_d_output, B,
one,
_d_A);
1102 Gemm_Call(
_d_A,
transb,
true, k,
m,
n,
one, B,
_d_output,
one,
_d_A);
1108 Gemm_Call(
_d_B, !
transa,
false, k,
n,
m,
one, A,
_d_output,
one,
_d_B);
1111 Gemm_Call(
_d_B,
true,
transa,
n, k,
m,
one,
_d_output, A,
one,
_d_B);
1116 for (
int i = 0; i <
sizeC; ++i) {
1130 for (
int i = 0; i <
size; i++) {
1139 for (
int i = 0; i <
size; i++) {
1148 for (
int i = 0; i <
size; i++) {
void sgemm_(const char *transa, const char *transb, const int *m, const int *n, const int *k, const float *alpha, const float *A, const int *lda, const float *B, const int *ldb, const float *beta, float *C, const int *ldc)
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
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 input
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 value
Namespace for new Math classes and functions.
Double_t CosH(Double_t)
Returns the hyperbolic cosine of x.
Double_t ACos(Double_t)
Returns the principal value of the arc cosine of x, expressed in radians.
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 Exp(Double_t x)
Returns the base-e exponential function of x, which is e raised to the power x.
Double_t Erf(Double_t x)
Computation of the error function erf(x).
Double_t ATan(Double_t)
Returns the principal value of the arc tangent of x, expressed in radians.
Double_t ASinH(Double_t)
Returns the area hyperbolic sine of x.
Double_t TanH(Double_t)
Returns the hyperbolic tangent of x.
Double_t ACosH(Double_t)
Returns the nonnegative area hyperbolic cosine of x.
Double_t Log(Double_t x)
Returns the natural logarithm of x.
Double_t Erfc(Double_t x)
Computes the complementary error function erfc(x).
Double_t Sq(Double_t x)
Returns x*x.
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.
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)
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Double_t LnGamma(Double_t z)
Computation of ln[gamma(z)] for all z.
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Double_t Tan(Double_t)
Returns the tangent of an angle of x radians.
Double_t ATanH(Double_t)
Returns the area hyperbolic tangent of x.
Double_t Log10(Double_t x)
Returns the common (base-10) logarithm of x.
Short_t Abs(Short_t d)
Returns the absolute value of parameter Short_t d.
Double_t SinH(Double_t)
Returns the hyperbolic sine of `x.
void landau_pdf_pullback(double x, double xi, double x0, double d_out, double *d_x, double *d_xi, double *d_x0)
void inc_gamma_c_pullback(double a, double x, double _d_y, double *_d_a, double *_d_x)
void landau_cdf_pullback(double x, double xi, double x0, double d_out, double *d_x, double *d_xi, double *d_x0)
void inc_gamma_pullback(double a, double x, double _d_y, double *_d_a, double *_d_x)
void Relu_pullback(float *output, const float *input, int size, float *_d_output, float *_d_input, int *)
void Fill_pullback(float *output, float value, int size, float *_d_output, float *_d_value, int *)
void Copy_pullback(float *output, const float *input, int size, float *_d_output, float *_d_input, int *)
void Gemm_Call_pullback(float *output, bool transa, bool transb, int m, int n, int k, float alpha, const float *A, const float *B, float beta, const float *C, float *_d_output, bool *, bool *, int *, int *, int *, float *_d_alpha, float *_d_A, float *_d_B, float *_d_beta, float *_d_C)
ValueAndPushforward< T, T > CosH_pushforward(T x, T d_x)
ValueAndPushforward< T, T > Abs_pushforward(T x, T d_x)
void Power_pullback(T x, U y, V p, T *d_x, U *d_y)
ValueAndPushforward< T, T > Sq_pushforward(T x, T d_x)
void Hypot_pullback(T x, T y, U p, T *d_x, T *d_y)
ValueAndPushforward< T, T > Erf_pushforward(T x, T d_x)
ValueAndPushforward< T, T > Erfc_pushforward(T x, T d_x)
ValueAndPushforward< T, T > Sin_pushforward(T x, T d_x)
ValueAndPushforward< T, T > Hypot_pushforward(T x, T y, T d_x, T d_y)
ValueAndPushforward< T, T > ASinH_pushforward(T x, T d_x)
ValueAndPushforward< T, T > LnGamma_pushforward(T z, T d_z)
ValueAndPushforward< T, T > ACosH_pushforward(T x, T d_x)
ValueAndPushforward< T, T > ASin_pushforward(T x, T d_x)
ValueAndPushforward< T, T > Power_pushforward(T x, U y, T d_x, U d_y)
ValueAndPushforward< T, T > Cos_pushforward(T x, T d_x)
ValueAndPushforward< T, T > Sqrt_pushforward(T x, T d_x)
ValueAndPushforward< T, T > Tan_pushforward(T x, T d_x)
ValueAndPushforward< T, T > Log_pushforward(T x, T d_x)
ValueAndPushforward< T, T > Log10_pushforward(T x, T d_x)
ValueAndPushforward< T, T > TanH_pushforward(T x, T d_x)
ValueAndPushforward< T, T > ACos_pushforward(T x, T d_x)
ValueAndPushforward< T, T > SinH_pushforward(T x, T d_x)
ValueAndPushforward< T, T > Exp_pushforward(T x, T d_x)
ValueAndPushforward< T, T > Log2_pushforward(T x, T d_x)
ValueAndPushforward< T, T > ATanH_pushforward(T x, T d_x)
ValueAndPushforward< T, T > ATan_pushforward(T x, T d_x)