randFromArray([-1, 1]) randFromArray([-1, 1]) randFromArray(smallDenominators) randFromArray(smallDenominators) randRangeExclude(1, 9, [D1]) randRangeExclude(1, 9, [D2]) getLCM(D1, D2) LCM / D1 LCM / D2 getGCD(S1 * F1 * N1 + S2 * F2 * N2, LCM)

`fraction(S1 * N1, D1) + fraction(S2 * N2, D2) = {?}`

S1 * N1 / D1 + S2 * N2 / D2

`\qquad = - \blue{\dfrac{N1 \times F1}{D1 \times F1}} -+ \green{\dfrac{N2 \times F2}{D2 \times F2}}`

`\qquad = - \blue{\dfrac{N1 * F1}{LCM}} -+ \green{\dfrac{N2 * F2}{LCM}}`

`\qquad = \dfrac{ - \blue{N1 * F1} -+ \green{N2 * F2} }{LCM}`

`\qquad = fraction(S1 * F1 * N1 + S2 * F2 * N2, LCM)`

`\qquad = fractionReduce(S1 * F1 * N1 + S2 * F2 * N2, LCM)`