Date: Mon, 19 Dec 2005 00:22:03 +0000 (UTC) From: Bruce Evans <bde@FreeBSD.org> To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/lib/msun/src s_cbrt.c s_cbrtf.c Message-ID: <200512190022.jBJ0M3gH032200@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200512190022.jBJ0M3gH032200>