-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flipwind: reduce roundoff in phase winding a[n] calc #534
Conversation
Thus is gains nearly a full digit in the most dramatic case (t1 and t2 mostly; effect on t3 is less, I believe because its deconv array does not use such a shift). There is one t3 case (1e-8) made a digit worse, strangely, but I don't think it deserved to be that good in master. To study. @DiamonDinoia This should be brought into GPU t1 and t2 code, at some point. |
More typical comparison (maybe not enough NU pts in prev): master:
flipwind:
0.3 digits better for tol = 1e-10, 1e-11. |
Hi Alex, this looks good to me. Shall we bring this in for 2.3.0? Or delay to the next release? |
Let's wait to post-2.3.0 tag otherwise there may be unintended
consequences. It's a change in core math. Annoying to wait, I know.
…On Wed, Aug 21, 2024 at 11:23 AM Marco Barbone ***@***.***> wrote:
Hi Alex, this looks good to me. Shall we bring this in for 2.3.0? Or delay
to the next release?
—
Reply to this email directly, view it on GitHub
<#534 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACNZRSV3ENGCLC32CG433T3ZSSWC7AVCNFSM6AAAAABM2YTDOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMBSGM3DCNRSGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
*-------------------------------------------------------------------~^`^~._.~'
|\ Alex Barnett Center for Computational Mathematics, Flatiron Institute
| \ http://users.flatironinstitute.org/~ahb 646-876-5942
|
I totally agree. There are a lot of changes for 2.3.0 already. |
reduce rounding error in onedim_fseries_kernel CPU code by avoiding catastrophic cancellation via (nf/2 - z[n]) being sent into the complex exp.
A minus sign is used instead. The reason for the nf/2 shift is obscure and to do with the find grid being {0,1,...,nf-1} but sitting physically in [-pi,pi), I think. It's as if the kernel were centered at nf/2 when its Fourier series is evaluated.
Here's an extreme case where tol is around epsmach * N1. Compare the rel l2-err figures (ignore one mode):
master:
flipwind:
Thus is seems to reduce the "bounce-back" of errors when tol reaches epsmach * max(N1,N2,N3).