RE: On Arnold's challenge & Paul's Observation...
Dear Dan, Many thanks for the clarification.
This raises a methodological question: where do we stop?
For example, as everyone know from numerical math, computing a+b+c also
depends on the order of the operations; some languages like C compute
left to right, Fortran if I remember correctly computes right to left,
and compilers change the order -- shall we prohibit this too?
In my opinion, there is a big difference between transformations like
(x+y)(x-y)=x^2-y^2 which may change interval estimates and changes like
(x^2 - y^2)/x^2 with 1 - (y/x)^2
Which of course depend on overflows etc. but only make interval
estimations, in general, narrower.
Probably we should distinguish between the two situations:
* first in an user-application situations in which a user (which is not
a professional specialist in interval computations) describes an
expression like (x^2 - y^2)/x^2 because this is exactly the formula that
relates the desired quantity with the variables x and y; in this case,
what the user wants is a valid interval enclosure for this particular
expression; in this case, in my opinion, we should allow compilers to
make transformations to 1 - (y/x)^2 because this helps the computer (in
many cases except for overflow-underflow situations) to get narrower
interval estimates
* I agree with you there are other situations when the program is
written by a professional in interval computations, in this case, the
given expression has been designed by a programmer explicitly to take
into account overflows or underflows etc.; in this case, we should
indicate to the compiler that this particular operation should be
performed exactly as written, and switch off any optimization features.
Probably the same thing is needed for a+b+c: sometimes it is just the
sum, and it does not matter whether we start with a+b or with b+c, and
sometimes, the user on purpose described the order in exactly this way.
Such an ability to switch compiler off and on for different expression
may be useful.
-----Original Message-----
From: ben@xxxxxxxxx [mailto:ben@xxxxxxxxx] On Behalf Of Dan Zuras
Intervals
>> Can you clarify this example? We are replacing an expression with an
> equal Single-Use expression -- for which (modulo rounding errors)
> straightforward interval computations produce the exact range, what is
> wrong with this transformation?
>>> Then, those things in point (3), say replacing an expression
>>> like (x^2 - y^2)/x^2 with 1 - (y/x)^2, should also be listed
>>> but, as they are value changing, reserved to the programmer
>>> to use or not, as the problem warrents.
Suppose the programmer knows that |y| < |x|. Then if
x^2 overflows, (x^2 - y^2)/x^2 would be oo/oo but
1 - (y/x)^2 would just get the right answer. If x^2
underflows, (x^2 - y^2)/x^2 would be 0/0 but 1 - (y/x)^2
would still get the right answer. In other cases, one
expression might be inexact while the other is exact.
There are other algebraically equivalent expressions,
(x + y)*(x - y)/x^2 or ((x + y)/x)*((x - y)/x) that
have their own advantages & problems but this is not
the point.