Horner's rule for polynomial evaluation: Difference between revisions

(→‎{{header|Kotlin}}: Updated example see https://github.com/dkandalov/rosettacode-kotlin for details)
Line 443:
(poly 3 P) → 128
</lang>
=={{header|Elena}}==
{{trans|C#}}
ELENA 3.2 :
<lang elena>import extensions.
import system'routines.
 
horner = (:coefficients:variable)
[
^ coefficients clone; sequenceReverse; accumulate(Real new) with(:accumulator:coefficient)(accumulator * variable + coefficient)
].
 
program =
[
console printLine(horner eval((-19.0r, 7.0r, -4.0r, 6.0r), 3.0r)).
].</lang>
{{out}}
<pre>
128.0
</pre>
 
=={{header|Elixir}}==
Anonymous user