[GiNaC-devel] Powers of exponents

Richard B. Kreckel kreckel at ginac.de
Sat Oct 3 23:53:18 CEST 2009


Hi!

Stephen Montgomery-Smith wrote:
> Vladimir V. Kisil wrote:
>>>>>>> On Fri, 02 Oct 2009 00:00:13 +0200, "Richard B. Kreckel" 
>>>>>>> <kreckel at ginac.de> said:
>>     RK> Maybe it is just too late, but I don't see the motivation for
>>     RK> the "is x an integer" condition.
>>
>>     Why not, if it is a correct substitution. Who know, may be as a
>>   result of some evaluation power of the exponents will becomes 2.

Actually, including "x is an integer" turns out to be correct. But we 
can do even better: it is sufficient to test if a is real.

Here is a proof. With arbitrary complex b:

     pow(exp(a),b) == exp(b*log(exp(a))

Since a is real, we know that exp(a) is real and positive. So 
log(exp(a))==a and exp(b*log(exp(a))==exp(b*a).  q.e.d.

I'll push a patch for the exp function and for doc/powerlaws.tex.

> I think it is wrong to include "x is an integer."  Even 1^i (which is 
> exp(0)^i) is not well defined (it can be any of e^(2 pi n) for all 
> integers).

That argument is confused. After all, we rewrite exp(2*Pi*I) -> 1.

   -richy.
-- 
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>


More information about the GiNaC-devel mailing list