      function qav (x)
c *** see RH Landau, Program lpott, 1981
      Implicit  Real*8   (a-h,o-z)
      Common /enpaul/ pf,ak,akd,cskkd,xi,e,xon
      Common /enqav/ xip
c
c     1st test arguments
      If (xip.lt.1.e-5) GoTo 10
      If (x.lt.1.e-5) GoTo 10
      If ((xip+x).lt.pf) GoTo 10
      If (abs(xip-x).gt.pf) GoTo 10
c
      y = x+xip
      y1 = (y-pf)*(y+pf)
      y = y1/(4.0*xip*x)
      qav = (1.0-y)
      Return
 10   Continue
      print 20, x,xip,pf
      STOP
c
 20   format (10h qav exit ,3f20.8)
      End
