improve numerical stability of inverse test