| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 | *DECK DPOLCF      SUBROUTINE DPOLCF (XX, N, X, C, D, WORK)C***BEGIN PROLOGUE  DPOLCFC***PURPOSE  Compute the coefficients of the polynomial fit (includingC            Hermite polynomial fits) produced by a previous call toC            POLINT.C***LIBRARY   SLATECC***CATEGORY  E1BC***TYPE      DOUBLE PRECISION (POLCOF-S, DPOLCF-D)C***KEYWORDS  COEFFICIENTS, POLYNOMIALC***AUTHOR  Huddleston, R. E., (SNLL)C***DESCRIPTIONCC     AbstractC        Subroutine DPOLCF computes the coefficients of the polynomialC     fit (including Hermite polynomial fits ) produced by a previousC     call to DPLINT.  The coefficients of the polynomial, expandedC     about XX, are stored in the array D. The expansion is of the formC     P(Z) = D(1) + D(2)*(Z-XX) +D(3)*((Z-XX)**2) + ... +C                                                  D(N)*((Z-XX)**(N-1)).C     Between the call to DPLINT and the call to DPOLCF the variable NC     and the arrays X and C must not be altered.CC     *****  INPUT PARAMETERSC      *** All TYPE REAL variables are DOUBLE PRECISION ***CC     XX   - The point about which the Taylor expansion is to be made.CC     N    - ****C            *     N, X, and C must remain unchanged between theC     X    - *     call to DPLINT and the call to DPOLCF.C     C    - ****CC     *****  OUTPUT PARAMETERC      *** All TYPE REAL variables are DOUBLE PRECISION ***CC     D    - The array of coefficients for the Taylor expansion asC            explained in the abstractCC     *****  STORAGE PARAMETERCC     WORK - This is an array to provide internal working storage. ItC            must be dimensioned by at least 2*N in the calling program.CCC     **** Note - There are two methods for evaluating the fit producedC     by DPLINT. You may call DPOLVL to perform the task, or you mayC     call DPOLCF to obtain the coefficients of the Taylor expansion andC     then write your own evaluation scheme. Due to the inherent errorsC     in the computations of the Taylor expansion from the NewtonC     coefficients produced by DPLINT, much more accuracy may beC     expected by calling DPOLVL as opposed to writing your own scheme.CC***REFERENCES  (NONE)C***ROUTINES CALLED  (NONE)C***REVISION HISTORY  (YYMMDD)C   890213  DATE WRITTENC   891006  Cosmetic changes to prologue.  (WRB)C   891024  Corrected KEYWORD section.  (WRB)C   891024  REVISION DATE from Version 3.2C   891214  Prologue converted to Version 4.0 format.  (BAB)C***END PROLOGUE  DPOLCFC      INTEGER I,IM1,K,KM1,KM1PI,KM2N,KM2NPI,N,NM1,NMKP1,NPKM1      DOUBLE PRECISION C(*),D(*),PONE,PTWO,X(*),XX,WORK(*)C***FIRST EXECUTABLE STATEMENT  DPOLCF      DO 10010 K=1,N      D(K)=C(K)10010 CONTINUE      IF (N.EQ.1) RETURN      WORK(1)=1.0D0      PONE=C(1)      NM1=N-1      DO 10020 K=2,N      KM1=K-1      NPKM1=N+K-1      WORK(NPKM1)=XX-X(KM1)      WORK(K)=WORK(NPKM1)*WORK(KM1)      PTWO=PONE+WORK(K)*C(K)      PONE=PTWO10020 CONTINUE      D(1)=PTWO      IF (N.EQ.2) RETURN      DO 10030 K=2,NM1      KM1=K-1      KM2N=K-2+N      NMKP1=N-K+1      DO 10030 I=2,NMKP1      KM2NPI=KM2N+I      IM1=I-1      KM1PI=KM1+I      WORK(I)=WORK(KM2NPI)*WORK(IM1)+WORK(I)      D(K)=D(K)+WORK(I)*D(KM1PI)10030 CONTINUE      RETURN      END
 |