def _qdwh_coefs(lk):
  """
  Computes a, b, c, l for the QDWH iterations.
  """
  d = (4. * (1. - lk**2) / (lk**4))**(1 / 3)
  f = 8. * (2. - lk**2) / (lk**2 * (1. + d)**(1 / 2))
  a = (1. + d)**(1 / 2) + 0.5 * (8. - 4. * d + f)**0.5
  b = (a - 1.)**2 / 4
  c = a + b - 1.
  lk = lk * (a + b * lk**2) / (1 + c * lk**2)
  return a, b, c, lk