Code for computing tan(x)