about summary refs log tree commit diff
path: root/src/math/atanh.c
diff options
context:
space:
mode:
authornsz <nsz@port70.net>2012-03-19 23:41:19 +0100
committernsz <nsz@port70.net>2012-03-19 23:41:19 +0100
commit0cbb65479147ecdaa664e88cc2a5a925f3de502f (patch)
tree7b6dc53fcec6497d55746d3cc47f167a20b7aa57 /src/math/atanh.c
parentb03255af77776703c8d48819e824d09f6f54ba86 (diff)
downloadmusl-0cbb65479147ecdaa664e88cc2a5a925f3de502f.tar.gz
musl-0cbb65479147ecdaa664e88cc2a5a925f3de502f.tar.xz
musl-0cbb65479147ecdaa664e88cc2a5a925f3de502f.zip
code cleanup of named constants
zero, one, two, half are replaced by const literals
The policy was to use the f suffix for float consts (1.0f),
but don't use suffix for long double consts (these consts
can be exactly represented as double).
Diffstat (limited to 'src/math/atanh.c')
-rw-r--r--src/math/atanh.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/math/atanh.c b/src/math/atanh.c
index 29290463..dbe241d1 100644
--- a/src/math/atanh.c
+++ b/src/math/atanh.c
@@ -30,8 +30,7 @@
 
 #include "libm.h"
 
-static const double one = 1.0, huge = 1e300;
-static const double zero = 0.0;
+static const double huge = 1e300;
 
 double atanh(double x)
 {
@@ -44,15 +43,15 @@ double atanh(double x)
 	if ((ix | ((lx|-lx)>>31)) > 0x3ff00000)  /* |x| > 1 */
 		return (x-x)/(x-x);
 	if (ix == 0x3ff00000)
-		return x/zero;
-	if (ix < 0x3e300000 && (huge+x) > zero)  /* x < 2**-28 */
+		return x/0.0;
+	if (ix < 0x3e300000 && (huge+x) > 0.0)   /* x < 2**-28 */
 		return x;
 	SET_HIGH_WORD(x, ix);
 	if (ix < 0x3fe00000) {                   /* x < 0.5 */
 		t = x+x;
-		t = 0.5*log1p(t + t*x/(one-x));
+		t = 0.5*log1p(t + t*x/(1.0-x));
 	} else
-		t = 0.5*log1p((x+x)/(one-x));
+		t = 0.5*log1p((x+x)/(1.0-x));
 	if (hx >= 0)
 		return t;
 	return -t;