octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #40683] Unequal results when using element-wis


From: jose
Subject: [Octave-bug-tracker] [bug #40683] Unequal results when using element-wise and broadcast power operations
Date: Sat, 23 Nov 2013 10:19:19 +0000
User-agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.24

URL:
  <http://savannah.gnu.org/bugs/?40683>

                 Summary: Unequal results when using element-wise and
broadcast power operations
                 Project: GNU Octave
            Submitted by: josombio
            Submitted on: sáb 23 nov 2013 10:19:18 GMT
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Inaccurate Result
                  Status: None
             Assigned to: None
         Originator Name: José
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.6.4
        Operating System: GNU/Linux

    _______________________________________________________

Details:

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).






    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?40683>

_______________________________________________
  Mensaje enviado vía/por Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]