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