Affordable web hosting - 472 ARITHMETIC 4.6.4 polynomials of higher degrees. This
472 ARITHMETIC 4.6.4 polynomials of higher degrees. This idea is due to C. T. Fike [CACM 10 (1967), 175-1781, who has presented several interesting examples. Any polynomial of the fifth degree may be evaluated using four muliiplica- tions, six additions, and one storing, by using the rule U(X) = U(Z)Z+UO, where U(Z) = u5×4 + ~42~ + u3z2 + zlzz + Q is evaluated as in (9). Alternatively, we can do the evaluation with four multiplications, five additions, and three storings, if the calculations take the form Y = (x + ao12, 4×1 = (NY + W)Y + Q2)(5 + a31 + a4)a5. (11) The determination of the cr s this time requires the solution of a cubic equation (see exercise 19). On many computers the number of storing operations required by (11) is less than 3; for example, we may be able to compute (X + ~0)~ without storing z + a~. In fact, many computers have more than one arithmetic register for floating point calculations, so we can avoid storing altogether. Because of the wide variety of features available for arithmetic on different computers, we shall henceforth in this section count only the arithmetic operations, not the operations of storing and loading an accumulator. The computation schemes can usually be adapted to any particular computer in a straightforward manner, so that very few of these auxiliary operations are necessary; on the other hand, it must be remembered that this extra overhead might well overshadow the fact that we are saving a multiplication or two, especially if the machine code is being produced by a compiler that does not optimize. A polynomial u(z) = ugz6 + . . . + ulx + ug of degree six can always be evaluated using four multiplications and seven additions, with the scheme 2 = (x + Qo)X + al, w = (x + a,)2 + Q3, U(x) = ((w + 2 + a4)w + a5)a6. (12) [See D. E. Knuth, CACM 5 (1962), 595-599.1 This saves two of the six multi- plications required by Horner s rule. Here again we must solve a cubic equation: Since a6 = L16,we may assume that 216 = 1. Under this assumption, let PI = gu5-Q P2 = u4-Pl(Pl+l), P3 = u3-p1@2, p4 = pl-p2, p5 = u2-PlP3. Let ,& be a real root of the cubic equation 2Y3 + (% -P2 + l)Y2 + (SD5 -P2P4 -i33)Y + (UI -h/35) = 0. (13) (This equation always has a real root, since the polynomial on the left approaches +oo for large positive y, and it approaches -oo for large negative y; it must assume the value zero somewhere in between.) Now if we define h=&+p4p6+P5, ~8=~3—~6-b, we have finally 00 =P2-2/36, a2 = Pl -Qo, & = /36 -aOa2, a3 = P7 -%Q2, &4=/38-P7-m, a5 = UO -@7p8* (14)
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision best web hosting services