I have software which stores information about algebraic numbers with absolute precision. If you build it up by creating instances of a Python representation of an integer, float, Decimal, or string, a binary tree in which each node is either a leaf node containing an integer, or a node storing an arithmetical operation and two order-significant children, the two numbers included in the operation. For the purposes of this discussion, I am ignoring the case of representing computable numbers like π and e, and assuming that all algebraic numbers are a binary tree boiling down to integers and floats.
There are two major liabilities which boil down to one: I don't see how to always know when there is rounding error at a particular node on the binary tree, and I don't know, in terms of math, how to tell if two algebraic numbers are equal. I can pull what is the standard operating procedure for floats, which is to never look for equality, just confirm that their equality is "good enough for government work" by calculating decimal representations to some perhaps configurable number of decimal places. One can of course increase the precision in the hopes of finding a difference, but that technique will perhaps eventually find the most minute inequality, but never prove an absolute inequality rather than a "looks at least close enough" claim of equality. The sets of "greater than" and "less than" are both recursively enumerable, but unless you can pull a theory-based test for algebraic equality / comparison, equal numbers are not even recursively enumerable.
My program is implemented in Python, as an "executable pseudocode" implementation implemented more than anything else reference implementation than anything else. But my question is not really a Python question; it is a question about an area of math I know little about. My question is this:
Given two representations of algebraic numbers built up by arithmetic on integers (which happens to be a binary tree, but that is not my question): Are there any algorithms that can compare / test for equality?