Python Calculate log(1+x)/x for x near 0
<p>Is there a way to correctly calculate the value of log(1+x)/x in python for values of x close to 0? When I do it normally using np.log1p(x)/x, I get 1. I somehow seem to get the correct values when I use np.log(x). Isn't log1p supposed to be more stable?</p>

<pre><code>np.log1p(1+x)
</code></pre>

<p>That gives you <code>log(2+x)</code>.  Change it to <code>np.log1p(x)</code>.  </p>

python numerical-stability