On Sept. 25, Raymond Toy wrote:
>> The exact result is 0 which makes the relative error calculation
>> undefined.
>> (I don't remember quadpack's definition of relative error offhand.)
>
> I looked it up. Quadpack computes
>
> errbnd = max(epsabs, epsrel*abs(result))
>
> This is used to determine if we've converged or not. But since result
> is always 0, errbnd is always 0 (because epsabs is 0). This is compared
> to the estimated abserr to determine convergence.
>
Thanks for the information about convergence decisions
Is there an example of an integrand and interval
for which the setting of epsabs makes any
difference??
When I attempt to influence this parameter in the
example f(x) = x over (-1,1) with ans = 0,
I see no change in the error message no matter what
value I attempt to assign. (Maybe my syntax is
wrong?)
---------------------------------------------------
"DEFAULT" EPSABS CASE
("0"; This can't be a floating point criterion in
the original fortran code. Up to now I
assumed it meant "0 to whithin floating
point precision".)
(%i14) for i thru 6 do
(qlist:quad_qag(x,x,-1,1,i),
print("key is ",i," ",qlist) )$
key is 1 [0.0, 1.1020760842711039E-14, 15, 2]
key is 2 [0.0, 1.1060840041517323E-14, 21, 2]
key is 3 [0.0, 1.108321668765528E-14, 31, 2]
key is 4 [0.0, 1.1091368685730577E-14, 41, 2]
key is 5 [0.0, 1.1095211642996757E-14, 51, 2]
key is 6 [0.0, 1.1097322727621492E-14, 61, 2]
----------------------------------------------------
"SMALL" EPSABS = 1D0-15
(%i15) for i thru 6 do
(qlist:quad_qag(x,x,-1,1,i, 'epsabs=1d0-15),
print("key is ",i," ",qlist ) )$
key is 1 [0.0, 1.1020760842711039E-14, 15, 2]
key is 2 [0.0, 1.1060840041517323E-14, 21, 2]
key is 3 [0.0, 1.108321668765528E-14, 31, 2]
key is 4 [0.0, 1.1091368685730577E-14, 41, 2]
key is 5 [0.0, 1.1095211642996757E-14, 51, 2]
key is 6 [0.0, 1.1097322727621492E-14, 61, 2]
---------------------------------------------
"MEDIUM" EPSABS = 1d-8
(%i16) for i thru 6 do
(qlist:quad_qag(x,x,-1,1,i, 'epsabs=1d0-8),
print("key is ",i," ",qlist ) )$
key is 1 [0.0, 1.1020760842711039E-14, 15, 2]
key is 2 [0.0, 1.1060840041517323E-14, 21, 2]
key is 3 [0.0, 1.108321668765528E-14, 31, 2]
key is 4 [0.0, 1.1091368685730577E-14, 41, 2]
key is 5 [0.0, 1.1095211642996757E-14, 51, 2]
key is 6 [0.0, 1.1097322727621492E-14, 61, 2]
--------------------------------
"LARGE" EPSABS = 1d0-4
(%i17) for i thru 6 do
(qlist:quad_qag(x,x,-1,1,i, 'epsabs=1d0-4),
print("key is ",i," ",qlist ) )$
key is 1 [0.0, 1.1020760842711039E-14, 15, 2]
key is 2 [0.0, 1.1060840041517323E-14, 21, 2]
key is 3 [0.0, 1.108321668765528E-14, 31, 2]
key is 4 [0.0, 1.1091368685730577E-14, 41, 2]
key is 5 [0.0, 1.1095211642996757E-14, 51, 2]
key is 6 [0.0, 1.1097322727621492E-14, 61, 2]
--------------------------
There is no effect on the error code "2"
OR on the precision of the answer OR
on the number of function evaluations.
---------------------------------------
Consider a harder integral:
f(x) = sqrt(x)*log(1/x) over (0, 1)
I get no bad error code, but
the value of epsabs does not
affect the precision of the result
nor the number of function evaluations.
-------------------------------
"DEFAULT" EPSABS
(%i13) for i thru 6 do
(qlist:quad_qag(sqrt(x)*log(1/x),x,0,1,i ),
print("key is ",i," ",qlist) )$
key is 1 [0.44444444444639, 3.546070696492148E-9, 555, 0]
key is 2 [0.44444444444641, 2.2661738353787069E-9, 735, 0]
key is 3 [0.44444444444921, 3.1700968483768995E-9, 961, 0]
key is 4 [0.4444444444502, 2.6138309725034223E-9, 1189, 0]
key is 5 [0.44444444445281, 2.8150024716225805E-9, 1377, 0]
key is 6 [0.44444444445799, 3.6058196629471457E-9, 1525, 0]
unrealistic SMALL EPSABS = 1d0-40
(%i12) for i thru 6 do
(qlist:quad_qag(sqrt(x)*log(1/x),x,0,1,i,'epsabs=1d0-40),
print("key is ",i," ",qlist) )$
key is 1 [0.44444444444639, 3.546070696492148E-9, 555, 0]
key is 2 [0.44444444444641, 2.2661738353787069E-9, 735, 0]
key is 3 [0.44444444444921, 3.1700968483768995E-9, 961, 0]
key is 4 [0.4444444444502, 2.6138309725034223E-9, 1189, 0]
key is 5 [0.44444444445281, 2.8150024716225805E-9, 1377, 0]
key is 6 [0.44444444445799, 3.6058196629471457E-9, 1525, 0]
MEDIUM EPSABS = 1d0-8
(%i18) for i thru 6 do
(qlist:quad_qag(sqrt(x)*log(1/x),x,0,1,i,'epsabs=1d0-8),
print("key is ",i," ",qlist) )$
key is 1 [0.44444444444639, 3.546070696492148E-9, 555, 0]
key is 2 [0.44444444444641, 2.2661738353787069E-9, 735, 0]
key is 3 [0.44444444444921, 3.1700968483768995E-9, 961, 0]
key is 4 [0.4444444444502, 2.6138309725034223E-9, 1189, 0]
key is 5 [0.44444444445281, 2.8150024716225805E-9, 1377, 0]
key is 6 [0.44444444445799, 3.6058196629471457E-9, 1525, 0]
LARGE EPSABS = 1d0-4
(%i11) for i thru 6 do
(qlist:quad_qag(sqrt(x)*log(1/x),x,0,1,i,'epsabs=1d0-4),
print("key is ",i," ",qlist) )$
key is 1 [0.44444444444639, 3.546070696492148E-9, 555, 0]
key is 2 [0.44444444444641, 2.2661738353787069E-9, 735, 0]
key is 3 [0.44444444444921, 3.1700968483768995E-9, 961, 0]
key is 4 [0.4444444444502, 2.6138309725034223E-9, 1189, 0]
key is 5 [0.44444444445281, 2.8150024716225805E-9, 1377, 0]
key is 6 [0.44444444445799, 3.6058196629471457E-9, 1525, 0]