[issue31630] math.tan has poor accuracy near pi/2 on OpenBSD and NetBSD

Tim Peters report at bugs.python.org
Wed Nov 1 17:36:08 EDT 2017


Tim Peters <tim at python.org> added the comment:

Oops!  I mixed up `sin` and `cos` in that comment.  If it's argument reduction that's broken, then for x near pi/2 cos(x) will be evaluated as -sin(x - pi/2), which is approximately -(x - pi/2), and so error in argument reduction (the "x - pi/2" part) will show up directly in the cos() result.  So to confirm or refute that, you could replace `tan` by `cos` in the Python program I posted.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31630>
_______________________________________


More information about the Python-bugs-list mailing list