bugGNU Octave - Bugs: bug #49832, power operator produces different...

 
 

bug #49832: power operator produces different results between Matlab & Octave

Submitted by:  None
Submitted on:  Tue 13 Dec 2016 12:16:30 AM UTC  
 
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: ConfirmedAssigned to: None
Originator Name: BawazeerOriginator Email: -unavailable-
Open/Closed: OpenRelease: dev
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Fri 16 Dec 2016 01:02:33 AM UTC, comment #5:

I keep old versions of Octave around for testing and in 3.2.4 the result is correct (although it is complex which isn't right). By version 3.4.3 the behavior has changed to return NaN + NaN i which is definitely wrong.

Rik <rik5>
Project Administrator
Thu 15 Dec 2016 10:50:30 AM UTC, comment #4:

I modify the program to test whether each power operation is complex.

for i=1:12
for j=1:12
iscomp(i,j)=~isreal(A(i).^A(j));
end
end

I ran it on Matlab and attached the results. It is different from octave.

Also, I noted that matlab cut the value of +eps(0) or -eps(0) to
4.9^-324 when doing some operation (add sub mul div) on those. This what I was referring to in my original submission. I gave the indecies where this happened exactly (in my original submission). However, I am not sure weather octave should do the same thing or no.

(file #39232)

Saleh <sabmab>
Thu 15 Dec 2016 09:10:04 AM UTC, comment #3:

In Matlab 2014 I see

and

I would keep the signed 0, but since isreal(Inf)=1 and real powers of real numbers are real numbers, [-Inf 0] .^ [-Inf 1] should be real.

Marco Caliari <caliari>
Project Member
Tue 13 Dec 2016 05:12:45 AM UTC, comment #2:

The only difference I see is with the power operator. For the other matrices, I used 'isequaln' which compares equality with NaN comparing equal to NaN. Because of the NaNs one can't use the equality operator '==', subtraction, or isequal, to determine if the matrices are equal.

For the power operator, there are differences between how the operator is computed for scalars and matrices.

For example,

But,

Rik <rik5>
Project Administrator
Tue 13 Dec 2016 12:37:49 AM UTC, comment #1:

It's a little too hard to debug what is going on here. Can you run this script under Matlab and upload the resulting mat file?

Rik <rik5>
Project Administrator
Tue 13 Dec 2016 12:16:30 AM UTC, original submission:

specially the power operation is totally different from matlab 2014.
octave version 4.3.0+

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #39232:  tstvar2.mat added by sabmab (1KiB - application/octet-stream)
file #39209:  tstvar.mat added by None (1KiB - application/octet-stream - attached the results on matlab)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by sabmab (Updated the item)
  • -unavailable- added by caliari (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by None (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 15 Dec 2016 10:50:30 AM UTCsabmabAttached File-=>Added tstvar2.mat, #39232
    Tue 13 Dec 2016 05:12:45 AM UTCrik5StatusNeed Info=>Confirmed
      Summaryoperations on double limites are not compatiable to matlab=>power operator produces different results between Matlab & Octave
    Tue 13 Dec 2016 01:10:01 AM UTCNoneAttached File-=>Added tstvar.mat, #39209
    Tue 13 Dec 2016 12:37:49 AM UTCrik5StatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup1