Program Rust
from_u64_bits
This Rust is the input prepared for Aeneas. Modeling choices explains the adaptations from the production source.
217 #[cfg(target_has_reliable_f16)]218 impl FloatExt for f16 {219 #[inline]220 fn from_u64_bits(v: u64) -> Self {221 Self::from_bits((v & 0xFFFF) as u16)222 }223 224 // Specializing the upstream default removes only unsupported associated-225 // integer operator resolution; these are the same bit operations withAeneas declaration
The Lean below was mechanically extracted by Aeneas from Rust.
def F16.Insts.Dec2flt_modelNumImpTraitsFloatExtU16.from_u64_bits
(v : Std.U64) : Result F16 := do
let i ← lift (v &&& 65535#u64)
let i1 ← lift (UScalar.cast .U16 i)
core.f16.F16.from_bits i1Operations used here
Source details
| Declaration | F16.Insts.Dec2flt_modelNumImpTraitsFloatExtU16.from_u64_bits |
|---|---|
| File | num/imp/../../traits.rs |
| Lines | 220:4–222:5 |
| Program version | Preparation 1 |