Question: Problem 1 (2 pts): Consider a computer that uses five-decimal-digit numbers. Let fl(x) denote the floating-point machine number closest to x. Let x = 0.5321487513,
Problem 1 (2 pts): Consider a computer that uses five-decimal-digit numbers. Let fl(x) denote the floating-point machine number closest to x. Let x = 0.5321487513, y = 0.5321304421, and z = 0.532148713 105 .
(a): What are the values fl(x), fl(y), and fl(z)?
(b): What is the relative error between x y and fl(x) fl(y)?
(c): What is the relative error between x z and fl(x) fl(z)?
(d): What is the reason for such different errors in (b) and (c)?
Problem 2 (3 pts): If f(x) = (2x+1)/( 1x^2) (1/1+x) is computed in fl-arithmetic by the formula (2.0 x + 1.0)/(1.0 x x) 1.0/(1.0 + x) then there will be a loss of precision for x close to zero. Explain why. Propose an algorithm for computing f(x) that will produce small relative error for x close to zero.
Problem 3 (3 pts): Among the following three algorithms, which is the best and which is the worst for evaluating f(x) = tan(x) sin(x) for x 0? Briefly explain. (a) (1/ cos(x) 1) sin(x), (b) (x^3)/2, (c) *tan(x) sin2 (x))/(cos(x) + 1).
Problem 4 (3 pts): Propose an algorithm for computing the following expression that avoids the loss of precision: f(x) = sqrt( 1/(1 x)) sqrt( 1/cos(x)) for x 0. COMPUTER PROJECT Solutions to the following problems should consist of program codes, computed results, and short write-ups. In the write-up, discuss the results you have obtained and explain them from the numerical point of view. Use SINGLE PRECISION ONLY. Insert COMMENTS in your programs.
PROBLEM 5 (2 pt.): Using a technique explained in the class, calculate the number of mantissa digits and the unit round-off on the machine that you will use for this course. You need to know the number for analyzing errors in this and other home-works and, therefore, I will not be checking your computer projects until you show me a correct solution to this problem.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
