y = a + bx where a and b are rational numbers.
I'm writing a program that uses equations which are of the same format as the equation above and I would like to find the most efficient way to get y and x.
A requirement for the solution is that both x and y are natural numbers.
I would start by multiplying by a natural number so as to clear the denominators of $a$ and $b$. Then you can use results on linear diophantine equations to solve the resulting equation (if any natural number solutions exist).
See for example https://brilliant.org/wiki/linear-diophantine-equations-one-equation/