You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
One problem is the type instability where z first is a Complex{Int64} and then turned into a Comlex{Float64} after the exponentiation. Fixing this removes the allocation but doesn't change the execution speed:
Removing
@fastmath
:Ref: #19298
One problem is the type instability where
z
first is aComplex{Int64}
and then turned into aComlex{Float64}
after the exponentiation. Fixing this removes the allocation but doesn't change the execution speed:Edit: It seems that the fast macro makes the exponent dispatch to a function that promotes both numbers to complex.
Edit2: Fixing the above, it turns out that the generic power by squaring is faster anyway up to an exponent of ~ 1000000000...
Edit3: The
@fastmath
macro also destroys theVal{2}
exponent optimization in the lowering since the syntax is rewritten topow_fast(z, 2)
.The text was updated successfully, but these errors were encountered: