Message9320

Author jeff.allen
Recipients jeff.allen, zyasoft
Date 2015-01-06.22:48:41
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1420584522.29.0.916381581761.issue2244@psf.upfronthosting.co.za>
In-reply-to
Content
Something similar happened to me when I switched from our own implementation 0.5*(Math.exp(x)+Math.exp(-x)) to Math.cosh(x). I don't think this is because the Java library is worse, just slightly worse at that particular identity. In that expression, in theory, the tolerance needs to be 15*ulp(1), but I went for 5, provisionally.
https://hg.python.org/jython/rev/7402bd620d52

I hadn't actually checked up to that point whether there was a Math.cosh (and sinh and tanh). I just accepted that since we'd implemented it, we must have had to. Maybe in Java 1.4?

But there is now, and several others to save us doing things the hard way. The math module is now, much more than it was, a façade on java.lang.Math. Java tells us how accurate its Math is and I've implemented a corresponding tolerance in test_testfile.
History
Date User Action Args
2015-01-06 22:48:42jeff.allensetmessageid: <1420584522.29.0.916381581761.issue2244@psf.upfronthosting.co.za>
2015-01-06 22:48:42jeff.allensetrecipients: + jeff.allen, zyasoft
2015-01-06 22:48:42jeff.allenlinkissue2244 messages
2015-01-06 22:48:41jeff.allencreate