X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fi386%2Facos.s;h=47f365efb1ea7493c34f7d64b7db33761e4337bd;hb=58bba42d1bd14e1ab01f3249ffc98afdbf841a6a;hp=bfff0c5c9a89d3332ea7df6a8e5d3cd0a68a01f3;hpb=a4a0c91275788407763b1e5a9da17b777495ca85;p=musl diff --git a/src/math/i386/acos.s b/src/math/i386/acos.s index bfff0c5c..47f365ef 100644 --- a/src/math/i386/acos.s +++ b/src/math/i386/acos.s @@ -1,3 +1,5 @@ +# use acos(x) = atan2(fabs(sqrt((1-x)*(1+x))), x) + .global acosf .type acosf,@function acosf: @@ -14,17 +16,13 @@ acosl: .type acos,@function acos: fldl 4(%esp) -1: fld1 - fld %st(1) +1: fld %st(0) fld1 - fsubp - fsqrt - fxch %st(2) - faddp + fsub %st(0),%st(1) + fadd %st(2) + fmulp fsqrt + fabs # fix sign of zero (matters in downward rounding mode) + fxch %st(1) fpatan - fld1 - fld1 - faddp - fmulp ret