function [w12L, w12U] = MC4(x1, x2, x1L, x1U, x2L, x2U)
% function [w12L w12U] = MC4(x1, x2, x1L, x1U, x2L, x2U)
% Computes the lower and upper bounds for w12 = x1 * x2
% with x1 in [x1L, x1U] and x2 in [x2L, x2U]
% based on McCormick relaxations 
% Carrilho - 21 Jan 2015
% 

x1M = (x1U+x1L)/2;
x2M = (x2U+x2L)/2;

if ( (x1 >= x1M) && (x2 >= x2M) )
    [w12L, w12U] = MC1(x1,x2,x1M,x1U,x2M,x2U);
end

if ( (x1 >= x1M) && (x2 < x2M) )
    [w12L, w12U] = MC1(x1,x2,x1M,x1U,x2L,x2M);
end

if ( (x1 < x1M) && (x2 >= x2M) )
    [w12L, w12U] = MC1(x1,x2,x1L,x1M,x2M,x2U);
end

if ( (x1 < x1M) && (x2 < x2M) )
    [w12L, w12U] = MC1(x1,x2,x1L,x1M,x2L,x2M);
end


   