Skip to content
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

#1231 Fix slight inaccuracy in single precision fft phase shifts #1234

Merged
merged 1 commit into from
Aug 31, 2023

Conversation

rmjarvis
Copy link
Member

@rmjarvis rmjarvis commented Aug 13, 2023

@EiffL reported a very slight difference in the rendered images of a shifted profile using FFT rendering vs real space for single-precision images. It's about 10x higher than the single precision epsilon on my laptop and 100x higher on Google collab, so I went ahead and switched the code to use double precision for the complex phases to avoid the accumulation of rounding errors, which fixed the problem.

Original:
junk

Fixed:
junk2

@rmjarvis rmjarvis linked an issue Aug 13, 2023 that may be closed by this pull request
@rmjarvis rmjarvis requested a review from EiffL August 13, 2023 01:39
@rmjarvis rmjarvis added this to the v2.5 milestone Aug 13, 2023
@rmjarvis rmjarvis added the numerics Involving details of the numerical algorithms for performing some calculation(s) label Aug 22, 2023
Copy link
Member

@jmeyers314 jmeyers314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rmjarvis rmjarvis merged commit 34dae56 into main Aug 31, 2023
9 checks passed
@rmjarvis rmjarvis deleted the #1231 branch August 31, 2023 05:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
numerics Involving details of the numerical algorithms for performing some calculation(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Small Discrepancy between Real and Fourier Space Shift
2 participants