This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients mark.dickinson, ned.deily, ronaldoussoren
Date 2016-09-04.08:35:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Opening this for the record; I intend to close as "wont fix".

The tan function has poor accuracy for inputs near pi/2 on OS X 10.4. This is a direct consequence of a poor libm implementation, so there's little we can do about it short of re-implenting tan ourselves. 10.4 is ancient enough by now that it's difficult to care too much.

Example failures:

FAIL: test_testfile (test.test_math.MathTests)
Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/", line 1190, in test_testfile
    '\n  '.join(failures))
AssertionError: Failures in test_testfile:
  tan0064: tan(1.5707963267948961): expected 1978937966095219.0, got 1978945885716843.0 (error = 7.92e+09 (31678486496 ulps); permitted error = 0 or 5 ulps)

and a corresponding failure in cmath:

FAIL: test_specific_values (test.test_cmath.CMathTests)
Traceback (most recent call last):
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/", line 398, in test_specific_values
  File "/Users/db3l/buildarea/3.x.bolen-tiger/build/Lib/test/", line 147, in rAssertAlmostEqual
    '{!r} and {!r} are not sufficiently close'.format(a, b))
AssertionError: tan0064: tan(complex(1.5707963267948961, 0.0))
Expected: complex(1978937966095219.0, 0.0)
Received: complex(1978945885716843.0, 0.0)
Received value insufficiently close to expected value.
Date User Action Args
2016-09-04 08:35:39mark.dickinsonsetrecipients: + mark.dickinson, ronaldoussoren, ned.deily
2016-09-04 08:35:39mark.dickinsonsetmessageid: <>
2016-09-04 08:35:39mark.dickinsonlinkissue27953 messages
2016-09-04 08:35:39mark.dickinsoncreate