[Numpy-svn] r5456 - branches/1.1.x/numpy/core/src

numpy-svn@scip... numpy-svn@scip...
Sat Jul 19 12:22:35 CDT 2008


Author: charris
Date: 2008-07-19 12:22:33 -0500 (Sat, 19 Jul 2008)
New Revision: 5456

Modified:
   branches/1.1.x/numpy/core/src/umathmodule.c.src
Log:
Fix arccosh and arcsinh implementations for complex numbers.


Modified: branches/1.1.x/numpy/core/src/umathmodule.c.src
===================================================================
--- branches/1.1.x/numpy/core/src/umathmodule.c.src	2008-07-19 14:15:47 UTC (rev 5455)
+++ branches/1.1.x/numpy/core/src/umathmodule.c.src	2008-07-19 17:22:33 UTC (rev 5456)
@@ -825,16 +825,16 @@
     c@typ@ t;
 
     nc_sum@c@(x, &nc_1@c@, &t);
+    nc_sqrt@c@(&t, &t);
     nc_diff@c@(x, &nc_1@c@, r);
-    nc_prod@c@(&t, r, r);
     nc_sqrt@c@(r, r);
+    nc_prod@c@(&t, r, r);
     nc_sum@c@(x, r, r);
     nc_log@c@(r, r);
     return;
     /*
-      return nc_log(nc_sum(x,
-      nc_sqrt(nc_prod(nc_sum(x,nc_1), nc_diff(x,nc_1)))));
-    */
+     * log(x + sqrt(x + 1)*sqrt(x - 1)
+     */
 }
 
 static void
@@ -863,13 +863,12 @@
     nc_prod@c@(x, x, r);
     nc_sum@c@(&nc_1@c@, r, r);
     nc_sqrt@c@(r, r);
-    nc_diff@c@(r, x, r);
+    nc_sum@c@(r, x, r);
     nc_log@c@(r, r);
-    nc_neg@c@(r, r);
     return;
     /*
-      return nc_neg(nc_log(nc_diff(nc_sqrt(nc_sum(nc_1,nc_prod(x,x))),x)));
-    */
+     * log(x + sqrt(1 + x**2))
+     */
 }
 
 static void



More information about the Numpy-svn mailing list