add generated math tests
[libc-test.git] / src / math / asinhf.c
blobd62c96bc59ffd522b4d9f06616bb54df9719b388
1 #include <stdint.h>
2 #include <stdio.h>
3 #include "util.h"
5 static struct f_f t[] = {
7 #include "sanity/asinhf.h"
8 };
10 int main(void)
12 float y;
13 float d;
14 int e, i, err = 0;
15 struct f_f *p;
17 for (i = 0; i < sizeof t/sizeof *t; i++) {
18 p = t + i;
19 setupfenv(p->r);
20 y = asinhf(p->x);
21 e = getexcept();
22 if (!checkexcept(e, p->e, p->r)) {
23 printf("%s asinhf(%a)==%a except: want %s", rstr(p->r), p->x, p->y, estr(p->e));
24 printf(" got %s\n", estr(e));
25 err++;
27 d = ulperrf(y, p->y, p->dy);
28 if (!checkulp(d, p->r)) {
29 printf("%s asinhf(%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++;
34 return !!err;