How to resolve the algorithm Horner's rule for polynomial evaluation step by step in the Aime programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm Horner's rule for polynomial evaluation step by step in the Aime programming language

Table of Contents

Problem Statement

A fast scheme for evaluating a polynomial such as: when is to arrange the computation as follows: And compute the result from the innermost brackets outwards as in this pseudocode: Task Description Cf. Formal power series

Let's start with the solution:

Step by Step solution about How to resolve the algorithm Horner's rule for polynomial evaluation step by step in the Aime programming language

Source code in the aime programming language

real
horner(list coeffs, real x)
{
    real c, z;

    z = 0;

    for (, c of coeffs) {
        z *= x;
        z += c;
    }

    z;
}


integer
main(void)
{
    o_(horner(list(-19r, 7.0, -4r, 6r), 3), "\n");

    0;
}

  

You may also check:How to resolve the algorithm Nim game step by step in the Clojure programming language
You may also check:How to resolve the algorithm Strip whitespace from a string/Top and tail step by step in the NewLISP programming language
You may also check:How to resolve the algorithm Substring/Top and tail step by step in the Raven programming language
You may also check:How to resolve the algorithm Partition function P step by step in the C programming language
You may also check:How to resolve the algorithm One-dimensional cellular automata step by step in the Common Lisp programming language