Dear Richard,
On Wed, 30 Sep 2009 23:39:25 +0200, "Richard B. Kreckel" <kreckel@ginac.de> said:
RK> The rewriting rule pow(exp(x),a) -> exp(a*x) is not correct in RK> the general complex case. Consider a=1/2 and x=-I*Pi, for RK> instance. Thanks for pointing out this. I am attaching a patch which do the substitution only for real x and a. Best wishes, Vladimir -- Vladimir V. Kisil email: kisilv@maths.leeds.ac.uk -- www: http://maths.leeds.ac.uk/~kisilv/ --- inifcns_trans.cpp 2009-02-17 13:39:22.000000000 +0000 +++ patches/inifcns_trans.cpp 2009-10-01 16:03:58.000000000 +0100 @@ -99,9 +99,18 @@ return exp(GiNaC::real_part(x))*sin(GiNaC::imag_part(x)); } +static ex exp_power(const ex & x, const ex & a) +{ + if (x.info(info_flags::real) && a.info(info_flags::real)) + return exp(x*a); + + return power(exp(x), a).hold(); +} + REGISTER_FUNCTION(exp, eval_func(exp_eval). evalf_func(exp_evalf). derivative_func(exp_deriv). + power_func(exp_power). real_part_func(exp_real_part). imag_part_func(exp_imag_part). latex_name("\\exp"));