function b = CS_bisect(x1,x2,h,err)
%

e1 = x1;
e2 = x2;
b = (e1+e2)/2;
if CS_feasible_pt(h,e2')  % fix to move e2 outside feasible region
    b = e2;
    return
end

done = 0;
while done==0
    [e1;b;e2];
    norm(e2-e1);
    if norm(e2-e1)<err
        done = 1;
    elseif CS_feasible_pt(h,b')
        e1 = b;
        b = (e1+e2)/2;
    else
        e2 = b;
        b = (e1+e2)/2;
    end
end
