      Subroutine legpol (xx,y,n)
      Implicit  Real*8   (a-h,o-z)
c *** see RH Landau, Program lpott, 1981
      Dimension y(50)
      y(1) = 1.
      y(2) = xx
      If (n.gt.2) GoTo 10
      Return
 10   Do 20 i=2,n
         g = xx*y(i)
         y(i+1) = g-y(i-1)+g-(g-y(i-1))/i
 20   Continue
      Return
      End
