<div dir="ltr">I'm not sure what Steven's code is, but his hypothesis:<div><br></div><div><span style="font-size:13px">"Furthermore, </span><span style="font-size:13px">for safety you normally want the larger estimate of error, not the </span><span style="font-size:13px">smaller…"</span><br></div><div><br></div><div>does not apply to the usual case where you have an actual value and an estimate.  He seems to be describing a symmetric error function, which is not intuitive to me.</div><div><br></div><div>Best,</div><div><br></div><div>Neil</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 15, 2015 at 7:23 PM, Chris Barker - NOAA Federal <span dir="ltr"><<a href="mailto:chris.barker@noaa.gov" target="_blank">chris.barker@noaa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><span class=""><div>On Jan 15, 2015, at 3:58 PM, Neil Girdhar <<a href="mailto:mistersheik@gmail.com" target="_blank">mistersheik@gmail.com</a>> wrote:</div><div><br></div><blockquote type="cite"><div><div dir="ltr">You almost always want to use either an absolute tolerance or a relative tolerance.  </div></div></blockquote><div><br></div></span><div>Exactly -- only the user knows what is wanted. The trick is that relative tolerance is the most-of the time choice for float compares, but it's not appropriate (or even possible) for zero. </div><div><br></div><div>So here we are grappling for a way to have sensible behavior at zero with otherwise relative tolerance. It's probably not possible to do so in the general case. </div><div><br></div><div>So we should probably simply require the user to specify either and absolute or relative tolerance and be done with it.</div><div><br></div><div>Nothing will be relatively close to zero except zero, which is fine, but should be mentioned in the docs.</div><div><br></div><div>It sounds like this is what Steven's code does. I just haven't figured out how to look at it on a phone.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div>-Chris</div></font></span><div><div class="h5"><div><br></div><blockquote type="cite"><div><div dir="ltr">Here's why:  Consider your estimated value a and your actual value b.  If the estimate is taken to be the mean of a standard Gaussian distribution (the minimum assumptive distribution for a given mean and variance over the reals), then using an absolute tolerance is equivalent to verifying that the probability of observing b is within a interval with sufficient probability.  Similarly, if the estimate is taken to be the mean of an standard exponential distribution (the minimum assumptive distribution for a given mean over the positive reals), then using a relative tolerance is equivalent to verifying the same thing.<div><br></div><div>You almost always want one or the other.  The symmetric error that people are proposing in this thread has no intuitive meaning to me.</div><div><br></div><div>Best,</div><div><br></div><div>Neil</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 15, 2015 at 6:47 PM, Chris Barker - NOAA Federal <span dir="ltr"><<a href="mailto:chris.barker@noaa.gov" target="_blank">chris.barker@noaa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><span><div><br></div><div><br>On Jan 15, 2015, at 3:31 PM, Neil Girdhar <<a href="mailto:mistersheik@gmail.com" target="_blank">mistersheik@gmail.com</a>> wrote:<br><span style="color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:13px;line-height:19px">absolute(</span><em style="color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:13px;line-height:19px">a</em><span style="color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:13px;line-height:19px"> - </span><em style="color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:13px;line-height:19px">b</em><span style="color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:13px;line-height:19px">) <= (</span><em style="color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:13px;line-height:19px">atol</em><span style="color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:13px;line-height:19px"> + </span><em style="color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:13px;line-height:19px">rtol</em><span style="color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:13px;line-height:19px"> * absolute(</span><em style="color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:13px;line-height:19px">b</em><span style="color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:13px;line-height:19px">))</span><br></div></span><div>Oh, and if the numbers are small, then adding the absolute tolerance changes the tolerance significantly -- so you don't get what you expect there, either.</div><span><font color="#888888"><div><br></div><div>Chris</div></font></span><span><div><br></div><div><br></div><br><blockquote type="cite"><div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><span style="color:rgb(51,51,51);font-family:'Open Sans',sans-serif;font-size:13px;line-height:19px"><br></span></div><div><font color="#333333" face="Open Sans, sans-serif"><span style="line-height:19px">where atol is an absolute tolerance and rtol is a relative tolerance (relative to the actual value b).  This subsumes most of the proposals here.</span></font></div></div></blockquote><div><br></div></span><div>adding atol  in there "takes care of" the near zero and straddleing zero issue ( I suspect that's why it's done that way), but it is fatally wrong for values much less than 1.0 --  the atol totally overwhelms the rtol.</div><div><br></div><div>See my post earlier today.</div><span><font color="#888888"><div><br></div><div>-Chris</div><div><br></div><div><br></div></font></span></div><span>-- <br><div><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R            <a href="tel:%28206%29%20526-6959" value="+12065266959" target="_blank">(206) 526-6959</a>   voice<br>7600 Sand Point Way NE   <a href="tel:%28206%29%20526-6329" value="+12065266329" target="_blank">(206) 526-6329</a>   fax<br>Seattle, WA  98115       <a href="tel:%28206%29%20526-6317" value="+12065266317" target="_blank">(206) 526-6317</a>   main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</span></div></div>
</blockquote></div><br></div>
</div></blockquote></span></div>
</blockquote></div><br></div>
</div></blockquote></div></div></div>
</blockquote></div><br></div>