Closed mwallerb closed 1 year ago
The implementation in Base
is generic, so funnily enough, if you just remove the stopgap implementation, everything works. (This is what DoubleFloats.jl does.) The computation is roughly 3.3x faster than with DoubleFloats.jl on my machine.
It is amazing how a stop-gap needed 3 years ago to obtain compatibility with GenericLinearAlgebra.jl is now not needed anymore. The generics have improved a lot!
Thanks for pointing this out @mwallerb! As @lrnv said, this stopgap was added years ago to make MultiFloats.jl work with GenericLinearAlgebra.jl, and was never intended to actually do the job hypot(x, y)
(i.e., avoiding undue overflow and underflow). I'm very glad to see that the generics have improved to the point that these sorts of hacks are no longer necessary.
hypot
is just not correctly implemented. it loses all digits of precision for small as well as large values.One should probably have some really robust precision audit as part of the unit tests.