Simplification of expressions with exponents