-
-
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
Improve performance of inv(::ComplexF64)
#39303
Conversation
Test error in spawn testset doesn't seem related afaict. |
Bump; just so I don't forget this for 2 years again. (I suspect nothing here is too controversial: maybe the main point to consider is whether to use |
In my opinion, the use of |
Overall, the code for this looks good. The worst error I've seen from this is 2.6 ULP (about the same as before the PR), but I don't really know what we aim for for the accuracy of complex arithmatic. |
Thanks for checking this explicitly; good to know. |
@thchr any idea why the windows tests are failing? I don't want this to get lost. It might be worth rebasing and hoping they just go away. |
Hmm, no; when I looked at it originally, it didn't look related. |
Oki, all green now test-wise. |
Anyone have objections to this merging? |
This is essentially just a rebase of #29058 (but my fork of that had gotten deleted so I had to open it anew): leads to a speedup of about 30% for
inv(::ComplexF64)
without changing the output.The gist of the changes are the same as in the original PR: speed up
inv(::ComplexF64)
by combining two if statements into anif-elseif
and opt for a cheaper variant ofmax
, because we know we won't benefit from checkingNaN
orInf
values in this context. Also now usemuladd
explicitly in one spot.Benchmarks:
1.6-beta:
PR:
Tagging @simonbyrne again, in case you still recall the PR that #29058 branched off originally (~2 years ago now 😮 ).