What algorithm is used by computers to calculate logarithms? I would like to know how logarithms are calculated by computers. The GNU C library, for example, uses a call to the fyl2x() assembler instruction, which means that logarithms are calculated directly from the hardware.
So the question is: what algorithm is used by computers to calculate logarithms?
 A: It really depends on the CPU.
For intel IA64, apparently they use Taylor series combined with a table.
More info can be found here: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.24.5177
and here: http://www.computer.org/csdl/proceedings/arith/1999/0116/00/01160004.pdf
A: All methods I have seen reduce first by dividing by the power of $2$ in the exponent and adding that exponent times $\ln(2)$ to the result.  From there, the two most common methods I have seen are Taylor series for $\ln(1+x)$ and a variant of the CORDIC algorithm.
J. M. also brings up Padé approximants which I have seen used in some calculator implementations.
A: Read the docs and the source of the cephes library for instance. Try also these books:


*

*J. F. Hart et al., Computer Approximations, Wiley, 1968.

*W. J. Cody, Jr. and W. Waite. Software Manual for the Elementary Functions.    Prentice Hall, 1980.

*J.-M. Muller, Elementary Functions, Algorithms and Implementation, SIAM, 2006.


See also https://stackoverflow.com/questions/2169641/where-to-find-algorithms-for-standard-math-functions.
