<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154076</link>
    <title>MATLAB Central Newsreader - significant digits</title>
    <description>Feed for thread: significant digits</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2008 by The MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>The MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 07 Aug 2007 13:06:23 -0400</pubDate>
      <title>significant digits</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154076#386573</link>
      <author>sunil vaidya</author>
      <description>i'm running a prog in matlab which uses two matrix&lt;br&gt;
inversions and one roots function. i have some inconsistency&lt;br&gt;
in my results. does matlab truncate numbers beyond 16&lt;br&gt;
significant digits? and if it does, is they any way around&lt;br&gt;
this problem----can the accuracy be increased or something? &lt;br&gt;
TIA&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 07 Aug 2007 13:14:45 -0400</pubDate>
      <title>Re: significant digits</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154076#386578</link>
      <author>Rick Rosson</author>
      <description>&lt;br&gt;
Hi Sunil,&lt;br&gt;
&lt;br&gt;
It's not so much that there is a fixed number of significant figures, but &lt;br&gt;
rather that MATLAB (and almost all other computer languages) uses floating &lt;br&gt;
point representations based on the IEEE standards.&lt;br&gt;
&lt;br&gt;
The absolute precision of a floating point variable depends on the absolute &lt;br&gt;
magnitude of the variable's current value.  For example:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;x = 1.5;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;y = 1.5e-9;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;e = eps(x);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;f = eps(y);&lt;br&gt;
&lt;br&gt;
Notice that 'e' and 'f' are about 9 orders of magnitude apart.&lt;br&gt;
&lt;br&gt;
On the other hand, the relative precision is approximately constant:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;a = e/x;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b = f/x;&lt;br&gt;
&lt;br&gt;
Notice that 'a' and 'b' are approximately equal.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
For more information, type&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;doc eps&lt;br&gt;
&lt;br&gt;
at the MATLAB command prompt.  Also, take a look at Technical Note 1108:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="http://www.mathworks.com/support/tech-notes/1100/1108.html"&gt;http://www.mathworks.com/support/tech-notes/1100/1108.html&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
I hope that helps.  Thanks.&lt;br&gt;
&lt;br&gt;
Rick&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
"sunil vaidya" &amp;lt;sunil.vaidya@gmail.com&amp;gt; wrote in message &lt;br&gt;
news:f99qoe$h6e$1@fred.mathworks.com...&lt;br&gt;
&amp;gt; i'm running a prog in matlab which uses two matrix&lt;br&gt;
&amp;gt; inversions and one roots function. i have some inconsistency&lt;br&gt;
&amp;gt; in my results. does matlab truncate numbers beyond 16&lt;br&gt;
&amp;gt; significant digits? and if it does, is they any way around&lt;br&gt;
&amp;gt; this problem----can the accuracy be increased or something?&lt;br&gt;
&amp;gt; TIA &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 07 Aug 2007 13:16:46 -0400</pubDate>
      <title>Re: significant digits</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154076#386581</link>
      <author>Rick Rosson</author>
      <description>Typo:  it should say...&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b = f/y;&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;instead of&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;b = f/x;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Sorry.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
