Binary-digit coefficients and natural Horner evaluation in polynomial time #
The binary digits of a binary natural can be returned as a framed list of natural coefficients.
Conversely, evaluating a list of arbitrary binary natural coefficients at 2 is polynomial-time:
Horner's step adds at most the coefficient's bit length plus three to the accumulator's length.
These certificates use the ordinary multitape polynomial-time predicate.
Main results #
Turing.MultiTapeTM.ComputableInPolyTime.binary_digitCoeffs: binary-digit coefficients.Turing.MultiTapeTM.ComputableInPolyTime.evalCoeffList_two: Horner evaluation at2.
Return the binary digits of a binary natural as natural coefficients.
Evaluate a list of binary natural coefficients at 2 by Horner's rule.