Improved exponentation folding.