procedure insiro(F,A,B,ORDMAX,PREC,SORT,RES); value A,B,ORDMAX,PREC; real procedure F; Boolean SORT; real A,B,PREC; integer ORDMAX; real array RES;
Integral of F(x) from A to B by Romberg's rule halving the step at each stage. If the relative difference between successive estimates is less than PREC, an exit is made with SORT=true, while if the number of points increases beyond ORDMAX, SORT=false on exit. The array RES [1:ORDMAX + 1] contains successive approximations, the most precise being in RES[1]. Tne maximum number of function evaluations is 2ORDMAX.
procedure indourec(F,A1,B1,A2,B2,N1,N2,ORDMAX,PREC,SORT,RES); value A1,B1,A2,B2,N1,N2,ORDMAX,PREC; real procedure F; Boolean SORT; real A1,B1,A2,B2,PREC; integer N1,N2,ORDMAX; real array RES;
Integral of F(x,y) over [A1,B1] × [A2,B2] by Romberg's rule, using N1 and N2 steps initially. The other parameters have the same significance as for insiro. The maximum number of function evaluations is N1 × N2 × 4(ORDMAX + 1).
procedure int3neville (F,A1,B1,A2,B2,A3,B3,H1,H2,H3,ALPHA,ORDMAX, PREC,INT,ENTlER,RES); value A1,B1,A2,B2,A3,B3,H1,H2,H3,ALPHA,ORDMAX,PREC; real procedure F; real A1,B1,A2,B2,A3,B3,H1,H2,H3,PREC,ALPHA; integer ORDMAX,ENTIER; real array RES,INT;
Integral of F(x,y,z) over [A1,B1] × [A2,B2] × [A3,B3] by Romberg's rule , with the steps hi reduced from the initial values (H1,H2,H3) according to the rule ki = hi/n where n=entier(ALPHA × n)+1, n(1)=1. We must set ALPHA > 1 (say 1.5). The trapezoidal estimates are in RES and the Neville extrapolations in INT [1:ORDMAX]. If the relative difference between extrapolations after ENTlER iterations is less than PREC, the value of the integral is stored in INT[ENTlER]. The number of function evaluations is then 1 + 8 × (ALPHA (3 × ENTlER -1) / (ALPHA3 -1))/ (H1 × H2 × H3).
procedure intcossin (F,A,B,LAM,RESCOS,RESSIN,ERCOS,ERSIN); value A,B,LAM,N; integer N; real procedure F; real A,B,LAM,RESCOS,RESSIN,ERCOS,ERSIN;
Integrals of F(x) cos(LAM.x) and F(x) sin(LAM.x) over [A,B] by piecewise polynomial interpolation of F(x) at N points, with an error estimate based on the interpolating polynomial. Integrals in RESCOS ,RESSIN; error estimates in ERCOS,ERSIN.
Not recommended for LAM < 0.05.