]>
git.ipfire.org Git - thirdparty/gcc.git/blob - libquadmath/math/cbrtq.c
1 #include "quadmath-imp.h"
6 cbrtq (const __float128 x
)
17 if (x
<= DBL_MAX
&& x
>= DBL_MIN
)
19 /* Use double result as starting point. */
20 y
= cbrt ((double) x
);
22 /* Two Newton iterations. */
23 y
-= 0.333333333333333333333333333333333333333333333333333Q
25 y
-= 0.333333333333333333333333333333333333333333333333333Q
31 if (x
<= LDBL_MAX
&& x
>= LDBL_MIN
)
33 /* Use long double result as starting point. */
34 y
= cbrtl ((long double) x
);
36 /* One Newton iteration. */
37 y
-= 0.333333333333333333333333333333333333333333333333333Q
43 /* If we're outside of the range of C types, we have to compute
44 the initial guess the hard way. */
48 y
= (i
>= 0 ? i
: -i
);
55 y
= scalbnq (y
, exp
/ 3);
57 /* Two Newton iterations. */
58 y
-= 0.333333333333333333333333333333333333333333333333333Q
60 y
-= 0.333333333333333333333333333333333333333333333333333Q