# [Scipy-tickets] [SciPy] #1572: Scipy dblquad/tplquad spuriously drops epsilon for inner integration

SciPy Trac scipy-tickets@scipy....
Thu Dec 1 19:40:48 CST 2011

```#1572: Scipy dblquad/tplquad spuriously drops epsilon for inner integration
--------------------------------------------------------------------------+-
Reporter:  trobinso                                                      |       Owner:  somebody
Type:  defect                                                        |      Status:  new
Priority:  normal                                                        |   Milestone:  Unscheduled
Component:  scipy.integrate                                               |     Version:  devel
Keywords:  quadpack, spurious loss of information granulaity, integrate  |
--------------------------------------------------------------------------+-
From devel ''scipy/integrate/quadpack.py'', the relative and absolute
epsilon values appear to be getting dropped on the floor for the inner
integration step:

{{{
def _infunc(x,func,gfun,hfun,more_args):
a = gfun(x)
b = hfun(x)
myargs = (x,) + more_args

def dblquad(func, a, b, gfun, hfun, args=(), epsabs=1.49e-8,
epsrel=1.49e-8):
...
return

def _infunc2(y,x,func,qfun,rfun,more_args):
a2 = qfun(x,y)
b2 = rfun(x,y)
myargs = (y,x) + more_args
return quad(func,a2,b2,args=myargs)[0] # <-- And here

def tplquad(func, a, b, gfun, hfun, qfun, rfun, args=(), epsabs=1.49e-8,
epsrel=1.49e-8):
...
return
}}}

This can be fixed with a quick refactoring of the inner operation. For
example:
{{{
def _infunc(x,func,gfun,hfun,epsabs,epsrel,more_args):
a = gfun(x)
b = hfun(x)
myargs = (x,) + more_args

def dblquad(func, a, b, gfun, hfun, args=(), epsabs=1.49e-8,
epsrel=1.49e-8):
...
return
}}}

I've made these changes to my local version, since I'm setting a large
epsilon for a faster approximation.

Is there a good reason why this information is being removed during the
handoff?

--
Ticket URL: <http://projects.scipy.org/scipy/ticket/1572>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.
```