devxlogo

Evaluate Polynomials Faster

Evaluate Polynomials Faster

The well-known Horner schema lets you calculate polynomial expressions efficiently. To calculate:

 A*x^N + B*x^(N-1) + . + Y*x + Z ( ^ means power ), 

simply write this expression as

 (.((A*x + B)*x + C)*x + . +Y)*x + Z

devx-admin

Share the Post: