For this special case, you could also write a function that operates on both, NumPy arrays and plain Python floats:
def func2d(x, y):
z = 2.0 * (x > y) - 1.0
z *= y
return x + z
This version is also more than four times as fast as unutbu's func2a()unutbu's func2a() (tested with N = 100).