added NaN test for tanh
added doc for tanh