You are on page 1of 2

Problem 3.

11
Use 5-digit arithmetic with chopping to determine the roots of the following equation with Eqs.
(3.12) and (3.13)

3.12

3.13
x2 5000.002x + 10
Compute percent relative errors for your results.
Answer
1 %Problem 3.11
2 %x2 5000.002x + 10
3
4 a = chop(1,5);
5 b = chop(-5000.002,5);
6 c = chop(10,5);
7
8 %Equation 3.12
9 x1 = chop((-b+sqrt(b^2-4*a*c))/(2*a), 5)
10 x2 = chop((-b-sqrt(b^2-4*a*c))/(2*a), 5)
11
12 %Equation 3.13
13 y1 = chop((-2*c)/(b+sqrt(b^2-4*a*c)), 5)
14 y2 = chop((-2*c)/(b-sqrt(b^2-4*a*c)), 5)
15
16 %Percent error
17 p_x1 = ((5000 - x1)/5000) * 100
18 p_x2 = ((.002 - x1)/.002) * 100
19 p_y1 = ((5000 - y1)/5000) * 100
20 p_y2 = ((.002 - y1)/.002) * 100
x1 = 5000
x2 = 0.0020
y1 = 5000
y2 = 0.0020
p_x1 = 0
p_x2 = -2.5000e+08
p_y1 = 0
p_y2 = -2.5000e+08

3.8 (a) Evaluate the polynomial y = x3 7x2 + 8x 0.35


PROBLEMS 77 at x = 1.37 . Use 3-digit arithmetic with chopping.
Evaluate the percent relative error.
(b) Repeat (a) but express y as y = ((x 7)x + 8)x 0.35
Evaluate the error and compare with part (a)

3.11 Use 5-digit arithmetic with chopping to determine


the roots of the following equation with
Eqs. (3.12) and (3.13) x2 5000.002x + 10 Compute percent
relative errors for your results.

You might also like