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:
nsz 2012-04-04 17:34:28 +02:00
commit 37eaec3ad3
2 changed files with 6 additions and 5 deletions

View file

@ -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

View file

@ -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