fix excess precision in return value of i386 atan[2][f]
[musl] / src / math / i386 / atan.s
index 7e28b39..2c57f6b 100644 (file)
@@ -2,6 +2,15 @@
 .type atan,@function
 atan:
        fldl 4(%esp)
+       mov 8(%esp),%eax
+       add %eax,%eax
+       cmp $0x00200000,%eax
+       jb 1f
        fld1
        fpatan
+       fstpl 4(%esp)
+       fldl 4(%esp)
+       ret
+               # subnormal x, return x with underflow
+1:     fsts 4(%esp)
        ret