I'm trying to implement an algorithm for comparing sums of square roots, i.e. to find out whether one sum is greater than/equal to the other $$ \sum\limits_{i=1}^{m} \sqrt{x_i} \ge \sum\limits_{j=1}^{n} \sqrt{y_j} $$ where $m$ may be not equal to $n$.
The problem is that we can't in general calculate square root "exactly" and cumulative error (even with increased precision) causes problems downstream.
I have no problems for $m + n < 5$, because it can be solved using consecutive squaring, but it's not always the case.
So I want to know if there exists some sufficient condition which doesn't involve square roots or some iterative process that minimises them.
Knowing about Jensen's inequality and the fact that square root is concave we can show that
$$
\sqrt{m \sum\limits_{i=1}^{m} x_i} \ge \sum\limits_{i=1}^{m} \sqrt{x_i}
$$
also following this answer we have
$$
\sum\limits_{i=1}^{m} \sqrt{x_i} \ge \sqrt{\sum\limits_{i=1}^{m} x_i}
$$
hence something like
$$
m \sum\limits_{i=1}^{m} x_i \ge \sum\limits_{j=1}^{n} y_j
$$
is necessary condition for original inequality
and
$$
\sum\limits_{i=1}^{m} x_i \ge n \sum\limits_{j=1}^{n} y_j
$$
is sufficient one,
which is great because doesn't involve any square roots, but I hope this can be improved.
So I want to know if there are "more precise" ones. Ideally something like $$ \sum\limits_{i=1}^{m} x_i \ge \sum\limits_{j=1}^{n} y_j \implies \sum\limits_{i=1}^{m} \sqrt{x_i} \ge \sum\limits_{j=1}^{n} \sqrt{y_j} $$ will be awesome.