def derivative(v1, v0, t1, t0):
  """Computes the difference quotient.

  Returns an approximation of the derivative dv/dt with special handling
  of delta(t) = 0.
  """
  if t1 > t0:
    return (v1 - v0) / (t1 - t0)
  else:
    return 0