Question: evalf(Int(...)) seems unable to assess numerically a definite double integral

Hi, 

Here is an example where evalf ( Int(....) ) fails to compute an in integral.
The function to integrate is very smooth and, except method=_Gquad, all the others seem to fail (even method=_MonteCarlo fails, which is probably the most surprising thing!)

Is it a weakness of evalf+Int or a misusse of my own ?

restart:

interface(version)

`Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895`

(1)

plot3d(cos(x*y), x=-1..3, y=-1..-0.2)

 

int(cos(x*y), [x=-1..3, y=-1..-1/5]);
evalf[15](%);

Si(3)+Si(1)-Si(3/5)-Si(1/5)

 

2.00705070023234

(2)

CodeTools:-Usage( evalf[10](Int(cos(x*y), [x=-1..3, y=-1..-0.2], method=_Gquad)) );

memory used=1.24KiB, alloc change=0 bytes, cpu time=0ns, real time=0ns, gc time=0ns

 

2.007050700

(3)

CodeTools:-Usage( evalf[10](Int(cos(x*y), [x=-1..3, y=-1..-0.2], method=_CubaVegas)) );

memory used=22.14KiB, alloc change=0 bytes, cpu time=16.99s, real time=17.01s, gc time=0ns

 

Int(Int(cos(x*y), x = -1. .. 3.), y = -1. .. -.2)

(4)

CodeTools:-Usage( evalf[10](Int(cos(x*y), [x=-1..3, y=-1..-0.2], method=_MonteCarlo)) );

memory used=12.79KiB, alloc change=0 bytes, cpu time=1000.00us, real time=0ns, gc time=0ns

 

Int(Int(cos(x*y), x = -1. .. 3.), y = -1. .. -.2)

(5)

N := 10^6:
X := Statistics:-Sample(Uniform(-1, 3), N):
Y := Statistics:-Sample(Uniform(-1, -0.2), N):
Z := cos~(X*~Y):
add(Z) / N * (4*0.8);

HFloat(2.0076470771803545)

(6)

 


 

Download evalf_Int.mw

 

Please Wait...