Horner's rule for polynomial evaluation: Difference between revisions

Content deleted Content added
Trizen (talk | contribs)
m Added the Sidef language
Line 1,150:
}
printsay horner( [=>](-19, 7, -4, 6 ), 3 );</lang>
 
An other possibility would consist in creating a list of functions and chain them with a composition operator.
Line 1,177:
 
# compute progressive approximations of exp(2)
my @c := lazy 1 X/ flat 1, [\*] 1 ... *;
 
say .(0) for horner( @c, 2 );</lang>
</lang>
 
{{out}}