Add some basic letsimp tests based on bug #3950
[maxima.git] / share / colnew / fortran / vmonde.f
blob5df846b64d2a606e9cd68ac0b5d01247f55d561a
1 SUBROUTINE VMONDE ( RHO, COEF, K )
3 C**********************************************************************
5 C purpose
6 C solve vandermonde system v * x = e
7 C with v(i,j) = rho(j)**(i-1)/(i-1)! .
9 C**********************************************************************
11 INTEGER K, I,IFAC,J,KM1,KMI
12 DOUBLE PRECISION RHO(K), COEF(K)
14 IF ( K .EQ. 1 ) RETURN
15 KM1 = K - 1
16 DO 10 I = 1, KM1
17 KMI = K - I
18 DO 10 J = 1, KMI
19 COEF(J) = (COEF(J+1) - COEF(J)) / (RHO(J+I) - RHO(J))
20 10 CONTINUE
22 IFAC = 1
23 DO 40 I = 1, KM1
24 KMI = K + 1 - I
25 DO 30 J = 2, KMI
26 30 COEF(J) = COEF(J) - RHO(J+I-1) * COEF(J-1)
27 COEF(KMI) = DFLOAT(IFAC) * COEF(KMI)
28 IFAC = IFAC * I
29 40 CONTINUE
30 COEF(1) = DFLOAT(IFAC) * COEF(1)
31 RETURN
32 END