6 static struct d_dd t
[] = {
7 #include "sanity/sincos.h"
8 #include "special/sincos.h"
13 #pragma STDC FENV_ACCESS ON
19 for (i
= 0; i
< sizeof t
/sizeof *t
; i
++) {
25 feclearexcept(FE_ALL_EXCEPT
);
26 sincos(p
->x
, &ysin
, &ycos
);
27 e
= fetestexcept(INEXACT
|INVALID
|DIVBYZERO
|UNDERFLOW
|OVERFLOW
);
29 if (!checkexcept(e
, p
->e
, p
->r
)) {
30 printf("%s:%d: bad fp exception: %s sincos(%a)=%a,%a, want %s",
31 p
->file
, p
->line
, rstr(p
->r
), p
->x
, p
->y
, p
->y2
, estr(p
->e
));
32 printf(" got %s\n", estr(e
));
35 dsin
= ulperr(ysin
, p
->y
, p
->dy
);
36 dcos
= ulperr(ycos
, p
->y2
, p
->dy2
);
37 if (!checkulp(dsin
, p
->r
) || !checkulp(dcos
, p
->r
)) {
38 printf("%s:%d: %s sincos(%a) want %a,%a got %a,%a, ulperr %.3f = %a + %a, %.3f = %a + %a\n",
39 p
->file
, p
->line
, rstr(p
->r
), p
->x
, p
->y
, p
->y2
, ysin
, ycos
,
40 dsin
, dsin
-p
->dy
, p
->dy
, dcos
, dcos
-p
->dy2
, p
->dy2
);