# HG changeset patch # User Rik # Date 1515198955 28800 # Node ID a6753fc10731e9c94fb8a5aeb37e9c46423e58d3 # Parent c85871d2a10e08367ba32eb7b6f7b222dbf0d04c 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. diff -r c85871d2a10e -r a6753fc10731 libinterp/corefcn/mappers.cc --- 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"))); diff -r c85871d2a10e -r a6753fc10731 scripts/elfun/asech.m --- 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));