x, y = minmax(x, y) return x + (y - x) / 2; ?
min = x^((y^x)&-(y<x)); return min + ((y^x^min)-min)/2;