diff --git a/src/common/mtest.h b/src/common/mtest.h index 9218a75..d390d03 100644 --- a/src/common/mtest.h +++ b/src/common/mtest.h @@ -102,10 +102,21 @@ float ulperrl(long double got, long double want, float dwant); static int checkexcept(int got, int want, int r) { if (r == RN) +#if defined CHECK_INEXACT + return got == want; +#elif defined CHECK_INEXACT_OMISSION return got == want || got == (want|INEXACT); +#else + return (got|INEXACT) == (want|INEXACT); +#endif return (got|INEXACT|UNDERFLOW) == (want|INEXACT|UNDERFLOW); } +static int checkexceptall(int got, int want, int r) +{ + return got == want; +} + static int checkulp(float d, int r) { // TODO: we only care about >=1.5 ulp errors for now, should be 1.0 diff --git a/src/functional/random.c b/src/functional/random.c index 65bbf28..69596fb 100644 --- a/src/functional/random.c +++ b/src/functional/random.c @@ -1,3 +1,4 @@ +#define _XOPEN_SOURCE 700 #include #include #include "test.h" diff --git a/src/math/ceil.c b/src/math/ceil.c index 0b88c25..253654c 100644 --- a/src/math/ceil.c +++ b/src/math/ceil.c @@ -27,7 +27,7 @@ int main(void) y = ceil(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s ceil(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/ceilf.c b/src/math/ceilf.c index 03d7dfb..3d20997 100644 --- a/src/math/ceilf.c +++ b/src/math/ceilf.c @@ -27,7 +27,7 @@ int main(void) y = ceilf(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s ceilf(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/ceill.c b/src/math/ceill.c index d812dee..2674c56 100644 --- a/src/math/ceill.c +++ b/src/math/ceill.c @@ -33,7 +33,7 @@ int main(void) y = ceill(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s ceill(%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/copysign.c b/src/math/copysign.c index 7ef6423..ecc3719 100644 --- a/src/math/copysign.c +++ b/src/math/copysign.c @@ -26,7 +26,7 @@ int main(void) y = copysign(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s copysign(%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/copysignf.c b/src/math/copysignf.c index eea9b87..e8bb768 100644 --- a/src/math/copysignf.c +++ b/src/math/copysignf.c @@ -26,7 +26,7 @@ int main(void) y = copysignf(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s copysignf(%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/copysignl.c b/src/math/copysignl.c index ff0c3b7..9442a17 100644 --- a/src/math/copysignl.c +++ b/src/math/copysignl.c @@ -32,7 +32,7 @@ int main(void) y = copysignl(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s copysignl(%La,%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/fabs.c b/src/math/fabs.c index 118cdb5..022cb9b 100644 --- a/src/math/fabs.c +++ b/src/math/fabs.c @@ -27,7 +27,7 @@ int main(void) y = fabs(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s fabs(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/fabsf.c b/src/math/fabsf.c index 9502560..cef9b5a 100644 --- a/src/math/fabsf.c +++ b/src/math/fabsf.c @@ -27,7 +27,7 @@ int main(void) y = fabsf(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s fabsf(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/fabsl.c b/src/math/fabsl.c index ef75ced..3634895 100644 --- a/src/math/fabsl.c +++ b/src/math/fabsl.c @@ -33,7 +33,7 @@ int main(void) y = fabsl(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s fabsl(%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/fdim.c b/src/math/fdim.c index 9f4eeea..9ce8086 100644 --- a/src/math/fdim.c +++ b/src/math/fdim.c @@ -26,7 +26,7 @@ int main(void) y = fdim(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s fdim(%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/fdimf.c b/src/math/fdimf.c index 55dc1dc..6dd9704 100644 --- a/src/math/fdimf.c +++ b/src/math/fdimf.c @@ -26,7 +26,7 @@ int main(void) y = fdimf(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s fdimf(%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/fdiml.c b/src/math/fdiml.c index e08e27e..5a27042 100644 --- a/src/math/fdiml.c +++ b/src/math/fdiml.c @@ -32,7 +32,7 @@ int main(void) y = fdiml(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s fdiml(%La,%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/floor.c b/src/math/floor.c index ac5ecc8..ca715dc 100644 --- a/src/math/floor.c +++ b/src/math/floor.c @@ -27,7 +27,7 @@ int main(void) y = floor(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s floor(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/floorf.c b/src/math/floorf.c index 1452f7f..ca3bf0c 100644 --- a/src/math/floorf.c +++ b/src/math/floorf.c @@ -27,7 +27,7 @@ int main(void) y = floorf(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s floorf(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/floorl.c b/src/math/floorl.c index 9681e6d..644724e 100644 --- a/src/math/floorl.c +++ b/src/math/floorl.c @@ -33,7 +33,7 @@ int main(void) y = floorl(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s floorl(%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/fma.c b/src/math/fma.c index cdd4cc3..24b65c8 100644 --- a/src/math/fma.c +++ b/src/math/fma.c @@ -25,7 +25,12 @@ int main(void) y = fma(p->x, p->x2, p->x3); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + /* do not check inexact by default */ +#if defined CHECK_INEXACT || defined CHECK_INEXACT_OMISSION + if (!checkexceptall(e, p->e, p->r)) { +#else + if (!checkexceptall(e|INEXACT, p->e|INEXACT, p->r)) { +#endif printf("%s:%d: bad fp exception: %s fma(%a,%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->x3, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/fmaf.c b/src/math/fmaf.c index 288bd32..c4329a2 100644 --- a/src/math/fmaf.c +++ b/src/math/fmaf.c @@ -25,7 +25,12 @@ int main(void) y = fmaf(p->x, p->x2, p->x3); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + /* do not check inexact by default */ +#if defined CHECK_INEXACT || defined CHECK_INEXACT_OMISSION + if (!checkexceptall(e, p->e, p->r)) { +#else + if (!checkexceptall(e|INEXACT, p->e|INEXACT, p->r)) { +#endif printf("%s:%d: bad fp exception: %s fmaf(%a,%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->x3, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/fmal.c b/src/math/fmal.c index 1f67aa4..791d5d3 100644 --- a/src/math/fmal.c +++ b/src/math/fmal.c @@ -30,7 +30,12 @@ int main(void) y = fmal(p->x, p->x2, p->x3); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + /* do not check inexact by default */ +#if defined CHECK_INEXACT || defined CHECK_INEXACT_OMISSION + if (!checkexceptall(e, p->e, p->r)) { +#else + if (!checkexceptall(e|INEXACT, p->e|INEXACT, p->r)) { +#endif printf("%s:%d: bad fp exception: %s fmal(%La,%La,%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->x3, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/fmax.c b/src/math/fmax.c index 3492893..b5a6b7a 100644 --- a/src/math/fmax.c +++ b/src/math/fmax.c @@ -26,7 +26,7 @@ int main(void) y = fmax(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s fmax(%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/fmaxf.c b/src/math/fmaxf.c index 8d787ed..cadc356 100644 --- a/src/math/fmaxf.c +++ b/src/math/fmaxf.c @@ -26,7 +26,7 @@ int main(void) y = fmaxf(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s fmaxf(%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/fmaxl.c b/src/math/fmaxl.c index 1c6e42a..1856dcd 100644 --- a/src/math/fmaxl.c +++ b/src/math/fmaxl.c @@ -32,7 +32,7 @@ int main(void) y = fmaxl(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s fmaxl(%La,%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/fmin.c b/src/math/fmin.c index 1ee3f4c..fb022c0 100644 --- a/src/math/fmin.c +++ b/src/math/fmin.c @@ -26,7 +26,7 @@ int main(void) y = fmin(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s fmin(%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/fminf.c b/src/math/fminf.c index c86569a..1bb1afa 100644 --- a/src/math/fminf.c +++ b/src/math/fminf.c @@ -26,7 +26,7 @@ int main(void) y = fminf(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s fminf(%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/fminl.c b/src/math/fminl.c index 91f3e87..da7a047 100644 --- a/src/math/fminl.c +++ b/src/math/fminl.c @@ -32,7 +32,7 @@ int main(void) y = fminl(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s fminl(%La,%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/frexp.c b/src/math/frexp.c index 88d2571..5ba58ff 100644 --- a/src/math/frexp.c +++ b/src/math/frexp.c @@ -27,7 +27,7 @@ int main(void) y = frexp(p->x, &yi); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s frexp(%a)=%a,%lld, want %s", p->file, p->line, rstr(p->r), p->x, p->y, p->i, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/frexpf.c b/src/math/frexpf.c index 33e1405..35dc913 100644 --- a/src/math/frexpf.c +++ b/src/math/frexpf.c @@ -27,7 +27,7 @@ int main(void) y = frexpf(p->x, &yi); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s frexpf(%a)=%a,%lld, want %s", p->file, p->line, rstr(p->r), p->x, p->y, p->i, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/frexpl.c b/src/math/frexpl.c index 9608504..a0cb1b8 100644 --- a/src/math/frexpl.c +++ b/src/math/frexpl.c @@ -33,7 +33,7 @@ int main(void) y = frexpl(p->x, &yi); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s frexpl(%La)=%La,%lld, want %s", p->file, p->line, rstr(p->r), p->x, p->y, p->i, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/ldexp.c b/src/math/ldexp.c index dcf73cc..93e92c2 100644 --- a/src/math/ldexp.c +++ b/src/math/ldexp.c @@ -26,7 +26,7 @@ int main(void) y = ldexp(p->x, p->i); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s ldexp(%a, %lld)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->i, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/ldexpf.c b/src/math/ldexpf.c index 4a1b742..135e957 100644 --- a/src/math/ldexpf.c +++ b/src/math/ldexpf.c @@ -26,7 +26,7 @@ int main(void) y = ldexpf(p->x, p->i); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s ldexpf(%a, %lld)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->i, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/ldexpl.c b/src/math/ldexpl.c index 8aa6a22..b04ef45 100644 --- a/src/math/ldexpl.c +++ b/src/math/ldexpl.c @@ -32,7 +32,7 @@ int main(void) y = ldexpl(p->x, p->i); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s ldexpl(%La, %lld)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->i, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/logb.c b/src/math/logb.c index 505d402..8d8a20f 100644 --- a/src/math/logb.c +++ b/src/math/logb.c @@ -26,7 +26,7 @@ int main(void) y = logb(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s logb(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/logbf.c b/src/math/logbf.c index 076ab26..4f0f0d0 100644 --- a/src/math/logbf.c +++ b/src/math/logbf.c @@ -26,7 +26,7 @@ int main(void) y = logbf(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s logbf(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/logbl.c b/src/math/logbl.c index 7792b78..8a774c7 100644 --- a/src/math/logbl.c +++ b/src/math/logbl.c @@ -32,7 +32,7 @@ int main(void) y = logbl(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s logbl(%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/modf.c b/src/math/modf.c index 5352a77..c0ce9d8 100644 --- a/src/math/modf.c +++ b/src/math/modf.c @@ -25,7 +25,7 @@ int main(void) y = modf(p->x, &yi); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s modf(%a)=%a,%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, p->y2, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/modff.c b/src/math/modff.c index dfdd3ab..d599f9f 100644 --- a/src/math/modff.c +++ b/src/math/modff.c @@ -25,7 +25,7 @@ int main(void) y = modff(p->x, &yi); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s modff(%a)=%a,%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, p->y2, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/modfl.c b/src/math/modfl.c index 84abdcd..5a19e83 100644 --- a/src/math/modfl.c +++ b/src/math/modfl.c @@ -30,7 +30,7 @@ int main(void) y = modfl(p->x, &yi); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s modf(%La)=%La,%La, want %s", p->file, p->line, rstr(p->r), p->x, p->y, p->y2, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/nearbyint.c b/src/math/nearbyint.c index 675e77c..1702097 100644 --- a/src/math/nearbyint.c +++ b/src/math/nearbyint.c @@ -26,7 +26,7 @@ int main(void) y = nearbyint(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s nearbyint(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/nearbyintf.c b/src/math/nearbyintf.c index a894548..1bd3db9 100644 --- a/src/math/nearbyintf.c +++ b/src/math/nearbyintf.c @@ -26,7 +26,7 @@ int main(void) y = nearbyintf(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s nearbyintf(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/nearbyintl.c b/src/math/nearbyintl.c index 0d62313..854255a 100644 --- a/src/math/nearbyintl.c +++ b/src/math/nearbyintl.c @@ -32,7 +32,7 @@ int main(void) y = nearbyintl(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s nearbyintl(%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/nextafter.c b/src/math/nextafter.c index 576a392..79667fe 100644 --- a/src/math/nextafter.c +++ b/src/math/nextafter.c @@ -26,7 +26,7 @@ int main(void) y = nextafter(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s nextafter(%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/nextafterf.c b/src/math/nextafterf.c index 822a9b6..18cd8bd 100644 --- a/src/math/nextafterf.c +++ b/src/math/nextafterf.c @@ -26,7 +26,7 @@ int main(void) y = nextafterf(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s nextafterf(%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/nextafterl.c b/src/math/nextafterl.c index 327258d..41edab0 100644 --- a/src/math/nextafterl.c +++ b/src/math/nextafterl.c @@ -32,7 +32,7 @@ int main(void) y = nextafterl(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s nextafterl(%La,%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/nexttoward.c b/src/math/nexttoward.c index ebf395c..8436c69 100644 --- a/src/math/nexttoward.c +++ b/src/math/nexttoward.c @@ -33,7 +33,7 @@ int main(void) y = nexttoward(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s nexttoward(%La,%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/nexttowardf.c b/src/math/nexttowardf.c index b026bd1..0cbed2f 100644 --- a/src/math/nexttowardf.c +++ b/src/math/nexttowardf.c @@ -33,7 +33,7 @@ int main(void) y = nexttowardf(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s nexttowardf(%La,%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/nexttowardl.c b/src/math/nexttowardl.c index f9250e1..ac0115a 100644 --- a/src/math/nexttowardl.c +++ b/src/math/nexttowardl.c @@ -32,7 +32,7 @@ int main(void) y = nexttowardl(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s nexttowardl(%La,%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/rint.c b/src/math/rint.c index 54c7df1..4ff50eb 100644 --- a/src/math/rint.c +++ b/src/math/rint.c @@ -26,7 +26,7 @@ int main(void) y = rint(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s rint(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/rintf.c b/src/math/rintf.c index e64fa1e..ced880d 100644 --- a/src/math/rintf.c +++ b/src/math/rintf.c @@ -26,7 +26,7 @@ int main(void) y = rintf(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s rintf(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/rintl.c b/src/math/rintl.c index 0079a1b..2970eb3 100644 --- a/src/math/rintl.c +++ b/src/math/rintl.c @@ -32,7 +32,7 @@ int main(void) y = rintl(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s rintl(%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/round.c b/src/math/round.c index 65a98fe..c7b8766 100644 --- a/src/math/round.c +++ b/src/math/round.c @@ -26,7 +26,7 @@ int main(void) y = round(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s round(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/roundf.c b/src/math/roundf.c index 3af83f1..d61762f 100644 --- a/src/math/roundf.c +++ b/src/math/roundf.c @@ -26,7 +26,7 @@ int main(void) y = roundf(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s roundf(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/roundl.c b/src/math/roundl.c index 8473dda..53eda20 100644 --- a/src/math/roundl.c +++ b/src/math/roundl.c @@ -32,7 +32,7 @@ int main(void) y = roundl(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s roundl(%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/scalb.c b/src/math/scalb.c index b1ea51e..901b20c 100644 --- a/src/math/scalb.c +++ b/src/math/scalb.c @@ -28,7 +28,7 @@ int main(void) y = scalb(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s scalb(%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/scalbf.c b/src/math/scalbf.c index c249153..309ff8d 100644 --- a/src/math/scalbf.c +++ b/src/math/scalbf.c @@ -28,7 +28,7 @@ int main(void) y = scalbf(p->x, p->x2); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s scalbf(%a,%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/scalbln.c b/src/math/scalbln.c index 4aa3f99..6e24b37 100644 --- a/src/math/scalbln.c +++ b/src/math/scalbln.c @@ -26,7 +26,7 @@ int main(void) y = scalbln(p->x, p->i); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s scalbln(%a, %lld)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->i, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/scalblnf.c b/src/math/scalblnf.c index e507582..ab19cf2 100644 --- a/src/math/scalblnf.c +++ b/src/math/scalblnf.c @@ -26,7 +26,7 @@ int main(void) y = scalblnf(p->x, p->i); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s scalblnf(%a, %lld)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->i, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/scalblnl.c b/src/math/scalblnl.c index bf07c16..2492483 100644 --- a/src/math/scalblnl.c +++ b/src/math/scalblnl.c @@ -32,7 +32,7 @@ int main(void) y = scalblnl(p->x, p->i); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s scalblnl(%La, %lld)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->i, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/scalbn.c b/src/math/scalbn.c index 4d17985..9b664dc 100644 --- a/src/math/scalbn.c +++ b/src/math/scalbn.c @@ -26,7 +26,7 @@ int main(void) y = scalbn(p->x, p->i); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s scalbn(%a, %lld)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->i, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/scalbnf.c b/src/math/scalbnf.c index 99c748b..69709a1 100644 --- a/src/math/scalbnf.c +++ b/src/math/scalbnf.c @@ -26,7 +26,7 @@ int main(void) y = scalbnf(p->x, p->i); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s scalbnf(%a, %lld)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->i, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/scalbnl.c b/src/math/scalbnl.c index 758b2af..9bc7bf5 100644 --- a/src/math/scalbnl.c +++ b/src/math/scalbnl.c @@ -32,7 +32,7 @@ int main(void) y = scalbnl(p->x, p->i); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s scalbnl(%La, %lld)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->i, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/special/atan2.h b/src/math/special/atan2.h index 0c5a2d0..058736f 100644 --- a/src/math/special/atan2.h +++ b/src/math/special/atan2.h @@ -24,3 +24,5 @@ T(RN, inf, inf, 0x1.921fb54442d18p-1, T(RN, inf, -inf, 0x1.2d97c7f3321d2p+1, -0x1.a79394p-3, INEXACT) T(RN, -inf, inf, -0x1.921fb54442d18p-1, 0x1.1a6264p-2, INEXACT) T(RN, -inf, -inf, -0x1.2d97c7f3321d2p+1, 0x1.a79394p-3, INEXACT) +T(RN, 0x1p-1023, 0x1p+0, 0x1p-1023, 0x0p+0, INEXACT|UNDERFLOW) +T(RN, 0x1p+0, 0x1p+1023, 0x1p-1023, 0x0p+0, INEXACT|UNDERFLOW) diff --git a/src/math/special/atan2f.h b/src/math/special/atan2f.h index 47421ec..1dc1d85 100644 --- a/src/math/special/atan2f.h +++ b/src/math/special/atan2f.h @@ -24,3 +24,5 @@ T(RN, inf, inf, 0x1.921fb6p-1, 0x1.777a5cp-2, INEXAC T(RN, inf, -inf, 0x1.2d97c8p+1, 0x1.99bc5cp-6, INEXACT) T(RN, -inf, inf, -0x1.921fb6p-1, -0x1.777a5cp-2, INEXACT) T(RN, -inf, -inf, -0x1.2d97c8p+1, -0x1.99bc5cp-6, INEXACT) +T(RN, 0x1p-127, 0x1p+0, 0x1p-127, 0x0p+0, INEXACT|UNDERFLOW) +T(RN, 0x1p+0, 0x1p+127, 0x1p-127, 0x0p+0, INEXACT|UNDERFLOW) diff --git a/src/math/special/atan2l.h b/src/math/special/atan2l.h index 42ae863..74113be 100644 --- a/src/math/special/atan2l.h +++ b/src/math/special/atan2l.h @@ -24,3 +24,5 @@ T(RN, inf, inf, 0x1. T(RN, inf, -inf, 0x1.2d97c7f3321d235p+1L, 0x1.b1acd8p-2, INEXACT) T(RN, -inf, inf, -0x1.921fb54442d1846ap-1L, -0x1.d9ccecp-3, INEXACT) T(RN, -inf, -inf, -0x1.2d97c7f3321d235p+1L, -0x1.b1acd8p-2, INEXACT) +T(RN, 0x1p-16383L, 0x1p+0L, 0x1p-16383L, 0x0p+0, INEXACT|UNDERFLOW) +T(RN, 0x1p+0L, 0x1p+16383L, 0x1p-16383L, 0x0p+0, INEXACT|UNDERFLOW) diff --git a/src/math/special/expm1.h b/src/math/special/expm1.h index e0d3ff9..5588ceb 100644 --- a/src/math/special/expm1.h +++ b/src/math/special/expm1.h @@ -5,3 +5,5 @@ T(RN, -0x1p+0, -0x1.43a54e4e98864p-1, 0x1.ca8a42p-4, INEXACT T(RN, inf, inf, 0x0p+0, 0) T(RN, -inf, -0x1p+0, 0x0p+0, 0) T(RN, nan, nan, 0x0p+0, 0) +T(RN, 0x1.ffffffffffffep-1023, 0x1.ffffffffffffep-1023, 0x0p+0, INEXACT|UNDERFLOW) +T(RN,-0x1.ffffffffffffep-1023,-0x1.ffffffffffffep-1023, 0x0p+0, INEXACT|UNDERFLOW) diff --git a/src/math/special/log1pf.h b/src/math/special/log1pf.h index 4fc4ff7..2761e8e 100644 --- a/src/math/special/log1pf.h +++ b/src/math/special/log1pf.h @@ -6,3 +6,4 @@ T(RN, -0x1p+0, -inf, 0x0p+0, DIVBYZERO) T(RN, inf, inf, 0x0p+0, 0) T(RN, -inf, nan, 0x0p+0, INVALID) T(RN, nan, nan, 0x0p+0, 0) +T(RN,-0x1.fffffcp-127,-0x1.fffffcp-127, 0x1p-104, INEXACT|UNDERFLOW) diff --git a/src/math/special/pow.h b/src/math/special/pow.h index fed7899..8af17c4 100644 --- a/src/math/special/pow.h +++ b/src/math/special/pow.h @@ -11,7 +11,7 @@ T(RN, 0x0p+0, -0x1p+0, inf, T(RN, 0x0p+0, -0x1p+1, inf, 0x0p+0, DIVBYZERO) T(RN, 0x0p+0, -0x1.8p+1, inf, 0x0p+0, DIVBYZERO) T(RN, 0x0p+0, -0x1p+2, inf, 0x0p+0, DIVBYZERO) -T(RN, 0x0p+0, -inf, inf, 0x0p+0, 0) +T(RN, 0x0p+0, -inf, inf, 0x0p+0, DIVBYZERO) T(RN, -0x0p+0, nan, nan, 0x0p+0, 0) T(RN, -0x0p+0, inf, 0x0p+0, 0x0p+0, 0) T(RN, -0x0p+0, 0x1.8p+1, -0x0p+0, 0x0p+0, 0) @@ -25,7 +25,7 @@ T(RN, -0x0p+0, -0x1p+0, -inf, T(RN, -0x0p+0, -0x1p+1, inf, 0x0p+0, DIVBYZERO) T(RN, -0x0p+0, -0x1.8p+1, -inf, 0x0p+0, DIVBYZERO) T(RN, -0x0p+0, -0x1p+2, inf, 0x0p+0, DIVBYZERO) -T(RN, -0x0p+0, -inf, inf, 0x0p+0, 0) +T(RN, -0x0p+0, -inf, inf, 0x0p+0, DIVBYZERO) T(RN, nan, 0x0p+0, 0x1p+0, 0x0p+0, 0) T(RN, inf, 0x0p+0, 0x1p+0, 0x0p+0, 0) T(RN, -inf, 0x0p+0, 0x1p+0, 0x0p+0, 0) diff --git a/src/math/special/powf.h b/src/math/special/powf.h index 8c7d72d..bec842d 100644 --- a/src/math/special/powf.h +++ b/src/math/special/powf.h @@ -11,7 +11,7 @@ T(RN, 0x0p+0, -0x1p+0, inf, 0x0p+0, DIVBYZ T(RN, 0x0p+0, -0x1p+1, inf, 0x0p+0, DIVBYZERO) T(RN, 0x0p+0, -0x1.8p+1, inf, 0x0p+0, DIVBYZERO) T(RN, 0x0p+0, -0x1p+2, inf, 0x0p+0, DIVBYZERO) -T(RN, 0x0p+0, -inf, inf, 0x0p+0, 0) +T(RN, 0x0p+0, -inf, inf, 0x0p+0, DIVBYZERO) T(RN, -0x0p+0, nan, nan, 0x0p+0, 0) T(RN, -0x0p+0, inf, 0x0p+0, 0x0p+0, 0) T(RN, -0x0p+0, 0x1.8p+1, -0x0p+0, 0x0p+0, 0) @@ -25,7 +25,7 @@ T(RN, -0x0p+0, -0x1p+0, -inf, 0x0p+0, DIVBYZ T(RN, -0x0p+0, -0x1p+1, inf, 0x0p+0, DIVBYZERO) T(RN, -0x0p+0, -0x1.8p+1, -inf, 0x0p+0, DIVBYZERO) T(RN, -0x0p+0, -0x1p+2, inf, 0x0p+0, DIVBYZERO) -T(RN, -0x0p+0, -inf, inf, 0x0p+0, 0) +T(RN, -0x0p+0, -inf, inf, 0x0p+0, DIVBYZERO) T(RN, nan, 0x0p+0, 0x1p+0, 0x0p+0, 0) T(RN, inf, 0x0p+0, 0x1p+0, 0x0p+0, 0) T(RN, -inf, 0x0p+0, 0x1p+0, 0x0p+0, 0) diff --git a/src/math/special/powl.h b/src/math/special/powl.h index c0e914c..2e613c0 100644 --- a/src/math/special/powl.h +++ b/src/math/special/powl.h @@ -11,7 +11,7 @@ T(RN, 0x0p+0L, -0x1p+0L, T(RN, 0x0p+0L, -0x1p+1L, inf, 0x0p+0, DIVBYZERO) T(RN, 0x0p+0L, -0x1.8p+1L, inf, 0x0p+0, DIVBYZERO) T(RN, 0x0p+0L, -0x1p+2L, inf, 0x0p+0, DIVBYZERO) -T(RN, 0x0p+0L, -inf, inf, 0x0p+0, 0) +T(RN, 0x0p+0L, -inf, inf, 0x0p+0, DIVBYZERO) T(RN, -0x0p+0L, nan, nan, 0x0p+0, 0) T(RN, -0x0p+0L, inf, 0x0p+0L, 0x0p+0, 0) T(RN, -0x0p+0L, 0x1.8p+1L, -0x0p+0L, 0x0p+0, 0) @@ -25,7 +25,7 @@ T(RN, -0x0p+0L, -0x1p+0L, T(RN, -0x0p+0L, -0x1p+1L, inf, 0x0p+0, DIVBYZERO) T(RN, -0x0p+0L, -0x1.8p+1L, -inf, 0x0p+0, DIVBYZERO) T(RN, -0x0p+0L, -0x1p+2L, inf, 0x0p+0, DIVBYZERO) -T(RN, -0x0p+0L, -inf, inf, 0x0p+0, 0) +T(RN, -0x0p+0L, -inf, inf, 0x0p+0, DIVBYZERO) T(RN, nan, 0x0p+0L, 0x1p+0L, 0x0p+0, 0) T(RN, inf, 0x0p+0L, 0x1p+0L, 0x0p+0, 0) T(RN, -inf, 0x0p+0L, 0x1p+0L, 0x0p+0, 0) diff --git a/src/math/special/remainder.h b/src/math/special/remainder.h index 54be6ec..150c435 100644 --- a/src/math/special/remainder.h +++ b/src/math/special/remainder.h @@ -64,3 +64,4 @@ T(RN, 0x1.cp+0, 0x1p-1, -0x1p-2, T(RN, -0x1.cp+0, 0x1p-1, 0x1p-2, 0x0p+0, 0) T(RN, 0x1.cp+0, -0x1p-1, -0x1p-2, 0x0p+0, 0) T(RN, -0x1.cp+0, -0x1p-1, 0x1p-2, 0x0p+0, 0) +T(RN, 0x1p-1070, inf, 0x1p-1070, 0x0p+0, 0) diff --git a/src/math/special/remainderf.h b/src/math/special/remainderf.h index 074a15d..28a8cfd 100644 --- a/src/math/special/remainderf.h +++ b/src/math/special/remainderf.h @@ -64,3 +64,4 @@ T(RN, 0x1.cp+0, 0x1p-1, -0x1p-2, 0x0p+0, 0) T(RN, -0x1.cp+0, 0x1p-1, 0x1p-2, 0x0p+0, 0) T(RN, 0x1.cp+0, -0x1p-1, -0x1p-2, 0x0p+0, 0) T(RN, -0x1.cp+0, -0x1p-1, 0x1p-2, 0x0p+0, 0) +T(RN, 0x1p-127, inf, 0x1p-127, 0x0p+0, 0) diff --git a/src/math/special/remainderl.h b/src/math/special/remainderl.h index 5667518..408f200 100644 --- a/src/math/special/remainderl.h +++ b/src/math/special/remainderl.h @@ -64,3 +64,4 @@ T(RN, 0x1.cp+0L, 0x1p-1L, T(RN, -0x1.cp+0L, 0x1p-1L, 0x1p-2L, 0x0p+0, 0) T(RN, 0x1.cp+0L, -0x1p-1L, -0x1p-2L, 0x0p+0, 0) T(RN, -0x1.cp+0L, -0x1p-1L, 0x1p-2L, 0x0p+0, 0) +T(RN, 0x1p-16383L, inf, 0x1p-16383L, 0x0p+0, 0) diff --git a/src/math/sqrt.c b/src/math/sqrt.c index 1c0d502..403e2dc 100644 --- a/src/math/sqrt.c +++ b/src/math/sqrt.c @@ -27,7 +27,7 @@ int main(void) y = sqrt(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s sqrt(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/sqrtf.c b/src/math/sqrtf.c index d29cc57..8e8f8fe 100644 --- a/src/math/sqrtf.c +++ b/src/math/sqrtf.c @@ -27,7 +27,7 @@ int main(void) y = sqrtf(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s sqrtf(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/sqrtl.c b/src/math/sqrtl.c index 6329a3e..ab59cc8 100644 --- a/src/math/sqrtl.c +++ b/src/math/sqrtl.c @@ -33,7 +33,7 @@ int main(void) y = sqrtl(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s sqrtl(%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/trunc.c b/src/math/trunc.c index 3b20db7..377118c 100644 --- a/src/math/trunc.c +++ b/src/math/trunc.c @@ -26,7 +26,7 @@ int main(void) y = trunc(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s trunc(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/truncf.c b/src/math/truncf.c index 1193623..94825d9 100644 --- a/src/math/truncf.c +++ b/src/math/truncf.c @@ -26,7 +26,7 @@ int main(void) y = truncf(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s truncf(%a)=%a, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/truncl.c b/src/math/truncl.c index 162d918..98d5197 100644 --- a/src/math/truncl.c +++ b/src/math/truncl.c @@ -32,7 +32,7 @@ int main(void) y = truncl(p->x); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); - if (!checkexcept(e, p->e, p->r)) { + if (!checkexceptall(e, p->e, p->r)) { printf("%s:%d: bad fp exception: %s truncl(%La)=%La, want %s", p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); printf(" got %s\n", estr(e)); diff --git a/src/math/ucb/pow.h b/src/math/ucb/pow.h index 04ea84a..05afcf5 100644 --- a/src/math/ucb/pow.h +++ b/src/math/ucb/pow.h @@ -143,10 +143,10 @@ T(RN, -0x0p+0, inf, 0x0p+0, // +-(|x| < 1) ** -inf is +inf T(RN, 0x1.fffffffffffffp-1, -inf, inf, 0x0p+0, 0) T(RN, 0x1p-1074, -inf, inf, 0x0p+0, 0) -T(RN, 0x0p+0, -inf, inf, 0x0p+0, 0) +T(RN, 0x0p+0, -inf, inf, 0x0p+0, DIVBYZERO) T(RN, -0x1.fffffffffffffp-1, -inf, inf, 0x0p+0, 0) T(RN, -0x1p-1074, -inf, inf, 0x0p+0, 0) -T(RN, -0x0p+0, -inf, inf, 0x0p+0, 0) +T(RN, -0x0p+0, -inf, inf, 0x0p+0, DIVBYZERO) // +1 ** (anthing) is +1 T(RN, 0x1p+0, nan, 0x1p+0, 0x0p+0, 0) T(RN, 0x1p+0, inf, 0x1p+0, 0x0p+0, 0) diff --git a/src/math/ucb/powf.h b/src/math/ucb/powf.h index c0d7747..d9e00db 100644 --- a/src/math/ucb/powf.h +++ b/src/math/ucb/powf.h @@ -277,28 +277,28 @@ T(RD, -0x0p+0, inf, 0x0p+0, 0x0p+0, 0) // +-(|x| < 1) ** -inf is +inf T(RN, 0x1.fffffep-1, -inf, inf, 0x0p+0, 0) T(RN, 0x1p-149, -inf, inf, 0x0p+0, 0) -T(RN, 0x0p+0, -inf, inf, 0x0p+0, 0) +T(RN, 0x0p+0, -inf, inf, 0x0p+0, DIVBYZERO) T(RN, -0x1.fffffep-1, -inf, inf, 0x0p+0, 0) T(RN, -0x1p-149, -inf, inf, 0x0p+0, 0) -T(RN, -0x0p+0, -inf, inf, 0x0p+0, 0) +T(RN, -0x0p+0, -inf, inf, 0x0p+0, DIVBYZERO) T(RZ, 0x1.fffffep-1, -inf, inf, 0x0p+0, 0) T(RZ, 0x1p-149, -inf, inf, 0x0p+0, 0) -T(RZ, 0x0p+0, -inf, inf, 0x0p+0, 0) +T(RZ, 0x0p+0, -inf, inf, 0x0p+0, DIVBYZERO) T(RZ, -0x1.fffffep-1, -inf, inf, 0x0p+0, 0) T(RZ, -0x1p-149, -inf, inf, 0x0p+0, 0) -T(RZ, -0x0p+0, -inf, inf, 0x0p+0, 0) +T(RZ, -0x0p+0, -inf, inf, 0x0p+0, DIVBYZERO) T(RU, 0x1.fffffep-1, -inf, inf, 0x0p+0, 0) T(RU, 0x1p-149, -inf, inf, 0x0p+0, 0) -T(RU, 0x0p+0, -inf, inf, 0x0p+0, 0) +T(RU, 0x0p+0, -inf, inf, 0x0p+0, DIVBYZERO) T(RU, -0x1.fffffep-1, -inf, inf, 0x0p+0, 0) T(RU, -0x1p-149, -inf, inf, 0x0p+0, 0) -T(RU, -0x0p+0, -inf, inf, 0x0p+0, 0) +T(RU, -0x0p+0, -inf, inf, 0x0p+0, DIVBYZERO) T(RD, 0x1.fffffep-1, -inf, inf, 0x0p+0, 0) T(RD, 0x1p-149, -inf, inf, 0x0p+0, 0) -T(RD, 0x0p+0, -inf, inf, 0x0p+0, 0) +T(RD, 0x0p+0, -inf, inf, 0x0p+0, DIVBYZERO) T(RD, -0x1.fffffep-1, -inf, inf, 0x0p+0, 0) T(RD, -0x1p-149, -inf, inf, 0x0p+0, 0) -T(RD, -0x0p+0, -inf, inf, 0x0p+0, 0) +T(RD, -0x0p+0, -inf, inf, 0x0p+0, DIVBYZERO) // +-1 ** +-inf is +1 T(RN, 0x1p+0, inf, 0x1p+0, 0x0p+0, 0) T(RN, 0x1p+0, -inf, 0x1p+0, 0x0p+0, 0)