5 static struct ddd_d t[] = {
6 #include "sanity/fma.h"
11 #pragma STDC FENV_ACCESS ON
17 for (i = 0; i < sizeof t/sizeof *t; i++) {
23 feclearexcept(FE_ALL_EXCEPT);
24 y = fma(p->x, p->x2, p->x3);
25 e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
27 if (!checkexcept(e, p->e, p->r)) {
28 printf("%s:%d: bad fp exception: %s fma(%a,%a,%a)=%a, want %s",
29 p->file, p->line, rstr(p->r), p->x, p->x2, p->x3, p->y, estr(p->e));
30 printf(" got %s\n", estr(e));
33 d = ulperr(y, p->y, p->dy);
34 if (!checkcr(y, p->y, p->r)) {
35 printf("%s:%d: %s fma(%a,%a,%a) want %a got %a ulperr %.3f = %a + %a\n",
36 p->file, p->line, rstr(p->r), p->x, p->x2, p->x3, p->y, y, d, d-p->dy, p->dy);