Velocity Reviews > cexp implementation questions

# cexp implementation questions

Ben Bacarisse
Guest
Posts: n/a

 01-21-2011

[I've removed the cross post to sci.maths. That's just going to
complicate matters because C's infinities are not mathematical
infinities.]

"io_x" <(E-Mail Removed)> writes:

> "io_x" <(E-Mail Removed)> ha scritto nel messaggio
> news:4d39c3db\$0\$19264\$(E-Mail Removed) ...
>> "Ben Bacarisse" <> ha scritto nel messaggio
>> news:0.6d02c8542229707911d7.20110121143620GMT.878v (E-Mail Removed)...
>>> steve <(E-Mail Removed)> writes:
>>> What result have you decided on for cexp(1000 + i0)?

>>
>> easy
>> exp(1000+i 0)= exp(1000)(cos(0) + i sin(0))=exp(1000)(1 + i 0)=
>> =exp(1000) + i 0
>>
>> the problem is exp(inf+i0)

>
> but where is the problem in define
> DeF
> exp(inf+i0)=inf+i 0
> ?

There is no problem with that definition. In fact, annex G recommends
that that be result of cexp(inf + i0). It was you that said this case
was a problem.

> so in all case
> if x!=NaN => exp(x+i0)=exp(x)+i 0
> exp(NaN+i 0)=NaN + i NaN

Annex G recommends NaN + i0 here. In other words, it suggests that
cimag(cexp(x + i0)) == 0 for all x (finite, infinite and NaN).

None the less, your suggestion (that cexp(NaN + i0) be NaN + i*NaN) is
quite reasonable. In fact it is what glibc does.

> have u done some course in complex analisys?

Yes, but I don't see how that matters.

--
Ben.