bugGNU Octave - Bugs: bug #43734, Tolerance problem in BIST tests...

 
 

bug #43734: Tolerance problem in BIST tests for chop.m on MS Windows

Submitter:  Avinoam Kalma <avinoam>
Submitted:  Mon 01 Dec 2014 10:39:17 PM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Avinoam Open/Closed:  * Closed
Release:  * 3.8.2 Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sun 25 Jan 2015 06:30:34 AM UTC, comment #9: 

I applied your fix in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/e68267373191) since it doesn't seem to hurt anything to calculate it in this manner, and it solves this bug.

Rik <rik5>
Group administrator
Sat 13 Dec 2014 06:40:55 PM UTC, comment #8: 

Hi,

Just to summarize the situation:

"test chop" does not fail on Linux (both cli & gui),
and does not fail on windows mxe cli.
(I have used last mxe version)
on windows mxe gui the situation is complicated:
1. test chop fails
2. _run_test_suite_ does not fail
3. running again test chop after _run_test_suite_ does not fail

My patch does not changed the situation in Linux, and in
windows-cli, but solves the first failure in windows gui version

Thanks,

Avinoam

Avinoam Kalma <avinoam>
Group Member
Fri 12 Dec 2014 09:30:47 PM UTC, comment #7: 

Does your patch which uses 1/inflate solve the problem on all platforms (Linux + Windows) and both CLI and GUI versions?

I don't see anything wrong with it and that would be a quick solution.

Rik <rik5>
Group administrator
Sat 06 Dec 2014 04:41:26 PM UTC, comment #6: 

Hi,

I do not think that adding a tolerance here is a good solution.
I would expect that chop(e,3) and 2.72 will have the same
numerical error, so that even though computer 2.72 will
not be the mathematical 2.72, due to limited binary representation,
but chop (e,3)-2.72 should be zero.

But...

>> chop(e,3) - 2.72
ans =   4.4409e-016


Thanks,

Avinoam

Avinoam Kalma <avinoam>
Group Member
Sat 06 Dec 2014 03:52:31 PM UTC, comment #5: 

I'm tempted to fix this particular report by just adding a tolerance to the built-in self test.  When doing numerical calculations on computers one can't really expect to do better than the machine precision.  So while this is annoying that the answer is not exact, it is what you would expect.


eps(2.72)
ans =    4.4409e-16


Rik <rik5>
Group administrator
Sat 06 Dec 2014 03:31:51 PM UTC, comment #4: 

Hi.

Test output in Windows 3.8.2 GUI version,
using last mxe version from  http://hg.octave.org/mxe-octave/


>> test chop
  ***** assert (chop (e, 3), 2.72)
!!!!! test failed
ASSERT errors for:  assert (chop (e, 3),2.72)

  Location  |  Observed  |  Expected  |  Reason
     ()          2.72         2.72       Abs err 4.4409e-016 exceeds tol 0


This is actually an example of bug 43741.

But there is some strange behaviour:
1. _run_test_suite_ in the same version does not produce this error
2. neither test chop nor _run_test_suite_ in cli version produce this error.

Avinoam

Avinoam Kalma <avinoam>
Group Member
Fri 05 Dec 2014 09:25:55 PM UTC, comment #3: 

@Avinoam: Could you post the output of the tests when they fail?  Is is just a tolerance that could be increased on the %!assert test?

Rik <rik5>
Group administrator
Tue 02 Dec 2014 05:18:34 AM UTC, comment #2: 

Hi again,

from some reason, this bug appears only in gui version,
and not in the cli version.

Avinoam

Avinoam Kalma <avinoam>
Group Member
Mon 01 Dec 2014 10:41:14 PM UTC, comment #1: 

The patch


(file #32581)

Avinoam Kalma <avinoam>
Group Member
Mon 01 Dec 2014 10:39:17 PM UTC, original submission:  


Hi,

in Octave ver. 3.8.2, in Microsoft Windows,
chop.m fails in 9 of 10 tests, while in linux it passes all the
tests.

The reason is probably fom the fact the in windows version
10^(-n) - 1./10^n
is not equal zero.

changing the line

deflate = 10 .^ (tmp - ndigits);
to
deflate = 1./inflate;

solve this problem, and chop.m passes all the tests.
Please check this.

A patch is attached.

Avinoam

Avinoam Kalma <avinoam>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #32581:  chop.patch added by avinoam (413B - application/octet-stream)

 

Digest:
   bug dependencies.

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by avinoam (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-01-25 rik5 StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2014-12-06 rik5 SummaryProblem in chop.m Tolerance problem in BIST tests for chop.m on MS Windows
    2014-12-06 rik5 Dependencies- Depends on bugs #43741
    2014-12-05 rik5 StatusNone Need Info
    2014-12-01 avinoam Attached File- Added chop.patch, #32581

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code