move perfect powers removal to _eval_expand_log