11 IMPLICIT DOUBLE PRECISION(a-
h, o-
z)
15 dimension pju(3,5),vju(5),psum(5),a(3,3),penew(3),pcm(5,5)
16 DATA twopi/6.283186d0/
20 psum(
j)=pju(1,
j)+pju(2,
j)+pju(3,
j)
22 psum2=psum(4)**2-psum(1)**2-psum(2)**2-psum(3)**2
26 a(
i,
j)=pju(
i,4)*pju(
j,4)-pju(
i,1)*pju(
j,1)-
27 & pju(
i,2)*pju(
j,2)-pju(
i,3)*pju(
j,3)
34 IF(a(2,2).GT.a(1,1))
i=2
35 IF(a(3,3).GT.
max(a(1,1),a(2,2)))
i=3
39 IF(a(
i,
k)**2*a(
j,
j).LT.a(
i,
j)**2*a(
k,
k))
THEN
52 pei=sqrt(2d0*aik*aij/(3d0*ajk))
53 pej=sqrt(2d0*ajk*aij/(3d0*aik))
54 pek=sqrt(2d0*aik*ajk/(3d0*aij))
62 pajmin=sqrt(
max(0d0,pejmin**2-pmj2))
63 pakmin=sqrt(
max(0d0,pekmin**2-pmk2))
64 fmin=pejmin*pekmin+0.5d0*pajmin*pakmin-ajk
65 peimax=(aij+aik)/sqrt(pmj2+pmk2+2d0*ajk)
66 IF(pmj2.GT.1d-4) peimax=aij/sqrt(pmj2)
67 paimax=sqrt(
max(0d0,peimax**2-pmi2))
68 hi=peimax**2-0.25d0*paimax**2
69 pajmax=(peimax*sqrt(
max(0d0,aij**2-pmj2*hi))-
70 & 0.5d0*paimax*aij)/hi
71 pakmax=(peimax*sqrt(
max(0d0,aik**2-pmk2*hi))-
72 & 0.5d0*paimax*aik)/hi
73 pejmax=sqrt(pajmax**2+pmj2)
74 pekmax=sqrt(pakmax**2+pmk2)
75 fmax=pejmax*pekmax+0.5d0*pajmax*pakmax-ajk
78 IF(fmax.GT.0d0.AND.itry.LE.2)
THEN
80 IF(a(
i1,
i1).GE.1d-4)
THEN
86 IF(itry.LE.2.AND.a(
i1,
i1).GE.1d-4)
THEN
96 pai=0.5d0*(paimin+paimax)
100 pei=sqrt(pai**2+pmi2)
101 hi=pei**2-0.25d0*pai**2
102 paj=(pei*sqrt(
max(0d0,aij**2-pmj2*hi))-0.5d0*pai*aij)/hi
103 pej=sqrt(paj**2+pmj2)
104 pak=(pei*sqrt(
max(0d0,aik**2-pmk2*hi))-0.5d0*pai*aik)/hi
105 pek=sqrt(pak**2+pmk2)
106 fnow=pej*pek+0.5d0*paj*pak-ajk
118 IF((
iter.LT.10.OR.itmin.LE.1.OR.itmax.LE.1).AND.
iter.LT.20)
120 pai=0.5d0*(paimin+paimax)
122 ELSEIF(
iter.LT.40.AND.fmin.GT.0d0.AND.fmax.LT.0d0.AND.
123 & abs(fnow).GT.1d-12*psum2)
THEN
124 pai=paimin+(paimax-paimin)*fmin/(fmin-fmax)
135 vxcm=-psum(1)/psum(5)
136 vycm=-psum(2)/psum(5)
137 vzcm=-psum(3)/psum(5)
138 gamcm=sqrt(1d0+vxcm**2+vycm**2+vzcm**2)
140 fac1=pju(
i,1)*vxcm+pju(
i,2)*vycm+pju(
i,3)*vzcm
141 fac2=fac1/(1d0+gamcm)+pju(
i,4)
142 pcm(
i,1)=pju(
i,1)+fac2*vxcm
143 pcm(
i,2)=pju(
i,2)+fac2*vycm
144 pcm(
i,3)=pju(
i,3)+fac2*vzcm
145 pcm(
i,4)=pju(
i,4)*gamcm+fac1
146 pcm(
i,5)=sqrt(pcm(
i,1)**2+pcm(
i,2)**2+pcm(
i,3)**2)
151 pcm(4,
j)=pcm(1,
j)/pcm(1,4)-pcm(2,
j)/pcm(2,4)
152 pcm(5,
j)=pcm(1,
j)/pcm(1,4)-pcm(3,
j)/pcm(3,4)
154 pcm(4,4)=penew(1)/pcm(1,4)-penew(2)/pcm(2,4)
155 pcm(5,4)=penew(1)/pcm(1,4)-penew(3)/pcm(3,4)
156 pcm4s=pcm(4,1)**2+pcm(4,2)**2+pcm(4,3)**2
157 pcm5s=pcm(5,1)**2+pcm(5,2)**2+pcm(5,3)**2
158 pcm45=pcm(4,1)*pcm(5,1)+pcm(4,2)*pcm(5,2)+pcm(4,3)*pcm(5,3)
159 c4=(pcm5s*pcm(4,4)-pcm45*pcm(5,4))/(pcm4s*pcm5s-pcm45**2)
160 c5=(pcm4s*pcm(5,4)-pcm45*pcm(4,4))/(pcm4s*pcm5s-pcm45**2)
161 vxju=c4*pcm(4,1)+c5*pcm(5,1)
162 vyju=c4*pcm(4,2)+c5*pcm(5,2)
163 vzju=c4*pcm(4,3)+c5*pcm(5,3)
164 gamju=sqrt(1d0+vxju**2+vyju**2+vzju**2)
167 fcm=(vxju*vxcm+vyju*vycm+vzju*vzcm)/(1+gamcm)+gamju
171 vju(4)=sqrt(1d0+vju(1)**2+vju(2)**2+vju(3)**2)
175 cth12=(pcm(1,1)*pcm(2,1)+pcm(1,2)*pcm(2,2)+pcm(1,3)*pcm(2,3))/
177 cth13=(pcm(1,1)*pcm(3,1)+pcm(1,2)*pcm(3,2)+pcm(1,3)*pcm(3,3))/
179 cth23=(pcm(2,1)*pcm(3,1)+pcm(2,2)*pcm(3,2)+pcm(2,3)*pcm(3,3))/
181 errccm=(cth12+0.5d0)**2+(cth13+0.5d0)**2+(cth23+0.5d0)**2
182 errtcm=
twopi-acos(cth12)-acos(cth13)-acos(cth23)
184 fac1=pju(
i,1)*vju(1)+pju(
i,2)*vju(2)+pju(
i,3)*vju(3)
185 fac2=fac1/(1d0+vju(4))+pju(
i,4)
186 pcm(
i,1)=pju(
i,1)+fac2*vju(1)
187 pcm(
i,2)=pju(
i,2)+fac2*vju(2)
188 pcm(
i,3)=pju(
i,3)+fac2*vju(3)
189 pcm(
i,4)=pju(
i,4)*vju(4)+fac1
190 pcm(
i,5)=sqrt(pcm(
i,1)**2+pcm(
i,2)**2+pcm(
i,3)**2)
192 cth12=(pcm(1,1)*pcm(2,1)+pcm(1,2)*pcm(2,2)+pcm(1,3)*pcm(2,3))/
194 cth13=(pcm(1,1)*pcm(3,1)+pcm(1,2)*pcm(3,2)+pcm(1,3)*pcm(3,3))/
196 cth23=(pcm(2,1)*pcm(3,1)+pcm(2,2)*pcm(3,2)+pcm(2,3)*pcm(3,3))/
198 errcju=(cth12+0.5d0)**2+(cth13+0.5d0)**2+(cth23+0.5d0)**2
199 errtju=
twopi-acos(cth12)-acos(cth13)-acos(cth23)
200 IF(errcju+errtju.GT.errccm+errtcm)
THEN