continued fraction simplification tricks