title: How does scipy.integrate.quad know when to stop?
body: <p>I have a piece of code that I am using scipy.integrate.quad.  The limits of integration are minus infinity to infinity.  It runs OK, but I would like it faster.</p>
  
  <p>The nature of the problem is that the function being integrated is the product of three functions: (1) one that is narrow (between zero and (2) one that is wide (between, say, 200,000 and 500,000), and (3) one that falls off as 1/abs(x).  </p>
  
  <p>I only need accuracy to .1%, if that.</p>
  
  <p>I could do a lot of work and actually determine integration limits that are real numbers so no excess computation gets done; outside the regions of functions 1 and 2 they are both zero, so the 1/x doesn't even come into play there.  But it would be a fair amount of error-prone code calculations.</p>
  
  <ol>
  <li><p>How does this function know how to optimize, and is it pretty good at it, with infinite bounds?</p></li>
  <li><p>Can I tune it through passing in guidance (like error tolerance)?</p></li>
  <li><p>Or, would it be worthwhile to try to give it limited integration bounds?</p></li>
  </ol>