How to compare performance of two versions of a function?
One thing you could do to compare these two versions is to rename one of them to f_old and execute them both inside the same batch, while including the actual execution plan and IO statistics.  From there, it is a simple matter of comparing the plans and IO stats of each.

One thing you need to be wary of is that in your first statement you had IF @b > 0.  In your second statement you have IF @b &lt; 0.  What happens if @b = 0?  You have not covered that possibility.

Finally, I imagine you will find that your thoughts regarding NOT EXISTS vs. EXISTS is correct.  EXISTS will process until the condition is met.  NOT EXISTS requires a table scan (if not indexed) and an index scan (if indexed).  On a small table, you will not see a huge performance gain, but it is always best to design your logic around EXISTS, as opposed to NOT EXISTS.

Matt