      subroutine _lhs(idum,nx,p2,p4,l,d,u)
      integer nx
      real p2(nx),p4(nx),l(nx),d(nx),u(nx)
      integer i,j,nxm1
C
      nxm1=nx-1
      do 10 i=1,nxm1,1
      j=i+1
      p4(j)=p4(j)-l(i)*p4(i)
 10   continue
C
      p4(nx)=p4(nx)*d(nx)
C
      do 20 i=nxm1,1,-1
      j=i+1
      p4(i) = p4(i)*d(i)-u(i)*p4(j)
 20   continue
C
      do 30 i=1,nx
      p4(i)=p4(i)-p2(i)
 30   continue
C
      return
      end
