romberg



The Romberg program was a short (1 page) Fortran program that I copied from
my (graduate) numerical analysis course notes into lisp, in 1969 or so. I
had no idea that it would last this long in Macsyma/Maxima.   On the other
hand, it should not be replaced by something that is functionally inferior
in any way.  I consider failure to support recursive calls to be inferior,
but I don't see why the qq programs, properly packaged would not allow
recursion too.
Furthermore, if the qq programs do not support bigfloats, it seems Romberg
should stay until they do.

RJF

> -----Original Message-----
> From: maxima-bounces at math.utexas.edu [mailto:maxima-
> bounces at math.utexas.edu] On Behalf Of Andrej Vodopivec
> Sent: Wednesday, January 03, 2007 1:15 AM
> To: Robert Dodier
> Cc: Maxima list mailing
> Subject: Re: [Maxima] proposal to cut out romberg and quanc8 functions
> 
> I don't have any strong opinions about this. But romberg and quanc8
> have the advantage that they can be nested:
> 
> (%i1) romberg(romberg(x^2+y^2, x, 0, y), y, 0, 1);
> (%o1) 0.33333333333333
> (%i2) integrate(integrate(x^2+y^2, x, 0, y), y, 0, 1);
> (%o2) 1/3
> 
> Andrej
> 
> On 1/3/07, Robert Dodier <robert.dodier at gmail.com> wrote:
> > Hello, I want to cut out the romberg and quanc8 functions.
> > These are numerical quadrature functions which are superseded
> > by QUADPACK. I believe that it will improve Maxima to remove
> > these obsolete functions.
> >
> > Specifically I want (1) to move
> >
> > demo/rombrg.dem
> > doc/share/rombrg.usg
> > src/rombrg.lisp
> >
> > share/numeric/qq.dem
> > share/numeric/qq.lisp
> > share/numeric/qq.usg
> >
> > to the archive directory, and (2) to cut out the descriptions of the
> > romberg and quanc8 stuff from the reference manual.
> >
> > (There is also a version of romberg which uses bigfloat computations.
> > I am undecided about whether or not to also remove that.)
> >
> > romberg implements Romberg's extrapolation method.
> > quanc8 implements an adaptive Newton-Cotes method.
> > These methods are superseded by the Gauss-Kronrod methods
> > implemented in QUADPACK. The QUADPACK functions are
> > extrapolation methods, and the basic rules are Gaussian
> > quadrature rules. Also, QUADPACK contains methods for
> > specific problems (infinite interval, integrand with diferent
> > weight functions, Cauchy principal value) and romberg and
> > quanc8 do not.
> >
> > Empirically I have tested the romberg, quanc8, and quad_qags
> > (from QUADPACK) on a set of 15 problems collected from the
> > documentation for romberg, quanc8, and QUADPACK.
> > Except for one problem in which numerical integration is expected
> > to fail, I found that quad_qags always reports success and always
> > meets the specified relative error tolerance (1e-6).
> > romberg failed to converge or failed with a programming error
> > in several cases, although it met the error tolerance otherwise.
> > quanc8 failed to converge or failed with a programming error in
> > some cases, and reported success without meeting the relative
> > error tolerance in some others, and reported success and met
> > the error tolerance in others.
> >
> > Thus I believe that it can established that QUADPACK is superior
> > both from theoretical considerations and empirical observations.
> >
> > I would like to know if you are opposed to cutting romberg and quanc8.
> >
> > All the best, & hope this helps,
> > Robert Dodier
> >
> > PS.
> > input script: http://maxima.sourceforge.net/misc/compare_quadrature.mac
> > raw output: http://maxima.sourceforge.net/misc/compare_quadrature.log
> > summary: http://maxima.sourceforge.net/misc/compare_quadrature.txt
> > (and also shown here)
> >
> >     legend:
> >
> >     (t/F, nnn) = (met relative error claim, #function evaluations)
> >     F.C. = failed to converge
> >     f.c.e. = failed to converge, but that was expected
> >     X/0 = division by 0
> >
> >             quad_qags   romberg     quanc8
> >
> >     F1      (t, 609)    F.C.        (t, 289)
> >
> >     F2      (t, 441)    (t, 85)     (t, 1089)
> >
> >     F3      (t, 2037)   F.C.        (F, 481)
> >
> >     F4      (t, 105)    (t, 257)    (t, 65)
> >
> >     F5      (t, 21)     (t, 17)     (t, 33)
> >
> >     F6      (t, 21)     (t, 65)     (t, 33)
> >
> >     F7      (t, 399)    F.C.        (t, 305)
> >
> >     F8      (t, 357)    (t, 2049)   (F, 145)
> >
> >     F9      (t, 441)    (t, 277)    (t, 5937)
> >
> >     F10     f.c.e.      f.c.e.      f.c.e.
> >
> >     F11     (t, 525)    (t, 2049)   (F, 33)
> >
> >     F12     (t, 525)    (t, 1025)   (t, 353)
> >
> >     F13     (t, 231)    X/0         X/0
> >
> >     F14     (t, 693)    F.C.        F.C.
> >
> >     F15     (t, 819)    X/0         X/0
> > _______________________________________________
> > Maxima mailing list
> > Maxima at math.utexas.edu
> > http://www.math.utexas.edu/mailman/listinfo/maxima
> >
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima