home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frostbyte's 1980s DOS Shareware Collection
/
floppyshareware.zip
/
floppyshareware
/
DOOG
/
PCSSP1.ZIP
/
GAUQUAD.ZIP
/
DQG8.FOR
< prev
next >
Wrap
Text File
|
1985-11-29
|
2KB
|
53 lines
C
C ..................................................................
C
C SUBROUTINE DQG8
C
C PURPOSE
C TO COMPUTE INTEGRAL(FCT(X), SUMMED OVER X FROM XL TO XU)
C
C USAGE
C CALL DQG8 (XL,XU,FCT,Y)
C PARAMETER FCT REQUIRES AN EXTERNAL STATEMENT
C
C DESCRIPTION OF PARAMETERS
C XL - DOUBLE PRECISION LOWER BOUND OF THE INTERVAL.
C XU - DOUBLE PRECISION UPPER BOUND OF THE INTERVAL.
C FCT - THE NAME OF AN EXTERNAL DOUBLE PRECISION FUNCTION
C SUBPROGRAM USED.
C Y - THE RESULTING DOUBLE PRECISION INTEGRAL VALUE.
C
C REMARKS
C NONE
C
C SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED
C THE EXTERNAL DOUBLE PRECISION FUNCTION SUBPROGRAM FCT(X)
C MUST BE FURNISHED BY THE USER.
C
C METHOD
C EVALUATION IS DONE BY MEANS OF 8-POINT GAUSS QUADRATURE
C FORMULA, WHICH INTEGRATES POLYNOMIALS UP TO DEGREE 15
C EXACTLY. FOR REFERENCE, SEE
C V.I.KRYLOV, APPROXIMATE CALCULATION OF INTEGRALS,
C MACMILLAN, NEW YORK/LONDON, 1962, PP.100-111 AND 337-340.
C
C ..................................................................
C
SUBROUTINE DQG8(XL,XU,FCT,Y)
C
C
DOUBLE PRECISION XL,XU,Y,A,B,C,FCT
C
A=.5D0*(XU+XL)
B=XU-XL
C=.48014492824876812D0*B
Y=.50614268145188130D-1*(FCT(A+C)+FCT(A-C))
C=.39833323870681337D0*B
Y=Y+.11119051722668724D0*(FCT(A+C)+FCT(A-C))
C=.26276620495816449D0*B
Y=Y+.15685332293894364D0*(FCT(A+C)+FCT(A-C))
C=.9171732124782490D-1*B
Y=B*(Y+.18134189168918099D0*(FCT(A+C)+FCT(A-C)))
RETURN
END