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