Answered step by step
Verified Expert Solution
Question
1 Approved Answer
EVALUATE IN ENGLISH Exercises 9 and 10 in ises 9 and 10 involve evaluating a polynomial a,x + a ! + ... + a, for
EVALUATE IN ENGLISH
Exercises 9 and 10 in ises 9 and 10 involve evaluating a polynomial a,x" + a ! + ... + a, for a specific value of x. straightforward algorithm to evaluate a polynomial is given by the following function: for x = c Poly(real an, real 0,-1, ... , real an, real c, integer n) llevaluates polynomial a," + 0,- +..+ ao Local variables: integer i real sum = ao real product = 1 for i = 1 to n do product = product * C sum = sum + a, * product end for return sum end function Poly 10. An alternative to the polynomial evaluation algorithm in Exercise 9 is an algorithm called Horner's method. Horner's method relies on an alternative expression for a polynomial, for example 2x3 7x + 5x 14 = -14 + x(5 + x(-7 + x(2))) Horner(real a,, real a,-1, ... , real an, real c, integer n). llevaluates polynomial a, " + a,,""! + ... + de for x = c. //using Horner's method Local variables: integer i real result = an for i = 1 to n do result = result * c + 0,- end for return resit end function Horner a. Walk through this algorithm to compute the value of 2r - 7x + 5x 14 for x = 4. b. Analyze this algorithm where addition and multiplication operations are the work units. c. In evaluating a polynomial of degree n = 98 for some value of x, how many operations have been saved by using Horner's method over the method of Exercise 9Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started