X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fmath%2Fi386%2Facos.s;h=47f365efb1ea7493c34f7d64b7db33761e4337bd;hb=6f64505df37c41d7496612dffe86048765339a7a;hp=4f0168f623d1f0294324b286ad90e2e9d2c46785;hpb=804fbf0b8c00fd4e2f37ef0769a610614d06138f;p=musl diff --git a/src/math/i386/acos.s b/src/math/i386/acos.s index 4f0168f6..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,19 +16,13 @@ acosl: .type acos,@function acos: fldl 4(%esp) -1: fld1 - fld %st(1) +1: fld %st(0) fld1 - fsubp - fxch %st(2) - faddp - fdivp + fsub %st(0),%st(1) + fadd %st(2) + fmulp fsqrt - fld1 + fabs # fix sign of zero (matters in downward rounding mode) fxch %st(1) fpatan - fld1 - fld1 - faddp - fmulp ret