Question: 14. There is a more efficient algorithm (in terms of the number of multiplications and additions used) for eval- uating polynomials than the conventional algorithm

14. There is a more efficient algorithm (in terms of the number of multiplications and additions used) for eval- uating polynomials than the conventional algorithm de- scribed in the previous exercise. It is called Horner's method. This pseudocode shows how to use this method a" + an-- ao at x = c. procedure Horner(c, do, a, a, ..., ,. real numbers) y := an for i:=1 to n y:= y* c + an- return y {y = a,c" + an-1ch-1 + ... +ac+a,} a) Evaluate 3x2 + x +1 at x = 2 by working through each step of the algorithm showing the values as- signed at each assignment step. b) Exactly how many multiplications and additions are used by this algorithm to evaluate a polynomial of degree n at x = c? (Do not count additions used to increment the loop variable.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
