The real issue here is what is "tol" supposed to mean?  The quadndg 
documentation simply calls it a tolerance parameter.

The existing quadndg is relative tolerance=tol, absolute tolerance=0; as 
you correctly observe, an absolute tolerance of 0 means integrals with a 
value of 0 have no tolerance at all, and hence never converge.

Your proposed change is relative tolerance=tol, absolute tolerance=tol.

The 1D quad in core Octave makes tol a vector, and uses relative 
tolerance=tol(2), absolute tolerance=tol(1).  This would also be easy to 
implement: if ( norm(int_old-int) < max(norm(int.*tol(2)),abs(tol(1))) 
Note that this will give an error with a 1-element tol, to avoid this 
add if(length(tol)!=2);tol=[0 tol];endif (for compatibility with 
existing code) or if(length(tol)!=2);tol=[tol tol];endif (possibly what 
1d quad does, as quad('sin',0,2*pi,1) doesn't give an error but 
quad('sin',0,2*pi,[0 1]) does) to the beginning of the function.

I don't know what MATLAB does, or if it even has an equivalent function.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to