68 static const double sqrtTwo = sqrt(2.0);
72 double x = argument-xoffset;
76 double expG=0.0, asymm=0.0;
79 expG = exp((xsigma*xsigma +2*tau*(x))/(2.0*tau*tau)) *
80 erfc((xsigma*xsigma+tau*(x))/(sqrtTwo*xsigma*tau))/(2.0*tau);
86 if (!std::isfinite(expG)) {
93 expG = exp((xsigma*xsigma +2*tau*(-x))/(2.0*tau*tau)) *
94 erfc((xsigma*xsigma+tau*(-x))/(sqrtTwo*xsigma*tau))/(2.0*tau);
100 if (!_finite(expG)) {
104 if (!std::isfinite(expG)) {
117 if (xsigma>6.0*tau) {
118 asymm = expG*(1/(1+tau*tau*freq*freq));
120 else if (xsigma==0.0) {
122 if (x>=0) asymm= (expG*cos(freq*x));
125 if (x>=0) asymm= (expG*sin(freq*x));
129 std::complex<double> z(freq*xsigma/sqrtTwo, (xsigma/tau-x/xsigma)/sqrtTwo);
132 asymm= 2.0*nwwerf(z).real()/tau/4.0*exp(-x*x/2.0/xsigma/xsigma);
135 asymm= 2.0*nwwerf(z).imag()/tau/4.0*exp(-x*x/2.0/xsigma/xsigma);
140 asymm= -2.0*nwwerf(std::conj(z)).real()/tau/4*exp(-x*x/2.0/xsigma/xsigma) +
141 exp(xsigma*xsigma/2 *(1/tau/tau - freq*freq) - x/tau)*(1./tau)*cos(freq*x - freq/tau*xsigma*xsigma);
144 asymm= +2.0*nwwerf(std::conj(z)).imag()/tau/4*exp(-x*x/2.0/xsigma/xsigma) +
145 exp(xsigma*xsigma/2 *(1/tau/tau - freq*freq) - x/tau)*(1./tau)*sin(freq*x - freq/tau*xsigma*xsigma);
152 double retVal = (expG+asymm)/2.0;
155 <<
"Warning in AnalyticConvolution: negative probablity"
159 << xsigma <<
' ' << tau <<
' ' << xoffset <<
' '
160 << freq <<
' '<< argument
163 std::cerr << retVal << std::endl;
166 else if (_type==
MIXED) {
167 double retVal = (expG-asymm)/2.0;
170 <<
"Warning in AnalyticConvolution: negative probablity"
174 << xsigma <<
' ' << tau <<
' ' << xoffset <<
' '
175 << freq <<
' ' << argument
178 std::cerr << retVal << std::endl;
186 <<
"Unknown sign parity. State is not allowed"
216 std::complex<double> zh,r[38],s,t,v;