Correct rounding of accepted binary exponential, logarithm, and power results #
Taylor enclosure bounds and exact decoding prove that each returned encoding is finite and equals nearest-even rounding of the real function. The domain certificates instantiate the finite-real contract on the executable success predicate.
For powers, rpow_eq_exp_reduced writes (s * 2 ^ e) ^ b as exp (b * log s + (b * e - k) * log 2) * 2 ^ k for every integer k. The grid enclosures of log s and log 2, the exponential
enclosure, and the scaled endpoint check Enclosure.roundScaled? then give
toReal_of_powRat_eq_ok and toReal_of_pow_eq_ok.
These are partial-correctness theorems: they describe a result whenever the kernel returns
.ok, and no theorem says which inputs succeed. The one proved success is the signed-zero
passthrough of expMinus1 and logPlus1. exp, log, and pow have no proved success case.
accept succeeds exactly with the certified encoding it was given.
The rational argument checks preserve the original guarded exponential for every attempt budget, including zero attempts and formats outside the supported domain.
Skipping impossible guards preserves both accepted encodings and failures of expMinus1Rat.
Successful rational-input exponentials are finite.
An accepted rational exponential equals rounding of the exact real exponential.
Successful rational-input logarithms are finite.
An accepted rational logarithm equals rounding of the exact real logarithm.
Successful rational-input expMinus1 results are finite.
The subtraction takes place in the exact real expression, before its only rounding.
Successful rational-input logPlus1 results are finite.
Forming 1 + argument exactly avoids an intermediate floating-point rounding.
Every exponential result returned by the concrete refinement algorithm is finite.
The concrete exponential kernel certifies nearest-even rounding of the exact input's exp.
Every logarithm result returned by the concrete refinement algorithm is finite.
The concrete logarithm kernel certifies nearest-even rounding of the exact input's log.
Each accepted expMinus1 result is finite, including the signed-zero branch.
An accepted expMinus1 equals nearest-even rounding of Real.exp x - 1.
Each accepted logPlus1 result is finite, including the signed-zero branch.
An accepted logPlus1 equals nearest-even rounding of Real.log (1 + x).
The IEEE input's zero encoding passes through expMinus1 unchanged.
The IEEE input's zero encoding passes through logPlus1 unchanged.
The finite-real contract holds on the exponential kernel's executable success domain. The zero fallback adapts the certified result to the contract's total-function argument.
The finite-real contract holds on the inputs accepted by the logarithm kernel.
Correct rounding of exp x - 1 on the executable acceptance domain.
Correct rounding of log (1 + x) on the executable acceptance domain.
Real powers #
Table reduction preserves logarithm containment for every positive rational.
The grid combination encloses exponent * log s + multiple * log 2.
One exponential at the lower end encloses exp over the whole argument interval.
An argument enclosed on every grid gives an enclosure of its exponential.
The real power of a positive scaled rational is the exponential of the reduced argument times the removed power of two, for every integer scale.
An argument at most the screened bound has an exponential of at most half the least subnormal:
[0, 1] contains it times 2 ^ -(minSubnormalExponent - 1), so the screen never forms that
power.
Successful scaled powers are finite.
An accepted scaled power equals rounding of the real power of scaled * 2 ^ binaryExponent.
The binary split of a positive rational is positive and recombines to its value.
Successful rational-input powers are finite.
An accepted rational power equals nearest-even rounding of the real power base ^ exponent
(Real.rpow, with base > 0 whenever the result is accepted).
An accepted rational power has a positive base.
The stored-field bound powArgumentExponent bounds |exponent * log base|.
Every exponential of an argument below 2 ^ -(fracWidth + 4) lies in powNearOne.
Every power returned by the certified search is finite.
An accepted certified power equals nearest-even rounding of the real power
toReal base ^ toReal exponent (Real.rpow, since the base of an accepted result is positive).