234 Appendix D: A Detailed Look at _
add a few program lines at the end of your function subroutine. These lines
should subtract the known root (to 10 significant digits) from the x-value
and divide this difference into the function value. In many cases the root
will be a simple one, and the new function will direct _ away from
the known root. On the other hand, the root may be a multiple root. A
multiple root is one that appears to be present repeatedly, in the following
sense: at such a root, not only does the graph of f(x) cross the x-axis, but its
slope (and perhaps the next few higher-order derivatives) also equals zero.
If the known root of your equation is a multiple root, the root is not
eliminated by merely dividing by the factor described above. For example,
the equation
f(x) = x(x – a)
3
= 0
has a multiple root at x = a (with a multiplicity of 3). This root is not
eliminated by dividing f(x) by (x îš± a). But it can be eliminated by dividing
by (x îš± a)
3
.
Example: Use deflation to help find the roots of
60x
4
îš± 944x
3
+ 3003x
2
+ 6171x – 2890 = 0.
Using Horner's method, this equation can be rewritten in the form
(((60x îš± 944)x + 3003)x + 6171)x îš± 2890 = 0.
Program a subroutine that evaluates the polynomial.