Jump to content

Horner's rule for polynomial evaluation: Difference between revisions

No edit summary
Line 531:
cat(horner(c(-19, 7, -4, 6), 3), "\n")</lang>
 
=={{header|RLaB}}==
 
RLaB implements horner's scheme for polynomial evaluation in its built-in function ''polyval''.
What is important is that RLaB stores the polynomials as row vectors starting from the highest
power.
 
This said, solution to the problem is
<lang RLaB>
>> x = [-19, 7, -4, 6]
</lang>
=={{header|Ruby}}==
<lang ruby>def horner(coeffs, x)
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.