Changed acos.rewrite(atan) to be more robust

The previous implementation of acos(x).rewrite(atan) produced outputs
which did not match with corresponding values from acos(x). A more
robust formula is used here to accommodate these errors.
Changed the test for acos(x).rewrite(atan)

Changed the test for acos(x).rewrite(atan) to accommodate the new
rewrite function