Overflow and admissible range for float 32 input parameters #448
Answered
by
ahbarnett
remy-abergel
asked this question in
Q&A
Replies: 2 comments 13 replies
-
I guess it depends on your point distribution, M, N1, N2, N3, etc. |
Beta Was this translation helpful? Give feedback.
9 replies
-
Thanks for finding what is essentially a bug, and for the kind words.
This is a failure mode I had never anticipated: because you're in 3D, the
kernel max size gets cubed. for eps=1e-6 (about the min useful in
single-prec), w=7, so kernel size is about 1e7, so its cube is 1e21, and
mult by your strength 1e13 and M=1e4 points all falling on top of each
other (in your data), and you get 1e38. Bingo!
We will rescale the kernel internally, and this will fix it. Certainly this
never bothered anyone in double-prec, but single I see is a problem.
Thanks, Alex
…On Mon, Jun 3, 2024 at 3:03 PM Rémy Abergel ***@***.***> wrote:
In summary, ideally you expect if input is in [1e-38, 1e+38] and output is
also in [1e-38, 1e+38], nufft should not return inf/nan as a result, right?
Ideally yes, but honestly, I would feel scary to try to compute nufft (or
even fft) of an input array with 1e38 maximal amplitude in float32
precision. However, for input *and* output falling in this range with a
more reasonable security margin (to be defined), if something can be done,
I think it would be nice to do it.
—
Reply to this email directly, view it on GitHub
<#448 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACNZRSTDS7VFHI2BIHN5573ZFS4ZRAVCNFSM6AAAAABISVIWRSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TMNJTGA4DA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***
com>
--
*-------------------------------------------------------------------~^`^~._.~'
|\ Alex Barnett Center for Computational Mathematics, Flatiron Institute
| \ http://users.flatironinstitute.org/~ahb 646-876-5942
|
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
remy-abergel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
Processing some unusual raw data related to Electron Paramagnetic Resonance imaging have led me to normalization issues that can be roughly summarized by the following code.
For sure, method n. 2 is easy to implement and may probably be preferred to method n. 1. However, provided that all the inputs
x, y, z, c
and the theoretical value of the real and imaginary parts of the outputf
fall into the admissible range fornp.float32
arrays ([1e-38, 1e-38]
) with reasonable security margins, should we expect method n. 1 to run without overflow issues? Otherwise, is there some guidelines about the admissible range fornufft
parameters?Many thanks
Beta Was this translation helpful? Give feedback.
All reactions