Slightly improve perf of tan & tanh, and accuracy too

Without the patch:
x=np.random.rand(10000)+np.random.rand(10000)*1j;
%timeit np.tan(x)
100 loops, best of 3: 2.77 ms per loop
%timeit np.tanh(x)
100 loops, best of 3: 2.77 ms per loop

With the patch:
%timeit np.tan(x)
100 loops, best of 3: 2.66 ms per loop
%timeit np.tanh(x)
100 loops, best of 3: 2.66 ms per loop