c     subroutine parfit
      subroutine parfit(xpar,ypar,aa,bb,cc)
      dimension xpar(5),ypar(5)
      v1=0
      v2=0
      v3=0
      v4=0
      r1=0 
      r2=0
      r3=0
      do 1 i=1,5
      v1=v1+xpar(i)**4
      v2=v2+xpar(i)**3
      v3=v3+xpar(i)**2
      v4=v4+xpar(i)
      r1=r1+ypar(i)*xpar(i)**2
      r2=r2+ypar(i)*xpar(i)
      r3=r3+ypar(i)
 1    continue
c      if (v4.eq.0.or.r3.eq.0.) print *,'division by zero expected'
      if (v4.eq.0.or.r3.eq.0.) goto 6680
      cc=((r3*v2-r2*v3)*(v1*v3-v2*v2)-(v1*r2-v2*r1)*(v2*v4-v3*v3))/
     ?((v1*v3-v2*v2)*(v2*5-v4*v3)-(v2*v4-v3*v3)*(v1*v4-v2*v3))
      bb=(r2*v1-r1*v2-cc*(v4*v1-v3*v2))/(v1*v3-v2*v2)
      aa=(r1-bb*v2-cc*v3)/v1
6680  return
      end
