Simplify algebraic fractions