fix math test gen script
[libc-test] / src / math / y1f.c
1 #include <stdint.h>
2 #include <stdio.h>
3 #include "util.h"
4
5 static struct f_f t[] = {
6 #include "sanity/y1f.h"
7
8 };
9
10 int main(void)
11 {
12         float y;
13         float d;
14         int e, i, err = 0;
15         struct f_f *p;
16
17         for (i = 0; i < sizeof t/sizeof *t; i++) {
18                 p = t + i;
19                 setupfenv(p->r);
20                 y = y1f(p->x);
21                 e = getexcept();
22                 if (!checkexcept(e, p->e, p->r)) {
23                         printf("%s y1f(%a)==%a except: want %s", rstr(p->r), p->x, p->y, estr(p->e));
24                         printf(" got %s\n", estr(e));
25                         err++;
26                 }
27                 d = ulperrf(y, p->y, p->dy);
28                 if (!checkulp(d, p->r)) {
29                         printf("%s y1f(%a) want %a got %a ulperr %.3f = %a + %a\n",
30                                 rstr(p->r), p->x, p->y, y, d, d-p->dy, p->dy);
31                         err++;
32                 }
33         }
34         return !!err;
35 }