On Fri, 13 Dec 2019, Liu Hao wrote:

Instead of splitting the mantissa into two parts of the same width, we
now split it into asymmetric parts, where the more significant part has
fewer bits and is less likely to cause rounding errors.

For `long double` with a 64-bit mantissa :  31 + 33
For `double` with a 53-bit mantissa      :  26 + 27
for `float` with a 24-bit mantissa       :  11 + 13








This is pure refactoring in preparation for porting this implementation
to `float` and `double`, as we are having a bug there.

Testcase:

 #include <assert.h>
 #include <math.h>

 int main(void)
   {
     volatile double a =  0x1.0000000000003p-461;
     volatile double b =  0x1.0000000000007p-461;
     volatile double c = -0x1.000000000000Ap-922;

     assert(a * b + c == 0);
     assert(fma(a, b, c) == 0x1.5p-1022);
   }

Signed-off-by: Liu Hao <[email protected]>
---
mingw-w64-crt/math/fmal.c | 93 ++++++++-------------------------------
1 file changed, 18 insertions(+), 75 deletions(-)

Looks ok to me, assuming you've tested it both with the quoted testcase above, and the testcases you made when you originally implemented this.

// Martin



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to