Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ift
nifty_gridder
Commits
d2598ea5
Commit
d2598ea5
authored
Aug 21, 2019
by
Martin Reinecke
Browse files
try to improve accuracy of wscreen formula
parent
6acee462
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty_gridder.cc
View file @
d2598ea5
...
...
@@ -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
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment