Program Rust
Dec2flt_modelNumImpDec2fltLemireU64
This Rust is the input prepared for Aeneas. Modeling choices explains the adaptations from the production source.
206 }207 }208 209 impl Lemire for f64 {210 // Exact upstream formula results for `SIG_TOTAL_BITS = 53`.211 const MAX_EXPONENT_FAST_PATH: i64 = 22;212 const MAX_EXPONENT_DISGUISED_FAST_PATH: i64 = 37;213 214 fn pow10_fast_path(exponent: usize) -> Self {215 // These bit patterns are exactly the source table's rounded binary64216 // literals. The match is the same masked lookup; it merely keeps float217 // constants out of Aeneas's unsupported constant interpreter.218 match exponent & 31 {219 0 => f64::from_bits(0x3FF0_0000_0000_0000),220 1 => f64::from_bits(0x4024_0000_0000_0000),221 2 => f64::from_bits(0x4059_0000_0000_0000),222 3 => f64::from_bits(0x408F_4000_0000_0000),223 4 => f64::from_bits(0x40C3_8800_0000_0000),224 5 => f64::from_bits(0x40F8_6A00_0000_0000),225 6 => f64::from_bits(0x412E_8480_0000_0000),226 7 => f64::from_bits(0x4163_12D0_0000_0000),227 8 => f64::from_bits(0x4197_D784_0000_0000),228 9 => f64::from_bits(0x41CD_CD65_0000_0000),229 10 => f64::from_bits(0x4202_A05F_2000_0000),230 11 => f64::from_bits(0x4237_4876_E800_0000),231 12 => f64::from_bits(0x426D_1A94_A200_0000),232 13 => f64::from_bits(0x42A2_309C_E540_0000),233 14 => f64::from_bits(0x42D6_BCC4_1E90_0000),234 15 => f64::from_bits(0x430C_6BF5_2634_0000),235 16 => f64::from_bits(0x4341_C379_37E0_8000),236 17 => f64::from_bits(0x4376_3457_85D8_A000),237 18 => f64::from_bits(0x43AB_C16D_674E_C800),238 19 => f64::from_bits(0x43E1_58E4_6091_3D00),239 20 => f64::from_bits(0x4415_AF1D_78B5_8C40),240 21 => f64::from_bits(0x444B_1AE4_D6E2_EF50),241 22 => f64::from_bits(0x4480_F0CF_064D_D592),242 _ => f64::from_bits(0),243 }244 }245 246 #[inline]247 // This method is precisely the source `u64 as f64` primitive conversion.248 // Aeneas cannot translate that cast; opacity is confined to the cast while249 // the fast-path algorithm, its range proof obligation, and all calls stay250 // visible in the extracted model.251 #[charon::opaque]252 fn from_u64(v: u64) -> Self {253 debug_assert!(v <= Self::MAX_MANTISSA_FAST_PATH);254 v as _255 }256 }257 258 #[inline]259 pub(super) fn pfe_empty() -> ParseFloatError {Aeneas declaration
The Lean below was mechanically extracted by Aeneas from Rust.
@[reducible]
impl_def F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64 : num.imp.dec2flt.Lemire
F64 Std.U64 := {
MAX_EXPONENT_FAST_PATH := ok
F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64.MAX_EXPONENT_FAST_PATH
MIN_EXPONENT_FAST_PATH :=
num.imp.dec2flt.Lemire.MIN_EXPONENT_FAST_PATH.default
F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64
MAX_EXPONENT_DISGUISED_FAST_PATH := ok
F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64.MAX_EXPONENT_DISGUISED_FAST_PATH
MAX_MANTISSA_FAST_PATH :=
num.imp.dec2flt.Lemire.MAX_MANTISSA_FAST_PATH.default
F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64
traitsFloatExtInst := F64.Insts.Dec2flt_modelNumImpTraitsFloatExtU64
pow10_fast_path :=
F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64.pow10_fast_path
from_u64 := F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64.from_u64
}Operations used here
Dec2flt_modelNumImpTraitsFloatExtU64 · Program Rust
pow10_fast_path · Program Rust
Source details
| Declaration | F64.Insts.Dec2flt_modelNumImpDec2fltLemireU64 |
|---|---|
| File | num/imp/../../dec2flt/mod.rs |
| Lines | 209:0–256:1 |
| Program version | Preparation 1 |