Avoid overflow with softplus function in python : <p>I am trying to implement the following softplus function:</p>

<pre><code>log(1 + exp(x))
</code></pre>

<p>I've tried it with math/numpy and float64 as data type, but whenever <code>x</code> gets too large (e.g. <code>x = 1000</code>) the result is <code>inf</code>.</p>

<p>Can you assist me on how to successfully handle this function with large numbers?</p>
