def dup_eval(f, a, K):
    if not a:
        return dup_TC(f, K)

    result = K.zero

    for c in f:
        result *= a
        result += c

    return result
Evaluate a polynomial at ``x = a`` in ``K[x]`` using Horner scheme.
dataset/ETHPy150Open sympy/sympy/sympy/polys/densetools.py/dup_eval