https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109008

--- Comment #45 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 54623
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54623&action=edit
gcc13-pr109008-3.patch

Further incremental patch to do the .5ulp widening rather than 1ulp if not
-frounding-math and not for IBM double double.
So far I've tested the + and - 300000 tests, still no errors (so conservatively
correct) and:
      1 0 50
      1 1 11
      1 11 1
      1 1 13
      1 1 16
      1 1 25
      1 1 28
      1 1 3
      1 1 36
      1 1 4
      1 1 40
      1 19 1
      1 39 1
      1 50 0
      2 1 17
      2 1 2
      2 1 32
      2 1 7
      2 2 1
      2 5 1
      3 3 1
      3 4 1
     38 50 1
     56 1 50
     71 1 0
     78 0 1
    160 50 50
  13173 0 0
 130096 -1 -1
 154232 1 1
so significantly better than the 1ulp version, over 50% of cases are 1ulp away
in each direction, over 43% of other cases have really empty range, over 4%
exact and rest is noise.
Let me finish * and / testing.

For the forward op, we'd need to do something like in the #c30 patch, which was
ugly.

And regarding !MODE_HAS_INFINITIES, the min/max values really act there like
infinities, so I think we should just detect that case and use infinities in
the
widened range even when the mode doesn't have them.  But, I'm afraid I don't
know how to test that...

Reply via email to