function v = midpoint(f, a, b)
  v = f(0.5*(a+b));
end