CPU Computing 85
The 0-index roots are the same for the two methods but the 1-index roots
differ. In fact, the roots have trailing significands that differ by seven, which
amounts to a floating-point difference of 1/2
21
+1/2
22
+1/2
23
.
=8.34465e−7.
The pseudocode shows the two floating-point neighbors of the 0-index
root, namely,
rootPrev[0] and rootNext[0]. Observe that the polynomial values
at those points have opposite signs, which means that zero lies between them
(in terms of infinite precision). The polynomial value at the computed root is
nearly zero and has a magnitude smaller than that of the polynomial value
at the root’s next-up neighbor. Thus, the floating-point value computed for
the root is the best that you can do in terms of 32-bit float and polynomi ...