cvs commit: src/lib/msun/src s_cbrt.c s_cbrtf.c
Bruce Evans
bde at FreeBSD.org
Sun Dec 18 16:22:04 PST 2005
bde 2005-12-19 00:22:03 UTC
FreeBSD src repository
Modified files:
lib/msun/src s_cbrt.c s_cbrtf.c
Log:
Use a minimax polynomial approximation instead of a Pade rational
function approximation for the second step. The polynomial has degree
2 for cbrtf() and 4 for cbrt(). These degrees are minimal for the final
accuracy to be essentially the same as before (slightly smaller).
Adjust the rounding between steps 2 and 3 to match. Unfortunately,
for cbrt(), this breaks the claimed accuracy slightly although incorrect
rounding doesn't. Claim less accuracy since its not worth pessimizing
the polynomial or relying on exhaustive testing to get insignificantly
more accuracy.
This saves about 30 cycles on Athlons (mainly by avoiding 2 divisions)
so it gives an overall optimization in the 10-25% range (a larger
percentage for float precision, especially in 32-bit mode, since other
overheads are more dominant for double precision, surprisingly more
in 32-bit mode).
Revision Changes Path
1.13 +21 -26 src/lib/msun/src/s_cbrt.c
1.14 +9 -11 src/lib/msun/src/s_cbrtf.c
More information about the cvs-src
mailing list