Polynomial-time directed rational logarithm #
This file assembles the exact odd-series loop into the full dyadically range-reduced lower and upper logarithms. The precision is supplied as a unary ruler. Leading binary positions are read from word lengths, powers of two are constructed directly as bitstrings, and all rational arithmetic is performed by the verified unreduced-rational machines.
The binary encoding of the raw-rational constant two.
Instances For
Extracts the unary series-length ruler from a directed-logarithm input.
Equations
Instances For
Extracts the encoded raw-rational argument of the directed logarithm.
Equations
Instances For
Doubles the truncated series sum to produce the unit-logarithm lower approximation.
Equations
Instances For
Builds a unary ruler of length 2 * N + 1 from the series-length ruler.
Equations
Instances For
Dyadic range reduction #
Extracts the absolute numerator bits of the encoded logarithm argument.
Equations
Instances For
Extracts the denominator bits of the encoded logarithm argument.
Equations
Instances For
Drops one numerator bit to form the ruler for its binary logarithmic scale.
Equations
Instances For
Drops one denominator bit to form the ruler for its binary logarithmic scale.
Equations
Instances For
Encodes the length of the numerator's logarithmic ruler in binary.
Equations
Instances For
Encodes the length of the denominator's logarithmic ruler in binary.
Equations
Instances For
Encodes 2^ruler.length as a binary natural number.
Equations
Instances For
Tests whether the scaled residual is at least one.
Equations
Instances For
Builds a logarithm-series query for two with the original series-length ruler.
Equations
Instances For
Builds a logarithm-series query for the chosen unit residual with the original ruler.
Equations
Instances For
Encodes the signed binary scaling exponent as a raw rational with denominator one.
Equations
Instances For
Normalizes the raw lower logarithm approximation into canonical rational encoding.
Equations
Instances For
Normalizes the raw upper logarithm approximation into canonical rational encoding.
Equations
Instances For
Exact unit-interval semantics #
The raw-rational series parameter (y - 1) / (y + 1) for logarithm evaluation.
Equations
Instances For
Twice the truncated logarithmic series at the transformed argument.
Equations
- y.logUnitLower N = (BeyondBethe.RawRat.ofNat 2).mul (y.logUnitParameter.logSeriesSum N)
Instances For
The raw-rational geometric tail expression 2 * x^(2*N+1) / (1 - x^2) for the transformed
argument.
Equations
- y.logSeriesError N = (BeyondBethe.RawRat.ofNat 2).mul ((y.logUnitParameter.pow (2 * N + 1)).div (BeyondBethe.RawRat.one.add (y.logUnitParameter.mul y.logUnitParameter).neg))
Instances For
The unit-logarithm lower approximation plus its geometric tail expression.
Equations
- y.logUnitUpper N = (y.logUnitLower N).add (y.logSeriesError N)
Instances For
The ratio of powers of two determined by the binary logarithms of the numerator and denominator.
Equations
- BeyondBethe.RawRat.logScale q = { num := ↑(2 ^ BeyondBethe.binaryNatLog2 q.num.natAbs), den := 2 ^ BeyondBethe.binaryNatLog2 q.den, den_pos := ⋯ }
Instances For
The raw-rational residual obtained by dividing q by its power-of-two scale.
Equations
Instances For
Selects the scaled residual or its reciprocal according to whether the residual is at least one.
Equations
Instances For
Embeds an integer as a raw rational with denominator one.
Equations
- BeyondBethe.RawRat.ofInt z = { num := z, den := 1, den_pos := BeyondBethe.RawRat.ofInt._proof_2 }
Instances For
Approximates the binary exponent times log 2 from below, with bound choice determined by
its sign.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Approximates the binary exponent times log 2 from above, with bound choice determined by
its sign.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Selects the unit-log lower approximation or negated upper approximation for the scaled residual.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Selects the unit-log upper approximation or negated lower approximation for the scaled residual.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Adds the lower approximations for the binary scaling and residual logarithms.
Equations
Instances For
Adds the upper approximations for the binary scaling and residual logarithms.