You can use the log and exp from numpy, without importing them from math.