[comp.arch] Calculating log, exp, and CORDIC - summary

radford@calgary.UUCP (Radford Neal) (06/08/87)

Many thanks to all who responded to my queries on calculation of log
and exp and the CORDIC algorithm. Here is a summary of what I've 
found out.

First, for those not in the know, CORDIC is a technique for calculating
log, exp, sin, cos, arcsin, arccos, sinh, arcsinh, etc. plus sqrt and
multiplication and division. It is an iterative algorithm, with each
iteration requiring about three adds and two shifts, and with the number
of iterations being equal (usually) to the number of bits of precision
desired.

This seems very attractive to me, so I asked why its not used more.
(I.e. why polynomial approximation is used instead.) Results:

    1) It is used more than I thought, in particular it is used in
       several floating-point co-processors, such as the 68881.

    2) It is less attractive than it seems at first glance, because
       although it allows one to calculate a sin (say) in about the
       same time as a simple multiply algorithm would take, multiplication
       can be speeded up by summing partial products in parallel,
       but the same can't be done with CORDIC.

I still think the algorithm is not used as much as it deserves:

    1) It doesn't seem to be used in floating-point packages for machines
       without any floating-point hardware (e.g. IBM PC). At least this
       seems to be the case judging by the atrocious times I've observed
       with some of these. Its advantage over polynomial approximation
       seems to me to be unequivocably a factor of five at least in this case.

    2) Mainframes and minis with CORDIC hardware seem never to have 
       been built. This may not be a win, given the alternative of
       spending the money on faster multiply/divide, but the fact that
       it hasn't been tried makes one doubt whether anyone really knows.

Thanks again to all who sent mail, especially Jim Valerio, Arch Robison,
Les Merrill, David Hough, Wayne Schlitt, Pat Shanahan, and David Robinson.

    Radford Neal