Re: float exponent



"cr88192" <cr88192@xxxxxxxxxxxxxxxxxx> wrote in message
news:1899e$47287d53$ca8010a3$32327@xxxxxxxxxxxxx

just wondering:
anyone here know how to go about computing floating point exponents (like
in 'pow')?...
sadly, this one escapes me, and I can't find more info.

f2xm1 and fyl2x would almost seem to provide something, but f2xm1 only
works over a very small range.

fxtract and maybe fprem1 are helpful for doing argument reductions.

even more useful:
if whoever knows, also knows about a form for complexes.

(a+b*i)**(c+d*i) = exp(log((a+b*i)**(c+d*i)))
= exp((c+d*i)*log(a+b*i))
= exp((c+d*i)*(log(a**2+b**2)/2+i*atan2(b,a)))
=
exp(c*log(a**2+b**2)/2-d*atan2(b,a)+i*(d*log(a**2+b**2)/2+c*atan2(b,a)))
=
exp(c*log(a**2+b**2)/2-d*atan2(b,a))*(cos(d*log(a**2+b**2)/2+c*atan2(b,a))+i*sin(d*log(a**2+b**2)/2+c*atan2(b,a)))

and, if I am really lucky, for quaternions.

Oog. The first thing I would try is to write out the quaternion in
matrix form, diagonalize it, raise the diagonal matrix to the appropriate
power, then reassemble the result...

all this is for my compiler, for which I have now added an exponent
operator. sadly, at present, since I have not figured this out, I have
ended up having to deal with the float case by generating calls to pow and
cpow.

Look up in gfortran or g95 sources for the realization of operator(**).

--
write(*,*) transfer((/17.392111325966148d0,6.5794487871554595D-85, &
6.0134700243160014d-154/),(/'x'/)); end


.