Mail Archives: djgpp/1996/02/13/15:39:22
In article <4es0ep$is2 AT fu-berlin DOT de> axl AT zedat DOT fu-berlin DOT de (Axel Thimm) writes:
....
The reason I "expored" this behaviour was an optimization by hand of a
simulation program. A lattices site value is very often used in
quadratic terms, so introducing a second lattice and storing theese
values seemed like just speeding up the process. I was amazed when the
output changed (the results were still within the stat. error).
So if someone is writing programs that can do exactly the same thing
with two different implementations, then he would very much like to turn
such optimizations temporarily off, to get the same results. Later he
would turn them on again.
....
My advice: get a good book on numerical math and read the section on
condition numbers. Any inexact computation (whether using floats,
doubles or quads) will lead to an inexact result, bounded by the
condition number of your computation times the machine precision
(which is, of course, different for floats, doubles and quads). Any
result within this threshold (which may be a pessimistic bound though)
is "correct". As an example, consider
(1.1 * 1.1) - exp (2.0 * log (1.1))
which will not be zero, although both factors are (mathematically) equal.
The second computation, however, has a worse condition number.
--
/
R. A. Hogendoorn /__
Informatics Division / \
National Aerospace Laboratory The Netherlands ( NLR )
E-mail: hogend AT nlr DOT nl \___/
Tel. +31-527-24-8376 /
Fax. +31-527-24-8210 /
- Raw text -