title: Fast approx to ln
body: <p><a href="https://pdfs.semanticscholar.org/00bb/69181895e16bbdd1b575f674432d80064106.pdf?fbclid=IwAR0BkXRBFeDwWOAiNbcnU4YB5ZvbNbJ00ULlaRjXuGsgBFXGy-XCaL2PIjo" rel="nofollow noreferrer">link to problem</a></p>
  <p>I need to write a fast approx of <code>ln</code> in Python and use the 2.4 algorithm. I know I can get the first a_i numbers with:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>def f1(x,i):
      a0=(x+1)/2
      g0=np.sqrt(x)
      a=[]
      for j in range(i):
          a0=(a0+g0)/2
          g0=np.sqrt((a0)*g0)
          a.append(a0)
      return a</code></pre>
  </div>
  </div>
  </p>