max(min(x,1-y),min(1-x,y)) from 0 to 1