minimal version of nintegrate



On Oct. 12, 2011, Raymond Toy wrote:
-------------------------
>> with the choice between the latter two functions
>> made on the basis of which method takes the
>> least number of function evaluations (as
>> suggested by Raymond Toy).
>>
>
>Did I actually suggest that?  I thought I suggested choosing the one with
>the least error (relative or absolute).  Choosing the fewest number of
>evaluations doesn't seem like a good criterion.
>
I would have to search my emails to find out your actual suggestion.

But in the meantime, I insert a couple display printouts to expose
the relative values of element 2 = est. abs. error, and
element 3 = no. of func. evals.

For the examples tested so far, using either element as
the choice criterion yields the same choice of method.

My idea is that a method with less function evaluations is
having an easier time of converging, and the result is
then more likely to be more accurate. But this is of
course an experimental question.
-------------------------------------------------------------
(%i1) load(nint);
(%o1) "c:/work2/nint.mac"
(%i2) details:true$
(%i3) g : (x-2)^2 * sin (4000*x)$
(%i4) nint(g,x,2,3);
gL = [-1.5862464665235301E-4,1.5316233778733241E-8,11873,        0]
                                                            smaller 
smaller

gsL = [-1.586246466525885E-4,1.5682686228551024E-8,13923,         0]
                                                             larger 
larger
quad_qag
(%o4) -1.5862464665235301E-4
(%i5) g:x^(1/2)*log(1/x);
(%o5) -sqrt(x)*log(x)
(%i6) nint(g,x,0,1);
gL = [0.44444448137913,3.1051603361057058E-5,403,         0]
                                                       larger 
larger
gsL = [0.44444444444444,1.314939093721712E-7,231,          0]
                                                      smaller 
smaller
quad_qags
(%o6) 0.44444444444444
----------------------------------------------------
Ted