Ah yes, I forgot about that condition. Thanks for pointing it out!
On a similar note, do you think it would it be necessary to account for all values of

in similar fashion?
If

were to fall in say, the second quadrant, then

and

.
Still, it's not immediately obvious to me given that

by default (well, barring one heckuva fast tank), that the entire expression

will evaluate to a value whose magnitude is less than 1, thus allowing us to evaluate

when

lies in the second quadrant.
I'll try coding what you've done once the weekend is over. With any luck, it
should work. ^^
Edit: I forgot to divide the final expression by
both here and in the original post. Now, at least it's a lot more plausible that
in all quadrants. 