Hi, I've noticed that the complex tan and cot functions return NaN if the argument z=x+i*y has a large negative imaginary part y, such as y=-1e7. However, the functions should either return -i or i in that case. I noticed that the corresponding hyperbolic functions do not have this problem, so I propose to fix this bug by using tan(z)=-i*tanh(i*z) and using the same algorithm for the calculation of the complex tan and tanh functions, see attached patch. I would also like to add unit tests for that (and also for the complex tan and cot functions for arguments with large positive imaginary part, and also for the complex tanh and coth functions for large real parts). I tried to understand how the Lisp file complex/test.el works and modified it (see the patch). However, it seems that emacs refuses to evaluate the functions for the arguments I've added, it leaves lines like {FN (tan), ARG(-3.45266983001243932001e-04,8.3886080e+06), RES(tan(-3.452669830012439320e-4, 8.388608e6), 60)}, which are then removed by the 'clean' function in test.el and never get written to results.h. Therefore, I've temporarily added the expected results as hardcoded values to results.h. I would appreciate any comments on how to improve this from people who know Lisp better then me. Best regards, Frank