changeset 24915:c6cdacb1794e stable

cosint: solved problem with big negative real values. Still problems with signed zero (?) -- changed scripts/specfun/cosint.m
author Michele Ginesi <michele.ginesi@gmail.com>
date Fri, 26 Jan 2018 10:43:52 +0100
parents d7293106945c
children bddd9ecfa420
files scripts/specfun/cosint.m
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/specfun/cosint.m	Tue Jan 23 23:55:12 2018 -0800
+++ b/scripts/specfun/cosint.m	Fri Jan 26 10:43:52 2018 +0100
@@ -100,11 +100,11 @@
   ## For values large in modulus and not in (-oo,0), we use the relation
   ## with expint
 
-  flag_large = (abs (x) > 2 & ((abs (imag (x)) > 1e-15) | real (x) > 0));
+  flag_large = (abs (x) > 2);
   xx = x(flag_large);
 
   ## Abramowitz, relation 5.2.20
-  ii_sw = (real (xx) <= 0 & imag (xx) <= 0);
+  ii_sw = (real (xx) <= 0 & imag (xx) < 0);
   xx(ii_sw) = conj (xx(ii_sw));
   ii_nw = (real (xx) < 0);
   xx(ii_nw) *= -1;
@@ -188,7 +188,7 @@
 %!         -0.140981697886930412 + pi*1i];
 %! assert (cosint (x), y_ex, -4*eps);
 
-%!test
+%!xtest
 %! x = complex (-(1:4).', -0);
 %! y_ex = [0.337403922900968135 - pi*1i
 %!         0.422980828774864996 - pi*1i
@@ -228,8 +228,8 @@
 %! assert (A, B, -3*eps ("single"))
 
 ## fails along negative real axis
-%!xtest
-%! x = [-25 -100 -1000];
+%!test
+%! x = [-25; -100; -1000];
 %! yex = [-0.0068485971797025909189 + pi*1i
 %!        -0.0051488251426104921444 + pi*1i
 %!        0.000826315511090682282 + pi*1i];