Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the figure below. It plots the function y = log(1 + x)/x computed in two different ways. Mathematically, y is a smooth function of

image text in transcribed
Consider the figure below. It plots the function y = log(1 + x)/x computed in two different ways. Mathematically, y is a smooth function of x near x = 0, equaling 1 at 0. But if we compute y using this formula, we get the plots on the left (shown in the ranges x belongsto [-1, 1] on the top left and x belongsto [-10^-15, 10^-15] on the bottom left). This formula is clearly unstable near x = 0. On the other hand, if we use the algorithm d = 1 + x if d = 1 then y = 1 else y = log (d)/(d - 1) end if we get the two plots on the right, which are correct near x = 0. Explain this phenomenon, proving that the second algorithm must compute an accurate answer in floating point arithmetic. Assume that the log function returns an accurate answer for any argument. (This is true of any reasonable implementation of logarithm.) Assume IEEE floating point arithmetic if that makes your argument easier. (Both algorithms can malfunction on a Cray machine.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro SQL Server Wait Statistics

Authors: Enrico Van De Laar

1st Edition

1484211391, 9781484211397

More Books

Students also viewed these Databases questions

Question

Did the groups function as a team?

Answered: 1 week ago