-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
^(-n) is slow #8939
Comments
At least I understood from this page that raising to negative integer power could be done without the floating-point |
llvm lowers most powi calls to the |
Right, of course they don't, I should not have included these. I was merely expecting x^{-n} to be as "elementary" as x^n. |
Maybe I should replace #8878 with a version that says to be careful with negative powers, and use 1/x^n for better performance. |
The question is not whether If the answer to both questions is no, and in general if we don't violate any IEEE 754 guarantees about |
not IEEE, but LLVM may be doing it anyways (configurable with http://llvm.org/docs/LangRef.html#fpmath-metadata) |
cc: @alanedelman |
If we privilege accuracy over speed, we shouldn't use |
Fixed on master. |
Related to #2741, raising to negative integer power does not seem to use the LLVM
powi
intrinsic and is much slower. This is somewhat unexpected (at least for me it was).The text was updated successfully, but these errors were encountered: