      SUBROUTINE SPL1D2(N,X,F,W,IJ,Y,TAB)
      implicit real*8 (a-h,o-z)
      DIMENSION X(3),F(3),W(3),TAB(3)
      integer ilo
      save ilo
      data ilo / 1 /
      CALL FndInt ( N-1, X, Y, ilo, I )
      I = MAX0(I,1)
   30 MI=(I-1)*IJ+1
      K1=MI+IJ
      FLK=X(I+1)-X(I)
      A=(W(MI)*(X(I+1)-Y)**3+W(K1)*(Y-X(I))**3)/(6.d0*FLK)
      B=(F(K1)/FLK-W(K1)*FLK/6.d0)*(Y-X(I))
      C=(F(MI)/FLK-FLK*W(MI)/6.d0)*(X(I+1)-Y)
      TAB(1)=A+B+C
      A=(W(K1)*(Y-X(I))**2-W(MI)*(X(I+1)-Y)**2)/(2.d0*FLK)
      B=(F(K1)-F(MI))/FLK
      C=FLK*(W(MI)-W(K1))/6.d0
      TAB(2)=A+B+C
      TAB(3)=(W(MI)*(X(I+1)-Y)+W(K1)*(Y-X(I)))/FLK
      RETURN
      END
