Let $a, b, c, d$ be natural numbers. Suppose we want to find the sum $\frac{p}{q}$ of the fractions $\frac{a}{b}$ and $\frac{c}{d}$ in lowest terms, that is, $p$ and $q$ are relatively prime. Suppose we try doing this using one of the following two basic methods.
Method 1.
- Calculate $p:=ad+bc$ and $q:=bd$.
- Return $\frac{p}{q}$.
Method 2.
- Find $q:=$ the lowest common multiple of $b$ and $d$.
- Calculate $r_b:=q/b$ and $r_d:=q/d$.
- Calculate $p:=ar_b+cr_d$.
- Return $\frac{p}{q}$.
Question: For either method, is it possible to characterise the sets of values of $a, b, c, d$ (in terms of $a, b, c, d$ only and not e.g. in terms of their prime factorisations) for which the respective method will return relatively prime $p, q$?
The question is not motivated by anything in particular, just a curiosity that strikes me as potentially non-trivial.