58
$\begingroup$

I would like to know how are logarithms 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?

  • 2
    Implementation dependent.2011-09-01
  • 5
    For the uninitiated: `fyl2x()` computes a binary (base-2) logarithm.2011-09-01
  • 2
    This is almost identical to the question I asked some time ago: http://math.stackexchange.com/questions/14066/calculator-algorithms2011-09-01
  • 10
    It’s easy. To get the algorithm, just let let a dyslexic write “logarithm”.2011-09-02
  • 2
    @KonradRudolph Wow, I never noticed they were anagrams of eachother!2014-08-18
  • 2
    @KonradRudolph LOL. Of course, there is the one about why the dyslexic, agnostic, insomniac lay awake all night last night ....2014-10-06
  • 0
    [How does C compute sin() and other math functions?](https://stackoverflow.com/q/2284860/995714), [What algorithms do FPUs use to compute transcendental functions?](https://stackoverflow.com/q/13877303/995714)2018-08-14

3 Answers 3