@classmethod
    def eval(cls, arg):
        # TODO: extend this to complex numbers?

        if arg.is_Number:
            if not arg.is_Integer:
                raise ValueError("argument must be nonnegative integer or negative odd integer")

            # This implementation is faster than the recursive one
            # It also avoids "maximum recursion depth exceeded" runtime error
            if arg.is_nonnegative:
                if arg.is_even:
                    k = arg / 2
                    return 2 ** k * factorial(k)
                return factorial2(arg - 1) / factorial(arg)


            if arg.is_odd:
                return arg * (S.NegativeOne) ** ((1 - arg) / 2) / factorial2(-arg)
            raise ValueError("argument must be nonnegative integer or negative odd integer")
dataset/ETHPy150Open sympy/sympy/sympy/functions/combinatorial/factorials.py/factorial2.eval/swapped operands of `/`