Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:21:18

0001  
0002 C*********************************************************************
0003  
0004 C...PYSIMP
0005 C...Simpson formula for an integral.
0006  
0007       FUNCTION PYSIMP(Y,X0,X1,N)
0008  
0009 C...Double precision and integer declarations.
0010       IMPLICIT DOUBLE PRECISION(A-H, O-Z)
0011       IMPLICIT INTEGER(I-N)
0012       INTEGER PYK,PYCHGE,PYCOMP
0013  
0014 C...Local variables.
0015       DOUBLE PRECISION Y,X0,X1,H,S
0016       DIMENSION Y(0:N)
0017  
0018       S=0D0
0019       H=(X1-X0)/N
0020       DO 100 I=0,N-2,2
0021         S=S+Y(I)+4D0*Y(I+1)+Y(I+2)
0022   100 CONTINUE
0023       PYSIMP=S*H/3D0
0024  
0025       RETURN
0026       END