Optimizing fast Python math with Numpy and Scipy