2
SUBROUTINE PCOEF (L, C, TC, A)
3
C***BEGIN PROLOGUE PCOEF
4
C***PURPOSE Convert the POLFIT coefficients to Taylor series form.
7
C***TYPE SINGLE PRECISION (PCOEF-S, DPCOEF-D)
8
C***KEYWORDS CURVE FITTING, DATA FITTING, LEAST SQUARES, POLYNOMIAL FIT
9
C***AUTHOR Shampine, L. F., (SNLA)
10
C Davenport, S. M., (SNLA)
13
C Written BY L. F. Shampine and S. M. Davenport.
17
C POLFIT computes the least squares polynomial fit of degree L as
18
C a sum of orthogonal polynomials. PCOEF changes this fit to its
19
C Taylor expansion about any point C , i.e. writes the polynomial
20
C as a sum of powers of (X-C). Taking C=0. gives the polynomial
21
C in powers of X, but a suitable non-zero C often leads to
22
C polynomials which are better scaled and more accurately evaluated.
24
C The parameters for PCOEF are
27
C L - Indicates the degree of polynomial to be changed to
28
C its Taylor expansion. To obtain the Taylor
29
C coefficients in reverse order, input L as the
30
C negative of the degree desired. The absolute value
31
C of L must be less than or equal to NDEG, the highest
32
C degree polynomial fitted by POLFIT .
33
C C - The point about which the Taylor expansion is to be
35
C A - Work and output array containing values from last
39
C TC - Vector containing the first LL+1 Taylor coefficients
40
C where LL=ABS(L). If L.GT.0 , the coefficients are
41
C in the usual Taylor series order, i.e.
42
C P(X) = TC(1) + TC(2)*(X-C) + ... + TC(N+1)*(X-C)**N
43
C If L .LT. 0, the coefficients are in reverse order,
45
C P(X) = TC(1)*(X-C)**N + ... + TC(N)*(X-C) + TC(N+1)
47
C***REFERENCES L. F. Shampine, S. M. Davenport and R. E. Huddleston,
48
C Curve fitting by polynomials in one variable, Report
49
C SLA-74-0270, Sandia Laboratories, June 1974.
50
C***ROUTINES CALLED PVALUE
51
C***REVISION HISTORY (YYMMDD)
53
C 890531 Changed all specific intrinsics to generic. (WRB)
54
C 890531 REVISION DATE from Version 3.2
55
C 891214 Prologue converted to Version 4.0 format. (BAB)
56
C 920501 Reformatted the REFERENCES section. (WRB)
57
C***END PROLOGUE PCOEF
60
C***FIRST EXECUTABLE STATEMENT PCOEF
63
CALL PVALUE (LL,LL,C,TC(1),TC(2),A)
64
IF (LL .LT. 2) GO TO 2
69
2 IF (L .GE. 0) GO TO 4