1. x/2
As an approximation toy=sqrt(x)
, x/2
is exact
for x=4
, too small for x<4
, and
too large for x>4
:

We can reduce the range of
x
to be considered using
frexp() and ldexp() as follows:
if x != 0 f = frexp(x,&e), produces f in the range [0.5, 1.0) if e is odd, multiply f by 2 and subtract 1 from e Now f is in the range [0.5, 2.0) and e is even Compute: g = sqrt(f) and then construct sqrt(x) using y=ldexp( g, e/2) = (f*2e)½So we only need to consider approximations to
sqrt(f)
for 0.5 <= f < 2.0