Generalized exponent folding.