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};
97 for (i = 1; i <=
n; i++) {
98 if ((dift = std::abs(
x - itod[i - 1])) < dif) {
107 for (
m = 1;
m <
n;
m++) {
108 for (i = 1; i <=
n -
m; i++) {
109 den = (
c[i + 1] -
d[i]) / itod[
m];
110 d[i] = (
x - itod[i +
m - 1]) * den;
111 c[i] = (
x - itod[i - 1]) * den;
113 dy = (2 * ns) < (
n -
m) ?
c[ns + 1] :
d[ns--];
140 dif = std::abs(
x - xa[0]);
141 for (i = 1; i <=
n; i++) {
142 if ((dift = std::abs(
x - xa[i - 1])) < dif) {
151 for (
m = 1;
m <
n;
m++) {
152 for (i = 1; i <=
n -
m; i++) {
154 hp = xa[i - 1 +
m] -
x;
158 std::cerr <<
"In " << __func__ <<
"(), " << __FILE__ <<
":" << __LINE__
159 <<
": Zero distance between points not allowed." << std::endl;
166 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)