(adsbygoogle = window.adsbygoogle || []).push({}); 1. The problem statement, all variables and given/known data

You have a number system in base 10 with a precision of 5 digits. Which function is more accurate: x^2-y^2 or (x-y)(x+y)?

2. Relevant equations

None really.

3. The attempt at a solution

My intuition would tell me that (x-y)(x+y) is more accurate, since multiplication is less accurate than addition or subtraction (unless the two numbers are very close). But look at x = 1.0000, y = 0.00001:

Actual value: 0.999999999

x^2 = 1, y^2 = 1e-10 ~ 0

x^2-y^2=1

x-y = 0.99999

x+y = 1.00001 ~ 1

(x-y)(x+y) = 0.99999

So x^2-y^2 is more accurate, at least in this situation. I have no idea why, though.

**Physics Forums | Science Articles, Homework Help, Discussion**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Homework Help: Which function is more accurate?

**Physics Forums | Science Articles, Homework Help, Discussion**