add generated math tests
[libc-test.git] / src / math / tgammal.c
bloba0e8db8996409b540c149600b3fd895a914b92dc
1 #include <stdint.h>
2 #include <stdio.h>
3 #include "util.h"
5 static struct l_l t[] = {
6 #if LDBL_MANT_DIG == 53
8 #include "sanity/tgammal.h"
9 #elif LDBL_MANT_DIG == 64
11 #include "sanity/tgammal.h"
12 #endif
15 int main(void)
17 long double y;
18 float d;
19 int e, i, err = 0;
20 struct l_l *p;
22 for (i = 0; i < sizeof t/sizeof *t; i++) {
23 p = t + i;
24 setupfenv(p->r);
25 y = tgammal(p->x);
26 e = getexcept();
27 if (!checkexcept(e, p->e, p->r)) {
28 printf("%s tgammal(%La)==%La except: want %s", rstr(p->r), p->x, p->y, estr(p->e));
29 printf(" got %s\n", estr(e));
30 err++;
32 d = ulperrl(y, p->y, p->dy);
33 if (!checkulp(d, p->r)) {
34 printf("%s tgammal(%La) want %La got %La ulperr %.3f = %a + %a\n",
35 rstr(p->r), p->x, p->y, y, d, d-p->dy, p->dy);
36 err++;
39 return !!err;