4 ms·
The notion of "by itself" is dubious in this context at best. You can only check up to finite precision that two numbers are equal. For something more, you need
by reikonomusha 7y ago
The notion of "by itself" is dubious in this context at best. You can only check up to finite precision that two numbers are equal. For something more, you need computer algebra, which is a tall order.
Even if you have computer algebra, math says it's not possible to check that arbitrary expressions are equal. It's an undecidable problem. So with that, I don't fault a computable reals package not being able to detect that x == y in an expression x/y.
- gjm11 7y agoYou can imagine an infinite-precision-real package that checks whether numerator and denominator are the exact same object and optimizes that case away. (And I wonder idly from time to time about making one that does know a bit about some particularly nice classes of number -- e.g., algebraic numbers -- and does all the things you'd like it to as long as you stay within such a class. Obviously as soon as you ask it for sqrt(2)+pi all that would go out the window.)