bugGNU Octave - Bugs: bug #29770, Wrong determinat

 
 

bug #29770: Wrong determinat

Submitted by:  Ralf <highspin>
Submitted on:  Tue 04 May 2010 10:45:51 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: InvalidAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.2.3Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Tue 04 May 2010 07:15:25 PM UTC, comment #4:

@David: Thank you very much for the explanation. Be honest, I have no idea which LAPACK version each octave version is using. I am using Ubuntu 10.04 and I am using the octave versions which the synaptic installer provides me.

Ralf <highspin>
Tue 04 May 2010 04:35:43 PM UTC, comment #3:

You are dealing with values in the matrix that are approximately 10, and so an error of at least 10eps or larger is to be expected, where eps is the machine precision. For IEEE754 double precision 10eps is 2.2204e-15 which is very close to the error you are seeing. So really a rounding error of this size is absolutely normal and correct.

Why the change between your versions of Octave 3.0.5 and 3.2.3 you asked. I suspect you changed the version of LAPACK you used with Octave between the two versions and the matrix factorisation used in calculating the determinant was done slightly differently between the two cases. I suspect you used a generic NETLIB lapack with 3.0.5 and an optimised ATLAS version with 3.2.3..

D.

David Bateman <dbateman>
Project Member
Tue 04 May 2010 12:56:44 PM UTC, comment #2:

@David: Thank you for that. But I think not changes anything in my comment. In the old version, the result was correct and in the new one not. I don't know how octave calculates the determinant, but I guess it breaks down to multiplication and summation of the elements. In my example are only integers so the result should be exact or not? Especially because of the fact that the facors in that calculation are not very large, so we will not have any conflicts with machine precission.

But maybe I am totally wrong, but then I would have learned something today. Anyway thank you for the link.

Ralf <highspin>
Tue 04 May 2010 12:24:11 PM UTC, comment #1:

Please read

D. Golberg, "What every computer scientist should know about floating-point arithmetic", ACM CSUR, pp5-48, March 1991

and then you'll understand that this is normal when using a floating point representation. An html copy can be found at

http://docs.sun.com/source/806-3568/ncg_goldberg.html

D.

David Bateman <dbateman>
Project Member
Tue 04 May 2010 10:45:51 AM UTC, original submission:

Hello!

Today I have noticed, when I calculate the determinant of the matrix

A = [1 2 3; 4 5 6; 7 8 9]

The result with Octave version 3.0.5 is exactly zero, which is correct. But version 3.2.3 gives -1.3326e-15

Ralf <highspin>

 

(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 dbateman (Posted a comment)
  • -unavailable- added by highspin (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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 04 May 2010 12:24:27 PM UTCdbatemanOpen/ClosedOpen=>Closed
    Tue 04 May 2010 12:24:11 PM UTCdbatemanStatusNone=>Invalid

    Back to the top


    Powered by Savane 3.1-cleanup1