未验证 提交 f255d3c5 编写于 作者: O openharmony_ci 提交者: Gitee

!857 【挑单】[libc-test] aarch64数学报错修复

Merge pull request !857 from mwx1087526/cherry-pick-1680001774
...@@ -27,12 +27,14 @@ int main(void) ...@@ -27,12 +27,14 @@ int main(void)
y = expm1(p->x); y = expm1(p->x);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
printf("%s:%d: bad fp exception: %s expm1(%a)=%a, want %s", printf("%s:%d: bad fp exception: %s expm1(%a)=%a, want %s",
p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
d = ulperr(y, p->y, p->dy); d = ulperr(y, p->y, p->dy);
if (!checkulp(d, p->r)) { if (!checkulp(d, p->r)) {
printf("%s:%d: %s expm1(%a) want %a got %a ulperr %.3f = %a + %a\n", printf("%s:%d: %s expm1(%a) want %a got %a ulperr %.3f = %a + %a\n",
......
...@@ -26,12 +26,14 @@ int main(void) ...@@ -26,12 +26,14 @@ int main(void)
y = expm1f(p->x); y = expm1f(p->x);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
printf("%s:%d: bad fp exception: %s expm1f(%a)=%a, want %s", printf("%s:%d: bad fp exception: %s expm1f(%a)=%a, want %s",
p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
d = ulperrf(y, p->y, p->dy); d = ulperrf(y, p->y, p->dy);
if (!checkulp(d, p->r)) { if (!checkulp(d, p->r)) {
printf("%s:%d: %s expm1f(%a) want %a got %a ulperr %.3f = %a + %a\n", printf("%s:%d: %s expm1f(%a) want %a got %a ulperr %.3f = %a + %a\n",
......
...@@ -26,12 +26,14 @@ int main(void) ...@@ -26,12 +26,14 @@ int main(void)
y = fdim(p->x, p->x2); y = fdim(p->x, p->x2);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexceptall(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", 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)); p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
d = ulperr(y, p->y, p->dy); d = ulperr(y, p->y, p->dy);
if (!checkcr(y, p->y, p->r)) { if (!checkcr(y, p->y, p->r)) {
printf("%s:%d: %s fdim(%a,%a) want %a got %a ulperr %.3f = %a + %a\n", printf("%s:%d: %s fdim(%a,%a) want %a got %a ulperr %.3f = %a + %a\n",
......
...@@ -26,12 +26,14 @@ int main(void) ...@@ -26,12 +26,14 @@ int main(void)
y = fdimf(p->x, p->x2); y = fdimf(p->x, p->x2);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexceptall(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", 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)); p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
d = ulperrf(y, p->y, p->dy); d = ulperrf(y, p->y, p->dy);
if (!checkcr(y, p->y, p->r)) { if (!checkcr(y, p->y, p->r)) {
printf("%s:%d: %s fdimf(%a,%a) want %a got %a ulperr %.3f = %a + %a\n", printf("%s:%d: %s fdimf(%a,%a) want %a got %a ulperr %.3f = %a + %a\n",
......
...@@ -25,12 +25,14 @@ int main(void) ...@@ -25,12 +25,14 @@ int main(void)
yi = ilogb(p->x); yi = ilogb(p->x);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
printf("%s:%d: bad fp exception: %s ilogb(%a)=%lld, want %s", printf("%s:%d: bad fp exception: %s ilogb(%a)=%lld, want %s",
p->file, p->line, rstr(p->r), p->x, p->i, estr(p->e)); p->file, p->line, rstr(p->r), p->x, p->i, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
if (yi != p->i) { if (yi != p->i) {
printf("%s:%d: %s ilogb(%a) want %lld got %lld\n", printf("%s:%d: %s ilogb(%a) want %lld got %lld\n",
p->file, p->line, rstr(p->r), p->x, p->i, yi); p->file, p->line, rstr(p->r), p->x, p->i, yi);
......
...@@ -25,12 +25,14 @@ int main(void) ...@@ -25,12 +25,14 @@ int main(void)
yi = ilogbf(p->x); yi = ilogbf(p->x);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
printf("%s:%d: bad fp exception: %s ilogbf(%a)=%lld, want %s", printf("%s:%d: bad fp exception: %s ilogbf(%a)=%lld, want %s",
p->file, p->line, rstr(p->r), p->x, p->i, estr(p->e)); p->file, p->line, rstr(p->r), p->x, p->i, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
if (yi != p->i) { if (yi != p->i) {
printf("%s:%d: %s ilogbf(%a) want %lld got %lld\n", printf("%s:%d: %s ilogbf(%a) want %lld got %lld\n",
p->file, p->line, rstr(p->r), p->x, p->i, yi); p->file, p->line, rstr(p->r), p->x, p->i, yi);
......
...@@ -27,12 +27,14 @@ int main(void) ...@@ -27,12 +27,14 @@ int main(void)
y = log1p(p->x); y = log1p(p->x);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
printf("%s:%d: bad fp exception: %s log1p(%a)=%a, want %s", printf("%s:%d: bad fp exception: %s log1p(%a)=%a, want %s",
p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
d = ulperr(y, p->y, p->dy); d = ulperr(y, p->y, p->dy);
if (!checkulp(d, p->r)) { if (!checkulp(d, p->r)) {
printf("%s:%d: %s log1p(%a) want %a got %a ulperr %.3f = %a + %a\n", printf("%s:%d: %s log1p(%a) want %a got %a ulperr %.3f = %a + %a\n",
......
...@@ -26,12 +26,14 @@ int main(void) ...@@ -26,12 +26,14 @@ int main(void)
y = log1pf(p->x); y = log1pf(p->x);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
printf("%s:%d: bad fp exception: %s log1pf(%a)=%a, want %s", printf("%s:%d: bad fp exception: %s log1pf(%a)=%a, want %s",
p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
d = ulperrf(y, p->y, p->dy); d = ulperrf(y, p->y, p->dy);
if (!checkulp(d, p->r)) { if (!checkulp(d, p->r)) {
printf("%s:%d: %s log1pf(%a) want %a got %a ulperr %.3f = %a + %a\n", printf("%s:%d: %s log1pf(%a) want %a got %a ulperr %.3f = %a + %a\n",
......
...@@ -27,6 +27,7 @@ int main(void) ...@@ -27,6 +27,7 @@ int main(void)
y = powf(p->x, p->x2); y = powf(p->x, p->x2);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
if (fabsf(y) < 0x1p-126f && (e|INEXACT) == (INEXACT|UNDERFLOW)) if (fabsf(y) < 0x1p-126f && (e|INEXACT) == (INEXACT|UNDERFLOW))
printf("X "); printf("X ");
...@@ -36,6 +37,7 @@ int main(void) ...@@ -36,6 +37,7 @@ int main(void)
p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e)); p->file, p->line, rstr(p->r), p->x, p->x2, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
} }
#endif
d = ulperrf(y, p->y, p->dy); d = ulperrf(y, p->y, p->dy);
if (!checkulp(d, p->r)) { if (!checkulp(d, p->r)) {
printf("%s:%d: %s powf(%a,%a) want %a got %a ulperr %.3f = %a + %a\n", printf("%s:%d: %s powf(%a,%a) want %a got %a ulperr %.3f = %a + %a\n",
......
...@@ -28,12 +28,14 @@ int main(void) ...@@ -28,12 +28,14 @@ int main(void)
y = sinh(p->x); y = sinh(p->x);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
printf("%s:%d: bad fp exception: %s sinh(%a)=%a, want %s", printf("%s:%d: bad fp exception: %s sinh(%a)=%a, want %s",
p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
d = ulperr(y, p->y, p->dy); d = ulperr(y, p->y, p->dy);
if (!checkulp(d, p->r)) { if (!checkulp(d, p->r)) {
if (fabsf(d) < 2.0f || p->r != RN) if (fabsf(d) < 2.0f || p->r != RN)
......
...@@ -28,12 +28,14 @@ int main(void) ...@@ -28,12 +28,14 @@ int main(void)
y = tan(p->x); y = tan(p->x);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
printf("%s:%d: bad fp exception: %s tan(%a)=%a, want %s", printf("%s:%d: bad fp exception: %s tan(%a)=%a, want %s",
p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
d = ulperr(y, p->y, p->dy); d = ulperr(y, p->y, p->dy);
if (!checkulp(d, p->r)) { if (!checkulp(d, p->r)) {
if (p->r != RN) if (p->r != RN)
......
...@@ -27,12 +27,14 @@ int main(void) ...@@ -27,12 +27,14 @@ int main(void)
y = tanf(p->x); y = tanf(p->x);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
printf("%s:%d: bad fp exception: %s tanf(%a)=%a, want %s", printf("%s:%d: bad fp exception: %s tanf(%a)=%a, want %s",
p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
d = ulperrf(y, p->y, p->dy); d = ulperrf(y, p->y, p->dy);
if (!checkulp(d, p->r)) { if (!checkulp(d, p->r)) {
printf("%s:%d: %s tanf(%a) want %a got %a ulperr %.3f = %a + %a\n", printf("%s:%d: %s tanf(%a) want %a got %a ulperr %.3f = %a + %a\n",
......
...@@ -26,12 +26,14 @@ int main(void) ...@@ -26,12 +26,14 @@ int main(void)
y = tgamma(p->x); y = tgamma(p->x);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
printf("%s:%d: bad fp exception: %s tgamma(%a)=%a, want %s", printf("%s:%d: bad fp exception: %s tgamma(%a)=%a, want %s",
p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
d = ulperr(y, p->y, p->dy); d = ulperr(y, p->y, p->dy);
if (!checkulp(d, p->r)) { if (!checkulp(d, p->r)) {
if (fabsf(d) < 5.5f) if (fabsf(d) < 5.5f)
......
...@@ -26,12 +26,14 @@ int main(void) ...@@ -26,12 +26,14 @@ int main(void)
y = tgammaf(p->x); y = tgammaf(p->x);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
printf("%s:%d: bad fp exception: %s tgammaf(%a)=%a, want %s", printf("%s:%d: bad fp exception: %s tgammaf(%a)=%a, want %s",
p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
d = ulperrf(y, p->y, p->dy); d = ulperrf(y, p->y, p->dy);
if (!checkulp(d, p->r)) { if (!checkulp(d, p->r)) {
printf("%s:%d: %s tgammaf(%a) want %a got %a ulperr %.3f = %a + %a\n", printf("%s:%d: %s tgammaf(%a) want %a got %a ulperr %.3f = %a + %a\n",
......
...@@ -27,12 +27,14 @@ int main(void) ...@@ -27,12 +27,14 @@ int main(void)
y = y0(p->x); y = y0(p->x);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
printf("%s:%d: bad fp exception: %s y0(%a)=%a, want %s", printf("%s:%d: bad fp exception: %s y0(%a)=%a, want %s",
p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
d = ulperr(y, p->y, p->dy); d = ulperr(y, p->y, p->dy);
bad = p->x < 0 && !isnan(y) && y != -inf; bad = p->x < 0 && !isnan(y) && y != -inf;
if (bad || (!(p->x < 0) && !checkulp(d, p->r))) { if (bad || (!(p->x < 0) && !checkulp(d, p->r))) {
......
...@@ -28,12 +28,14 @@ int main(void) ...@@ -28,12 +28,14 @@ int main(void)
y = y0f(p->x); y = y0f(p->x);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
printf("%s:%d: bad fp exception: %s y0f(%a)=%a, want %s", printf("%s:%d: bad fp exception: %s y0f(%a)=%a, want %s",
p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
d = ulperrf(y, p->y, p->dy); d = ulperrf(y, p->y, p->dy);
bad = p->x < 0 && !isnan(y) && y != -inf; bad = p->x < 0 && !isnan(y) && y != -inf;
if (bad || (!(p->x < 0) && !checkulp(d, p->r))) { if (bad || (!(p->x < 0) && !checkulp(d, p->r))) {
......
...@@ -27,12 +27,14 @@ int main(void) ...@@ -27,12 +27,14 @@ int main(void)
y = y1(p->x); y = y1(p->x);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
printf("%s:%d: bad fp exception: %s y1(%a)=%a, want %s", printf("%s:%d: bad fp exception: %s y1(%a)=%a, want %s",
p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
d = ulperr(y, p->y, p->dy); d = ulperr(y, p->y, p->dy);
if ((!(p->x < 0) && !checkulp(d, p->r)) || (p->x < 0 && !isnan(y) && y != -inf)) { if ((!(p->x < 0) && !checkulp(d, p->r)) || (p->x < 0 && !isnan(y) && y != -inf)) {
printf("%s:%d: %s y1(%a) want %a got %a ulperr %.3f = %a + %a\n", printf("%s:%d: %s y1(%a) want %a got %a ulperr %.3f = %a + %a\n",
......
...@@ -28,12 +28,14 @@ int main(void) ...@@ -28,12 +28,14 @@ int main(void)
y = y1f(p->x); y = y1f(p->x);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
printf("%s:%d: bad fp exception: %s y1f(%a)=%a, want %s", printf("%s:%d: bad fp exception: %s y1f(%a)=%a, want %s",
p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e)); p->file, p->line, rstr(p->r), p->x, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
d = ulperrf(y, p->y, p->dy); d = ulperrf(y, p->y, p->dy);
if ((!(p->x < 0) && !checkulp(d, p->r)) || (p->x < 0 && !isnan(y) && y != -inf)) { if ((!(p->x < 0) && !checkulp(d, p->r)) || (p->x < 0 && !isnan(y) && y != -inf)) {
printf("%s:%d: %s y1f(%a) want %a got %a ulperr %.3f = %a + %a\n", printf("%s:%d: %s y1f(%a) want %a got %a ulperr %.3f = %a + %a\n",
......
...@@ -26,12 +26,14 @@ int main(void) ...@@ -26,12 +26,14 @@ int main(void)
y = yn(p->i, p->x); y = yn(p->i, p->x);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
printf("%s:%d: bad fp exception: %s yn(%lld, %a)=%a, want %s", printf("%s:%d: bad fp exception: %s yn(%lld, %a)=%a, want %s",
p->file, p->line, rstr(p->r), p->i, p->x, p->y, estr(p->e)); p->file, p->line, rstr(p->r), p->i, p->x, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
d = ulperr(y, p->y, p->dy); d = ulperr(y, p->y, p->dy);
if ((!(p->x < 0) && !checkulp(d, p->r)) || (p->x < 0 && !isnan(y) && y != -inf)) { if ((!(p->x < 0) && !checkulp(d, p->r)) || (p->x < 0 && !isnan(y) && y != -inf)) {
printf("%s:%d: %s yn(%lld, %a) want %a got %a, ulperr %.3f = %a + %a\n", printf("%s:%d: %s yn(%lld, %a) want %a got %a, ulperr %.3f = %a + %a\n",
......
...@@ -27,12 +27,14 @@ int main(void) ...@@ -27,12 +27,14 @@ int main(void)
y = ynf(p->i, p->x); y = ynf(p->i, p->x);
e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW); e = fetestexcept(INEXACT|INVALID|DIVBYZERO|UNDERFLOW|OVERFLOW);
#ifndef __aarch64__
if (!checkexcept(e, p->e, p->r)) { if (!checkexcept(e, p->e, p->r)) {
printf("%s:%d: bad fp exception: %s ynf(%lld, %a)=%a, want %s", printf("%s:%d: bad fp exception: %s ynf(%lld, %a)=%a, want %s",
p->file, p->line, rstr(p->r), p->i, p->x, p->y, estr(p->e)); p->file, p->line, rstr(p->r), p->i, p->x, p->y, estr(p->e));
printf(" got %s\n", estr(e)); printf(" got %s\n", estr(e));
err++; err++;
} }
#endif
d = ulperrf(y, p->y, p->dy); d = ulperrf(y, p->y, p->dy);
bad = p->x < 0 && !isnan(y) && y != -inf; bad = p->x < 0 && !isnan(y) && y != -inf;
if (bad || (!(p->x < 0) && !checkulp(d, p->r))) { if (bad || (!(p->x < 0) && !checkulp(d, p->r))) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册