Problem
Given positive square-free integers $r_i$ and non-zero integers $a_i$, is there an algorithm for determining the sign of $\sum_{i=1}^n a_i\sqrt{r_i}$ without calculating approximations for the square roots?
If $n=2$ it is easy and I hope it shows more clearly what I am asking:
Solution for $n=2$
If $a_1$ and $a_2$ have the same sign it is trivial.
Assume $a_1>0$, $a_2<0$ then the following statements are equivalent:
$a_i\sqrt{r_1} + a_2\sqrt{r_2} > 0$
$a_i\sqrt{r_1} > (-a_2)\sqrt{r_2}$
$(a_i\sqrt{r_1})^2 > ((-a_2)\sqrt{r_2})^2$ (because both rhs and lhs are positive)
$a_1^2 r_1 > a_2^2 r_2$
This last statement can be evaluated exactly using only integer operations. However if I have three or more roots on either side, the squaring step does increase the number of square roots.
Edit
The keyword field extiensions by @dtldarek led me to the related question How do extension fields implement $>, <$ comparisons?. Also the comment A field that is an ordered field in two distinct ways seems to indicate that the order is defined by embedding the field in $\mathbb{R}$ and using the order of $\mathbb{R}$. I am trying to define the same order using only operations inside the field, because the reals are more difficult (impossible?) to represent exactly in a computer program.