Canonical binary evaluation of a fixed natural polynomial — definitions #
A fixed polynomial is compiled into finitely many Horner layers. Each layer multiplies the current accumulator by the preserved input, adds one hardwired coefficient, clears the old accumulator, and swaps the two accumulator roles. The initial orientation is chosen from coefficient-list parity so the designated result tape holds the final value and the other accumulator is zero.
The five tape roles used by binary polynomial evaluation are pairwise distinct.
Instances For
Coefficients of p, highest degree first.
Equations
- Complexity.TM.binaryPolynomialCoeffs p = (List.map p.coeff (List.range (p.natDegree + 1))).reverse
Instances For
Horner evaluation of a highest-degree-first coefficient list.
Equations
- Complexity.TM.binaryHornerFold x [] x✝ = x✝
- Complexity.TM.binaryHornerFold x (coeff :: coeffs) x✝ = Complexity.TM.binaryHornerFold x coeffs (x✝ * x + coeff)
Instances For
One Horner layer: target := source * input + coeff, followed by clearing
source to canonical zero.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Compile a coefficient list into finitely many alternating Horner layers.
Equations
- One or more equations did not get rendered due to their size.
- Complexity.TM.binaryHornerLayersTM inputIdx sourceIdx targetIdx mulCounterIdx addCounterIdx [] = Complexity.TM.binaryAddConstTM sourceIdx 0
Instances For
Evaluate a fixed natural polynomial. Parity chooses which zero accumulator is the initial source so the designated result is final.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Runtime of one Horner layer.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Runtime of fixed-polynomial evaluation.
Equations
- Complexity.TM.binaryPolynomialTime p inputValue = Complexity.TM.binaryHornerLayersTime inputValue (Complexity.TM.binaryPolynomialCoeffs p) 0
Instances For
Local all-prefix space bound for one Horner layer.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Polynomial cap dominating every Horner prefix value.
Equations
- Complexity.TM.binaryPolynomialValueCap p inputValue = ((Complexity.TM.binaryPolynomialCoeffs p).sum + 1) * (inputValue + 1) ^ (Complexity.TM.binaryPolynomialCoeffs p).length
Instances For
A natural polynomial whose value is exactly twice the Horner-prefix cap
used by binaryPolynomialSpace.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Public width-based all-prefix space bound for polynomial evaluation.
Equations
- Complexity.TM.binaryPolynomialSpace initialSpace p inputValue = initialSpace + 10 * (2 * Complexity.TM.binaryPolynomialValueCap p inputValue).size + 17