DATA X1/250,258.266.274,282.290,298/ DATA Y1/0.5,6,14,21,13,5,0/ A1=250 B1=298 CALLSIMP(N.A.B.X.Y.EPS.S) CALLSIMP(M.A1.B1.X1,Y1.EPS.S1) SS-S/S1 WRITE(6,*YS=,S, s1,S1 WRITE(6,11)SS 11 FORMAT(2X,The ratio of content of the two substances(S/S1)is:'F18.10) END SUBROUTINESIMP(M.A.B.X.Y.EPS.S2) DOUBLE PRECISION A.B.X.YEPS S2.FA.FB.XO.YO DIMENSION X(M).Y(M) H=B-A N=1 CALLLGRG2(X.Y.M.A.FA) CALL LGRG2(X.Y.M.B.FBY T1-0.5*H(FA+FB) 10 S=0 D020K=1N +(K-0)H CALLLGRG2(X,Y.M.X0,Y0) 20 S=S+Y0 T2=0.5*T1+H*S) S2=T2+T2-T1V3.0 IF(N.EQ.1)GOTO40 30 D=ABS(S2-SI) IF(ABS(S2).GT.1.0)THEN D=ABS((S2-S1S2) ENDIE IF(D LT EPSIGOTO 50 40 N-N+N H=0.5*H T1=T2 S1=82 G0T010 50 RETURN END SUBROUTINE LGRG2(X,Y.N,T.Z) DATA X1/250,258,266,274,282,290,298/ DATA Y1/0.5,6,14,21,13,5,0/ A=38 B=130 A1=250 B1=298 CALL SIMP(N,A,B,X,Y,EPS,S) CALL SIMP(M,A1,B1,X1,Y1,EPS,S1) SS=S/S1 WRITE(6,*)'S=',S,' S1=',S1 WRITE(6,11)SS 11 FORMAT(2X,'The ratio of content of the two substances(S/S1) is:',F18.10) END SUBROUTINE SIMP(M,A,B,X,Y,EPS,S2) DOUBLE PRECISION A,B,X,Y,EPS,S2,FA,FB,X0,Y0 DIMENSION X(M),Y(M) H=B-A N=1 CALL LGRG2(X,Y,M,A,FA) CALL LGRG2(X,Y,M,B,FB) T1=0.5*H*(FA+FB) 10 S=0 DO 20 K=1,N X0=A+(K-0.5)*H CALL LGRG2(X,Y,M,X0,Y0) 20 S=S+Y0 T2=0.5*(T1+H*S) S2=T2+(T2-T1)/3.0 IF(N.EQ.1)GOTO 40 30 D=ABS(S2-S1) IF(ABS(S2).GT.1.0)THEN D=ABS((S2-S1)/S2) END IF IF(D.LT.EPS)GOTO 50 40 N=N+N H=0.5*H T1=T2 S1=S2 GOTO 10 50 RETURN END SUBROUTINE LGRG2(X,Y,N,T,Z)