Message303556
| Author |
tim.peters |
| Recipients |
davin, mark.dickinson, rhettinger, serhiy.storchaka, skrah, tim.peters |
| Date |
2017年10月02日.18:39:22 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1506969563.08.0.213398074469.issue31630@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
If someone opens a bug report with OpenBSD, or just for us to get more info, it could be useful to have a larger universe of troublesome tan inputs to stare at. So the attached tanny.py supplies them, testing all inputs within 100 ulps of math.pi/2 (or change N=100 to whatever you like).
There are no failures on my 64-bit Win10 3.6.1.
The "correct" answers are computed by using mpmath.tan() set to 200 mantissa bits, then rounding back to 53 bits. These all match the results from my dirt-dumb decimal tan() rounded back, but it's better to trust a widely-used package.
Of course mpmath needs to be installed ("pip install mpmath" works fine):
http://mpmath.org/
Nothing else is needed (while mpmath will exploit gmpy if it's installed, by default it sticks to pure Python code). |
|