about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-03-19 23:08:49 -0400
committerRich Felker <dalias@aerifal.cx>2012-03-19 23:08:49 -0400
commit804fbf0b8c00fd4e2f37ef0769a610614d06138f (patch)
treeb2179b38c3588def9b27c5fcd3c650043af15b3d /src
parent97721a5508415a2f10eb068e022093811c9ff8be (diff)
downloadmusl-804fbf0b8c00fd4e2f37ef0769a610614d06138f.tar.gz
musl-804fbf0b8c00fd4e2f37ef0769a610614d06138f.tar.xz
musl-804fbf0b8c00fd4e2f37ef0769a610614d06138f.zip
use alternate formula for acos asm to avoid loss of precision
Diffstat (limited to 'src')
-rw-r--r--src/math/i386/acos.s14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/math/i386/acos.s b/src/math/i386/acos.s
index 6f9ef7f0..4f0168f6 100644
--- a/src/math/i386/acos.s
+++ b/src/math/i386/acos.s
@@ -14,11 +14,19 @@ acosl:
 .type acos,@function
 acos:
 	fldl 4(%esp)
-1:	fld %st(0)
-	fmul %st(0)
+1:	fld1
+	fld %st(1)
 	fld1
-	fsubp %st(1)
+	fsubp
+	fxch %st(2)
+	faddp
+	fdivp
 	fsqrt
+	fld1
 	fxch %st(1)
 	fpatan
+	fld1
+	fld1
+	faddp
+	fmulp
 	ret