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.
Asked
Active
Viewed 449 times
2
-
2As 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