Assuming that $f, g, x_i, y_i$ are required to be real, this uniquely determines $f$ and $g$, so I wonder if you’re just asking how to divide complex numbers:
$$\frac{x_1 + iy_1}{x_2+iy_2} = \frac{x_1 + iy_1}{x_2+iy_2} \frac{x_2- iy_2}{x_2-iy_2} = \frac{x_1 x_2 + y_1 y_2}{x_2^2 + y_2^2} + i \frac{x_2 y_1 - x_1 y_2}{x_2^2 + y_2^2}.$$
It is certainly possible, though unnecessary, to derive this by solving a small system of linear equations: is that what you meant by implicit?
Edit: I see from your question on Code Review that you are interested in integer division. In that case as Brian Moehring comments above, you just round nearest on the fractional values of $f$ and $g$ (note that the remainder is not guaranteed to have positive components like in the integer case). I suspect you are using /
to mean division with rounding which is a confusing way to phrase a math question :). I would use something that doesn’t look like exact
division, such as DIV
.