Documentation fixes in MathTools

Documentation was improved for various functions
This should not affect compiled code, but apologies if it did, as I used the GitHub web interface