Commit d2598ea5 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

try to improve accuracy of wscreen formula

parent 6acee462
......@@ -594,8 +594,11 @@ template<typename T> class GridderConfig
complex<T> wscreen(double x, double y, double w, bool adjoint) const
{
constexpr double pi = 3.141592653589793238462643383279502884197;
double n = cos(sqrt(x+y)), xn = 1./n;
double phase = 2*pi*w*(n-1);
double eps = sqrt(x+y);
double s = sin(eps);
double nm1 = -s*s/(1.+cos(eps));
double n = nm1+1., xn = 1./n;
double phase = 2*pi*w*nm1;
if (adjoint) phase *= -1;
return complex<T>(cos(phase)*xn, sin(phase)*xn);
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment