3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-07-17 04:25:44 +00:00

Fix FP.eq simplification for nonzero numerals and add round-trip regression test

This commit is contained in:
copilot-swe-agent[bot] 2026-06-26 05:38:19 +00:00 committed by GitHub
parent f1daa2828b
commit 03a386627a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 0 deletions

View file

@ -95,8 +95,20 @@ static void test_recfun_defined_function_soundness() {
false);
}
static void test_to_fp_from_to_real_roundtrip() {
run_fp_test(
"(declare-fun a () Float32)\n"
"(declare-fun t () Float32)\n"
"(assert (fp.eq a ((_ to_fp 8 24) RNE 1.0)))\n"
"(assert (fp.eq t ((_ to_fp 8 24) RNE 0.8)))\n"
"(assert (fp.eq (fp.add RNE a t) ((_ to_fp 8 24) RNE (+ 1.0 (fp.to_real t)))))\n"
"(check-sat)\n",
true);
}
void tst_fpa() {
test_fp_to_real_denormal();
test_to_fp_from_real_interval();
test_recfun_defined_function_soundness();
test_to_fp_from_to_real_roundtrip();
}