Using a technique explained in the class calculate the


Answer the following Question :

Problem 1 : 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 × 10-5 .

(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 : If f(x) = (2x+1)/( 1-x2) - (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 : 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) (x3)/2, (c) *tan(x) sin2 (x))/(cos(x) + 1).

Problem 4 : 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 : 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.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Using a technique explained in the class calculate the
Reference No:- TGS02897326

Expected delivery within 24 Hours