Skip to content

Repository files navigation

fp.lean core library

A library for bitblasting IEEE754 floating point multiplication.

-- https://github.com/opencompl/fp.lean/blob/5e51278246ed86f5e772ee6697400c163b56d5e3/Fp/Multiplication.lean#L82
theorem mul_one_is_id (a : PackedFloat 5 2) (m : RoundingMode) (ha : ¬a.isNaN)
  : (mul a oneE5M2 m) = a := by
  apply PackedFloat.inj
  simp at ha
  simp [mul, round, BitVec.cons, oneE5M2, -BitVec.shiftLeft_eq', -BitVec.ushiftRight_eq']
  bv_decide

References

  • We use circuits inspired from symfpu for bitblasting.

Trustworthiness: Exhaustive Enumeration Golden testing

Our CI exhaustively enumerates against the FloatX and symfpu libraries for bit-for-bit compatibility.

We would appreciate pull requests that improve our testing. We audited several librares, but settled on our choices since they enable us to test all rounding modes for small bitwidths.

References

About

Floating Point Semantics Mechanization for Lean

Topics

Resources

Stars

23 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages