The routines in numpy are probably faster and have better numerical behaviour than the routines in math. Find all the stuff you use in math and use the numpy version instead. As an addendum, also use exp(x) rather than e**x, as this can be more accurate and better behaved since e will only be known to finite precision, while an exponentiation function can calculate accurately without relying on a finite version of e.
The routines in
numpy
are probably faster and have better numerical behaviour than the routines inmath
. Find all the stuff you use inmath
and use thenumpy
version instead. As an addendum, also useexp(x)
rather thane**x
, as this can be more accurate and better behaved sincee
will only be known to finite precision, while an exponentiation function can calculate accurately without relying on a finite version ofe
.