Generally such comparisons can be done efficiently via continued fractions, e.g.
$$\rm\displaystyle a = \frac{847}{383}\ =\ 2 + \cfrac{1}{4 + \cfrac{1}{1 + \cdots}}\ \ \Rightarrow\ \ 2+\frac{1}{4+1} < a < 2+\frac{1}4$$
$$\rm\displaystyle b = \frac{536}{254}\ =\ 2 + \cfrac{1}{9 + \cdots}\ \ \Rightarrow\ \ 2 < b < 2 + \frac{1}9 < 2+\frac{1}5 < a$$
The comparison of the continued fraction coefficients can be done in parallel with the computation of the continued fraction. Namely, compare the integer parts. If they are unequal then that will determine the inequality. Otherwise, recurse on the (inverses of) the fractional parts (and note that inversion reverses the inequality). For the above example this yields:
$$\rm\displaystyle\ \frac{847}{383} > \frac{536}{254}\ \iff\ \frac{81}{383}>\frac{28}{254}\ \iff\ \frac{254}{28}>\frac{383}{81}\ \Leftarrow\ \ 9 > 4$$
In words: to test if $\rm\:847/383 > 536/254\: $ we first compare their integer parts (floor). They both have integer part $\:2\:$ so we subtract $\:2\:$ from both and reduce to comparing their fractional parts $\rm\ 81/383,\ \ 28/254\:.$ To do this we invert them and recurse. But since inversion reverses inequalities $\rm\ x < y\ \iff\ 1/y < 1/x\ $ (for $\rm\:xy>0\:$), the equivalent inequality to test is if $\rm\ 254/28 > 383/81\:.\ $ Comparing their integer parts $\rm\:m,\:n\:$ we see since $\rm\ m > 5 > n\:$ so the inequality is true. This leads to the following simple algorithm that essentially compares any two real numbers via the lex order of their continued fraction coefficients (note: it will not terminate if given two equal reals with infinite continued fraction).
$\rm compare\_reals\:(A,\: B)\ := \qquad\qquad\qquad\quad\ \ \color{blue}{\ // \ computes\ \ sgn(A - B) }$
$\rm\quad\ let\ [\ n_1\leftarrow \lfloor A\rfloor\:;\ \ \ n_2\leftarrow \lfloor B\rfloor\ ] \ \qquad\qquad\quad \color{blue}{\ //\ compare\ integer\ parts}$
$\rm\quad\quad if\ \ n_1 \ne n_2\ \ then\ \ return\ \ sgn(n_1 - n_2)\:;$
$\rm\quad\quad let\ [\ a \leftarrow A - n_1\:;\ \ \ b \leftarrow B - n_2\ ] \quad\quad\quad \color{blue}{//\ compute\ fractional\ parts\ \ a,\: b }$
$\rm\quad\quad\quad if\ \ a\:b=0\ \ then\ \ return\ \ sgn(a-b)\:;$
$\rm\quad\quad\quad compare\_reals(b^{-1}\:, a^{-1})\:;\qquad\qquad \color{blue}{\ //\ \text{recurse on inverses of fractional parts}}$
Equivalently one can employ Farey fractions and mediants. Generally such approaches will be quite efficient due to the best approximations properties of the algorithm. For a nice example see my post here using continued fractions to solve the old chestnut of comparing $\ 7^\sqrt 8\ $ to $\ 8^\sqrt 7\ $ and see also this thread where some folks struggled to prove this by calculus.
This is a bit long for a comment, so I'll start turning it into an answer, though there may well be more to say e.g. about the meaning of the iterates.
I find it slightly easier to think about the corresponding algorithm for comparing products without multiplication; as discussed in the comments, this is directly analogous. Let's see how this plays out in an example (assuming that none of the intermediate steps yield a successful comparison):
$$
\begin{eqnarray}
54a&\lessgtr&21b\\
33a&\lessgtr&21(b-a)\\
12a&\lessgtr&21(b-2a)\\
12(3a-b)&\lessgtr&9(b-2a)\\
3(3a-b)&\lessgtr&9(2b-5a)\\
3(8a-3b)&\lessgtr&6(2b-5a)\\
3(13a-5b)&\lessgtr&3(2b-5a)\\
\end{eqnarray}$$
The algorithm ends with $\gcd(54,21)=3$ and a direct comparison of the numbers $13a-5b$ and $2b-5a$, which is the same as comparing $18a$ and $7b$, the original comparison reduced by the gcd.
The efficiency of the Euclidean algorithm is usually analyzed counting each quotient and remainder computation as one step; in that case the worst case is two consecutive Fibonacci numbers, so the algorithm takes about $\log n/\log\phi$ steps. However, if you perform individual subtractions instead, this may take linear time, the worst case in this scenario being if one of the exponents is $1$ and you're merely very inefficiently multiplying out the power on the other side one factor at a time. At first I thought your algorithm might be an efficient way to organize exponentiation by squaring, but that example shows that it's more somewhat complementary to that. Indeed you could combine the two and make the complexity logarithmic by doing the intermediate steps using repeated squaring.
Two more comments: The bases never influence the control flow, except by ending it; the sequence of computations is entirely determined by the Euclidean algorithm being applied to the exponents. And if you're looking for precision and trying to compare numbers close to each other, I don't think you're gaining much other than reducing by the gcd, since you're explicitly calculating ratios of high powers of the bases, whose quotient is (the gcd-th root of) the quotient of the numbers being compared.
Best Answer
If $a\gt b\gt e , b^a\gt a^b$. To see this, take logs. You want to compare $a \ln b$ with $b \ln a$. $\ln$ rises slowly, so the larger multiplier wins.