1
* $Id: ffcxs4.f,v 1.3 1995/10/17 06:55:09 gj Exp $
3
c Revision 1.3 1995/10/17 06:55:09 gj
4
c Fixed ieps error in ffdcrr (ffcxs4.f), added real case in ffcrr, debugging
5
c info in ffxd0, and warned against remaining errors for del2=0 in ffrot4
8
c Revision 1.2 1995/10/06 09:17:22 gj
9
c Found stupid typo in ffxc0p which caused the result to be off by pi^2/3 in
10
c some equal-mass cases. Added checks to ffcxs4.f ffcrr.f.
13
subroutine ffcxs4(cs3,ipi12,w,y,z,dwy,dwz,dyz,d2yww,d2yzz,
14
+ xpi,piDpj,ii,ns,isoort,ier)
15
***#[*comment:***********************************************************
17
* Calculate the 8 Spence functions = 4 R's = 2 dR's *
21
***#]*comment:***********************************************************
27
integer ipi12(4),ii,ns,isoort(4),ier
28
DOUBLE COMPLEX cs3(40)
29
DOUBLE PRECISION w(4),y(4),z(4),dwy(2,2),dwz(2,2),dyz(2,2),
30
+ d2yww,d2yzz,xpi(ns),piDpj(ns,ns),x00(3)
34
integer iepz(2),iepw(2)
37
* DOUBLE PRECISION absc
42
* absc(c) = abs(DBLE(c)) + abs(DIMAG(c))
45
if ( ltest .and. ns .ne. 6 )
46
+ print *,'ffcxs4: error: only for ns=6, not ',ns
47
if ( isoort(2) .eq. 0 ) then
52
if ( isoort(4) .eq. 0 ) then
57
if ( isoort(2) .ne. 0 ) then
58
if ( z(2) .gt. z(1) .eqv. xpi(ii+3) .gt. 0 ) then
66
print *,'ffcxs4: error: untested algorithm'
67
if ( piDpj(ii,ii+3) .gt. 0 ) then
73
if ( isoort(4) .ne. 0 ) then
74
if ( w(2) .gt. w(1) .eqv. xpi(5) .gt. 0 ) then
82
print *,'ffcxs4: error: untested algorithm'
83
if ( piDpj(2,5) .gt. 0 ) then
91
if ( isoort(4) .eq. 0 ) then
92
if (lwrite) print *,'ffcxs4: to ffcxr(zm)'
93
call ffcxr(cs3(1),ipi12(1),y(2),y(4),z(1),z(3),dyz(2,1),
94
+ ld2yzz,d2yzz,z(2),z(4),.FALSE.,x00,iepz(1),ier)
96
if (lwrite) print *,'ffcxs4: to ffdcxr(zm,wp)'
97
if ( .not. ( dwz(2,1).eq.0 .and. iepz(1).eq.iepw(2) ) )
98
+ call ffdcxr(cs3( 1),ipi12(1),y(2),y(4),z(1),z(3),
99
+ z(2),z(4),d2yzz,w(2),w(4),w(1),w(3),d2yww,
100
+ dyz(2,1),dwy(2,2),dwz(2,1),iepz(1),iepw(2),ier)
104
if ( isoort(2) .eq. 0 ) then
105
if (lwrite) print *,'ffcxs4: to ffcxr(wm)'
106
call ffcxr(cs3(1),ipi12(1),y(2),y(4),w(1),w(3),-dwy(1,2),
107
+ ld2yww,d2yww,w(2),w(4),.FALSE.,x00,iepw(1),ier)
109
if (lwrite) print *,'ffcxs4: to ffdcxr(zp,wm)'
110
if ( .not. ( dwz(1,2).eq.0 .and. iepz(2).eq.iepw(1) ) )
111
+ call ffdcxr(cs3(21),ipi12(3),y(2),y(4),z(2),z(4),
112
+ z(1),z(3),d2yzz,w(1),w(3),w(2),w(4),d2yww,
113
+ dyz(2,2),dwy(1,2),dwz(1,2),iepz(2),iepw(1),ier)
119
subroutine ffcs4(cs3,ipi12,cw,cy,cz,cdwy,cdwz,cdyz,cd2yww,cd2yzz
120
+ ,cpi,cpiDpj,cp2p,cetami,ii,ns,isoort,ier)
121
***#[*comment:***********************************************************
123
* Calculate the 8 Spence functions = 4 R's = 2 dR's *
127
***#]*comment:***********************************************************
133
integer ipi12(4),ii,ns,isoort(4),ier
134
DOUBLE COMPLEX cs3(40)
135
DOUBLE COMPLEX cw(4),cy(4),cz(4),cdwy(2,2),cdwz(2,2),cdyz(2,2)
136
DOUBLE COMPLEX cd2yww,cd2yzz,cpi(ns),cp2p,cpiDpj(ns,ns),
141
logical ld2yzz,ld2yww
142
integer i,j,ip,iepz(2),iepw(2),nz(4),nw(4),ntot,i2pi
143
DOUBLE COMPLEX c,cc,clogy,c2y1,cdyw(2,2)
144
DOUBLE COMPLEX zfflo1,zfflog
145
DOUBLE PRECISION absc
153
absc(c) = abs(DBLE(c)) + abs(DIMAG(c))
157
if ( ns .ne. 6 ) then
158
print *,'ffcs4: error: only for ns=6, not ',ns
162
if ( ipi12(i).ne.0 ) then
163
print *,'ffcs4: error: ipi12(',i,') non-zero! ',
169
if ( isoort(2) .eq. 0 ) then
174
if ( isoort(4) .eq. 0 ) then
179
call ffieps(iepz,cz,cpi(ip),cpiDpj(ip,ii),isoort)
180
call ffieps(iepw,cw,cp2p,cpiDpj(ip,ii),isoort(3))
181
if ( isoort(4) .eq. 0 ) then
182
print *,'ffcs4: error: case not implemented'
187
if ( isoort(4) .eq. 0 ) then
188
call ffcrr(cs3(1),ipi12(1),cy(2),cy(4),cz(1),cz(3),cdyz(2,1)
189
+ ,ld2yzz,cd2yzz,cz(2),cz(4),isoort(4),iepz(1),ier)
191
if (lwrite) print *,'ffcs4: to ffdcrr(zm,wp)'
192
if ( .not. ( cdwz(2,1).eq.0 .and. iepz(1).eq.iepw(2) ) )
193
+ call ffdcrr(cs3( 1),ipi12(1),cy(2),cy(4),cz(1),cz(3),cz(2),
194
+ cz(4),cd2yzz,cw(2),cw(4),cw(1),cw(3),cd2yww,cdyz(2,1),
195
+ cdwy(2,2),cdwz(2,1),isoort(4),iepz(1),iepw(2),ier)
197
if ( isoort(2) .eq. 0 ) then
198
call ffcrr(cs3(1),ipi12(1),cy(2),cy(4),cw(1),cw(3),-cdwy(1,2
199
+ ),ld2yww,cd2yww,cw(2),cw(4),isoort(2),iepw(1),ier)
201
if (lwrite) print *,'ffcs4: to ffdcrr(zp,wm)'
202
if ( .not. ( cdwz(1,2).eq.0 .and. iepz(2).eq.iepw(1) ) )
203
+ call ffdcrr(cs3(21),ipi12(3),cy(2),cy(4),cz(2),cz(4),cz(1),
204
+ cz(3),cd2yzz,cw(1),cw(3),cw(2),cw(4),cd2yww,cdyz(2,2),
205
+ cdwy(1,2),cdwz(1,2),iepz(2),isoort(2),iepw(1),ier)
209
if ( DIMAG(cpi(ip)) .eq. 0 ) then
210
call ffgeta(nz,cz,cdyz,cd2yzz,
211
+ cpi(ip),cpiDpj(ii,ip),iepz,isoort,ier)
214
cdyw(i,j) = cdwy(j,i)
217
call ffgeta(nw,cw,cdyw,cd2yww,
218
+ cp2p,cpiDpj(ii,ip),iepw,isoort(3),ier)
220
print *,'ffcs4: error: not ready for complex D0 yet'
222
ntot = nz(1)+nz(2)+nz(3)+nz(4)-nw(1)-nw(2)-nw(3)-nw(4)
223
if ( ntot .ne. 0 ) then
225
if ( 1/absc(cy(2)) .lt. xloss ) then
226
clogy = zfflo1(1/cy(2),ier)
229
if ( DBLE(c) .gt. -abs(DIMAG(c)) ) then
230
clogy = zfflog(c,0,c0,ier)
232
* take out the factor 2*pi^2
234
if ( absc(cc) .lt. xloss ) then
235
c2y1 = -cd2yzz - cz(1) + cz(4)
236
if ( absc(c2y1) .lt. xloss*max(absc(cz(1)),
237
+ absc(cz(4))) ) then
238
c2y1 = -cd2yzz - cz(2) + cz(3)
239
if ( lwarn .and. absc(c2y1) .lt. xloss*max(
240
+ absc(cz(2)),absc(cz(3))) ) then
241
call ffwarn(134,ier,absc(c2y1),
247
print *,'-c2y1/cy(2) = ',-c2y1/cy(2)
249
clogy = zfflo1(-c2y1/cy(2),ier)
251
clogy = zfflog(-c,0,c0,ier)
253
if ( DIMAG(c) .lt. 0 ) then
255
elseif ( DIMAG(c) .gt. 0 ) then
261
ipi12(2) = ipi12(2) - ntot*24*i2pi
264
if ( cs3(40) .ne. 0 ) print *,'ffcs4: error: cs3(40) != 0'
265
cs3(40) = ntot*c2ipi*clogy
271
print *,'total:',ntot*c2ipi*clogy
272
if ( i2pi .ne. 0 ) print *,' +',-ntot*24*i2pi*pi12
273
print *,' =',ntot,' *( ',c2ipi*clogy,' + ',24*i2pi*pi12,
280
subroutine ffdcxr(cs3,ipi12,y,y1,z,z1,zp,zp1,d2yzz,
281
+ w,w1,wp,wp1,d2yww,dyz,dwy,dwz,iepsz,iepsw,ier)
282
***#[*comment:***********************************************************
286
* R(y,z,iepsz) - R(y,w,iepsw) *
289
* a = [yzw] (real) see definition *
290
* a1 = 1 - a (real) *
291
* dab = a - b (real) *
292
* ieps[zw] (integer) sign of imaginary part *
293
* of argument logarithm *
294
* cs3(20) (complex) assumed zero *
297
* cs3(20) (complex) the results, not added *
298
* ipi12(2) (integer) factors pi^2/12 *
302
***#]*comment:***********************************************************
308
integer ipi12(2),iepsz,iepsw,ier
309
DOUBLE COMPLEX cs3(20)
310
DOUBLE PRECISION y,z,w,y1,z1,w1,dyz,dwy,dwz,zp,zp1,d2yzz,wp,wp1,
315
integer i,ieps,ipi12p(2),ier1,ier2,isign,inorm
317
DOUBLE PRECISION yy,yy1,zz,zz1,dyyzz,xx1,xx1n,term,tot,d2,d3,
318
+ d21,d31,d2n,d3n,d21n1,d31n1,dw,xlogy,x00(3)
319
DOUBLE COMPLEX csum,csum1,csum2,cs3p(20),chulp
320
DOUBLE PRECISION dfflo1
328
* absc(c) = abs(DBLE(c)) + abs(DIMAG(c))
332
if ( dwz .eq. 0 .and. iepsz .eq. iepsw ) return
333
if ( dyz .eq. 0 ) then
339
if ( xx1 .le. x05 .or. xx1 .gt. 2 ) then
349
if ( dw .eq. 0 ) then
350
if ( lwrite ) print *,' Trivial case'
353
elseif ( abs(dw) .gt. xloss .or. again ) then
354
* nothing's the matter
355
if ( lwrite ) print *,' Normal case'
357
call ffcxr(cs3( 1),ipi12(1),y,y1,z,z1,dyz,
358
+ .TRUE.,d2yzz,zp,zp1,.FALSE.,x00,iepsz,ier)
359
call ffcxr(cs3(11),ipi12(2),y,y1,w,w1,-dwy,
360
+ .TRUE.,d2yww,wp,wp1,.FALSE.,x00,iepsw,ier)
365
* #[ only cancellations in w, not in y:
366
elseif ( abs(d2) .gt. xloss ) then
367
* there are no cancellations the other way:
368
if ( lwrite ) print *,' Cancellations one way, turned Rs'
369
if ( iepsz .ne. iepsw .and. ( y/dyz .gt. 1 .or.-y/dwy .gt.
373
print *,'ffdcxr: problems with ieps, solvable,'
374
print *,' but for the moment just call the ',
391
call ffcxr(cs3( 1),ipi12(1),yy,yy1,zz,zz1,dyyzz,.FALSE.,x0,
392
+ x0,x0,.FALSE.,x00,2*ieps,ier)
396
if ( y1 .gt. 0 ) then
401
call ffcxr(cs3(11),ipi12(2),yy,yy1,zz,zz1,dyyzz,.FALSE.,x0,
402
+ x0,x0,.FALSE.,x00,2*ieps,ier)
407
* #] only cancellations in w, not in y:
409
elseif ( ( 1 .gt. xloss*abs(y) .or. abs(xx1) .gt. xloss )
410
+ .and. ( 1 .gt. xloss*abs(z) .or. abs(z/dyz) .gt. xloss )
411
+ .and. ( 1 .gt. xloss*abs(y) .or. abs(dyz/y) .gt. xloss )
413
* do a Hill identity on the y,y-1 direction
414
if ( lwrite ) print *,' Hill identity to split z,w'
419
dyyzz = -w*w1*(dyz/(dwy*dwz))
420
if ( y*dwz .gt. 0 .eqv. (y+dwz) .gt. 0 ) then
425
call ffcxr(cs3( 1),ipi12(1),yy,yy1,zz,zz1,dyyzz,.FALSE.,x0,
426
+ x0,x0,.FALSE.,x00,ieps,ier)
432
call ffcxr(cs3( 9),ipi12(2),yy,yy1,zz,zz1,dyyzz,.FALSE.,x0,
433
+ x0,x0,.FALSE.,x00,ieps,ier)
437
* the extra logarithms ...
438
if ( 1 .lt. xloss*abs(w) ) then
439
chulp = dfflo1(1/w,ier)
440
elseif ( w1 .lt. 0 .or. w .lt. 0 ) then
443
chulp = DCMPLX(DBLE(log(w1/w)),DBLE(-iepsw*pi))
445
cs3(20) = -DBLE(dfflo1(dwz/dwy,ier))*chulp
447
* #[ Taylor expansion:
448
elseif ( (w.lt.0..or.w1.lt.0) .and. (z.lt.0..or.z1.lt.0) ) then
449
* do a Taylor expansion
450
if ( abs(xx1) .lt. xloss ) then
451
if ( lwrite ) print *,'ffdcxr: Taylor expansion, normal'
468
term = xx1n*d2n*d3n*xn2inv(i)
470
if ( abs(term) .le. precx*abs(tot) ) goto 51
472
if ( lwarn ) call ffwarn(46,ier,tot,term)
474
* if ( isign .eq. 1 ) then
479
elseif ( abs(z/dyz) .lt. xloss ) then
480
if ( lwrite ) print *,' Normal case'
482
call ffcxr(cs3( 1),ipi12(1),y,y1,z,z1,dyz,
483
+ .TRUE.,d2yzz,zp,zp1,.FALSE.,x00,iepsz,ier)
484
call ffcxr(cs3(11),ipi12(2),y,y1,w,w1,-dwy,
485
+ .TRUE.,d2yww,wp,wp1,.FALSE.,x00,iepsw,ier)
488
* if ( lwrite ) print *,'ffdcxr: Taylor expansion, 1-x'
489
* print *,'NOT YET READY !!!'
491
* yy = y1*dwz/(z1*dwy)
492
* if ( abs(yy) .lt. xloss ) then
493
* cs3(10) = -dfflo1(1/y,ier)*dfflo1(yy,ier)
495
* yy1 = -w1*dyz/(z1*dwy)
496
* if ( yy1 .gt. xalogm ) then
497
* cs3(10) = -dfflo1(1/y,ier)*log(yy1)
498
* elseif ( yy1 .gt. -xalogm ) then
499
* if ( lwarn ) call ffwarn(80,ier,yy1,xalogm)
502
* if ( lwarn .and. iepsz.ne.iepsw )
503
* + call ffwarn(81,ier,x1,x1)
504
* if ( (w1+dyz)*dwz*y1*iepsz .lt. 0 ) then
505
* cs3(10) = -dfflo1(1/y,ier)*DCMPLX(DBLE(xlogy),DBLE(pi))
507
* cs3(10) = -dfflo1(1/y,ier)*DCMPLX(DBLE(xlogy),DBLE(-pi))
511
* cs3(11) = -dfflo1(1/z,ier)*dfflo1(dwz/dwy,ier)
513
* if ( abs(yy) .lt. xloss ) then
514
* cs3(12) = -dfflo1(w/dwy,ier)*dfflo1(yy,ier)
517
* if ( yy1 .gt. xalogm ) then
518
* cs3(12) = -dfflo1(w/dwy,ier)*log(yy1)
519
* elseif ( yy .gt. -xalogm ) then
520
* if ( lwarn ) call ffwarn(80,ier,yy,xalogm)
523
* if ( lwarn .and. iepsz.ne.iepsw )
524
* + call ffwarn(81,ier,x1,x1)
525
* if ( dwz*(dwz+1)*ieps .gt. 0 ) then
526
* cs3(12) = -dfflo1(w/dwy,ier)*DCMPLX(DBLE(xlogy),DBLE(pi))
528
* cs3(12) =-dfflo1(w/dwy,ier)*DCMPLX(DBLE(xlogy),DBLE(-pi))
537
if ( lwrite ) print *,'ffdcxr: Taylor expansion, 1/x'
542
if ( lwrite ) print *,'Not clear, take normal route'
544
call ffcxr(cs3( 1),ipi12(1),y,y1,z,z1,dyz,.FALSE.,x0,x0,x0,
545
+ .FALSE.,x00,iepsz,ier)
546
call ffcxr(cs3(11),ipi12(2),y,y1,w,w1,-dwy,.FALSE.,x0,x0,x0,
547
+ .FALSE.,x00,iepsw,ier)
552
* #] Taylor expansion:
558
print '(i2,2g16.8)',i,cs3(i)
560
print '(a)','---------------------------------'
561
print '(2x,2g16.8,2i3)',csum,ipi12
562
print '(a,i3)','ier = ',ier
563
if ( inorm .eq. 0 ) then
571
call ffcxr(cs3p( 1),ipi12p(1),y,y1,z,z1,dyz,.FALSE.,x0,x0,
572
+ x0,.FALSE.,x00,iepsz,ier1)
573
call ffcxr(cs3p(11),ipi12p(2),y,y1,w,w1,-dwy,.FALSE.,x0,x0,
574
+ x0,.FALSE.,x00,iepsw,ier2)
577
910 csum1 = csum1 + cs3p(i)
580
920 csum2 = csum2 - cs3p(i)
581
csum = csum1 + csum2 + (ipi12p(1)-ipi12p(2))*DBLE(pi12)
583
print '(i2,2g16.8,i3)',1,csum1,ier1
584
print '(i2,2g16.8,i3)',2,csum2,ier2
585
print *,'------------------+'
586
print '(2x,2g16.8,3i3)',csum1+csum2,ipi12p,max(ier1,ier2)
587
print '(2x,2g16.8,3i3)',csum
595
subroutine ffdcrr(cs3,ipi12,cy,cy1,cz,cz1,czp,czp1,cd2yzz,cw,cw1
596
+ ,cwp,cwp1,cd2yww,cdyz,cdwy,cdwz,isoort,iepsz,iepsw,ier)
597
***#[*comment:***********************************************************
601
* R(cy,cz,iepsz) - R(cy,cw,iepsw) *
604
* a = [yzw] (real) see definition *
605
* a1 = 1 - a (real) *
606
* dab = a - b (real) *
607
* ieps[zw] (integer) sign of imaginary part *
608
* of argument logarithm *
609
* cs3(20) (complex) assumed zero *
612
* cs3(20) (complex) the results, not added *
613
* ipi12(2) (integer) factors pi^2/12 *
617
***#]*comment:***********************************************************
623
integer ipi12(2),isoort,iepsz,iepsw,ier
624
DOUBLE COMPLEX cs3(20)
625
DOUBLE COMPLEX cy,cz,czp,cw,cwp,cy1,cz1,czp1,cw1,cwp1,
626
+ cdyz,cdwy,cdwz,cd2yzz,cd2yww
630
integer i,ieps,ieps1,ieps2,ipi12p(2),ier1,ier2,isign,inorm,i2pi,
631
+ nffeta,nffet1,n1,n2,n3,n4,n5,n6
633
DOUBLE COMPLEX cyy,cyy1,czz,czz1,cdyyzz,chulp,zfflo1,zfflog,
634
+ cc1,cdw,cc1n,cterm,ctot,cd2,cd3,
635
+ cd21,cd31,cd2n,cd3n,cd21n1,cd31n1,
636
+ cc2,cfactz,cfactw,czzp,czzp1,cd2yyz
637
DOUBLE COMPLEX csum,csum1,csum2,cs3p(20),c,check
638
DOUBLE PRECISION absc,xlosn
646
absc(c) = abs(DBLE(c)) + abs(DIMAG(c))
651
xlosn = xloss*DBLE(10)**(-1-mod(ier,50))
652
check = cd2yzz - 2*cy + cz + czp
653
if ( xlosn*absc(check) .gt. precc*max(2*absc(cy),absc(cz),
655
print *,'ffdcrr: error: cd2yzz != 2*cy - cz - czp:',
656
+ cd2yzz,cy,cz,czp,check
658
check = cd2yww - 2*cy + cw + cwp
659
if ( xlosn*absc(check) .gt. precc*max(2*absc(cy),absc(cw),
661
print *,'ffdcrr: error: cd2yww != 2*cy - cw - cwp:',
662
+ cd2yww,cy,cw,cwp,check
667
if ( cdwz .eq. 0 ) then
668
if ( abs(DIMAG(cz)) .gt. precc*abs(DBLE(cz)) .or.
669
+ iepsz .eq. iepsw ) return
670
if ( DBLE(cz) .ge. 0 .and. DBLE(cz1) .ge. 0 ) return
674
if ( cdyz .eq. 0 ) then
680
if ( DBLE(cc1) .le. x05 .or. abs(cc1-1) .gt. 1 ) then
688
if ( absc(cdw) .eq. 0 ) then
689
if ( lwrite ) print *,' Trivial case'
693
* if no cancellations are expected OR the imaginary signs differ
694
* and are significant
696
elseif ( absc(cdw) .gt. xloss .or. (iepsz.ne.iepsw .and.
697
+ (DBLE(cy/cdyz).gt.1 .or. DBLE(-cy1/cdyz).gt.1) ) ) then
698
* nothing's the matter
699
if ( lwrite ) print *,'ffdcrr: Normal case'
701
* special case to avoid bug found 15-oct=1995
702
if ( iepsz.eq.iepsw ) then
703
if ( DIMAG(cz).eq.0 .and. DIMAG(cz1).eq.0 ) then
704
print *,'ffdcrr: flipping sign iepsz'
706
elseif ( DIMAG(cw).eq.0 .and. DIMAG(cw1).eq.0 ) then
707
print *,'ffdcrr: flipping sign iepsw'
710
print *,'ffdcrr: error: missing eta terms!'
714
call ffcrr(cs3(1),ipi12(1),cy,cy1,cz,cz1,cdyz,.TRUE.,
715
+ cd2yzz,czp,czp1,isoort,iepsz,ier)
716
call ffcrr(cs3(8),ipi12(2),cy,cy1,cw,cw1,-cdwy,.TRUE.,
717
+ cd2yww,cwp,cwp1,isoort,iepsw,ier)
723
* #[ only cancellations in cw, not in cy:
724
elseif ( absc(cd2) .gt. xloss ) then
725
* there are no cancellations the other way:
726
if ( lwrite ) print *,'ffdcrr: Cancellations one way, ',
733
if ( DBLE(cy) .gt. 0 ) then
738
* Often 2y-z-z is relevant, but 2*yy-zz-zz is not, solve by
741
cd2yyz = cd2yzz*cyy/cy
743
if ( absc(czzp1) .lt. xloss ) then
744
* later try more possibilities
749
call ffcrr(cs3(1),ipi12(1),cyy,cyy1,czz,czz1,cdyyzz,
750
+ ld2yyz,cd2yyz,czzp,czzp1,isoort,ieps1,ier)
753
if ( DBLE(-cy1) .gt. 0 ) then
758
cdyyzz = -cyy*cdyz/cy1
760
cd2yyz = -cd2yzz*cyy/cy1
762
if ( absc(czzp1) .lt. xloss ) then
763
* later try more possibilities
768
call ffcrr(cs3(8),ipi12(2),cyy,cyy1,czz,czz1,cdyyzz,
769
+ .TRUE.,cd2yyz,czzp,czzp1,isoort,ieps2,ier)
774
* eta terms (are not calculated in ffcrr as ieps = 3)
776
if ( DIMAG(cz) .eq. 0 ) then
777
if ( DIMAG(cy) .eq. 0 ) then
781
n1 = nffet1(DCMPLX(DBLE(0),DBLE(iepsz)),cfactz,
783
n2 = nffet1(DCMPLX(DBLE(0),DBLE(iepsz)),cfactz,
787
n1 = nffeta(-cz,cfactz,ier)
788
n2 = nffeta(cz1,cfactz,ier)
791
if ( DIMAG(cw) .eq. 0 ) then
792
if ( DIMAG(cy) .eq. 0 ) then
796
n4 = nffet1(DCMPLX(DBLE(0),DBLE(iepsw)),cfactw,
798
n5 = nffet1(DCMPLX(DBLE(0),DBLE(iepsw)),cfactw,
802
n4 = nffeta(-cw,cfactw,ier)
803
n5 = nffeta(cw1,cfactw,ier)
806
* we assume that cs3(15-17) are not used, this is always true
815
if ( absc(cc1) .lt. xloss ) then
816
cs3(15) = n1*c2ipi*zfflo1(cc1,ier)
819
cs3(15) = n1*c2ipi*zfflog(cc1,0,c0,ier)
823
if ( DIMAG(cc1).eq.0 .or. DIMAG(cc2).eq.0 ) then
826
n3 = nffeta(cc1,1/cc2,ier)
829
print *,'ffdcrr: error: untested algorithm'
831
ipi12(1) = ipi12(1) + 4*12*n1*n3
837
cs3(15) = (n1*zfflog(cc1,ieps1,c0,ier) +
838
+ n4*zfflog(cc2,ieps1,c0,ier))*c2ipi
845
if ( absc(cc1) .lt. xloss ) then
846
cs3(16) = n2*c2ipi*zfflo1(cc1,ier)
849
cs3(16) = n2*c2ipi*zfflog(cc1,0,c0,ier)
853
if ( DIMAG(cc1).eq.0 .or. DIMAG(cc2).eq.0 ) then
856
n6 = nffeta(cc1,1/cc2,ier)
859
print *,'ffdcrr: error: untested algorithm'
861
ipi12(2) = ipi12(2) + 4*12*n2*n6
867
cs3(15) = (n2*zfflog(cc1,ieps2,c0,ier) +
868
+ n5*zfflog(cc2,ieps2,c0,ier))*c2ipi
871
print *,' eta''s z are :',n1,n2,n3
872
print *,' eta''s w are :',n4,n5,n6
874
* #] only cancellations in cw, not in cy:
876
elseif ( ( 1.gt.xloss*absc(cy) .or. absc(cc1).gt.xloss )
877
+ .and. ( 1.gt.xloss*absc(cz) .or. absc(cz/cdyz).gt.xloss )
878
+ .and. ( 1.gt.xloss*absc(cy) .or. absc(cdyz/cy).gt.xloss )
880
* do a Hill identity on the cy,cy-1 direction
881
if ( lwrite ) print *,'ffdcrr: Hill identity to split cz,cw'
886
cdyyzz = -cw*cw1*(cdyz/(cdwy*cdwz))
888
call ffcrr(cs3(1),ipi12(1),cyy,cyy1,czz,czz1,cdyyzz,
889
+ .FALSE.,c0,c0,c0,isoort,ieps,ier)
895
call ffcrr(cs3(8),ipi12(2),cyy,cyy1,czz,czz1,cdyyzz,
896
+ .FALSE.,c0,c0,c0,isoort,0,ier)
900
* the extra logarithms ...
901
if ( 1 .lt. xloss*absc(cw) ) then
902
chulp = zfflo1(1/cw,ier)
904
chulp = zfflog(-cw1/cw,0,c0,ier)
906
cs3(15) = -zfflo1(cdwz/cdwy,ier)*chulp
908
* #[ Taylor expansion:
910
* Do a Taylor expansion
911
if ( absc(cc1) .lt. xloss ) then
912
if ( lwrite ) print *,'ffdcrr: Taylor expansion, normal'
927
cd2n = cd2n + cd2*cd21n1
928
cd3n = cd3n + cd3*cd31n1
929
cterm = cc1n*cd2n*cd3n*DBLE(xn2inv(i))
931
if ( absc(cterm) .lt. precc*absc(ctot) ) goto 51
933
if ( lwarn ) call ffwarn(45,ier,absc(ctot),absc(cterm))
935
* if ( isign .eq. 1 ) then
940
elseif ( absc(cz/cdyz) .lt. xloss ) then
941
if ( lwrite ) print *,'ffdcrr: Normal case'
943
call ffcrr(cs3(1),ipi12(1),cy,cy1,cz,cz1,cdyz,.TRUE.,
944
+ cd2yzz,czp,czp1,isoort,iepsz,ier)
945
call ffcrr(cs3(8),ipi12(2),cy,cy1,cw,cw1,-cdwy,.TRUE.,
946
+ cd2yww,cwp,cwp1,isoort,iepsw,ier)
950
* if ( lwrite ) print *,'ffdcrr: Taylor expansion, 1-x'
951
* print *,'NOT YET READY !!'
953
* cyy = cy1*cdwz/(cz1*cdwy)
954
* if ( absc(cyy) .lt. xloss ) then
955
* cs3(10) = -zfflo1(1/cy,ier)*zfflo1(cyy,ier)
957
* cyy1 = -cw1*cdyz/(cz1*cdwy)
958
* cs3(10) = -zfflo1(1/cy,ier)*zfflog(cyy1,0,cy,ier)
960
* cs3(11) = -zfflo1(1/cz,ier)*zfflo1(cdwz/cdwy,ier)
961
* cyy = cdwz/(cw*cz1)
962
* if ( absc(cyy) .lt. xloss ) then
963
* cs3(12) = -zfflo1(cw/cdwy,ier)*zfflo1(cyy,ier)
965
* cyy1 = cz*cw1/(cw*cz1)
966
* cs3(12) = -zfflo1(cw/cdwy,ier)*zfflog(cyy1,0,c0,ier)
973
if ( lwrite ) print *,'ffdcrr: Taylor expansion, 1/x'
978
* #] Taylor expansion:
984
print '(i2,2g16.8)',i,cs3(i)
986
print '(a)','---------------------------------'
987
print '(2x,2g16.8,2i3)',csum,ipi12
988
print '(a,2g16.8)','= ',csum+(ipi12(1)+ipi12(2))*DBLE(pi12)
989
print '(a,i3)','ier = ',ier
990
if ( inorm .eq. 0 ) then
998
call ffcrr(cs3p(1),ipi12p(1),cy,cy1,cz,cz1,cdyz,
999
+ .TRUE.,cd2yzz,czp,czp1,isoort,iepsz,ier1)
1000
call ffcrr(cs3p(8),ipi12p(2),cy,cy1,cw,cw1,-cdwy,
1001
+ .TRUE.,cd2yww,cwp,cwp1,isoort,iepsw,ier2)
1004
910 csum1 = csum1 + cs3p(i)
1007
920 csum2 = csum2 - cs3p(i)
1009
print '(i2,2g16.8,i2)',1,csum1,ier1
1010
print '(i2,2g16.8,i2)',2,csum2,ier2
1011
print *,'------------------+'
1012
print '(2x,2g16.8,3i3)',csum1+csum2,ipi12p,
1014
print '(a,2g16.8,3i3)','= ',csum1+csum2+
1015
+ (ipi12p(1)-ipi12p(2))*DBLE(pi12)