title: Newton method in python / scipy
body: <p>i am trying to get root of a function using Newton's algorithm on python. I have a runtime error even if i change the precision level. can you kindly help me understand how can i improve it?</p>
  
  <p>Best,
  GB</p>
  
  <p>Below my 'simple' code and the root finding part:</p>
  
  <pre><code>from scipy.stats import norm
  import numpy as np 
  import matplotlib.pyplot as plt  
  import scipy.optimize as opt
  
  
  def vega_callspread(r,S,T,d,sigma,q,K1,K2):
  
      d1 = (np.log(S/K1)+(r+sigma*sigma/2)*T)/(sigma*np.sqrt(T))
      d2 = (np.log(S/K2)+(r+sigma*sigma/2)*T)/(sigma*np.sqrt(T))
  
      u1 = S*np.exp(-q*T)*norm.pdf(d1,0,1)
      u2 = S*np.exp(-q*T)*norm.pdf(d2,0,1)
  
      return u1-u2;
  
  x0=112
  r=0
  T=1
  d=0
  sigma=0.2
  q=0
  K1=110
  K2=130
  
  
  
  
  res2= opt.newton(vega_callspread, x0, args=(r,T,d,sigma,q,K1,K2,),tol=10**(-1),maxiter=1000000)
  
  
  the error i get is: res2= opt.zeros.newton(vega_callspread, x0, args=(r,T,d,sigma,q,K1,K2,),tol=10**(-1),maxiter=1000000)
  /Users/anaconda/lib/python3.5/site-packages/scipy/optimize/zeros.py:173: RuntimeWarning: Tolerance of 0.011300000000005639 reached
    warnings.warn(msg, RuntimeWarning)
  </code></pre>