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
This commit is contained in:
parent
5bd0ab8af6
commit
37eaec3ad3
2 changed files with 6 additions and 5 deletions
|
|
@ -15,9 +15,10 @@ asinl:
|
||||||
asin:
|
asin:
|
||||||
fldl 4(%esp)
|
fldl 4(%esp)
|
||||||
1: fld %st(0)
|
1: fld %st(0)
|
||||||
fmul %st(0)
|
|
||||||
fld1
|
fld1
|
||||||
fsubp %st(1)
|
fsub %st(0),%st(1)
|
||||||
|
fadd %st(2)
|
||||||
|
fmulp
|
||||||
fsqrt
|
fsqrt
|
||||||
fpatan
|
fpatan
|
||||||
ret
|
ret
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@
|
||||||
asinl:
|
asinl:
|
||||||
fldt 8(%rsp)
|
fldt 8(%rsp)
|
||||||
1: fld %st(0)
|
1: fld %st(0)
|
||||||
fmul %st(0)
|
|
||||||
fld1
|
fld1
|
||||||
fsubp %st(1)
|
fsub %st(0),%st(1)
|
||||||
|
fadd %st(2)
|
||||||
|
fmulp
|
||||||
fsqrt
|
fsqrt
|
||||||
fpatan
|
fpatan
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue