[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 

Can you fix your patch to only do this simplification when it cannot be 

Best wishes
Richard B. Kreckel

More information about the GiNaC-devel mailing list