docs: def ks_unif_durbin_recurrence_rational(samples, statistic):
      """
      Calculates the probability that the statistic is less than the given value,
      using Durbin's recurrence and employing the standard fractions module.
  
      This is a (hopefully) exact reference implementation, likely too slow for
      practical usage. The statistic should be given as a Fraction instance and
      the result is also a Fraction. See: doi:10.18637/jss.v026.i02.
      """
      t = statistic * samples
      # Python 3: int()s can be skipped.
      ft1 = int(floor(t)) + 1
      fmt1 = int(floor(-t)) + 1
      fdt1 = int(floor(2 * t)) + 1
      qs = [Fraction(i ** i, factorial(i)) for i in range(ft1)]
      qs.extend(Fraction(i ** i, factorial(i)) - 2 * t *
                      sum((t + j) ** (j - 1) / factorial(j) *
                          (i - t - j) ** (i - j) / factorial(i - j)
                          for j in range(i + fmt1))
                for i in range(ft1, fdt1))
      qs.extend(-sum((-1) ** j * (2 * t - j) ** j / factorial(j) * qs[i - j]
                     for j in range(1, fdt1))
                for i in range(fdt1, samples + 1))
      return qs[samples] * factorial(samples) / samples ** samples