The construction of a rational function that is nonnegative on two intervals of which one is infinite is considered. It is assumed that the maximum deviation of the function from zero on the infinite interval takes the minimum possible value under the condition that the values of the function on the finite interval are within the given bounds. It is assumed that the rational function (fraction) has the complete alternance. In this case, the original problem is reduced to solving a system of nonlinear equations. For solving this system, a two-stage method is proposed. At the first stage, a subsystem is selected and used to find a good approximation for the complete system. At the second stage, the complete system of nonlinear equations is solved. The solution is explained in detail for the case when the order of the fraction is between one and four. Numerical results for a fraction of order ten are presented.