fix: math errors and optimization
fix: math errors and optimization

Fixed the pow functions for negative integer exponents and optimized the
factorial functions (removed 1 unused iteration)

lnsp/tmath,mooxmirror/tmath