If we assume that a variable x
and y
can be represented in double precision without an error. Would it be better to writte x^2 - y^2
or just (x + y)(x-y)
?
I thought about this problem, and think that x^2 - y^2
should be more accurate, because of the irratonality of certain roots of numbers. (sqrt(numbers)
)
I really would appreciate your answer!!!