Closed mzaffalon closed 3 years ago
The same integral does not hang with HCubature
:
using HCubature
julia> @time hcubature(x -> (1.0+(x[1]*x[3]*sin(x[2]))^2), [0,0,-0.2], [0.2,2π,0.2], atol=1e-6)
0.051035 seconds (200.74 k allocations: 10.392 MiB)
(0.5026995050032179, 0.0)
EDIT: ... because it was fixed in https://github.com/JuliaMath/HCubature.jl/issues/4#issuecomment-319518345
Yes, same as JuliaMath/HCubature.jl#4 and stevengj/cubature#7. This needs to be fixed in the underlying C library.
Should be fixed by https://github.com/JuliaRegistries/General/pull/25426.
Yup, it works now:
julia> Cubature.hcubature(x -> (1.0+(x[1]*x[3]*sin(x[2]))^2), [0,0,-0.2], [0.2,2π,0.2], abstol=1e-6)
(0.5026995050032179, 1.1102230246251565e-16)
hcubature
seems to hang for some integrands when the integrand is symmetric in the domain of integration and the tolerance is sufficiently high.(Sorry for the contrived example: I could not find one with lower dimensionality.)