-
-
Notifications
You must be signed in to change notification settings - Fork 22
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
Use 'long double' for x,y,z arguments #93
Conversation
dstndstn
commented
Jun 26, 2018
- use cosl,sinl for radec_to_healpixlf
- compute 1-vz in long double
…lpixlf; compute 1-z in long double
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me - I don't have time to check whether this fully fixes #34, so I'll leave it up to you whether to merge or wait until we can confirm this is fixed.
There's a bit of a concern with this, in the sense that it probably won't fix the issue for all users: some will end up with only "double" precision still (see https://en.wikipedia.org/wiki/Long_double). Even worse would be if there's a distribution problem where binaries (e.g. Windows from conda-forge) don't work at all for some users (e.g. some Windows machines); I don't know if that's a real concern. I would suggest we merge tomorrow, and continue with more edits and checks in the next days. Unless there is a more stable way to do that computation using only |
Hmm, as far as I understand, the problematic term is sqrt(1.-vz). Wouldn't it be possible to rewrite this as That should be more accurate. |
Going to |
In this case it's the sin(Dec) that drops precision; Dec->90 degrees so sin(Dec)->1 |
Yes, that's why I think it should be safer to use cos(Dec) (i.e. I see similar code in other places in the package... the
It's not much slower, and it works extremely reliably. |
I tried this in #94 - thanks for the tip! - seems to work in our one polar test case |