def test_infinite_limits(self): # Test that large arguments converge to the hard-coded limits # at infinity. assert_allclose( sc.gammainc(1000, 100), sc.gammainc(cp.inf, 100), atol=1e-200, # Use `atol` since the function converges to 0. rtol=0, ) assert sc.gammainc(100, 1000) == sc.gammainc(100, cp.inf)
def test_roundtrip(self): a = cp.logspace(-5, 10, 100) x = cp.logspace(-5, 10, 100) y = sc.gammaincinv(a, sc.gammainc(a, x)) assert_allclose(x, y, rtol=1e-10)
def test_limit_check(self): result = sc.gammainc(1e-10, 1) limit = sc.gammainc(0, 1) assert cp.isclose(result, limit)
def test_x_zero(self): a = cp.arange(1, 10) assert_array_equal(sc.gammainc(a, 0), 0)
def test_infinite_arguments(self, a, x, desired): result = sc.gammainc(a, x) if cp.isnan(desired): assert cp.isnan(result) else: assert result == desired
def test_a_eq_0_x_gt_0(self): assert sc.gammainc(0, 1) == 1
def test_domain(self, a, x): assert cp.isnan(sc.gammainc(a, x))