[GiNaC-devel] Powers of exponents
Richard B. Kreckel
kreckel at ginac.de
Wed Sep 30 23:39:25 CEST 2009
Dear Vladimir,
Vladimir V. Kisil wrote:
> I noticed that exp() functions is not aware of power()
> method. As a results simple things like pow(exp(a), 2) are not
> simplified to exp(2*a). I am attaching the corresponding patch.
The rewriting rule pow(exp(x),a) -> exp(a*x) is not correct in the
general complex case. Consider a=1/2 and x=-I*Pi, for instance. This is
because, generally, log(exp(x)) -> x is not correct.
GiNaC is very careful about *not* doing such simplifications that are
not guaranteed to be correct, even in the general complex case. Maybe
you are unaware of this file
<http://www.ginac.de/ginac.git?a=blob;f=doc/powerlaws.tex;h=ade0547d048a51f65f414c08416a3979ea885ee8;hb=master>.
Can you fix your patch to only do this simplification when it cannot be
wrong?
Best wishes
-richy.
--
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>
More information about the GiNaC-devel
mailing list