From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ffdd4d59cbfb4caf,start X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Ada 95 Numerics questions for the experts Date: 1997/08/25 Message-ID: #1/1 X-Deja-AN: 268524183 References: <3401C14B.480@gsfc.nasa.gov> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-08-25T00:00:00+00:00 List-Id: Michael asks <> 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.