Question: ( 2 5 pts ) Consider the function f ( x ) = 1 - x 2 2 - 1 + x 2 2 We

(25pts) Consider the function
f(x)=1-x22-1+x22
We want to compute it accurately in the IEEE single precision standard (,t,emin,emax)=
(2,24,-126,128).
A) Rearrange f(x) in a manner so that it will be computed accurately for small x.
f(x)=-2x21-x22+1+x22
B) Give a good approximate value for f(10-7) computed by your algorithm. Briefly justify your
answer.
f(10-7)=-2(10-7)21-(10-7)22+1+(10-7)22=-210-141-10-142+1+10-142~~-10-14~~0
The single precision standard can hold 24 bits or less, so the relative error 10-14 becomes zero.
C) Argue why your algorithm can produce a better result than computing with the original
expression.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!