#  Think c1, ..., c7, c9, ..., c16 as functions of c8.
#  The procedure dcxsoverdc8 compute the derivative
#
#    c3'-c5'+c6'-c7'+c10'-c11'+c13'-c14'+c15'-c16'
#
#  Input x:vector contains 
#               c1,  c2,  c3,  c4,  c5,  c6,  c7, 
#               c9,  c10, c11, c12, c13, c14, c15, c16.
#
#                                        Ren-Cang Li, June 1, 1996
#                                        na.rcli@na-net.ornl.gov
#
dcxsoverdc8:=proc(x:vector, c8)
    local F15, i, j, dc, b;
    F15:=matrix(15,15): dc:=vector(15): b:=vector(15):
    for i from 1 to 15 do
       for j from 1 to 7 do
           F15[i,j]:=subs(c[1]=x[1],  c[2]=x[2],  c[3]=x[3],  c[4]=x[4],
                         c[5]=x[5],  c[6]=x[6],  c[7]=x[7],  c[8]=c8,
			 c[9]=x[8],  c[10]=x[9], c[11]=x[10],c[12]=x[11],
			 c[13]=x[12],c[14]=x[13],c[15]=x[14],c[16]=x[15],
			 g[i][j]):
       od:
    od: 
    for i from 1 to 15 do
       for j from 8 to 15 do
           F15[i,j]:=subs(c[1]=x[1],  c[2]=x[2],  c[3]=x[3],  c[4]=x[4],
                         c[5]=x[5],  c[6]=x[6],  c[7]=x[7],  c[8]=c8,
			 c[9]=x[8],  c[10]=x[9], c[11]=x[10],c[12]=x[11],
			 c[13]=x[12],c[14]=x[13],c[15]=x[14],c[16]=x[15],
			 g[i][j+1]):
       od:
    od: 
    for i from 1 to 15 do
        b[i]:=-subs(c[1]=x[1],  c[2]=x[2],  c[3]=x[3],  c[4]=x[4],
                    c[5]=x[5],  c[6]=x[6],  c[7]=x[7],  c[8]=c8,
                    c[9]=x[8],  c[10]=x[9], c[11]=x[10],c[12]=x[11],
                    c[13]=x[12],c[14]=x[13],c[15]=x[14],c[16]=x[15],
	            g[i][8]):
    od:
    dc:=linsolve(F15,b):
    dc[3]-dc[5]+dc[6]-dc[7]+dc[9]-dc[10]+dc[12]-dc[13]+dc[14]-dc[15];
end:
