#NEWLINE# def dup_eval( f , a , K ) : #NEWLINE# #INDENT# '\n    Evaluate a polynomial at ``x = a`` in ``K[x]`` using Horner scheme.\n\n    Examples\n    ========\n\n    >>> from sympy.polys import ring, ZZ\n    >>> R, x = ring("x", ZZ)\n\n    >>> R.dup_eval(x**2 + 2*x + 3, 2)\n    11\n\n    ' #NEWLINE# if ( not a ) : #NEWLINE# #INDENT# return dup_TC ( f , K ) #NEWLINE# #UNINDENT# result = K . zero #NEWLINE# for c in f : #NEWLINE# #INDENT# result *= a #NEWLINE# result += c #NEWLINE# #UNINDENT# return result