Message303479
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(). |
|
Date |
User |
Action |
Args |
2017-10-01 19:02:35 | tim.peters | set | recipients:
+ tim.peters, rhettinger, mark.dickinson, serhiy.storchaka, davin |
2017-10-01 19:02:35 | tim.peters | set | messageid: <1506884555.45.0.213398074469.issue31630@psf.upfronthosting.co.za> |
2017-10-01 19:02:35 | tim.peters | link | issue31630 messages |
2017-10-01 19:02:35 | tim.peters | create | |
|