42 double re = -z.real() * z.real() + z.imag() * z.imag();
43 double im = -2. * z.real() * z.imag();
45 return (z.real() >= 0.) ? (std::complex<double>(re, im) *
faddeeva(std::complex<double>(-z.imag(), z.real())))
46 : (2. - std::complex<double>(re, im) *
faddeeva(std::complex<double>(z.imag(), -z.real())));
51 double re = -z.real() * z.real() + z.imag() * z.imag();
52 double im = -2. * z.real() * z.imag();
54 return (z.real() >= 0.)
55 ? (std::complex<double>(re, im) *
faddeeva_fast(std::complex<double>(-z.imag(), z.real())))
56 : (2. - std::complex<double>(re, im) *
faddeeva_fast(std::complex<double>(z.imag(), -z.real())));
61 double re = -z.real() * z.real() + z.imag() * z.imag();
62 double im = -2. * z.real() * z.imag();
64 return (z.real() >= 0.) ? (1. - std::complex<double>(re, im) *
faddeeva(std::complex<double>(-z.imag(), z.real())))
65 : (std::complex<double>(re, im) *
faddeeva(std::complex<double>(z.imag(), -z.real())) - 1.);
70 double re = -z.real() * z.real() + z.imag() * z.imag();
71 double im = -2. * z.real() * z.imag();
73 return (z.real() >= 0.)
74 ? (1. - std::complex<double>(re, im) *
faddeeva_fast(std::complex<double>(-z.imag(), z.real())))
75 : (std::complex<double>(re, im) *
faddeeva_fast(std::complex<double>(z.imag(), -z.real())) - 1.);
83 static double itod[20] = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0,
84 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0};
86 double den, dif, dift ,
y, dy;
90 for (i = 1; i <=
n; i++) {
91 if ((dift = std::abs(
x - itod[i - 1])) < dif) {
100 for (
m = 1;
m <
n;
m++) {
101 for (i = 1; i <=
n -
m; i++) {
102 den = (
c[i + 1] -
d[i]) / itod[
m];
103 d[i] = (
x - itod[i +
m - 1]) * den;
104 c[i] = (
x - itod[i - 1]) * den;
106 dy = (2 * ns) < (
n -
m) ?
c[ns + 1] :
d[ns--];
120 double den, dif, dift, ho, hp,
w,
y, dy;
123 dif = std::abs(
x - xa[0]);
124 for (i = 1; i <=
n; i++) {
125 if ((dift = std::abs(
x - xa[i - 1])) < dif) {
134 for (
m = 1;
m <
n;
m++) {
135 for (i = 1; i <=
n -
m; i++) {
137 hp = xa[i - 1 +
m] -
x;
141 std::cerr <<
"In " << __func__ <<
"(), " << __FILE__ <<
":" << __LINE__
142 <<
": Zero distance between points not allowed." << std::endl;
149 dy = (2 * ns) < (
n -
m) ?
c[ns + 1] :
d[ns--];
static std::complex< double > erfc(const std::complex< double > z)
complex erfc function
static std::complex< double > erf(const std::complex< double > z)
complex erf function
static std::complex< double > faddeeva(std::complex< double > z)
evaluate Faddeeva function for complex argument
static double interpolate(double yArr[], Int_t nOrder, double x)
static std::complex< double > faddeeva_fast(std::complex< double > z)
evaluate Faddeeva function for complex argument (fast version)
static std::complex< double > erfc_fast(const std::complex< double > z)
complex erfc function (fast version)
static std::complex< double > erf_fast(const std::complex< double > z)
complex erf function (fast version)
__roodevice__ static __roohost__ void cexp(double &re, double &im)
__roodevice__ __roohost__ STD::complex< double > faddeeva(STD::complex< double > z)
__roodevice__ __roohost__ STD::complex< double > faddeeva_fast(STD::complex< double > z)