Related articles |
---|
Advanced expression simplification ichudov@algebra.com (2005-07-11) |
Re: Advanced expression simplification marcov@stack.nl (Marco van de Voort) (2005-07-11) |
Re: Advanced expression simplification haberg@math.su.se (2005-07-12) |
Re: Advanced expression simplification eugene.ressler@frontiernet.net (Gene) (2005-07-17) |
Advanced expression simplification drikosv@otenet.gr (Evangelos Drikos) (2005-07-17) |
Re: Advanced expression simplification liekweg@ipd.info.uni-karlsruhe.de (F. Liekweg) (2005-07-17) |
From: | "F. Liekweg" <liekweg@ipd.info.uni-karlsruhe.de> |
Newsgroups: | comp.compilers |
Date: | 17 Jul 2005 13:58:28 -0400 |
Organization: | University of Karlsruhe, Germany |
References: | 05-07-040 |
Keywords: | optimize |
Posted-Date: | 17 Jul 2005 13:58:28 EDT |
Truly, Igor Chudov wrote on 07/11/05 13:03:
> (x^2-1)/(x-1) simplifies to x+1. GOOD
>
> (1^100-1)/(x-1) "simplifies" to x^99+x^98+...+x+1. NOT GOOD.
But watch out, neither case preserves the division-by-zero
condition for x==1. The code around the expression might
actually depend on this behaviour, much like the elimination
of memory stores/loads might omit null-pointer checks that
the surrounding code might depend on.
Also, if you are transforming floating-point expressions,
a seemingly more complicated expresson might be numerically
stable and more robust wrt. rounding errors that the simplified
version. In particular, inside a fixed-point iteration, a longer
expression that is better conditioned might reduce the number
of iterations needed for convergence, so that simplifying it
would be counter-productive.
yours,
Florian
--
=======================================================================
Florian Liekweg | Dot is a very forgiving language; it should
Universität Karlsruhe | be considered some form of religion.
================================= graphviz-interest@research.att.com ==
Return to the
comp.compilers page.
Search the
comp.compilers archives again.