libm has a fallback to multiprecision calculation for some functions (log, exp, atan, pow, etc.) which is much slower than the fast path. While the inputs that trigger this are unknown, it would be useful to document the fact that there is such a performance difference, along with an explanation of why the multiprecision stage is needed at all.
Some background on why such documentation could save a lot of frustration can be found in bug 13932, and in http://entropymine.com/imageworsener/slowpow/, and simply by googling "slowpow".
Shouldn't this issue just be fixed? IEEE specifically omits the requirement of correct rounding for transcendental functions because of the long-known issue that there's no known efficient way to compute the correctly-rounded results. As far as I can tell, no other libm implementations have these performance bugs; they're unique to glibc and the "IBM Accurate Mathematical Library" written for glibc.
(In reply to comment #2) > Shouldn't this issue just be fixed? IEEE specifically omits the requirement of > correct rounding for transcendental functions because of the long-known issue > that there's no known efficient way to compute the correctly-rounded results. > As far as I can tell, no other libm implementations have these performance > bugs; they're unique to glibc and the "IBM Accurate Mathematical Library" > written for glibc. Sorry, are you advocating we "fix it" as opposed to "document it?" If you are then I agree, but documenting things until you fix them is a good intermediate step.
At least since release 4.04, the Linux man-pages say: On 64-bits, pow() may be more than 10,000 times slower for some (rare) inputs than for other nearby inputs. This affects only pow(), and not powf() nor powl().
I'm going to retitle this bug and instead of saying we're going to document the performance issues, we should fix them. We have already agreed to relax the ULPs to 9 ULPs for all functions and thus remove the MP-fallback paths in these cases. We have just had a user report that: * acos * asin Both have MP-fallback cases that are very bad and should be fixed. Szabolcs Nagy from Arm has worked on many of these fixes.
All slow paths have now been removed from all math functions.