Question: problem 2 and problem 4 Thank you ! Problem 1 (2 pts): Consider a computer that uses 6-decimal-digit numbers for mantissa Let fl(2) denote the

problem 2 and problem 4 Thank you !
Problem 1 (2 pts): Consider a computer that uses 6-decimal-digit numbers for mantissa Let fl(2) denote the floating-point machine number closest to r. Let x = 0.4539720868 and y=0.4539711293. (a): What are the values fl(2) and fl(y)? (b): What is the relative error between 2-y and fl(2) - fl(y)? Problem 2 (3 pts): If f(1) = 34+2 - is computed in fl-arithmetic by the formula (3.0 +2 +1.0)/(1.0 2) - 1.0/1.0 *) then there will be a loss of precision for 2 close to zero. Explain why. Propose an algorithm for computing f(x) that will produce small relative error for 2 close to zero. Problem 3 (3 pts): Among the following two algorithms, which is the best for evaluating f(x) =tan(2) - sin(x) for 2 0? Briefly explain. (a) (1/cos(2) - 1) sin(x), (b) tan () sin(x)/(cos(x) +1). EXTRA Problem (3 pts): Propose an algorithm for computing the following expression that avoids the loss of precision: $(a) = VII, vention for 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 4 (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, we will not be checking your computer projects until you show us (grader or me) a correct solution to this problem. Problem 1 (2 pts): Consider a computer that uses 6-decimal-digit numbers for mantissa Let fl(2) denote the floating-point machine number closest to r. Let x = 0.4539720868 and y=0.4539711293. (a): What are the values fl(2) and fl(y)? (b): What is the relative error between 2-y and fl(2) - fl(y)? Problem 2 (3 pts): If f(1) = 34+2 - is computed in fl-arithmetic by the formula (3.0 +2 +1.0)/(1.0 2) - 1.0/1.0 *) then there will be a loss of precision for 2 close to zero. Explain why. Propose an algorithm for computing f(x) that will produce small relative error for 2 close to zero. Problem 3 (3 pts): Among the following two algorithms, which is the best for evaluating f(x) =tan(2) - sin(x) for 2 0? Briefly explain. (a) (1/cos(2) - 1) sin(x), (b) tan () sin(x)/(cos(x) +1). EXTRA Problem (3 pts): Propose an algorithm for computing the following expression that avoids the loss of precision: $(a) = VII, vention for 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 4 (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, we will not be checking your computer projects until you show us (grader or me) a correct solution to this
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
