MATH-1021
Reordering can prevent some overflow occurrences (fix suggested by
Brian Bloniarz).
Added unit test.


git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1512546 13f79535-47bb-0310-9956-ffa450edef68