On Nov. 24, 2012, Robert Dodier wrote:
----------------------------------
>I think the problem in this example (dunno if this is the same as other
>examples considered in this thread, I haven't been paying attention) is
>that you have assigned brombergabs which is smaller than the current
>value of 10^(- fpprec) (namely 10^-16). So bromberg can never satisfy
>brombergabs, so it keeps going up to brombergit. The number of function
>evaluations before giving up is 2^brombergit + 1 = 2^100 + 1. It will
>take a long time to evaluate the integrand that many times.
>
>What happens if you increase the value of fpprec, to, say, 50?
-------------------------------------------------------------------------
Setting global fpprec higher does the job; I had been assuming
that the new bromberg did that job locally based on the
requested precision. I also was not aware that the new bromberg
does not require the definition of a separate function f, and then
the syntax bromberg(f,x1,x2), as implied by the Macsyma manual,
my only source of documentation (of course I haven't studied
the code!).
------------------------------------------------
(%i1) load("c:/work2/bromberg.lisp");
(%o1) "c:/work2/bromberg.lisp"
(%i2) [brombergtol,brombergabs,brombergit,brombergmin];
(%o2) [1.0E-4,0.0,11,0]
(%i3) (brombergtol:0.0b0,brombergit:100)$
(%i4) brombergabs:1.0b-20$
(%i5) fpprec:50$
(%i6) g(x):= 1/(1+sqrt(x))$
(%i7) bval : bromberg(g,1/2,1);
(%o7) 2.6909206998615507341183361093738044447610421970518b-1
(%i8) time(%);
(%o8) [0.11]
(%i9) tval : bfloat(2 - sqrt(2) - 2*log(4) + 2*log(2 + sqrt(2)));
(%o9) 2.6909206998615507341183356137535683526014837806556b-1
(%i10) abs(bval - tval);
(%o10) 4.9562023609215955841639621740751209102598887600742b-26
(%i11) bval : bromberg(1/(1+sqrt(x)),x,1/2,1);
(%o11) 2.6909206998615507341183361093738044447610421970518b-1
(%i12) time(%);
(%o12) [0.09]
(%i13) abs(bval - tval);
(%o13) 4.9562023609215955841639621740751209102598887600742b-26
(%i14) fpprec:30$
(%i15) bval : bromberg(1/(1+sqrt(x)),x,1/2,1);
(%o15) 2.69092069986155073411833610938b-1
(%i16) time(%);
(%o16) [0.12]
(%i17) abs(bval - tval);
(%o17) 4.95626515608388823368837587657b-26
-------------------------------------------------
Ted