Program Rust
Dec2flt_modelNumImpTraitsFloatU64
This Rust is the input prepared for Aeneas. Modeling choices explains the adaptations from the production source.
291 }292 }293 294 impl Float for f64 {295 type Int = u64;296 297 const INFINITY: Self = Self::INFINITY;298 const NEG_INFINITY: Self = Self::NEG_INFINITY;299 const NAN: Self = Self::NAN;300 // Bit-identical to the upstream `-f64::NAN`, without the unsupported301 // compile-time float negation.302 const NEG_NAN: Self = f64::from_bits(0xFFF8_0000_0000_0000);303 304 const BITS: u32 = 64;305 const SIG_TOTAL_BITS: u32 = Self::MANTISSA_DIGITS;306 const EXP_MASK: Self::Int = Self::EXPONENT_MASK;307 const SIG_MASK: Self::Int = Self::MANTISSA_MASK;308 309 const MIN_EXPONENT_ROUND_TO_EVEN: i32 = -4;310 const MAX_EXPONENT_ROUND_TO_EVEN: i32 = 23;311 // Exact value of trunc(1024 / log2(10)) from the upstream default.312 const LARGEST_POWER_OF_TEN: i32 = 308;313 const SMALLEST_POWER_OF_TEN: i32 = -342;314 315 fn to_bits(self) -> Self::Int {316 self.to_bits()317 }318 319 fn classify(self) -> FpCategory {320 self.classify()321 }322 }323 324 impl FloatExt for f64 {325 #[inline]Aeneas declaration
The Lean below was mechanically extracted by Aeneas from Rust.
@[reducible]
impl_def F64.Insts.Dec2flt_modelNumImpTraitsFloatU64 : num.imp.traits.Float F64
Std.U64 := {
INFINITY := F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.INFINITY
NEG_INFINITY := F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.NEG_INFINITY
NAN := F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.NAN
NEG_NAN := F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.NEG_NAN
BITS := ok F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.BITS
SIG_TOTAL_BITS := F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.SIG_TOTAL_BITS
EXP_MASK := F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.EXP_MASK
SIG_MASK := F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.SIG_MASK
SIG_BITS := num.imp.traits.Float.SIG_BITS.default
F64.Insts.Dec2flt_modelNumImpTraitsFloatU64
EXP_BITS := num.imp.traits.Float.EXP_BITS.default
F64.Insts.Dec2flt_modelNumImpTraitsFloatU64
EXP_SAT := num.imp.traits.Float.EXP_SAT.default
F64.Insts.Dec2flt_modelNumImpTraitsFloatU64
INFINITE_POWER := num.imp.traits.Float.INFINITE_POWER.default
F64.Insts.Dec2flt_modelNumImpTraitsFloatU64
EXP_BIAS := num.imp.traits.Float.EXP_BIAS.default
F64.Insts.Dec2flt_modelNumImpTraitsFloatU64
EXP_MIN := num.imp.traits.Float.EXP_MIN.default
F64.Insts.Dec2flt_modelNumImpTraitsFloatU64
MIN_EXPONENT_ROUND_TO_EVEN := ok
F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.MIN_EXPONENT_ROUND_TO_EVEN
MAX_EXPONENT_ROUND_TO_EVEN := ok
F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.MAX_EXPONENT_ROUND_TO_EVEN
LARGEST_POWER_OF_TEN := ok
F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.LARGEST_POWER_OF_TEN
SMALLEST_POWER_OF_TEN := ok
F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.SMALLEST_POWER_OF_TEN
coreopsarithDivInst := F64.Insts.CoreOpsArithDivF64F64
coreopsarithNegInst := F64.Insts.CoreOpsArithNegF64
coreopsarithMulInst := F64.Insts.CoreOpsArithMulF64F64
coreopsarithAddInst := F64.Insts.CoreOpsArithAddF64F64
corecmpPartialEqInst := F64.Insts.CoreCmpPartialEqF64
corecmpPartialOrdInst := F64.Insts.CoreCmpPartialOrdF64
coredefaultDefaultInst := F64.Insts.CoreDefaultDefault
corecloneCloneInst := F64.Insts.CoreCloneClone
coremarkerCopyInst := F64.Insts.CoreMarkerCopy
IntInst := U64.Insts.Dec2flt_modelNumImpTraitsInt
coreconvertIntoSelf_IntU64Inst := core.convert.IntoFrom
(core.convert.FromSame Std.U64)
classify := F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.classify
to_bits := F64.Insts.Dec2flt_modelNumImpTraitsFloatU64.to_bits
}Operations used here
CoreCmpPartialEqF64 · Rust library
CoreCmpPartialOrdF64 · Rust library
CoreDefaultDefault · Rust library
CoreOpsArithAddF64F64 · Rust library
CoreOpsArithMulF64F64 · Rust library
CoreOpsArithDivF64F64 · Rust library
CoreOpsArithNegF64 · Rust library
SMALLEST_POWER_OF_TEN · Program Rust
LARGEST_POWER_OF_TEN · Program Rust
MAX_EXPONENT_ROUND_TO_EVEN · Program Rust
Source details
| Declaration | F64.Insts.Dec2flt_modelNumImpTraitsFloatU64 |
|---|---|
| File | num/imp/../../traits.rs |
| Lines | 294:0–322:1 |
| Program version | Preparation 1 |