Transform abs(x)^n => x^n if x is real and n is even.