function q = midpoint ( a, b, f )

  x = ( a + b ) / 2.0;
  w = ( b - a );

  q = w * f ( x );

  return
end
