Add tests extracted from SciPy bug report. Fixes https://github.com/boostorg/math/issues/1006. See also https://github.com/boostorg/math/pull/1009.