I was looking for speed with Inverse[] by trying different methods when I came across this.
Inverse[] with its default Method->Automatic is extremely fast. The documentation of Inverse[] says that it will choose one of three methods if left to Automatic, but if you choose any of the three they are all orders of magnitude slower- I mean 1000x or more slower on a large system (n=500). Is there another method being chosen? Maybe it's attempting symbolic computation or no accelerator (i.e., MKL LAPACK) is used?
Mathematica documentation does tend to be a bit cryptic for my taste. It would be interesting to know more about what is going on under the hood here. References and/or documentation on the algorithms would be of great use.
Why the slow timings while Inverse[] left alone is so fast? Thanks in advance.
V13.2 On Core I9-10900K CPU@3.70GHz Windows 11 PC;
A = RandomReal[10, {500, 500}];
RepeatedTiming[Inverse[A, Method -> Automatic], 10][[1]] (*sec=0.0033 !!!*)
RepeatedTiming[Inverse[A, Method -> "CofactorExpansion"], 10][[1]] (*sec=3.3930731`*)
RepeatedTiming[Inverse[A, Method -> "DivisionFreeRowReduction"], 10][[1]](*sec=10.6844523`*)
RepeatedTiming[Inverse[A, Method -> "OneStepRowReduction"], 10][[1]](*sec=10.9590677`*)