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

numpy-svn@scip... numpy-svn@scip...
Sat Jul 19 16:56:52 CDT 2008


Author: ptvirtan
Date: 2008-07-19 16:56:46 -0500 (Sat, 19 Jul 2008)
New Revision: 5457

Modified:
   trunk/numpy/core/src/umathmodule.c.src
Log:
Fix arccosh branch cut. Remove one unnecessary operation from nc_asinh.

Modified: trunk/numpy/core/src/umathmodule.c.src
===================================================================
--- trunk/numpy/core/src/umathmodule.c.src	2008-07-19 17:22:33 UTC (rev 5456)
+++ trunk/numpy/core/src/umathmodule.c.src	2008-07-19 21:56:46 UTC (rev 5457)
@@ -825,15 +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_sqrt@c@(r, r);
     nc_prod@c@(&t, r, r);
-    nc_sqrt@c@(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)))));
+      nc_prod(nc_sqrt(nc_sum(x,nc_1)), nc_sqrt(nc_diff(x,nc_1)))));
     */
 }
 
@@ -863,12 +864,11 @@
     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)));
+      return nc_log(nc_sum(nc_sqrt(nc_sum(nc_1,nc_prod(x,x))),x));
     */
 }
 



More information about the Numpy-svn mailing list