      function f_qdf(f) ! bernd berg nov 11 1998.
c variance ratio distribution function.
      include '../../libs/fortran/implicit.sta'
      include '../../libs/fortran/constants.par'
      common /parft/ nf1,nf2
      xf1h=half*nf1
      xf2h=half*nf2
      x=(nf2*one)/(nf1*f+nf2)
      f_qdf=one-beta_i(x,xf2h,xf1h)
      if(f_qdf.gt.half) f_qdf=one-f_qdf
      return
      end
