@classmethod
    def eval(cls, x, k):
        x = sympify(x)
        k = sympify(k)

        if x is S.NaN or k is S.NaN:
            return S.NaN
        elif k.is_integer and x == k:
            return factorial(x)
        elif k.is_Integer:
            if k is S.Zero:
                return S.One
            else:
                if k.is_positive:
                    if x is S.Infinity:
                        return S.Infinity
                    elif x is S.NegativeInfinity:
                        if k.is_odd:
                            return S.NegativeInfinity
                        else:
                            return S.Infinity
                    else:
                        try:
                            F, opt = poly_from_expr(x)
                        except PolificationFailed:
                            return reduce(lambda r, i: r*(x - i),
                                          range(0, int(k)), 1)
                        if len(opt.gens) > 1 or F.degree() <= 1:
                            return reduce(lambda r, i: r*(x - i),
                                          range(0, int(k)), 1)
                        else:
                            v = opt.gens[0]
                            return reduce(lambda r, i:
                                          r*(F.subs(v, v - i).expand()),
                                          range(0, int(k)), 1)
                else:
                    if x is S.Infinity:
                        return S.Infinity
                    elif x is S.NegativeInfinity:
                        return S.Infinity
                    else:
                        try:
                            F, opt = poly_from_expr(x)
                        except PolificationFailed:
                            return 1/reduce(lambda r, i: r*(x + i),
                                            range(1, abs(int(k)) + 1), 1)
                        if len(opt.gens) > 1 or F.degree() <= 1:
                            return 1/reduce(lambda r, i: r*(x + i),
                                            range(1, abs(int(k)) + 1), 1)
                        else:
                            v = opt.gens[0]
                            return 1/reduce(lambda r, i:
                                            r*(F.subs(v, v + i).expand()),
                                            range(1, abs(int(k)) + 1), 1)
dataset/ETHPy150Open sympy/sympy/sympy/functions/combinatorial/factorials.py/FallingFactorial.eval/original