Source/Reference

Float32Exact

reference/numeric/Float32Exact.alpha

142 lines17 declarations6.4 KiBSHA-256 e0ea5c3a7c33

def · lines 70–77

float32ExactInverseRootNaturalLogTwo

Full file
The EX2 attention path needs score/sqrt(n) in base-two units. Bound both sqrt(n) and ln(2) from their rational intervals, then require that the bounds round to the same F32 word. This avoids rounding 1/sqrt(n) before multiplying by log2(e), which can choose a different final word.
70def float32ExactInverseRootNaturalLogTwo =
71  (lambda unrestricted n : Nat .
72    (let unrestricted rootLow = (float32ExactRootLow n 1) in
73      (float32ExactBetween
74        (naturalMultiply float32RootScale float32Places)
75        (naturalMultiply (succ rootLow) (succ float32Ln2Digits))
76        (naturalMultiply float32RootScale float32Places)
77        (naturalMultiply rootLow float32Ln2Digits))))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.