s_cbrtf.c (fd2891004df86c868f77e042a840510c496c81aa) s_cbrtf.c (20a990117de27fff03b77503a05ed58d727b988a)
1/* s_cbrtf.c -- float version of s_cbrt.c.
2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
3 * Debugged and optimized by Bruce D. Evans.
4 */
5
6/*
7 * ====================================================
8 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.

--- 27 unchanged lines hidden (view full) ---

36 int32_t hx;
37 u_int32_t sign;
38 u_int32_t high;
39
40 GET_FLOAT_WORD(hx,x);
41 sign=hx&0x80000000; /* sign= sign(x) */
42 hx ^=sign;
43 if(hx>=0x7f800000) return(x+x); /* cbrt(NaN,INF) is itself */
1/* s_cbrtf.c -- float version of s_cbrt.c.
2 * Conversion to float by Ian Lance Taylor, Cygnus Support, ian@cygnus.com.
3 * Debugged and optimized by Bruce D. Evans.
4 */
5
6/*
7 * ====================================================
8 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.

--- 27 unchanged lines hidden (view full) ---

36 int32_t hx;
37 u_int32_t sign;
38 u_int32_t high;
39
40 GET_FLOAT_WORD(hx,x);
41 sign=hx&0x80000000; /* sign= sign(x) */
42 hx ^=sign;
43 if(hx>=0x7f800000) return(x+x); /* cbrt(NaN,INF) is itself */
44 if(hx==0)
45 return(x); /* cbrt(0) is itself */
46
47 /* rough cbrt to 5 bits */
44
45 /* rough cbrt to 5 bits */
48 if(hx<0x00800000) { /* subnormal number */
46 if(hx<0x00800000) { /* zero or subnormal? */
47 if(hx==0)
48 return(x); /* cbrt(+-0) is itself */
49 SET_FLOAT_WORD(t,0x4b800000); /* set t= 2**24 */
50 t*=x;
51 GET_FLOAT_WORD(high,t);
52 SET_FLOAT_WORD(t,sign|((high&0x7fffffff)/3+B2));
53 } else
54 SET_FLOAT_WORD(t,sign|(hx/3+B1));
55
56 /*

--- 18 unchanged lines hidden ---
49 SET_FLOAT_WORD(t,0x4b800000); /* set t= 2**24 */
50 t*=x;
51 GET_FLOAT_WORD(high,t);
52 SET_FLOAT_WORD(t,sign|((high&0x7fffffff)/3+B2));
53 } else
54 SET_FLOAT_WORD(t,sign|(hx/3+B1));
55
56 /*

--- 18 unchanged lines hidden ---