changeset 24532:a6753fc10731

Mark certain hyperbolic BIST tests as Mac-only failures (bug #52627). * mappers.cc (Facos): Relax tolerance from 2*eps to 3*eps. * mappers.cc (Facosh): Use run-time conditional (! ismac ()) to run regular BIST code on non-mac platforms. Create xtest which only executes on Macs to document failure. * asech.m: Use run-time conditional (! ismac ()) to run regular BIST code on non-mac platforms. Create xtest which only executes on Macs to document failure.
author Rik <rik@octave.org>
date Fri, 05 Jan 2018 16:35:55 -0800
parents c85871d2a10e
children ad7b19bfcce4
files libinterp/corefcn/mappers.cc scripts/elfun/asech.m
diffstat 2 files changed, 31 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/mappers.cc	Fri Jan 05 16:17:36 2018 -0800
+++ b/libinterp/corefcn/mappers.cc	Fri Jan 05 16:35:55 2018 -0800
@@ -116,13 +116,13 @@
 %! ival = 1.31695789692481671;
 %! obs = acos ([2, 2-i*eps, 2+i*eps]);
 %! exp = [rval + ival*i, rval + ival*i, rval - ival*i];
-%! assert (obs, exp, 2*eps);
+%! assert (obs, exp, 3*eps);
 %! rval = pi;
 %! obs = acos ([-2, -2-i*eps, -2+i*eps]);
 %! exp = [rval - ival*i, rval + ival*i, rval - ival*i];
-%! assert (obs, exp, 2*eps);
-%! assert (acos ([2 0]),  [ival*i, pi/2], 2*eps);
-%! assert (acos ([2 0i]), [ival*i, pi/2], 2*eps);
+%! assert (obs, exp, 3*eps);
+%! assert (acos ([2 0]),  [ival*i, pi/2], 3*eps);
+%! assert (acos ([2 0i]), [ival*i, pi/2], 3*eps);
 
 ## Test large magnitude arguments (bug #45507)
 ## Test fails with older versions of libm, solution is to upgrade.
@@ -149,7 +149,15 @@
 }
 
 /*
-%!test
+%!testif ; ! ismac ()
+%! x = [1, 0, -1, 0];
+%! v = [0, pi/2*i, pi*i, pi/2*i];
+%! assert (acosh (x), v, sqrt (eps));
+
+%!xtest <52627>
+%! ## Same test code as above, but intended only for test statistics on Mac.
+%! ## Mac trig/hyperbolic functions have huge tolerances.
+%! if (! ismac ()), return; endif
 %! x = [1, 0, -1, 0];
 %! v = [0, pi/2*i, pi*i, pi/2*i];
 %! assert (acosh (x), v, sqrt (eps));
@@ -164,7 +172,15 @@
 %! im = pi/2;
 %! assert (acosh (-10i), re - i*im);
 
-%!test
+%!testif ; ! ismac ()
+%! x = single ([1, 0, -1, 0]);
+%! v = single ([0, pi/2*i, pi*i, pi/2*i]);
+%! assert (acosh (x), v, sqrt (eps ("single")));
+
+%!xtest <52627>
+%! ## Same test code as above, but intended only for test statistics on Mac.
+%! ## Mac trig/hyperbolic functions have huge tolerances.
+%! if (! ismac ()), return; endif
 %! x = single ([1, 0, -1, 0]);
 %! v = single ([0, pi/2*i, pi*i, pi/2*i]);
 %! assert (acosh (x), v, sqrt (eps ("single")));
--- a/scripts/elfun/asech.m	Fri Jan 05 16:17:36 2018 -0800
+++ b/scripts/elfun/asech.m	Fri Jan 05 16:35:55 2018 -0800
@@ -35,7 +35,15 @@
 endfunction
 
 
-%!test
+%!testif ; ! ismac ()
+%! v = [0, pi*i];
+%! x = [1, -1];
+%! assert (asech (x), v, sqrt (eps));
+
+%!xtest <52627>
+%! ## Same test code as above, but intended only for test statistics on Mac.
+%! ## Mac trig/hyperbolic functions have huge tolerances.
+%! if (! ismac ()), return; endif
 %! v = [0, pi*i];
 %! x = [1, -1];
 %! assert (asech (x), v, sqrt (eps));