11 #include <gsl/gsl_fft_complex.h>
15 #define REAL(z,i) ((z)[2*(i)])
16 #define IMAG(z,i) ((z)[2*(i)+1])
18 double const sqrt2 = std::sqrt(2);
28 if (ta <
TINY && tb <
TINY)
return 0.;
29 return 0.5 * std::log((ta*exp_ybeam + tb/exp_ybeam) / std::max(ta/exp_ybeam + tb*exp_ybeam,
TINY));
44 return (ta - tb)/std::max(ta + tb,
TINY);
57 std::vector<double>
y_;
67 for (std::size_t ieta = 0; ieta <
neta_; ++ieta) {
69 double Jsh = J*std::sinh(eta);
70 double sq = std::sqrt(1. + Jsh*Jsh);
71 y_[ieta] = std::log(sq + Jsh);
72 dydeta_[ieta] = J*std::cosh(eta)/sq;
78 double xi = std::fmod(steps, 1.);
79 std::size_t
index = std::floor(steps);
80 return y_[
index]*(1. - xi) +
y_[index+1]*xi;
85 double xi = std::fmod(steps, 1.);
86 std::size_t
index = std::floor(steps);
117 double k1, k2, k3, amp, arg;
123 for(
size_t i=0;
i<
N;
i++){
128 amp = std::exp(-k2/2.0);
129 arg = fftmean*k1+skew/6.0*k3*amp;
134 gsl_fft_complex_radix2_forward(
data, 1, N);
136 for(
size_t i=0;
i<
N;
i++){
146 if (y < -eta_max || y >=
eta_max)
return 0.0;
148 size_t iy = std::floor(xy);
150 return dsdy[iy]*(1.-ry) +
dsdy[iy+1]*ry;