To reduce the number of comparisons in the common case of finite values, it would be better to check for infinities only once.  i.e.
```
if isfinite(zr)
    if isfinite(zi)
          ....
    else
          ....
    end
else # infinite zr
   ....
end
```