5 static struct l_ll t[] = {
6 #if LDBL_MANT_DIG == 53
7 #include "sanity/sincos.h"
8 #elif LDBL_MANT_DIG == 64
9 #include "sanity/sincosl.h"
15 #pragma STDC FENV_ACCESS ON
16 long double ysin, ycos;
21 for (i = 0; i < sizeof t/sizeof *t; i++) {
27 feclearexcept(FE_ALL_EXCEPT);
28 sincosl(p->x, &ysin, &ycos);
29 e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
31 if (!checkexcept(e, p->e, p->r)) {
32 printf("%s:%d: bad fp exception: %s sincosl(%La)=%La,%La, want %s",
33 p->file, p->line, rstr(p->r), p->x, p->y, p->y2, estr(p->e));
34 printf(" got %s\n", estr(e));
37 dsin = ulperr(ysin, p->y, p->dy);
38 dcos = ulperr(ycos, p->y2, p->dy2);
39 if (!checkulp(dsin, p->r) || !checkulp(dcos, p->r)) {
40 printf("%s:%d: %s sincosl(%La) want %La,%La got %La,%La, ulperr %.3f = %a + %a, %.3f = %a + %a\n",
41 p->file, p->line, rstr(p->r), p->x, p->y, p->y2, ysin, ycos,
42 dsin, dsin-p->dy, p->dy, dcos, dcos-p->dy2, p->dy2);