use alternate formula for acos asm to avoid loss of precision
authorRich Felker <dalias@aerifal.cx>
Tue, 20 Mar 2012 03:08:49 +0000 (23:08 -0400)
committerRich Felker <dalias@aerifal.cx>
Tue, 20 Mar 2012 03:08:49 +0000 (23:08 -0400)
src/math/i386/acos.s

index 6f9ef7f0e37ada36bc53e9b37a3c1d234f528be6..4f0168f623d1f0294324b286ad90e2e9d2c46785 100644 (file)
@@ -14,11 +14,19 @@ acosl:
 .type acos,@function
 acos:
        fldl 4(%esp)
-1:     fld %st(0)
-       fmul %st(0)
+1:     fld1
+       fld %st(1)
        fld1
-       fsubp %st(1)
+       fsubp
+       fxch %st(2)
+       faddp
+       fdivp
        fsqrt
+       fld1
        fxch %st(1)
        fpatan
+       fld1
+       fld1
+       faddp
+       fmulp
        ret