title: RuntimeWarning: invalid value encountered in double_scalars related to np.sqrt
body: <p>I have defined a mathematical function with np.sqrt(a positive number) in it.
  It returns me RuntimeWarning.</p>
  
  <p>After I simplify it to a very simple mathematical function that anyone can solve manually, it still return me the error.
  Below is the simplified function:</p>
  
  <pre><code>import numpy as np
  n=30
  def f0(x,k):
      bot = 9.37 * 10**(-4) * k**(0.25)
      x_0 = 2*bot
      #print(x_0)
      E_c = 4730 * np.sqrt(k)
      #print(E_c)
      r = E_c/(E_c - k/bot)
      #print(r)
      top = x/(1+(x/x_0)**n)**(1/n) 
  
      return (top/bot)**r
  
  a = f0(-0.001,36)
  </code></pre>
  
  <p>It returns:</p>
  
  <pre><code>RuntimeWarning: invalid value encountered in double_scalars
  </code></pre>
  
  <p>And <code>a</code> is <code>nan</code></p>
  
  <p>It works well if the input <code>x &gt;= 0</code>, or I remove <code>np.sqrt()</code> to the result of the square root of the number inside the <code>np.sqrt()</code>.</p>
  
  <p>What's reason of that.</p>
  
  <p>I have noticed the type of np.sqrt is a bit different to another number. Is this the reason?</p>