10 #define M_2PI 6.28318530717958 12 static fptype n1[12] = {0.25, 1.0, 2.25, 4.0, 6.25, 9.0, 12.25, 16.0, 20.25, 25.0, 30.25, 36.0};
13 static fptype e1[12] = {0.7788007830714049,
22 1.388794386496402e-11,
23 7.287724095819692e-14,
24 2.319522830243569e-16};
28 = {0.2809, 1.1236, 2.5281, 4.4944, 7.0225, 10.1124, 13.7641, 17.9776, 22.7529, 28.09, 33.9889, 40.4496};
29 static fptype e2[12] = {0.7551038420890235,
37 1.313835773243312e-10,
38 6.319285885175346e-13,
39 1.733038792213266e-15,
40 2.709954036083074e-18};
43 static fptype C[7] = {65536.0, -2885792.0, 69973904.0, -791494704.0, 8962513560.0, -32794651890.0, 175685635125.0};
44 static fptype D[7] = {192192.0, 8648640.0, 183783600.0, 2329725600.0, 18332414100.0, 84329104860.0, 175685635125.0};
47 fptype *n, *e, t, u, r, s, d, f, g, h;
60 for(i = 1; i <= 6; i++) {
76 if(fabs(z.imag()) < 0.01 && fabs(z.real()) < 6.01) {
77 h = fabs(z.real()) * 2;
82 if(h < 0.02 || h > 0.98) {
89 d = (z.imag() - z.real()) * (z.imag() + z.real());
90 f = 4 * z.real() * z.real() * z.imag() * z.imag();
94 for(i = 0; i < 12; i++) {
96 u = e[i] / (t * t + f);
103 c = r *
fpcomplex(z.imag() * (u + 2.0 * g), z.real() * (u + 2.0 * h));
105 if(z.imag() <
M_2PI) {
112 g = 2.0 * exp(d - u) / (s * s + f * f);
113 u = 2.0 * z.real() * z.imag();
116 c += g *
fpcomplex((h * f - t * s), -(h * s + t * f));
127 if((0 == s) && (0 == w))
133 fptype coef = -0.5 / (s * s);
138 return (1 / (arg * arg + 0.25 * w * w));
142 return exp(coef * arg * arg);
145 fptype c = 1. / (sqrt(2) * s);
152 static const fptype rsqrtPi = 0.5641895835477563;
153 return c * rsqrtPi * v.real();
Thrown when a general error is encountered.
fptype cpuvoigtian(fptype x, fptype m, fptype w, fptype s)
thrust::complex< fptype > fpcomplex
fpcomplex Faddeeva_2(const fpcomplex &z)