[comp.arch] how to compute exp

jbs@WATSON.IBM.COM (05/14/91)

          Herman Rubin says:
I fail to see how one would compute exp(pi^3) even to short precision
without doing some computation like (pi^3)/ln2.

          I can think of at least 3 ways:
     1)  Use the power series.  Since all terms are positive there are
no numerical problems (if we compute in double).
     2)  Use exp(x)=exp(x/2)**2 to reduce the argument to a small number
y, compute exp(y) with a minimax polynomial approximation, recover exp(x)
by squaring the appropriate number of times.  Each square will lose a
bit of accuracy but if we are computing in double this need not be a
problem.
     3)  Write x=a+b+c+d.  Compute exp(a), exp(b), exp(c) and exp(d) by
table look up.  Compute exp(x) as exp(a)*exp(b)*exp(c)*exp(d).
          I am sure there are others.
                      James B. Shearer