def test_gammainc_nan_c(): x1 = at.dscalar() x2 = at.dscalar() y = gammainc(x1, x2) test_func = CLinker().accept(FunctionGraph([x1, x2], [y])).make_function() assert np.isnan(test_func(-1, 1)) assert np.isnan(test_func(1, -1)) assert np.isnan(test_func(-1, -1))
def test_gammainc_python(): x1 = at.dscalar() x2 = at.dscalar() y = gammainc(x1, x2) test_func = function([x1, x2], y, mode=Mode("py")) assert np.isclose(test_func(1, 2), sp.gammainc(1, 2))