diff options
author | nsz <nsz@port70.net> | 2012-03-19 23:41:19 +0100 |
---|---|---|
committer | nsz <nsz@port70.net> | 2012-03-19 23:41:19 +0100 |
commit | 0cbb65479147ecdaa664e88cc2a5a925f3de502f (patch) | |
tree | 7b6dc53fcec6497d55746d3cc47f167a20b7aa57 /src/math/acosf.c | |
parent | b03255af77776703c8d48819e824d09f6f54ba86 (diff) | |
download | musl-0cbb65479147ecdaa664e88cc2a5a925f3de502f.tar.gz musl-0cbb65479147ecdaa664e88cc2a5a925f3de502f.tar.bz2 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/acosf.c')
-rw-r--r-- | src/math/acosf.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/math/acosf.c b/src/math/acosf.c index 945347cb..d875f3ef 100644 --- a/src/math/acosf.c +++ b/src/math/acosf.c @@ -16,8 +16,7 @@ #include "libm.h" static const float -one = 1.0000000000e+00, /* 0x3F800000 */ -pi = 3.1415925026e+00, /* 0x40490fda */ +pi = 3.1415925026e+00, /* 0x40490fda */ pio2_hi = 1.5707962513e+00; /* 0x3fc90fda */ static const volatile float pio2_lo = 7.5497894159e-08; /* 0x33a22168 */ @@ -46,13 +45,13 @@ float acosf(float x) return pio2_hi + pio2_lo; z = x*x; p = z*(pS0+z*(pS1+z*pS2)); - q = one+z*qS1; + q = 1.0f+z*qS1; r = p/q; return pio2_hi - (x - (pio2_lo-x*r)); } else if (hx < 0) { /* x < -0.5 */ - z = (one+x)*0.5f; + z = (1.0f+x)*0.5f; p = z*(pS0+z*(pS1+z*pS2)); - q = one+z*qS1; + q = 1.0f+z*qS1; s = sqrtf(z); r = p/q; w = r*s-pio2_lo; @@ -60,14 +59,14 @@ float acosf(float x) } else { /* x > 0.5 */ int32_t idf; - z = (one-x)*0.5f; + z = (1.0f-x)*0.5f; s = sqrtf(z); df = s; GET_FLOAT_WORD(idf,df); SET_FLOAT_WORD(df,idf&0xfffff000); c = (z-df*df)/(s+df); p = z*(pS0+z*(pS1+z*pS2)); - q = one+z*qS1; + q = 1.0f+z*qS1; r = p/q; w = r*s+c; return 2.0f*(df+w); |