Path: news.mathworks.com!not-for-mail From: <HIDDEN> Newsgroups: comp.soft-sys.matlab Subject: Re: Very weird resolution issue. Bug ????? Seriously !! Date: Wed, 4 Mar 2009 03:16:02 +0000 (UTC) Organization: The MathWorks, Inc. Lines: 11 Message-ID: <gokrpi$ing$1@fred.mathworks.com> References: <goju5b$nv4$1@fred.mathworks.com> <gok3qm$2gn$1@fred.mathworks.com> <gok5db$mqi$1@fred.mathworks.com> <gok6c5$19g$1@fred.mathworks.com> <gok8gq$2na$1@fred.mathworks.com> <gok9cs$3ut$1@fred.mathworks.com> <gokdr9$heh$1@fred.mathworks.com> Reply-To: <HIDDEN> NNTP-Posting-Host: webapp-03-blr.mathworks.com Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1236136562 19184 172.30.248.38 (4 Mar 2009 03:16:02 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Wed, 4 Mar 2009 03:16:02 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 1187260 Xref: news.mathworks.com comp.soft-sys.matlab:522319 "Sung Soo Kim" <sskimbox@aol.com> wrote in message <gokdr9$heh$1@fred.mathworks.com>... > ....... > So, isn't really there any standard on matrix multiplication? If it is, it is really surprising... :( > ....... Sung Soo Kim, it is a serious mistake in my opinion to constrain oneself to always performing arithmetic operations in precisely the same order or even with the same algorithm in accomplishing some goal. To give a rather extreme example of this latter, consider a problem that was posed recently on this newsgroup. The task (in slightly simplified form) was to compute the sum of the squares of every possible difference in pairings of the n elements of a vector of values. To do this directly requires n^2 subtractions, n^2 squarings, and n^2-1 additions. However, it can readily be shown that the same answer (mathematically speaking) can be obtained using a quite different expression that uses only 2*n-2 additions, n squarings, n subtractions, one division, and one crucial multiplication, which amounts to vastly fewer operations for large n. Obviously the rounding errors in the two methods would be different, but it would be a shame not to be able to take advantage of such savings as this. I think the same principle should apply even to such seemingly routine tasks as computing the product of matrices. There are some important shortcuts that can be used in such calculations but they require processing the data in different arrangements than one would expect. I seriously doubt that Mathworks would be happy living under the restriction that they always had to use a consistent order of operations or even a consistent algorithm in matrix multiplication from one Matlab version to the next. In your case it was a mistake to assume that the b(1,1) element was arrived at in precisely the same manner as was c. It is far better that users create their applications with sufficient robustness so as not to be vulnerable to variations in rounding errors. Rounding errors are a fact of life that must be faced in any use of floating point numbers. Roger Stafford