maybe use numpy and jit. or cython
maybe use numpy and jit. or cython