Given the equation ax2 + bx + c = 0. If b^2 4ac > 0, then
Question:
Given the equation ax2 + bx + c = 0. If b^2 − 4ac > 0, then its roots can be calculated with the use of the following two different types :
(I) ξ± = (−b ±√(b^2 − 4ac))/2a
(II) ξ+ =−2c / (b + √(b^2 − 4ac)), ξ− = c / aξ+
Application: Given a = 1.000, b = 76.30, c = −1.710.
( Exact values (to 10 significant digits) : ξ+ = 0.02240495436, ξ− = −76.32240495).
Calculate using floating point arithmetic with 4 significant figures and rounding the roots of the equation applying formulas (I) and (II). For each type to estimate, vs approach .
a. The absolute error of the calculated values ξ+ and ξ− of the roots.
b.The absolute relative error of the calculated values ξ+ and ξ− of the roots.
c. What conclusions do you draw about the accuracy of the results in a) and b); Compare as to the accuracy of the two types. Comment on your conclusions.
Introduction to Java Programming, Comprehensive Version
ISBN: 978-0133761313
10th Edition
Authors: Y. Daniel Liang