Jump to content

Draft:Knuth–Eve algorithm

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Ammrat13 (talk | contribs) at 02:15, 26 July 2025 (Use "we"). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The Knuth-Eve algorithm is an algorithm for polynomial evaluation. Specifically, it can evaluate an arbitrary polynomial with real coefficients of one real variable. It preprocesses the coefficients of the polynomial to reduce the number of multiplications required at runtime.

The key ideas used in this algorithm were originally proposed by Donald Knuth. His procedure opportunistically exploits structure in the polynomial being evaluated[1] Eve determined for which polynomials this structure exists, and they gave a simple method of preconditioning polynomials to endow them with that structure.[2]

Algorithm

Preliminaries

Consider an arbitrary polynomial of degree . Assume that . Define such that: if is odd then , and if is even then .

Again, the goal is to create an algorithm that returns given any . The algorithm is allowed to depend on the polynomial itself. And ideally, it would use as few operations — as few additions and multiplications — as possible.

Overview

Using polynomial long division, we can write

where, is the divisor. Picking a value for fixes both the quotient and the coefficients in the remainder and . Then, the key idea is to cleverly choose such that , so that

Finally, we apply this procedure recursively to , expressing

After recursive calls, the quotient is either a linear or a quadratic polynomial. In that base case, it can be evaluated with (say) Horner's method.

Preprocessing

Runtime

Notes

  1. ^ Knuth, Donald (December 1962). "Evaluation of polynomials by computer". Communications of the ACM. 5 (12): 595–599. doi:10.1145/355580.369074. Retrieved 25 July 2025.
  2. ^ Eve, J. (December 1964). "The evaluation of polynomials". Numerische Mathematik. 6 (1): 17–21. doi:10.1007/BF01386049. Retrieved 25 July 2025.

References