It might be better to use something like ``np.allclose`` which allows for both relative and absolute tolerances.  Also, the threshold should be precision dependent but it is not obvious how to do this yet.