Polynomial-time dyadic floor #
The precision is represented by a unary ruler: its value is the ruler's
length. This is essential for an honest FP statement, since a dyadic output
with denominator 2^p has p + 1 denominator bits. The machine shifts the
absolute numerator by the ruler length, performs verified long division, and
implements Euclidean flooring explicitly for negative inputs.
Extracts the unary precision ruler from a dyadic-rounding request.
Equations
Instances For
Extracts the raw rational code from a dyadic-rounding request.
Equations
Instances For
Extracts the signed numerator code from the raw rational payload of a dyadic-rounding request.
Equations
Instances For
Extracts the denominator bits from the raw rational payload of a dyadic-rounding request.
Equations
Instances For
Reads the sign bit of the encoded numerator in a dyadic-rounding request.
Equations
Instances For
Computes the binary absolute value of the numerator in a dyadic-rounding request.
Equations
Instances For
Builds a zero-bit word whose length equals the requested unary precision.
Equations
Instances For
Divides the scaled numerator magnitude by the denominator and returns the encoded quotient-remainder pair.
Equations
Instances For
Extracts the binary quotient from scaled numerator division.
Equations
Instances For
Extracts the binary remainder from scaled numerator division.
Equations
Instances For
Adds one to the binary quotient from scaled numerator division.
Equations
Instances For
Encodes the denominator 2^p as p low-order zero bits followed by one.
Equations
Instances For
Unreduced dyadic-floor output, with denominator 2^p.
Equations
Instances For
Canonical public rational encoding of the dyadic floor.
Equations
Instances For
Computes the integer floor of the scaled raw rational using binary long division, increasing the negative magnitude when the remainder is nonzero.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Pairs the binary-computed floor of 2^p * q with the positive denominator 2^p.
Equations
- BeyondBethe.binaryRawDyadicFloor p q = { num := BeyondBethe.binaryRawDyadicFloorInt p q, den := 2 ^ p, den_pos := ⋯ }