Minor update `atan2`. Added tests.

Followed the convention for if-else statements.
is_canonical was failing for some test cases, so added explicit
else statements to the previous version.