-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
when x
is NaN
in trig functions return x
rather than NaN
#49285
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
Conversation
x
is NaN
in trig functions return x
rather than NaN
I think this guarantee is destroyed by the LLVM optimizer anyway From page 5 of https://arxiv.org/pdf/1603.09290.pdf:
IMO that recommendation from the IEEE standard is silly. Although the discussion in #48523 rightly points out that payload tagging has useful applications, I don't think that extends to propagating the payload through arithmetic. edit: But IIUC, this change is done for performance reasons, not to improve NaN propagation? |
yeah. This is (I believe) a minor performance benefit, but also makes NaN propagation a little more reliable (although LLVM still is allowed to mess with us) |
The "return |
Co-authored-by: mikmoore <95002244+mikmoore@users.noreply.github.com>
…iaLang#49285) * when x is NaN in trig functions return x rather than NaN * prefer `isnan(x) | isnan(y)` --------- Co-authored-by: mikmoore <95002244+mikmoore@users.noreply.github.com>
see #48523 for reasoning.