bugGNU Octave - Bugs: bug #40683, Unequal results when using...

 
 

bug #40683: Unequal results when using element-wise and broadcast power operations

Submitter:  jose <josombio>
Submitted:  Sat 23 Nov 2013 10:19:18 AM UTC
   
 
Category:  Octave Function Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Inaccurate Result
Status:  Fixed Assigned to:  None
Originator Name:  José Open/Closed:  * Closed
Release:  * 3.6.4 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 16 Nov 2016 11:25:50 PM UTC, comment #3: 

This appears to be fixed in Octave 4.2.0 which is the currently supported release now.

Mike Miller <mtmiller>
Group Member
Sat 06 Dec 2014 03:40:57 PM UTC, comment #2: 

An easier way to reproduce it


a=100+rand;l=1e-10;d=[a-l;a;a+l];
for pow=1:15
  T(:,pow)=diag(diag(d)^pow)-d.^pow;
endfor
T


In octave 3.8.2 (in Kubuntu), the last columns of T are


Columns 12 through 15:

  -4.0265e+08  -3.4360e+10  -4.3980e+12  -2.8147e+14
   2.6844e+08   5.1540e+10   4.3980e+12   5.6295e+14
  -1.3422e+08  -1.7180e+10  -2.1990e+12  -1.4074e+14


jose <josombio>
Sat 23 Nov 2013 05:09:45 PM UTC, comment #1: 

Confirmed on the development version as well. Failure occurs on an x86-64 build but not on a 32-bit x86 build. When I responded on the ML I was only checking on a 32-bit system at the time.

Mike Miller <mtmiller>
Group Member
Sat 23 Nov 2013 10:19:18 AM UTC, original submission:  

In order to reproduce this bug, one can do the following:


clear all
r=3;
N=100;
S=rand(1,N);
C=S.^r;
C2=bsxfun(@power,S,r);
for n=1:N
  C3(n)=S(n)^r;
endfor
assert(C,C2)  %fails
assert(C,C3)  %fails
assert(C2,C3) %Does not fail


This seems to occur (at least) with powers different than 2.

Although I marked the 3.6.4 release as the one being affected, this seems to affect also other previous releases. In octave 3.6.2 the results are slightly different, being

assert(C,C2)  %does not fail
assert(C,C3)  %fails
assert(C2,C3) %fails


Additionally, this bug seems to be somehow machine (or architecture) dependent, as Mike has reported that the previous code works for him in the 3.6.4 and development versions.
I have tested in 3 different machines, two 64-bit and one 32-bits. The tests in the 32-bit machine passed cleanly, but I used somehow old octave releases (3.2.4 and 3.4.3).


jose <josombio>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by josombio (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-16 mtmiller StatusConfirmed Fixed
        Open/ClosedOpen Closed
    2013-11-23 mtmiller StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code