#NEWLINE# def dmp_eval( f , a , u , K ) : #NEWLINE# #INDENT# '\n    Evaluate a polynomial at ``x_0 = a`` in ``K[X]`` using the Horner scheme.\n\n    Examples\n    ========\n\n    >>> from sympy.polys import ring, ZZ\n    >>> R, x,y = ring("x,y", ZZ)\n\n    >>> R.dmp_eval(2*x*y + 3*x + y + 2, 2)\n    5*y + 8\n\n    ' #NEWLINE# if ( not u ) : #NEWLINE# #INDENT# return dup_eval ( f , a , K ) #NEWLINE# #UNINDENT# if ( not a ) : #NEWLINE# #INDENT# return dmp_TC ( f , K ) #NEWLINE# #UNINDENT# ( result , v ) = ( dmp_LC ( f , K ) , ( u - 1 ) ) #NEWLINE# for coeff in f [ 1 : ] : #NEWLINE# #INDENT# result = dmp_mul_ground ( result , a , v , K ) #NEWLINE# result = dmp_add ( result , coeff , v , K ) #NEWLINE# #UNINDENT# return result