Author tim.peters
Recipients davin, mark.dickinson, rhettinger, serhiy.storchaka, tim.peters
Date 2017-10-01.19:02:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1506884555.45.0.213398074469.issue31630@psf.upfronthosting.co.za>
In-reply-to
Content
Of course the relationship is extremely delicate near pi/2.  On my Windows Python 3:

>>> import math
>>> (1.5707963267948961).hex()
'0x1.921fb54442d16p+0'
>>> math.tan(float.fromhex('0x1.921fb54442d16p+0')) # what the test expects
1978937966095219.0
>>> math.tan(float.fromhex('0x1.921fb54442d15p+0')) # input 1 ulp less
1374823386397210.2
>>> math.tan(float.fromhex('0x1.921fb54442d17p+0')) # input 1 ulp more
3530114321217157.5

Interestingly, wxMaxima on the same box reproduces the OpenBSD result:

(%i1) tan(1.5707963267948961);
(%o1) 1.978945885716843*10^15

But I don't know how Maxima (or OpenBSD) implement tan().
History
Date User Action Args
2017-10-01 19:02:35tim.peterssetrecipients: + tim.peters, rhettinger, mark.dickinson, serhiy.storchaka, davin
2017-10-01 19:02:35tim.peterssetmessageid: <1506884555.45.0.213398074469.issue31630@psf.upfronthosting.co.za>
2017-10-01 19:02:35tim.peterslinkissue31630 messages
2017-10-01 19:02:35tim.peterscreate