Canonical binary evaluation of a fixed natural polynomial #
This module exposes a finite Horner program compiled from a fixed polynomial. It preserves the input, writes the polynomial value to the designated result tape in canonical binary, and restores the scratch accumulator and both counters to canonical zero. Its all-prefix space bound depends on value width, not runtime, and is logarithmic in the input value for every fixed polynomial.
Main results #
binaryHornerFold_polyCoeffsidentifies the compiled Horner coefficients.binaryPolynomialEvalTM_hoareTime_framegives the endpoint and time bound.binaryPolynomialEvalTM_hoareTimeSpace_framebounds every execution prefix.binaryPolynomialSpace_bigOproves the fixed-polynomial logarithmic bound.binaryPolynomialEvalTM_isTransducerproves append-only-output safety.
A fixed polynomial contributes exactly one coefficient for each degree through its natural degree, including explicit zero coefficients.
The compiled coefficient list is never empty, including for the zero polynomial.
Horner evaluation leaves an accumulator unchanged at the empty list.
One Horner step multiplies the accumulator by the input and adds the next coefficient.
The high-degree-first coefficient list computes the polynomial's ordinary evaluation when Horner evaluation starts from zero.
Ordinary polynomial evaluation is bounded by the explicit cap used for every intermediate value of the compiled Horner routine.
Evaluating a fixed polynomial changes only the result tape. The input is preserved literally, and the scratch accumulator and both internal counters are restored to their initial canonical-zero tapes.
Every prefix of fixed-polynomial evaluation respects a common bound based on the width of a polynomial cap for all Horner intermediate values.
For every fixed polynomial and initial-space allowance, the public all-prefix space bound is logarithmic in the numeric input.
Evaluation of the explicit width polynomial is exactly twice the Horner-prefix value cap.
Fixed-polynomial evaluation never moves its output head left.