Algorithm for computing resilient fractions.