[Numpy-svn] r4882 - trunk/numpy/core/src

numpy-svn at scipy.org numpy-svn at scipy.org
Mon Mar 17 11:20:24 EDT 2008


Author: charris
Date: 2008-03-17 10:20:18 -0500 (Mon, 17 Mar 2008)
New Revision: 4882

Modified:
   trunk/numpy/core/src/umathmodule.c.src
Log:
Use a more accurate expression for arccosh of complex numbers. The
implementations of the other special functions should be examined to see if
similar improvements can be made.


Modified: trunk/numpy/core/src/umathmodule.c.src
===================================================================
--- trunk/numpy/core/src/umathmodule.c.src	2008-03-17 14:52:17 UTC (rev 4881)
+++ trunk/numpy/core/src/umathmodule.c.src	2008-03-17 15:20:18 UTC (rev 4882)
@@ -804,15 +804,18 @@
 static void
 nc_acosh at c@(c at typ@ *x, c at typ@ *r)
 {
-    nc_prod at c@(x, x, r);
-    nc_diff at c@(r, &nc_1 at c@, r);
+    c at typ@ t;
+
+    nc_sum at c@(x, &nc_1 at c@, &t);
+    nc_diff at c@(x, &nc_1 at c@, r);
+    nc_prod at c@(&t, r, r);
     nc_sqrt at c@(r, r);
     nc_sum at c@(x, r, r);
     nc_log at c@(r, r);
     return;
     /*
       return nc_log(nc_sum(x,
-      nc_sqrt(nc_diff(nc_prod(x,x),nc_1))));
+      nc_sqrt(nc_prod(nc_sum(x,nc_1), nc_diff(x,nc_1)))));
     */
 }
 




More information about the Numpy-svn mailing list