[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
test failure for mappers.cc
From: |
John W. Eaton |
Subject: |
test failure for mappers.cc |
Date: |
Tue, 9 Nov 2010 12:42:42 -0500 |
On 9-Nov-2010, Ben Abbott wrote:
| I'm seeing the failure below with tip 11212
|
| octave:2> test mappers.cc
| ***** assert(arg (single(-1)), single(pi));
| !!!!! test failed
| assert (arg (single (-1)),single (pi)) expected
| 3.1416
| but got
| 3.1416
| values do not match
|
| The difference between the actual and expected is ...
|
| arg (single (-1)) - single (pi)
| ans = -2.3842e-07
|
| I consistently get the *exactly* same difference.
|
| for n = 1:10
| d(n) = arg (single (-1)) - single (pi);
| endfor
| std (d)
| ans = 0
|
| I assume this came about after your mapper changesets. Do you
| (anyone?) see this as well?
I'm not seeing the difference, but it is probably happening because I
changed the float version of arg from
float arg (float x) { return atan2 (0.0, x); }
to
float arg (float x) { return atan2f (0.0f, x); }
It looks like your result is now off by about "2*eps ('single')".
Does adding that as a tolerance avoid the warning? Even if it does,
should we make the change? Shouldn't the atan2f function in your math
library recognize -1 as a special case and return precisely the single
precision value for pi? Should we be tweaking test tolerances to hide
what might be considered bugs in system libraries?
jwe
- test failure for mappers.cc, Ben Abbott, 2010/11/09
- test failure for mappers.cc,
John W. Eaton <=
- Re: test failure for mappers.cc, Michael D Godfrey, 2010/11/09
- Re: test failure for mappers.cc, Ben Abbott, 2010/11/10
- Re: test failure for mappers.cc, John W. Eaton, 2010/11/10
- Re: test failure for mappers.cc, Ben Abbott, 2010/11/10
- Re: test failure for mappers.cc, Jarno Rajahalme, 2010/11/10
- Re: test failure for mappers.cc, Ben Abbott, 2010/11/10
- Re: test failure for mappers.cc, Jarno Rajahalme, 2010/11/10