projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5bd0ab8
)
math: fix x86 asin accuracy
author
nsz
<nsz@port70.net>
Wed, 4 Apr 2012 15:34:28 +0000
(17:34 +0200)
committer
nsz
<nsz@port70.net>
Wed, 4 Apr 2012 15:34:28 +0000
(17:34 +0200)
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
src/math/i386/asin.s
patch
|
blob
|
history
src/math/x86_64/asinl.s
patch
|
blob
|
history
diff --git
a/src/math/i386/asin.s
b/src/math/i386/asin.s
index cab7bfc84466cf63d220bc6824c380577addd413..932c7542442787f30361489b3f4e9d57fed7ffec 100644
(file)
--- a/
src/math/i386/asin.s
+++ b/
src/math/i386/asin.s
@@
-15,9
+15,10
@@
asinl:
asin:
fldl 4(%esp)
1: fld %st(0)
- fmul %st(0)
fld1
- fsubp %st(1)
+ fsub %st(0),%st(1)
+ fadd %st(2)
+ fmulp
fsqrt
fpatan
ret
diff --git
a/src/math/x86_64/asinl.s
b/src/math/x86_64/asinl.s
index 83c392f761986d1c76859e34e38e5efb7922b6fd..ed212d9a6c173855c26d8d9428ff8a38cb5d5819 100644
(file)
--- 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
-