<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Jun 17, 2016 at 7:05 PM, Paul Urbanczyk <span dir="ltr"><<a href="mailto:gomer@stanford.edu" target="_blank">gomer@stanford.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p>Sure... I understand that floating point calculations will not
always yield exact zero for a number of reasons.</p>
<p>The question I have is why some of the results are exactly zero
and others are not. I.e. why aren't the numbers all the same? What
is different about the calculation in rows 0, 1, 8, and 9 from the
other rows (2, 3, 4, 5, 6, 7)?</p></div></blockquote><div>Different order of operations.</div><div><br></div><div> Matt <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF">
<p>Thanks,</p>
<p>Paul<br>
</p>
<br>
<div>On 06/17/2016 01:06 PM, Matthew Knepley
wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">On Fri, Jun 17, 2016 at 2:47 PM, Paul
Urbanczyk <span dir="ltr"><<a href="mailto:gomer@stanford.edu" target="_blank">gomer@stanford.edu</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello
all,<br>
<br>
I'm using PETSc's "MatMult" function - MatMult(Mat A, Vec
x, Vec y) - to do a matrix-vector multiply. The Matrix, A,
is anti-symmetric, and the vector, x, is uniform. Thus,
the resulting vector, y, should be all zeros.<br>
<br>
The output I'm seeing typically looks like the following:<br>
<br>
Vec Object: Vec_0x20b2000_2 1 MPI processes<br>
type: mpi<br>
Process [0]<br>
0.<br>
0.<br>
-2.08167e-17<br>
-2.08167e-17<br>
-2.08167e-17<br>
-2.08167e-17<br>
-2.08167e-17<br>
-2.08167e-17<br>
0.<br>
0.<br>
<br>
Now, I know that -2.08167e-17 is machine zero, but I'm a
bit confused why a few of the entries would be exactly
zero while others are "machine zero." I would expect them
all to be either exactly zero, or machine zero, but not a
mixture. Do you have any idea why this might be?<br>
</blockquote>
<div><br>
</div>
<div>The order of addition matter for roundoff errors.</div>
<div><br>
</div>
<div> Thanks,</div>
<div><br>
</div>
<div> Matt</div>
<div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks for your help!<span><font color="#888888"><br>
<br>
-Paul<br>
</font></span></blockquote>
</div>
<div><br><span class="HOEnZb"><font color="#888888">
</font></span></div><span class="HOEnZb"><font color="#888888">
-- <br>
<div data-smartmail="gmail_signature">What
most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results
to which their experiments lead.<br>
-- Norbert Wiener</div>
</font></span></div>
</div>
</blockquote>
<br>
</div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener</div>
</div></div>