Say I have a reduced fraction where the numerator and denominator can only be integers:
$$ \frac{1071283}{28187739} $$
and I want to reduce it more, accepting the lose of precision.
I could just remove an equal numbers of integers from the right:
$$ \frac{107}{2818} $$
However playing around with it shows me that I can easily find a fraction that contains the same number of integers but has lost less precision compared to the original fraction:
$$ \frac{108}{2842} $$
How can I reduce a fraction of integers and lose the minimal amount of precision?
As suggested in comments, use the continued fraction decomposition. $$\frac{1071283}{28187739} = \frac{1}{26+\frac{1}{3+\frac{1}{4+\frac{1}{1+\frac{1}{9+ \frac{1}{1+\frac{1}{3+\frac{1}{1+\frac{1}{1+\frac{1}{1+ \frac{1}{1+\frac{1}{1+\frac{1}{1+\frac{1}{14+\frac{1}{2+ \frac{1}{3}}}}}}}}}}}}}}}}$$ Halting the decomposition sooner will give you a good approximation, among the fractions with denominators less than the one of the fraction.This gives the approximations $$\left(\frac{1}{26} , \frac{3}{79} , \frac{13}{342} , \frac{16}{421} , \frac{157}{4131} , \frac{173}{4552} , \frac{676}{17787} , \frac{849}{22339} , \frac{1525}{40126},...\right)$$ So for example, $$\frac{157}{4131} = \frac{1}{26+\frac{1}{3+\frac{1}{4+\frac{1}{1+\frac{1}{9}}}}}$$