how can I speed up bromberg?



How can I speed up the use of   bromberg?

I have a simple non-singular integrand
depending only on sqrt, over a small domain, which
quad_qags does (using the defaults) in almost no time.

I am only asking bromberg for 10 digit precision.

The integrand is 1/(1 + sqrt(x), the domain is [x,0,1].

If I don't translate the function, bromberg takes about
9 minutes.

If I translate the function, bromberg takes about 8.5 min.

If I both compile brmbrg.lisp and the function (see below)
bromberg takes about 7.8 min.

------------------------------------------------------------------
(%i2) to_lisp();
Type (to-maxima) to restart, ($quit) to quit Maxima.

MAXIMA> (compile-file
           "C:/PROGRA~1/MA81DB~1.0/share/maxima/5.28.0-2/share/numeric/brmbrg.lisp")

Compiling 
C:/PROGRA~1/MA81DB~1.0/share/maxima/5.28.0-2/share/numeric/brmbrg.lisp.
End of Pass 1.
End of Pass 2.
OPTIMIZE levels: Safety=2, Space=3, Speed=3
Finished compiling 
C:/PROGRA~1/MA81DB~1.0/share/maxima/5.28.0-2/share/numeric/brmbrg.lisp.
#p"C:/PROGRA~1/MA81DB~1.0/share/maxima/5.28.0-2/share/numeric/brmbrg.o"

>>>copied compiled file code to work2:

MAXIMA> (load "c:/work2/brmbrg.o")

5328
MAXIMA> (to-maxima)

Returning to Maxima
(%o2) true


(%i3) [brombergtol,brombergabs,brombergit,brombergmin];
(%o3) [1.0b-4,0.0b0,11,0]

(%i4) (brombergtol:0.0b0,brombergit:100)$
(%i5) brombergabs:1.0b-10;
(%o5) 1.0b-10

(%i6) g(x):= 1/(1+sqrt(x))$

(%i7) compile(g);
Compiling C:/DOCUME~1/EDWINW~1/LOCALS~1/Temp/gazonk_208_0.lsp.
End of Pass 1.
End of Pass 2.
OPTIMIZE levels: Safety=2, Space=3, Speed=3
Finished compiling C:/DOCUME~1/EDWINW~1/LOCALS~1/Temp/gazonk_208_0.lsp.
(%o7) [g]

>>>so with compiled brmbrg and compile function g:

compiled run -> 7.8 min:

(%i8) bromberg(g,0,1);
(%o8) 6.137056389033864b-1
(%i9) time(%);
(%o9) [470.71]

>>> tried reducing max no of iterations:

(%i10) brombergit:20$
(%i11) bromberg(g,0,1);
bromberg: failed to converge.
 -- an error. To debug this try: debugmode(true);

>>>with maxit=50,  7.7 min:

(%i12) brombergit:50$
(%i13) bromberg(g,0,1);
(%o13) 6.137056389033864b-1
(%i14) time(%);
(%o14) [463.47]

>>>using quadpack: almost no time:

(%i15) quad_qags(1/(1+sqrt(x)),x,0,1);
(%o15) [0.61370563888011,2.5191471131336129E-10,231,0]
(%i16) time(%);
(%o16) [0.01]
-----------------------------------------
Ted Woollett