Program Rust
power
This Rust is the input prepared for Aeneas. Modeling choices explains the adaptations from the production source.
118 /// log2(10), where 217706 / 2^16 is accurate for the119 /// entire range of non-finite decimal exponents.120 #[inline]121 fn power(q: i32) -> i32 {122 (q.wrapping_mul(152_170 + 65536) >> 16) + 63123 }124 125 #[inline]126 fn full_multiplication(a: u64, b: u64) -> (u64, u64) {Aeneas declaration
The Lean below was mechanically extracted by Aeneas from Rust.
def num.imp.dec2flt.lemire.power (q : Std.I32) : Result Std.I32 := do
let i ← 152170#i32 + 65536#i32
let i1 ← lift (core.num.I32.wrapping_mul q i)
let i2 ← i1 >>> 16#i32
i2 + 63#i32Source details
| Declaration | num.imp.dec2flt.lemire.power |
|---|---|
| File | num/imp/../../dec2flt/lemire.rs |
| Lines | 121:0–123:1 |
| Program version | Original program |