*dk lsthpot
      subroutine lsthpot(x,e)
c
      implicit real*8 (a-h,o-z)
*ca lsthpotc
      common / potcom / c6,c8, rkw(87), ekw(87), wkw(87)
      dimension x(3),tab(3),xq(3),xj(3)
      data xxn1,xxn2,xxn3,fn/.0012646477d0,-.0001585792d0,
     1 .0000079707d0,.0035d0/
      data xxn4/-.0000001151d0/
      data a,a1,c,f/ -1.514663474d0,-1.46d0,-1.2148730613d0,
     1 2.088442d0/
      data fb,b1,b2,b3/ .052d0,1.7732141742d0,-2.0979468223d0,
     1 -3.9788502170d0/
      data fb2,c1,c2/.52d0,3.0231771503d0,-1.08935219d0/
      data d1,d2,d3,d4/.4908116374d0,-.8718696387d0,.1612118092d0,
     1 -.1273731045d0/
      data fl,xl1,xl2/.79d0,-13.3599568553d0,.9877930913d0/
      wn=abs((x(1)-x(2))*(x(2)-x(3))*(x(1)-x(3)))
      cos1=(x(1)*x(1)-x(2)*x(2)-x(3)*x(3))/x(2)/x(3)
      cos2=(x(2)*x(2)-x(1)*x(1)-x(3)*x(3))/x(1)/x(3)
      cos3=(x(3)*x(3)-x(2)*x(2)-x(1)*x(1))/x(1)/x(2)
      wb=(cos1+cos2+cos3)/2.0d0+1.0d0
      do 100 i=1,3
      t=c*(a+x(i)*(1.0d0+x(i)*a1))*exp(-f*x(i))
      tab(1) = 0.0d0
      if ( x(i) .lt. 10.0d0 )
     >call lsthspl(87,rkw,ekw,wkw,1,x(i),tab)
      xq(i)=(tab(1)+t)/2.0d0
  100 xj(i)=(tab(1)-t)/2.0d0
      xr=x(1)+x(2)+x(3)
      xx = exp(-fb*xr*xr)
      xx1= exp(-fb2*xr)
      xri=1.0d0/x(1)+1.0d0/x(2)+1.0d0/x(3)
      eb2=wb*(c1+xr*c2+d1*xri)*xx1
      eq=(x(1)-x(2))**2+(x(1)-x(3))**2+(x(3)-x(2))**2
      eb3=eq*wb*(d4*xx+d3*xx1)
      eb=(wb**2)*(b1+wb*(b2+wb*(b3))+d2*xri)*xx
      elong=wb*(xl1+xl2*xr*xr)*exp(-fl*xr)
      xlsp=(wn**2)*(xxn1+wn*(xxn2+wn*(xxn3+wn*xxn4)))
      en = xlsp*exp(-fn*xr**3)
      elp=sqrt(((xj(1)-xj(2))**2+(xj(1)-xj(3))**2
     1   +(xj(2)-xj(3))**2)/2.0d0)
      elp=xq(1)+xq(2)+xq(3)-elp
      e=(elp+en+eb+eb2+eb3+elong)
      return
      end
