Closed johnbcoughlin closed 3 years ago
It also probably has to do with the integrand being zero (to within machine precision) at the boundaries.
Yup. Your integrand underflows to 0.0 for |x| > 30 or so. So, if you have too few initial points in a subregion then the quadrature rule won't be able to distinguish it from a function that is identically zero in that region, and won't refine.
I'm guessing you really want to simulate an infinite integration domain? It is better to do that with a coordinate transformation than by using a huge box. Otherwise, you simply need to set a large enough initdiv
.
I'm getting inconsistent and incorrect results for integrating a very smooth function:
The correct answer is 1.5, as can be verified with Mathematica. Perhaps this has something to do with the function being radially symmetric? It also probably has to do with the integrand being zero (to within machine precision) at the boundaries. If I use boundaries at
(-4, 4)
instead of(-100, 100)
, I get the right answer.