def quadrature(func, a, b, args=(), tol=1.49e-08, rtol=1.49e-08, maxiter=50, vec_func=True, miniter=1):
 if (not isinstance(args, tuple)):
  args = (args,)
 vfunc = vectorize1(func, args, vec_func=vec_func)
 val = np.inf
 err = np.inf
 maxiter = max((miniter + 1), maxiter)
 for n in xrange(miniter, (maxiter + 1)):
  newval = fixed_quad(vfunc, a, b, (), n)[0]
  err = abs((newval - val))
  val = newval
  if ((err < tol) or (err < (rtol * abs(val)))):
   break
 else:
  warnings.warn(('maxiter (%d) exceeded. Latest difference = %e' % (maxiter, err)), AccuracyWarning)
 return (val, err)

def quadrature ( func , a , b , args = ( ) , tol = 1.49e-08 , rtol = 1.49e-08 , maxiter = 50 , vec_func = True , miniter = 1 ) : if ( not isinstance ( args , tuple ) ) : args = ( args , ) vfunc = vectorize1 ( func , args , vec_func = vec_func ) val = np . inf err = np . inf maxiter = max ( ( miniter + 1 ) , maxiter ) for n in xrange ( miniter , ( maxiter + 1 ) ) : newval = fixed_quad ( vfunc , a , b , ( ) , n ) [ 0 ] err = abs ( ( newval - val ) ) val = newval if ( ( err < tol ) or ( err < ( rtol * abs ( val ) ) ) ) : break else : warnings . warn ( ( 'maxiter (%d) exceeded. Latest difference = %e' % ( maxiter , err ) ) , AccuracyWarning ) return ( val , err )
compute a definite integral using fixed-tolerance gaussian quadrature .