Exercises 40—43 refer to another algorithm, known as Horner’s rule, for finding the value of a polynomial.
Algorithm 11.3.4 Homer’s Rule
[This algorithn computes the value of a polynomial by nesting successive additions and multiplications as indicated in the following parenthesization:
At each stage, starting with
, the current value of polyval is multiplied by x and the next lower coefficient of the polynomial is added to it.] Input: n[a nonnegative integer],
[an array of real numbers], x [a real number] Algorithm Body:
for to n next i
Output: polyval [a real number]
42. Let the number of additions and multiplications that are performed when Algorithm 11.3.4 is executed for a polynomial of degree n. Express , as a function of n.
The total number of additions and multiplications performed , for algorithm for Horner’s Rule.
is the number of elementary operations when the given algorithm is executed where is the degree of the polynomial.
The considered algorithm for Horner’s Rule is as follows.
[a nonnegative integer], [an array of real numbers], [a real number] Algorithm Body:
[at this point
Bartleby provides explanations to thousands of textbook problems written by our experts, many with advanced degrees!Get Started