continued fraction simplification