"Rick Rosson" &amp;lt;rrosson@mathworks.com&amp;gt; wrote in message &lt;br&gt;
news:f99r87$rff$1@fred.mathworks.com...&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Hi Sunil,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; It's not so much that there is a fixed number of significant figures, but &lt;br&gt;
&amp;gt; rather that MATLAB (and almost all other computer languages) uses floating &lt;br&gt;
&amp;gt; point representations based on the IEEE standards.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; The absolute precision of a floating point variable depends on the &lt;br&gt;
&amp;gt; absolute magnitude of the variable's current value.  For example:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;    x = 1.5;&lt;br&gt;
&amp;gt;    y = 1.5e-9;&lt;br&gt;
&amp;gt;    e = eps(x);&lt;br&gt;
&amp;gt;    f = eps(y);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Notice that 'e' and 'f' are about 9 orders of magnitude apart.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; On the other hand, the relative precision is approximately constant:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;    a = e/x;&lt;br&gt;
&amp;gt;    b = f/x;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Notice that 'a' and 'b' are approximately equal.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; For more information, type&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;   doc eps&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; at the MATLAB command prompt.  Also, take a look at Technical Note 1108:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;   &lt;a href="http://www.mathworks.com/support/tech-notes/1100/1108.html"&gt;http://www.mathworks.com/support/tech-notes/1100/1108.html&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I hope that helps.  Thanks.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Rick&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; "sunil vaidya" &amp;lt;sunil.vaidya@gmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; news:f99qoe$h6e$1@fred.mathworks.com...&lt;br&gt;
&amp;gt;&amp;gt; i'm running a prog in matlab which uses two matrix&lt;br&gt;
&amp;gt;&amp;gt; inversions and one roots function. i have some inconsistency&lt;br&gt;
&amp;gt;&amp;gt; in my results. does matlab truncate numbers beyond 16&lt;br&gt;
&amp;gt;&amp;gt; significant digits? and if it does, is they any way around&lt;br&gt;
&amp;gt;&amp;gt; this problem----can the accuracy be increased or something?&lt;br&gt;
&amp;gt;&amp;gt; TIA&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 07 Aug 2007 13:34:20 -0400</pubDate>
      <title>Re: significant digits</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154076#386586</link>
      <author>John D'Errico</author>
      <description>"sunil vaidya" &amp;lt;sunil.vaidya@gmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;lt;f99qoe$h6e$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; i'm running a prog in matlab which uses two matrix&lt;br&gt;
&amp;gt; inversions and one roots function. i have some inconsistency&lt;br&gt;
&amp;gt; in my results. does matlab truncate numbers beyond 16&lt;br&gt;
&amp;gt; significant digits? and if it does, is they any way around&lt;br&gt;
&amp;gt; this problem----can the accuracy be increased or something? &lt;br&gt;
&amp;gt; TIA&lt;br&gt;
&lt;br&gt;
I'll just add a few extra comments to what&lt;br&gt;
Rick has ably explained. Very often we see&lt;br&gt;
people looking for additional precision in a&lt;br&gt;
numerical computation. They think, if only&lt;br&gt;
I could just throw more digits at this, I could&lt;br&gt;
solve my problem simply, without actually&lt;br&gt;
investing any thought in it.&lt;br&gt;
&lt;br&gt;
The flaw is, that logic never ends. We would&lt;br&gt;
see people trying to use 100 digits of&lt;br&gt;
precision to solve a problem where their&lt;br&gt;
data only has 2 significant digits. (Yes, it&lt;br&gt;
is easy enough to formulate a nasty&lt;br&gt;
problem.) Garbage in, garbage out.&lt;br&gt;
&lt;br&gt;
You will benefit far more from some study&lt;br&gt;
of your problem, learning how to compute&lt;br&gt;
efficiently and accurately what you need to&lt;br&gt;
do in a reasonable amount of precision, than&lt;br&gt;
you will from just throwing a few extra digits&lt;br&gt;
at it.&lt;br&gt;
&lt;br&gt;
HTH,&lt;br&gt;
John&lt;br&gt;
</description>
    </item>
    <item>
      <pubDate>Tue, 07 Aug 2007 13:45:07 -0400</pubDate>
      <title>Re: significant digits</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/154076#386588</link>
      <author> Randy Poe</author>
      <description>On Aug 7, 9:06 am, "sunil vaidya" &amp;lt;sunil.vai...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; i'm running a prog in matlab which uses two matrix&lt;br&gt;
&amp;gt; inversions and one roots function. i have some inconsistency&lt;br&gt;
&amp;gt; in my results. does matlab truncate numbers beyond 16&lt;br&gt;
&amp;gt; significant digits? and if it does, is they any way around&lt;br&gt;
&amp;gt; this problem----can the accuracy be increased or something?&lt;br&gt;
&amp;gt; TIA&lt;br&gt;
&lt;br&gt;
You could use the VPA tools to do your calculation&lt;br&gt;
symbolically, in variable-precision arithmetic, but you will find&lt;br&gt;
that slows down your calculation enormously.&lt;br&gt;
&lt;br&gt;
Better, as people have said, to learn to deal with round-off error,&lt;br&gt;
to use imprecision in your floating-point comparisons, to&lt;br&gt;
expect "real" values to possibly have imaginary components&lt;br&gt;
on the order of 10^-16, etc. This is part of numerical&lt;br&gt;
computation, the price we pay for the computation power.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;- Randy&lt;br&gt;
&lt;br&gt;
</description>
    </item>
  </channel>
</rss>
