
On gcc 4.1.1 glibc 2.4 x86_64 linux. If I use asinhf from glibc then the test works, if I use asinh from boost::math then it fails. (This is for float) glibc, scaled error > 0: -1.4 scaled_error = 2.1509 -0.6 scaled_error = 0.592733 -0.4 scaled_error = 0.270268 0.4 scaled_error = 0.270268 0.6 scaled_error = 0.592733 1.4 scaled_error = 2.1509 boost::match, scaled error > 0: -3.8 scaled_error = 44.7236 -1.4 scaled_error = 2.1509 -0.8 scaled_error = 0.668717 -0.4 scaled_error = 0.540536 0.4 scaled_error = 0.540536 0.8 scaled_error = 0.668717 1.4 scaled_error = 2.1509 3.8 scaled_error = 44.7236 For the test to pass scaled_error must be less than 4. -- Lgb

"Lars Gullik Bjønnes" wrote:
On gcc 4.1.1 glibc 2.4 x86_64 linux.
If I use asinhf from glibc then the test works, if I use asinh from boost::math then it fails. (This is for float)
Perplexing, it probably needs someone with an interest in numerics to debug it on that platform to figure this out, especially as the asinh code for that test case is a completely trivial: return( log( x + sqrt(x*x+one) ) ); We might be able to eliminate a couple of obvious ones though: can you find out what std::sinh(3.8F) returns? First 9 digits please :-) Then what happens if you add a boost::math:: qualifier to the asinh call in asinh_test.hpp and re-run the test? I'm also pleased to see I'm not the only person who mis-types "math" as "match"!! :-) Regards, John.

"John Maddock" <john@johnmaddock.co.uk> writes: | "Lars Gullik Bjønnes" wrote: | > On gcc 4.1.1 glibc 2.4 x86_64 linux. | > | > If I use asinhf from glibc then the test works, if I use asinh from | > boost::math then it fails. (This is for float) | | Perplexing, it probably needs someone with an interest in numerics to debug | it on that platform to figure this out, especially as the asinh code for | that test case is a completely trivial: | | return( log( x + sqrt(x*x+one) ) ); | | We might be able to eliminate a couple of obvious ones though: can you find | out what std::sinh(3.8F) returns? First 9 digits please :-) std::sinh(3.8F) = 22.3394069672 sinhf(3.8F) = 22.3394069672 (*) But perhaps more interesting: asinhf(*) = 3.79999995232 boost::math:asinhf(*) = 3.80000019073 And: x = std::sinh(3.8F); logf( x + sqrtf(x*x+one) = 3.80000019073 log( x + sqrt(x*x+one) = 3.79999995232 std::log( x + std::sqrt(x*x+one) = 3.80000019073 So it seems that glibc asinhf is using double precision internally, and that this somehow contributes to makeing the testcase fail. I think this is close to as far as I can test... far away from my domain already. | Then what happens if you add a boost::math:: qualifier to the asinh call in | asinh_test.hpp and re-run the test? In my tests that does not make a difference. | I'm also pleased to see I'm not the only person who mis-types "math" as | "match"!! :-) Hmm... must be the brain-stem in the fingers taking over. -- Lgb

Hubert, If you have a couple of minutes, can you explain why you multiply the absolute error by cosh(x) in the asinh tests: T y = sinh(x); T z = asinh(y); T absolute_error = abs(z-x); T relative_error = absolute_error*cosh(x); // Why???? T scaled_error = relative_error/epsilon; Without that and using the usual definition of relative error in this case: fabs(z-x)/x Then I see an error of 0.5eps for the case that fails on Linux/AMD64. However with the multiplication by cosh(x) in place (which is a largish value for some of the test inputs) I believe the test will only pass if the error is zero, which is not the case on Linux AMD64. BTW, I'm not familiar with the term "scaled error", I don't see anything useful with a web search either? Thanks, John.
participants (2)
-
John Maddock
-
larsbj@gullik.net