From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: LARGE roundoff error in matrix-vector multiplication?
Date: Fri, 5 Nov 2010 22:16:03 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 19
Message-ID: <ib1vn3$bge$>
References: <ib1q18$51r$>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1288995363 11790 (5 Nov 2010 22:16:03 GMT)
NNTP-Posting-Date: Fri, 5 Nov 2010 22:16:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: comp.soft-sys.matlab:684283

"Henry Wolkowicz" <> wrote in message <ib1q18$51r$>...
> I get the following relatively large roundoff error on matrix-vector multiplication
> >> [size(A) nnz(A) nnz(x)  normest(round(A*1e3)/1e3-A)]
> ans =
>    129   185   465   185     0
> >> norm(A(:,colPerm)*x(colPerm) - A*x)
> ans =
>   1.3523e-012
> i.e. a   A is sparse  129by185  and I am finding    A*x
> A has numbers with 2 decimal accuracy. The vector colPerm is a permutation of the integers  1:185.  By permuting the columns of A and components of x and redoing the multiplication I get an error in the 12th place. This seems like an enormous error for this type of multiplication. This does not happen with random matrices A. So perhaps there is some catastrophic 'subtraction' roundoff that happens? But getting an error in the 12th place seems enormous to me. I am trying to obtain a high accuracy algorithm and this is just checking the error at the end. So the error check has an error in it?
> Am I doing something wrong here?

Your matrix is badly scaled.