To add a/b + c/d, put both over a common denominator, then reduce:
numerator = a × d + c × b
denominator = b × d
g = gcd(numerator, denominator)
answer = (numerator / g) / (denominator / g)
Using lcm(b, d) as the denominator keeps the intermediate numbers smaller. Either way, the final GCD division guarantees the lowest terms.