2

I have a question regarding the mathematical functions of the C standard library, to be precise the (natural) logarithmic function: On which mathematical approximation is the implementation based and how exactly is it implemented? An explanation for the reason why/how would be nice.

Mary
  • 63
  • 4
  • 2
    As written this is a pretty broad question. From the [source](https://code.woboq.org/userspace/glibc/sysdeps/ieee754/dbl-64/e_log.c.html) it looks like it's handling inputs close to 1 with a polynomial approximation called "B", and inputs far from 1 by argument reduction by a power of two with a table lookup and a different polynomial called "A". – David Eisenstat Jan 31 '21 at 17:33

0 Answers0