1 #include "quadmath-imp.h"
6 sqrtq (const __float128 x)
20 if (x <= DBL_MAX && x >= DBL_MIN)
22 /* Use double result as starting point. */
23 y = sqrt ((double) x);
25 /* Two Newton iterations. */
26 y -= 0.5q * (y - x / y);
27 y -= 0.5q * (y - x / y);
32 if (x <= LDBL_MAX && x >= LDBL_MIN)
34 /* Use long double result as starting point. */
35 y = sqrtl ((long double) x);
37 /* One Newton iteration. */
38 y -= 0.5q * (y - x / y);
43 /* If we're outside of the range of C types, we have to compute
44 the initial guess the hard way. */
50 y = scalbnq (y, exp / 2);
52 /* Two Newton iterations. */
53 y -= 0.5q * (y - x / y);
54 y -= 0.5q * (y - x / y);