From: nsz Date: Wed, 4 Apr 2012 15:34:28 +0000 (+0200) Subject: math: fix x86 asin accuracy X-Git-Tag: v0.8.8~41^2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=37eaec3ad396ea4502f4aea2395b3b5f5f69a1c6;p=oweals%2Fmusl.git 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 --- diff --git a/src/math/i386/asin.s b/src/math/i386/asin.s index cab7bfc8..932c7542 100644 --- 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 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 -