Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gauss1.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file gauss1.f
1 
2 C
3 C
4 C*********GAUSSIAN ONE-DIMENSIONAL INTEGRATION PROGRAM*************
5 C
6  FUNCTION gauss1(F,A,B,EPS)
7  EXTERNAL f
8  dimension w(12),x(12)
9  DATA const/1.0e-12/
10  DATA w/0.1012285,.2223810,.3137067,.3623838,.0271525,
11  & .0622535,0.0951585,.1246290,.1495960,.1691565,
12  & .1826034,.1894506/
13  DATA x/0.9602899,.7966665,.5255324,.1834346,.9894009,
14  & .9445750,0.8656312,.7554044,.6178762,.4580168,
15  & .2816036,.0950125/
16  delta=const*abs(a-b)
17  gauss1=0.0
18  aa=a
19 5 y=b-aa
20  IF(abs(y).LE.delta) RETURN
21 2 bb=aa+y
22  c1=0.5*(aa+bb)
23  c2=c1-aa
24  s8=0.0
25  s16=0.0
26  DO 1 i=1,4
27  u=x(i)*c2
28 1 s8=s8+w(i)*(f(c1+u)+f(c1-u))
29  DO 3 i=5,12
30  u=x(i)*c2
31 3 s16=s16+w(i)*(f(c1+u)+f(c1-u))
32  s8=s8*c2
33  s16=s16*c2
34  IF(abs(s16-s8).GT.eps*(1.+abs(s16))) goto 4
35  gauss1=gauss1+s16
36  aa=bb
37  goto 5
38 4 y=0.5*y
39  IF(abs(y).GT.delta) goto 2
40  WRITE(6,7)
41  gauss1=0.0
42  RETURN
43 7 FORMAT(1x,'GAUSS1....TOO HIGH ACURACY REQUIRED')
44  END