# Re: Computing exp(z)

*From*: Ron Shepard <ron-shepard@xxxxxxxxxxxxxxxxxx>*Date*: Thu, 19 May 2005 11:04:09 -0500

In article <d6htql$rbq$1@xxxxxxxxxxxxxxxxxx>,

"gh14tq5@xxxxxxxxx" <gh14tq5@xxxxxxxxx> wrote:

> Are there any disadvantages/pitfalls to computing exp(z) as

>

> exp(z) = exp(real(z))*(cos(aimag(z)),sin(aimag(z)))

One possible disadvantage is that this is not the correct equation.

At least it isn't the one that I've always used. Did you compare

results to see if your equation was correct? What you want, I

think, is something like:

r = abs(z)

theta = atan2(real(z),aimag(z))

expz = exp(r) * complx( cos(theta), sin(theta) )

Of course, you need to test for r=0.0 and so on, but you get the

point. I doubt that the intrinsic exp(z) is slower than this.

$.02 -Ron Shepard

.

**Follow-Ups**:**Re: Computing exp(z)***From:*gh14tq5

**Re: Computing exp(z)***From:*Tim Prince

**Re: Computing exp(z)***From:*James Van Buskirk

**References**:**Computing exp(z)***From:*gh14tq5@xxxxxxxxx

- Prev by Date:
**Re: Computing exp(z)** - Next by Date:
**Re: Computing exp(z)** - Previous by thread:
**Re: Computing exp(z)** - Next by thread:
**Re: Computing exp(z)** - Index(es):