Replaced commons-math3 with uncommons-maths library. Resolves #1871

Found a replacement for commons-math3. It has no dependencies and very small size (47KB).