Rewrite an expression in a more efficient equivalent form.