about summary refs log tree commit diff
path: root/src/math/x86_64/asinl.s
diff options
context:
space:
mode:
authornsz <nsz@port70.net>2012-04-04 17:34:28 +0200
committernsz <nsz@port70.net>2012-04-04 17:34:28 +0200
commit37eaec3ad396ea4502f4aea2395b3b5f5f69a1c6 (patch)
tree4a5aef1ff345c6b529589c9d1ffb181c9a779b30 /src/math/x86_64/asinl.s
parent5bd0ab8af66829af74ed80cac767ce1c041fd767 (diff)
downloadmusl-37eaec3ad396ea4502f4aea2395b3b5f5f69a1c6.tar.gz
musl-37eaec3ad396ea4502f4aea2395b3b5f5f69a1c6.tar.xz
musl-37eaec3ad396ea4502f4aea2395b3b5f5f69a1c6.zip
math: fix x86 asin accuracy
use (1-x)*(1+x) instead of (1-x*x) in asin.s
the later can be inaccurate with upward rounding when x is close to 1
Diffstat (limited to 'src/math/x86_64/asinl.s')
-rw-r--r--src/math/x86_64/asinl.s6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/math/x86_64/asinl.s b/src/math/x86_64/asinl.s
index 83c392f7..ed212d9a 100644
--- a/src/math/x86_64/asinl.s
+++ b/src/math/x86_64/asinl.s
@@ -3,10 +3,10 @@
 asinl:
 	fldt 8(%rsp)
 1:	fld %st(0)
-	fmul %st(0)
 	fld1
-	fsubp %st(1)
+	fsub %st(0),%st(1)
+	fadd %st(2)
+	fmulp
 	fsqrt
 	fpatan
 	ret
-