13 REAL gadapf,
x,a0,b0,f,
eps,a,b,f1,
f2,f3,
s,red,
c,w1,u2,ss,sold,sum
15 REAL aa,bb,f1f,f2f,f3f
18 dimension a(300),b(300),f1(300),
f2(300),f3(300),
s(300),
n(300)
19 1
FORMAT(16h
gadap:i too big)
20 dsum(f1f,f2f,f3f,aa,bb)=5./18.*(bb-aa)*(f1f+1.6*f2f+f3f)
21 IF(
eps.LT.1.0e-8)
eps=1.0e-8
29 f1(1)=f(
x,0.5*(1+
c)*a0+0.5*(1-
c)*b0)
30 f2(1)=f(
x,0.5*(a0+b0))
31 f3(1)=f(
x,0.5*(1-
c)*a0+0.5*(1+
c)*b0)
33 s(1)= dsum(f1(1),
f2(1),f3(1),a0,b0)
38 a(i+1)=a(i)+
c*(b(i)-a(i))
40 a(i+2)=a(i)+b(i)-a(i+1)
44 w1=a(i)+(b(i)-a(i))/5.
45 u2=2.*w1-(a(i)+a(i+2))/2.
46 f1(i+1)=f(
x,a(i)+b(i)-w1)
48 f3(i+1)=f(
x,b(i)-a(i+2)+w1)
51 f3(i+2)=f(
x,b(i+2)+a(i+2)-u2)
52 f1(i+3)=f(
x,a(i)+a(i+2)-w1)
56 IF(ifu.GT.5000) goto 130
57 s(i+1)= dsum(f1(i+1),
f2(i+1),f3(i+1),a(i+1),b(i+1))
58 s(i+2)= dsum(f1(i+2),
f2(i+2),f3(i+2),a(i+2),b(i+2))
59 s(i+3)= dsum(f1(i+3),
f2(i+3),f3(i+3),a(i+3),b(i+3))
60 ss=
s(i+1)+
s(i+2)+
s(i+3)
64 IF(abs(sold-ss).GT.
eps*(1.+abs(ss))/2.) goto 100
73 IF(
n(l).NE.0) goto 100