[Python-checkins] r76982 - python/trunk/Modules/_math.c

mark.dickinson python-checkins at python.org
Mon Dec 21 16:40:34 CET 2009


Author: mark.dickinson
Date: Mon Dec 21 16:40:33 2009
New Revision: 76982

Log:
Inverse hyperbolic trigonometric functions should call m_log1p, not log1p.


Modified:
   python/trunk/Modules/_math.c

Modified: python/trunk/Modules/_math.c
==============================================================================
--- python/trunk/Modules/_math.c	(original)
+++ python/trunk/Modules/_math.c	Mon Dec 21 16:40:33 2009
@@ -3,6 +3,7 @@
 
 #include "Python.h"
 #include <float.h>
+#include "_math.h"
 
 /* The following copyright notice applies to the original
    implementations of acosh, asinh and atanh. */
@@ -67,7 +68,7 @@
 	}
 	else {				/* 1 < x <= 2 */
 		double t = x - 1.0;
-		return log1p(t + sqrt(2.0*t + t*t));
+		return m_log1p(t + sqrt(2.0*t + t*t));
 	}
 }
 
@@ -103,7 +104,7 @@
 	}
 	else {				/* 2**-28 <= |x| < 2= */
 		double t = x*x;
-		w = log1p(absx + t / (1.0 + sqrt(1.0 + t)));
+		w = m_log1p(absx + t / (1.0 + sqrt(1.0 + t)));
 	}
 	return copysign(w, x);
 	
@@ -149,10 +150,10 @@
 	}
 	if (absx < 0.5) {		/* |x| < 0.5 */
 		t = absx+absx;
-		t = 0.5 * log1p(t + t*absx / (1.0 - absx));
+		t = 0.5 * m_log1p(t + t*absx / (1.0 - absx));
 	} 
 	else {				/* 0.5 <= |x| <= 1.0 */
-		t = 0.5 * log1p((absx + absx) / (1.0 - absx));
+		t = 0.5 * m_log1p((absx + absx) / (1.0 - absx));
 	}
 	return copysign(t, x);
 }


More information about the Python-checkins mailing list