-
Notifications
You must be signed in to change notification settings - Fork 0
chore: new rounder #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
We also develop a bunch of infra to allow us to compute on BVs without having to worry about extension, by writing custom functions which extend appropriately. Their `toInt` lemmas will not have modulos, which will do the right thing when performing arithemtic.
info: Fp/Division.lean:600:0: PANIC at List.get!Internal Init.GetElem:328:18: invalid index backtrace: 0 libleanshared.dylib 0x00000001149692fc _ZN4leanL15lean_panic_implEPKcmb + 268 1 libleanshared.dylib 0x00000001149697d0 lean_panic_fn + 40 2 libleanshared.dylib 0x0000000110276ed4 l___private_Lean_Elab_Tactic_BVDecide_Frontend_BVDecide_0__Lean_Elab_Tactic_BVDecide_Frontend_DiagnosisM_diagnose_transformEquation + 7064 3 libleanshared.dylib 0x000000011027bf34 l___private_Init_Data_Array_Basic_0__Array_forIn_x27Unsafe_loop___at___00Lean_Elab_Tactic_BVDecide_Frontend_DiagnosisM_diagnose_spec__5 + 416 4 libleanshared.dylib 0x000000011027cbe0 l_Lean_Elab_Tactic_BVDecide_Frontend_DiagnosisM_diagnose + 88 5 libleanshared.dylib 0x000000011497e2f0 lean_apply_7 + 184 6 libleanshared.dylib 0x000000011026e9bc l_Lean_Elab_Tactic_BVDecide_Frontend_DiagnosisM_run___lam__0 + 116 7 libleanshared.dylib 0x000000011497bf34 lean_apply_5 + 1020 8 libleanshared.dylib 0x000000011026e810 l_Lean_MVarId_withContext___at___00Lean_Elab_Tactic_BVDecide_Frontend_DiagnosisM_run_spec__0___redArg + 44 9 libleanshared.dylib 0x000000011027e104 l_Lean_Elab_Tactic_BVDecide_Frontend_explainCounterExampleQuality + 220
| } | ||
| else | ||
| -- we are in the <1.-----> case. | ||
| if hExTooBig : inUf.ex > BitVec.ofInt e (maxNormalExp e') then -- + BitVec.ofInt e s' then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think rounding should be done in terms of PackedFloat's e and s and not the UnpackedFloat's version, which can fit a larger range of values. So, the output type should be EUnpackedFloat (exponentWidth e' s') (s' + 1). Otherwise, the condition in this line is too week maxNormalExp (exponentWidth e' s') >= maxNormalExp e'.
Develop a new rounding circuit, based on SymFPU's design and "handbook of floating point reasoning".