Merge the relevant part of rev.1.14 of s_cbrt.c (a micro-optimization

involving moving the check for x == 0).  The savings in cycles are
smaller for cbrtf() than for cbrt(), and positive in all measured cases
with gcc-3.4.4, but still very machine/compiler-dependent.
This commit is contained in:
Bruce Evans 2007-05-29 07:13:07 +00:00
parent 9c933e2939
commit 20a990117d
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=170089

View File

@ -41,11 +41,11 @@ cbrtf(float x)
sign=hx&0x80000000; /* sign= sign(x) */
hx ^=sign;
if(hx>=0x7f800000) return(x+x); /* cbrt(NaN,INF) is itself */
if(hx==0)
return(x); /* cbrt(0) is itself */
/* rough cbrt to 5 bits */
if(hx<0x00800000) { /* subnormal number */
if(hx<0x00800000) { /* zero or subnormal? */
if(hx==0)
return(x); /* cbrt(+-0) is itself */
SET_FLOAT_WORD(t,0x4b800000); /* set t= 2**24 */
t*=x;
GET_FLOAT_WORD(high,t);