Not so much time needed to google "sagemath Horner" in order to get an 
answer...

# 
http://doc.sagemath.org/html/en/reference/calculus/sage/calculus/wester.html
R = PolynomialRing(QQ,5,names='a')
S.<x> = PolynomialRing(R)
p = S(list(R.gens()))*x
print "p = ",p.substitute(a0=17,a1=3,a2=4,a3=6,a4=8)
restore('x')
#p(x)
f(x) = p.substitute(a0=17,a1=3,a2=4,a3=6,a4=8); print "f : ",f

working just now in the sagemath cloud :

p =  8*x^5 + 6*x^4 + 4*x^3 + 3*x^2 + 17*xf :  x |--> ((2*((4*x + 3)*x + 2)*x + 
3)*x + 17)*x

Dominique.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to