-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Inlining of small powers is incorrect #20768
Comments
You should be able to recover the behavior you want by importing |
Yes, that works, thanks. |
Haven't we always had a default definition of |
I imagine this is probably happening because all of the specialized methods for edit: that's not quite right, there are some methods that have an abstract type for the second argument, but you get the idea. |
cc @stevengj |
Probably this should be closed as a WONTFIX. This is the price that we pay for the opportunity for compile-time specialization and modified type computations for literal powers — we knew that going into this experiment. What we will find out in 0.6 is how many people get affected negatively by this; interval arithmetic is one such case. Hopefully there aren't too many others. |
(I should also point out that |
An alternative would be to restrict the inlining of literal powers to hardware numeric types + complex numbers thereof, which gain the most from this. |
An interface where you have to know about and define two different methods in order to get a consistent specialization across two subtly different caller contexts seems to be troublesome in general. It's nice to provide the ability to override behaviors when you know the value of the exponent at compile-time, but could we structure the dispatch in a way that only base types avoid calling |
I thought the old behaviour was a codegen optimization for machine types? |
#20782 changes inlining for literal exponents back to only hardware numeric types (and complex and rationals thereof), so it should close this issue. |
Confirmed fixed, many thanks! |
The new inlining of small powers is incorrect e.g. for interval arithmetic, where e.g.
x^2
forx
anInterval
is not the same asx*x
, and is defined using a completely separate code path.E.g.:
cc @stevengj
The text was updated successfully, but these errors were encountered: