Closed davidmallasen closed 7 months ago
I'll take a look at the golden reference path
gnarly situation of crossing bad edits: turns out that the golden reference is ok, the failure is in the proper carry propagation in the exponent and regime, as shown here:
Fast specialization posit<16,2>: report test cases
posit< 16,2> useed scale 4 minpos scale -56 maxpos scale 56 : 0
FAIL
1.3877787807814456755e-17 + 4.5474735088646411896e-13 != 1.3642420526593923569e-12 golden reference is 4.5474735088646411896e-13
0b0.000000000000001.. + 0b0.000000000001.11.0 != 0b0.00000000001.00.10 golden reference is 0b0.000000000001.11.0
FAIL
1.3877787807814456755e-17 + 6.8212102632969617844e-13 != 1.5916157281026244164e-12 golden reference is 6.8212102632969617844e-13
0b0.000000000000001.. + 0b0.000000000001.11.1 != 0b0.00000000001.00.11 golden reference is 0b0.000000000001.11.1
FAIL
1.3877787807814456755e-17 + -3.9990234375 != -1.99951171875 golden reference is -3.9990234375
0b0.000000000000001.. + 0b1.10.01.11111111111 != 0b1.10.00.11111111111 golden reference is 0b1.10.01.11111111111
FAIL
1.3877787807814456755e-17 + -3.998046875 != -1.99951171875 golden reference is -3.998046875
0b0.000000000000001.. + 0b1.10.01.11111111110 != 0b1.10.00.11111111111 golden reference is 0b1.10.01.11111111110
FAIL
1.3877787807814456755e-17 + -3.9970703125 != -1.9990234375 golden reference is -3.9970703125
0b0.000000000000001.. + 0b1.10.01.11111111101 != 0b1.10.00.11111111110 golden reference is 0b1.10.01.11111111101
FAIL
1.3877787807814456755e-17 + -3.99609375 != -1.9990234375 golden reference is -3.99609375
0b0.000000000000001.. + 0b1.10.01.11111111100 != 0b1.10.00.11111111110 golden reference is 0b1.10.01.11111111100
FAIL
1.3877787807814456755e-17 + -3.9951171875 != -1.99853515625 golden reference is -3.9951171875
0b0.000000000000001.. + 0b1.10.01.11111111011 != 0b1.10.00.11111111101 golden reference is 0b1.10.01.11111111011
FAIL
1.3877787807814456755e-17 + -3.994140625 != -1.99853515625 golden reference is -3.994140625
0b0.000000000000001.. + 0b1.10.01.11111111010 != 0b1.10.00.11111111101 golden reference is 0b1.10.01.11111111010
FAIL
1.3877787807814456755e-17 + -3.9931640625 != -1.998046875 golden reference is -3.9931640625
0b0.000000000000001.. + 0b1.10.01.11111111001 != 0b1.10.00.11111111100 golden reference is 0b1.10.01.11111111001
FAIL
1.3877787807814456755e-17 + -3.9921875 != -1.998046875 golden reference is -3.9921875
0b0.000000000000001.. + 0b1.10.01.11111111000 != 0b1.10.00.11111111100 golden reference is 0b1.10.01.11111111000```
Now need to figure out what is going wrong.
Following issue #343 I implemented the specialized posit<16,2> addition following the guidelines from softposit. I think it is working correctly, but the tests are not computing the golden solution correctly. When I run the exhaustive tests with the
reportTestCases=true
, I get the following fails:Where I believe the computed value is correct and the golden one isn't.
I checked the
to_double()
function and it seems to be correct, but calls some other functions inposit_impl.hpp
that I don't know. Could you have a look at this @Ravenwater @theo-lemurian ?