Computer Systems: A Programmer's Perspective (3rd Edition)
Computer Systems: A Programmer's Perspective (3rd Edition)
3rd Edition
ISBN: 9780134092669
Author: Bryant, Randal E. Bryant, David R. O'Hallaron, David R., Randal E.; O'Hallaron, Bryant/O'hallaron
Publisher: PEARSON
bartleby

Videos

Textbook Question
Book Icon
Chapter 5.7, Problem 5.6PP

Practice Problem 5.6 (solution page 575)

Let us continue exploring ways to evaluate polynomials, as described in Practice Problem 5 5. We can reduce the number of multiplications in evaluating a polynomial by applying Horner’s method, named after British mathematician William G. Horner (1786-1837). The idea is to repeatedly factor out the powers of x to get the following evaluation:

a0+x(a1+x(a2+···x(an-1+xan)···))     (5.3)

Chapter 5.7, Problem 5.6PP, Practice Problem 5.6 (solution page 575) Let us continue exploring ways to evaluate polynomials, as

  Using Horner's method, we can implement polynomial evaluation using the following code:

  1. A.    For degree n, how many additions and how many multiplications does this code perform?
  2. B.     On our reference machine, with the arithmetic operations having the latencies shown in Figure 5.12, we measure the CPE for this function to be 8.00. Explain how this CPE arises based on the data dependencies formed between iterations due to the operations implementing line 7 of the function.
  3. C.     Explain how the function shown in Practice Problem 5.5 can run faster, even though it requires more operations.
Blurred answer
Students have asked these similar questions
Q1) Write a computer program that uses Newton's method to find the root of a given function, and apply this program to find the root of the following functions, using co as given. Stop the iteration when the error as estimated by n+1 - Enl is less than 10-6. Compare to your results for bisection. (a) f(x) = 1-2xe-/2, xo = 0; (b) f(x)=5-x-¹, x = ¹; (c) f(x)= x³ - 2x - 5, xo = 2; (d) f(x)=e-2, xo = 1; (e) f(x)=x-e, xo = 1; (f) f(x)=x-x-1, xo = 1; (g) f(x)=x²-sinx, xo =/; (h) f(x)= x³-2,0 = 1; (i) f(x) = x + tan x, zo = 3; (j) f(x)=2x-¹ In x, xo = 3.
ENGINEERING • COMPUTER-ENGINEERING 2 - calculate the first four iterations for the approximate value of the root of the function f(x) = x*log(x) - 1 using the method below: a) Bissection Method. Use as interval for the root the values [2,3].
(x² If h(x) X 2 , then 2

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
CPP Function Parameters | Returning Values from Functions | C++ Video Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=WqukJuBnLQU;License: Standard YouTube License, CC-BY