5 * Revision 1.1.1.1 1996/04/01 15:01:57 mclareni
10 #if defined(CERNLIB_DOUBLE)
11 SUBROUTINE C309R7(A,B,IBEG,INUM,XX,EPS)
13 C*******************************************************************
15 C RCF converts polynomial A to the corresponding continued
16 C fraction, in 'normal' form with coefficients B
17 C by the 'P algorithm' of Patry & Gupta
19 C A(z) = A1/z + A2/z**3 + A3/z**5 + ... + An/z**(2n-1)
21 C B(z) = B1/z+ B2/z+ B3/z+ .../(z+ Bn/z)
24 C A vector A(k), k=1,INUM input
25 C B vector B(k), k=IBEG,INUM output
26 C IBEG order of first coef. calc. input
27 C INUM order of A, even or odd input
28 C XX auxiliary vector of length .ge. length of vector B
29 C caller provides space for A,B,XX
30 C Note that neither of the first two terms A(1) A(2) should be zero
31 C & the user can start the calculation with any value of
32 C IBEG provided the c.f. coefs have been already
33 C calculated up to INUM = IBEG-1
34 C & the method breaks down as soon as the absolute value
35 C of a c.f. coef. is less than EPS. At the time of the
36 C break up INUM has been replaced by minus times the number
37 C of this coefficient.
38 C algorithm: J. Patry & S. Gupta, EIR-Bericht 247, November 1973
39 C Eidg. Institut fur Reaktorforschung
40 C Wuerenlingen, Switzerland
41 C see also: Haenggi, Roesel & Trautmann,
42 C J. Comput. Phys., v. 137, (1980) 242-258
43 C note: restart procedure modified by I.J.Thompson
45 C*******************************************************************
47 IMPLICIT COMPLEX*16(A-H,O-Z)
48 DIMENSION A(100),B(100),XX(2,100)
53 IF(IBEG .GT. 4) GO TO 50
54 IF(IBEG .EQ. 4) GO TO 20
56 IF(IBN .GE. 2) B(2)=-A(2)/A(1)
68 20 IF(ABS(B(3)) .LT. EPS*ABS(X0)) THEN
78 40 X1=X1+A(M-K+1)*XX(1,K-1)
81 50 IF(ABS(B(M)) .LT. EPS*ABS(X0)) THEN
86 60 XX(2,K)=XX(1,K)+B(M)*XX(2,K-1)