function q = gauss3 ( a, b, f )

  x = zeros ( 3, 1 );
  x(1) = -0.774596669241483377035853079956;
  x(2) = 0.000000000000000000000000000000;
  x(3) = 0.774596669241483377035853079956;

  w = zeros ( 3, 1 );
  w(1) = 0.555555555555555555555555555556;
  w(2) = 0.888888888888888888888888888889;
  w(3) = 0.555555555555555555555555555556;
%
%  Transform from [-1,+1] to [a,b].
%
  x(1:3) = ( ( 1.0 - x(1:3) ) * a + ( 1.0 + x(1:3) ) * b ) / 2.0;
  w(1:3) = w(1:3) * ( b - a ) / 2.0;

  q = w' * f ( x );

  return
end
