bugGNU Octave - Bugs: bug #50553, eps with imaginary argument gives...

 
 

bug #50553: eps with imaginary argument gives wrong value

Submitted by:  Ceral Paquet <octavebugs>
Submitted on:  Wed 15 Mar 2017 09:27:34 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 16 Mar 2017 03:30:46 PM UTC, comment #3:

The patch works. I'm going to mark this as fixed and close the report. However, it has exposed a horrible performance issue. The C++ code is 350X slower than an m-file implementation. I've filed bug #50561 about that.

Rik <rik5>
Project Administrator
Thu 16 Mar 2017 12:59:58 PM UTC, comment #2:

I pushed the following changeset. If the result is based on abs of the argument and not looking at real and imaginary parts separately, then I think this should be sufficient.

http://hg.savannah.gnu.org/hgweb/octave/rev/953cb077757c

John W. Eaton <jwe>
Project Administrator
Thu 16 Mar 2017 12:00:13 AM UTC, comment #1:

Confirmed. The function eps is written in C++ and is located in libinterp/corefcn/data.cc. The bit of code which is the problem is

The first line asks for "array_value" which produces an array of doubles (and thus only the real part). It seems that this needs to be broken up in to two sections.

I don't know if the best strategy is to declare a complex NDArray and then use the abs() function to produce a real NDArray and then iterate through that. Or whether we should be using Array directly.

Rik <rik5>
Project Administrator
Wed 15 Mar 2017 09:27:34 PM UTC, original submission:

MATLAB:

Octave 4.2.1

Short story: MATLAB eps() function seems to be based on abs(arg) whereas Octave only looks at real(arg).

Fix: need to take abs() of argument to eps() function.

Ceral Paquet <octavebugs>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by octavebugs (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 8 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 16 Mar 2017 03:30:46 PM UTCrik5StatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
      Release4.2.1=>dev
    Thu 16 Mar 2017 12:59:58 PM UTCjweStatusConfirmed=>Ready For Test
    Thu 16 Mar 2017 12:00:13 AM UTCrik5CategoryNone=>Octave Function
      Item GroupNone=>Matlab Compatibility
      StatusNone=>Confirmed
      Operating SystemGNU/Linux=>Any

    Back to the top


    Powered by Savane 3.1-cleanup1