Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

RE: Motion 52 -- Time to revive the "Expression" subgroup?



x-x is a good example when an optimizing compiler improves the range obtained by using straightforward interval computations. Alas, there are other cases when an optimizing compilers, while simplifying the expression, make the resulting estimate worse. An example I teach to my students is 1/(1+a/b). This is a perfect Single-Use Expression for which straightforward interval computations produces the exact range. 

However, this expression requires two division and one addition, so a good optimizing compiler will transform it into an easier-to-compute equivalent expression b/(a+b) which needs 1 addition and only 1 division. However, when we apply straightforward interval computations to this optimized expression, we get excess width, e.g., if a is in [1,2] and b is in [1,2]. 

-----Original Message-----
From: stds-1788@xxxxxxxx [mailto:stds-1788@xxxxxxxx] On Behalf Of Vincent Lefevre
Sent: Tuesday, November 19, 2013 4:59 PM
To: stds-1788
Subject: Re: Motion 52 -- Time to revive the "Expression" subgroup?

Note: If in some language, x represents a number but the evaluation is done with interval arithmetic, then compiler could be allowed to optimize x-x to 0, but that's out of the scope of P1788, because the optimization (or simplification) is done before interval arithmetic comes into play.