This assignment to `z[out_of_bounds]` does not work as intended --- `z` has shape `(len(x), len(y))`, whereas `out_of_bounds` has shape `nx`.