[Top][All Lists]

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

Re: strange problem

From: Tomer Altman
Subject: Re: strange problem
Date: Fri, 28 Nov 2003 02:24:26 -0800 (PST)

These are algorithms, not AI. You cannot expect them to
"reality-check" their own results. They can't tell "obvious" errors apart
from numerical errors. They have their own method of calculating a
matrix product, and they'll plod through the same steps whether its a
2x2 or a 2000x2000 matrix. They cannot take a look at your data, and
show how that ans(1,1) element is really only trivial
arithmetic. They're going to find out the answer the long, systematic
way, which might introduce more round-off error than by just "seeing it".

If you are confident that you only need a limited amount of precision,
round off the unnessary precision. In my algorithms, I don't bemoan
"Oh no! Negative zeros! BLAS must be all messed up!". I just realize
the limitations of floating point, and try to determine the minimum
precision I require for my answers.

If you want infinitely-precise results, I recommend GNU Maxima:



P.S.- My incoherent & misspelled ramblings this evening are offered

On Nov 28, 2003 at 10:51am, Gerald Ebberink wrote:

ebberi >Date: Fri, 28 Nov 2003 10:51:42 +0100
ebberi >From: Gerald Ebberink <address@hidden>
ebberi >To: Geraint Paul Bevan <address@hidden>
ebberi >Cc: address@hidden
ebberi >Subject: Re: strange problem
ebberi >Resent-Date: Fri, 28 Nov 2003 03:52:02 -0600
ebberi >Resent-From: address@hidden
ebberi >
ebberi >-----BEGIN PGP SIGNED MESSAGE-----
ebberi >Hash: SHA1
ebberi >
ebberi >It is not just representation. This was hust one in a series of 4000
ebberi >matrix multiplications in a script. It gave me the problem of a
ebberi >impossible answer,a negative distance in a optical system (this is
ebberi >possible just not in the system I'm building).
ebberi >
ebberi >So one of the problems is this number is negative.
ebberi >
ebberi >Also this problem strikes me as a problem early calculators had.
ebberi >you know the 1/3 * 3 =0.99999999 problem.
ebberi >
ebberi >then there is a third thing I would like to point out.
ebberi >
ebberi >as you can see in your own example -1/100 = -0.01 and not
ebberi >- -0.01000000000000000020817 which would give you the 2.0817e-17
ebberi >
ebberi >
ebberi >Geraint Paul Bevan wrote:
ebberi >| Gerald,
ebberi >|
ebberi >| just to follow up to my earlier answer, if the purposes of your
ebberi >| calculation are just for demonstration, the command "format bank" will
ebberi >| set Octave to print only two decimal places; it only changes the
ebberi >| display, however, not the underlying representation so calculations 
ebberi >| not be affected.
ebberi >|
ebberi >| octave:1> format bank
ebberi >| octave:2> a = [ 1 , 100 ; 0 , 1 ] * [ 1 , 0 ; -1/100 , 1 ]
ebberi >| a =
ebberi >|
ebberi >| ~    -0.00   100.00
ebberi >| ~    -0.01     1.00
ebberi >|
ebberi >|
ebberi >| --
ebberi >| Geraint Bevan
ebberi >|
ebberi >|
ebberi >
ebberi >- --
ebberi >Ing. Gerald Ebberink
ebberi >Laser Technician
ebberi >
ebberi >Kernfysisch Versneller Instituut
ebberi >Rijksuniversiteit Groningen
ebberi >Zernikelaan 25
ebberi >9747 AA Groningen
ebberi >The Netherlands
ebberi >tel: +31 50 363 3518
ebberi >lab: +31 50 363 3588
ebberi >fax: +31 50 363 4003
ebberi >
ebberi >
ebberi >-----BEGIN PGP SIGNATURE-----
ebberi >Version: GnuPG v1.2.2 (GNU/Linux)
ebberi >Comment: Using GnuPG with Mozilla -
ebberi >
ebberi >iD8DBQE/xxqubSbfYz8yWIMRAljHAJoCfnGzA/Kc8NEc9yVe/d7aRoV05wCgtwiZ
ebberi >E4QcevhwD0w5OensMy/8mmw=
ebberi >=LFzj
ebberi >-----END PGP SIGNATURE-----
ebberi >
ebberi >
ebberi >
ebberi >-------------------------------------------------------------
ebberi >Octave is freely available under the terms of the GNU GPL.
ebberi >
ebberi >Octave's home on the web:
ebberi >How to fund new projects:
ebberi >Subscription information:
ebberi >-------------------------------------------------------------
ebberi >
ebberi >

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

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