muhat]=cubBayesNet_g(fun, dim, inputArgs{:});
check = double(abs(exactInteg-muhat) < max(absTol,relTol*abs(exactInteg)))

%%
% *Example 3: Keister function*
%
% Estimate the Keister's integrand, a multidimensional integral  
% inspired by a physics application over the interval $[0,1]^2$ 
% with parameters: order=2, abstol=0.001, relTol=0.01

dim=2; absTol=1e-3; relTol=1e-2;
normsqd = @(t) sum(t.*t,2); %squared l_2 norm of t
replaceZeros = @(t) (t+(t==0)*eps); % to avoid getting infinity, NaN
yinv = @(t)(er