[docs] [issue35880] math.sin has no backward error; this isn't documented

Tim Peters report at bugs.python.org
Fri Mar 8 19:46:49 EST 2019


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

Jurjen, the errors you see in Python's sin() are _entirely_ due to your platform C's libm.  Python just calls the platform C's sin.  So nothing can be said about it in general.

The better libm trig functions today do indeed perform trig argument reduction "as if" an infinite precision pi were used.  In practice, even for IEEE double precision no more than a few thousand bits are ever needed in the worst case, and the better libm trig functions use something much cheaper than that for arguments in a "reasonably small" range.  But, again, Python has nothing to do with that.

The better libm implementations guarantee worst-case error strictly less than 1 ULP away from the infinitely precise result.  But correctly rounded ("nearest-even") in all cases is still beyond what most of the better libms guarantee.

----------
stage: needs patch -> resolved
status: open -> closed

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


More information about the docs mailing list