X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=0.7 required=5.0 tests=BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Message-ID: <905080.83354.qm@web25508.mail.ukl.yahoo.com> Date: Mon, 3 May 2010 12:42:23 +0000 (GMT) From: Marco Atzeri Subject: R: Octave 3.2.3: wrong matrix calculation To: texsit Cc: cygwin AT cygwin DOT com In-Reply-To: <877561.49926.qm@web29017.mail.ird.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com --- Lun 3/5/10, texsit ha scritto: > Hi All, > I use octave 3.2.3 under Cygwin (windows 7) for my math > application.=20 > I discovered a bad calculation calling the function det(). > The step to reproduce is this: >=20 > > A =3D [1,2,3;4,5,6;7,8,9]; > > det(A) > ans =3D -9.5171e-16 >=20 > The matrix is singular so I expected the resul was 0 and > not a very very little number. I problem is the same also > with Octave 3.2.4. > At the begin I thougth it was only a round error, but I've > made the same proof with Octave under Debian Linux (lenny). >=20 > Under Linux=A0the resul has been 0 as I expected. >=20 > Can anyone suggest me something to solve that problem? >=20 > I'm using Cygwin 1.7.5-1 with Intel centrino 2 and windows > 7 64 bit. >=20 > Thank you in advance. > Regards. >=20 > Luca >=20 Dear Luca, it is not an error , it is a rounding feature ;-) On cygwin most of the calculation are performed with 80 bits but data are stored with 64 bits, while on Linux both are=20 on 64 bits. For this reason the same sequence of operations=20 could provide a slightly different outcome. Suggested reading: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D323 http://hal.archives-ouvertes.fr/hal-00128124 In any case if you ask also for the matrix reverse=20 condition number [D, RCOND] =3D det (A) D =3D -9.5171e-16 RCOND =3D 2.2030e-18 you can recognize that the matrix is very bad conditioned Regards Marco Atzeri octave cygwin maintainer -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple