If you need to figure out things like this in future then you might want to try writing a table (I think its called a truth table, but some of the more mathematically minded here may correct me) showing all possible inputs and their respective outcomes. Once you've written the table you should be able to quickly identify the overall logic and possibly simplify it.
For the above a table might look like this;
a | b | z1
------------------
t | t |
t | f |
f | t |
f | f |
Go through each row and write the effects of z1 in the column. This should allow you to easily determine what's going on and how to shorten it, if possible.