comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Ada 95 Numerics questions for the experts
Date: 1997/08/25
Date: 1997-08-25T00:00:00+00:00	[thread overview]
Message-ID: <dewar.872560202@merv> (raw)
In-Reply-To: 3401C14B.480@gsfc.nasa.gov


Michael asks

<<a)  X'model_epsilon
b)  X'model_small
c)  something else
d)  it depends (if so how?)
>>


the only possible answer is d). You need to figure out exactly what
test you need, and then program it. Perhaps an exact equality is
appropriate, perhaps using one of the measures related to rounding
discrepancies is appropriate, perhaps some entirely different test
is appropriate (for example if you are doing Simpon's rule integration,
you need to be quite careful about the test for convergence, and a test
like model_epsilon will likely be much TOO tight, and will miss the
convergence point -- I used to have great fun giving this out as an
assignment early on, students sure burned up a lot of CPU time missing
the convergence point :-)

If the equality is to do with comparing observations from the physical 
world, then you need to find out how precise these observations are.
For example, suppose we are searching a data base of people for a match,
and one of the items is the height represented in floating point. A test
for equal heights using model_epsilon or anything similar would be 
ludicrous. Instead we need to get some idea of how accurate the 
data is, and perhaps 0.5 might be a reasonable tolerance for comparing
heights in inches.

On the other hand, to repeat an example I have given before, if you are
computing square roots using Newton Raphson iteration on a machine with
a reasonable floating-point model, iteration to identify may be appropriate.

There is no easy answer to your question, you are simply fooling yourself
if you think you can replace analysis by a simple rule of the type
suggested by (a) or (b) above.





       reply	other threads:[~1997-08-25  0:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3401C14B.480@gsfc.nasa.gov>
1997-08-25  0:00 ` Robert Dewar [this message]
     [not found] ` <dewar.872560585@merv>
     [not found]   ` <jcreem-2608970711210001@ljd155.sanders.lockheed.com>
     [not found]     ` <dewar.872630607@merv>
     [not found]       ` <jeffrey.m.creem-2708970802350001@ljd155.sanders.lockheed.com>
1997-08-27  0:00         ` Ada 95 Numerics questions for the experts Robert Dewar
     [not found]           ` <jeffrey.m.creem-2808970708260001@ljd155.sanders.lockheed.com>
1997-08-28  0:00             ` Robert Dewar
1997-08-27  0:00         ` David C. Hoos, Sr.
1997-08-27  0:00           ` Robert Dewar
1997-08-27  0:00           ` Jeff Creem
1997-08-28  0:00             ` Robert Dewar
1997-08-28  0:00               ` Jeff Creem
1997-08-29  0:00               ` Tucker Taft
1997-08-30  0:00                 ` Robert A Duff
1997-08-31  0:00                 ` Tom Moran
1997-09-01  0:00                 ` Robert Dewar
1997-09-02  0:00                   ` Fergus Henderson
1997-09-02  0:00                   ` Robert A Duff
     [not found]                   ` <mheaney-ya023680000209972104030001@news.ni.net>
1997-09-05  0:00                     ` Robert Dewar
1997-09-05  0:00                       ` Matthew Heaney
1997-09-08  0:00                         ` Robert A Duff
1997-09-08  0:00                           ` Matthew Heaney
1997-09-09  0:00                             ` Robert A Duff
     [not found]                     ` <EFxt94.F5F@world.std.com>
1997-09-06  0:00                       ` Robert Dewar
1997-09-08  0:00                         ` Robert A Duff
1997-09-08  0:00                           ` Matthew Heaney
1997-09-09  0:00                             ` Robert A Duff
1997-09-01  0:00                 ` Robert Dewar
1997-08-30  0:00         ` Robert A Duff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox