Question

Which of the two mathematically equivalent expressions, 2 -y2 and (+) (-y), can be evaluated Which of the two mathematically

0 0
Add a comment Improve this question Transcribed image text
Answer #1

(a) Which of the two mathematically equivalent expressions x2 − y2 and (x − y)(x + y)
can be evaluated more accurately in floating-point arithmetic? Why?


The squaring of a floating point number may lead to round off error, as the decimal part
in the result will have more digits. And of course, after that the subtraction will loose
some digits when handling extremely skewed floating point numbers. So, x2 - y2 may lead
to more rounding errors.
Where as, on the other hand, (x-y)(x+y) will relatively be preferred to the previous one.
Even though this operation is also having multiplication involved in it, the subtraction
before the multiplication will do less harm relatively.

For what values of x and y, relative to each other, is there a substantial difference in the accuracy of the two expressions?

Computing the exact difference or sum of two floating point numbers can be very expensive
when their exponents are substantially different. Therefore, when the exponents are
substantially high, the x, and y value will have substantial difference in their accuracy.


Add a comment
Know the answer?
Add Answer to:
Which of the two mathematically equivalent expressions, 2 -y2 and (+) (-y), can be evaluated Which of the two mathematically equivalent expressions, r2y and (r+y) (r-y), can be evaluated more accurat...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT