Currently if you try to naïvely integrate an equation that produces a NaN in the integration region, hcubature will just run forever, presumably because the rtol calculation doesn't check for NaN. Obviously, users should be thinking about their code and not integrating functions which produce NaN, but it'd be nice if there was and error thrown on encountering NaN instead of just silently running forever (unless one sets MaxEvals)
Here's a MWE:
f((x, y)) = y ≈ 0 ? NaN : x*y
hcubature(f, [-1, -1], [1, 1])
Currently if you try to naïvely integrate an equation that produces a
NaN
in the integration region,hcubature
will just run forever, presumably because thertol
calculation doesn't check forNaN
. Obviously, users should be thinking about their code and not integrating functions which produceNaN
, but it'd be nice if there was and error thrown on encountering NaN instead of just silently running forever (unless one setsMaxEvals
)Here's a MWE: