1570af302Sopenharmony_ci#include <stdint.h> 2570af302Sopenharmony_ci#include <stdio.h> 3570af302Sopenharmony_ci#include "mtest.h" 4570af302Sopenharmony_ci 5570af302Sopenharmony_cistatic struct l_l t[] = { 6570af302Sopenharmony_ci#if LDBL_MANT_DIG == 53 7570af302Sopenharmony_ci#include "crlibm/sinh.h" 8570af302Sopenharmony_ci#include "ucb/sinh.h" 9570af302Sopenharmony_ci#include "sanity/sinh.h" 10570af302Sopenharmony_ci#include "special/sinh.h" 11570af302Sopenharmony_ci 12570af302Sopenharmony_ci#elif LDBL_MANT_DIG == 64 13570af302Sopenharmony_ci#include "sanity/sinhl.h" 14570af302Sopenharmony_ci#include "special/sinhl.h" 15570af302Sopenharmony_ci 16570af302Sopenharmony_ci#elif LDBL_MANT_DIG == 113 17570af302Sopenharmony_ci#ifdef LD128_ENABLE 18570af302Sopenharmony_ci#include "ld128/sinhl.h" 19570af302Sopenharmony_ci#endif 20570af302Sopenharmony_ci 21570af302Sopenharmony_ci#endif 22570af302Sopenharmony_ci}; 23570af302Sopenharmony_ci 24570af302Sopenharmony_ciint main(void) 25570af302Sopenharmony_ci{ 26570af302Sopenharmony_ci #pragma STDC FENV_ACCESS ON 27570af302Sopenharmony_ci long double y; 28570af302Sopenharmony_ci float d; 29570af302Sopenharmony_ci int e, i, err = 0; 30570af302Sopenharmony_ci struct l_l *p; 31570af302Sopenharmony_ci 32570af302Sopenharmony_ci for (i = 0; i < sizeof t/sizeof *t; i++) { 33570af302Sopenharmony_ci p = t + i; 34570af302Sopenharmony_ci 35570af302Sopenharmony_ci if (p->r < 0) 36570af302Sopenharmony_ci continue; 37570af302Sopenharmony_ci fesetround(p->r); 38570af302Sopenharmony_ci feclearexcept(FE_ALL_EXCEPT); 39570af302Sopenharmony_ci y = sinhl(p->x); 40570af302Sopenharmony_ci e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); 41570af302Sopenharmony_ci 42570af302Sopenharmony_ci if (!checkexcept(e, p->e, p->r)) { 43570af302Sopenharmony_ci printf("%s:%d: bad fp exception: %s sinhl(%La)=%La, want %s", 44570af302Sopenharmony_ci p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); 45570af302Sopenharmony_ci printf(" got %s\n", estr(e)); 46570af302Sopenharmony_ci err++; 47570af302Sopenharmony_ci } 48570af302Sopenharmony_ci d = ulperrl(y, p->y, p->dy); 49570af302Sopenharmony_ci if (!checkulp(d, p->r)) { 50570af302Sopenharmony_ci if (fabsf(d) < 5.0f || p->r != RN) 51570af302Sopenharmony_ci printf("X "); 52570af302Sopenharmony_ci else 53570af302Sopenharmony_ci err++; 54570af302Sopenharmony_ci printf("%s:%d: %s sinhl(%La) want %La got %La ulperr %.3f = %a + %a\n", 55570af302Sopenharmony_ci p->file, p->line, rstr(p->r), p->x, p->y, y, d, d-p->dy, p->dy); 56570af302Sopenharmony_ci } 57570af302Sopenharmony_ci } 58570af302Sopenharmony_ci return !!err; 59570af302Sopenharmony_ci} 60