(func, z)
return res
Recognise polynomial cases. Returns None if not such a case.
        Requires order to be fully reduced.
Recognise polynomial cases. Returns None if not such a case.
        Requires order to be fully reduced.
Recognise polynomial cases . Returns None if not such a case . Requires order to be fully reduced .
def try_polynomial(func, z):
    """ Recognise polynomial cases. Returns None if not such a case.
        Requires order to be fully reduced. """
    abuckets, bbuckets = sift(func.ap, _mod1), sift(func.bq, _mod1)
    a0 = abuckets[S(0)]
    b0 = bbuckets[S(0)]
    a0.sort()
    b0.sort()
    al0 = [x for x in a0 if x <= 0]
    bl0 = [x for x in b0 if x <= 0]

    if bl0:
        return oo
    if not al0:
        return None

    a = al0[-1]
    fac = 1
    res = S(1)
    for n in Tuple(*list(range(-a))):
        fac *= z
        fac /= n + 1
        for a in func.ap:
            fac *= a + n
        for b in func.bq:
            fac /= b + n
        res += fac
    return res
def try_polynomial ( func , z ) : abuckets , bbuckets = sift ( func . ap , _mod1 ) , sift ( func . bq , _mod1 ) a0 = abuckets [ S ( 0 ) ] b0 = bbuckets [ S ( 0 ) ] a0 . sort ( ) b0 . sort ( ) al0 = [ x for x in a0 if x <= 0 ] bl0 = [ x for x in b0 if x <= 0 ] if bl0 : return oo if not al0 : return None a = al0 [ - 1 ] fac = 1 res = S ( 1 ) for n in Tuple ( * list ( range ( - a ) ) ) : fac *= z fac /= n + 1 for a in func . ap : fac *= a + n for b in func . bq : fac /= b + n res += fac return res