The tangent of an angle is the sine of the angle divided by the cosine of the angle. The numeric expression is treated as an angle in the current trigonometric mode:RADians orDEGrees. The default units are radians.TANis defined for all real numbers except±PI/2 (±90 degrees) and other odd multiples ofPI/2 (90 degrees).
COMPLEX Arguments
TANaccepts either aCOMPLEXorREALargument and returns a value of the same type. ForCOMPLEXarguments the angle must be specified in radians, regardless of the current trigonometric mode. The real and imaginary parts ofTAN(Z) are calculated (using real arithmetic) as:
REAL(TAN(Z)) = SIN(2*REAL(Z))/D
IMAG(TAN(Z)) = SINH(2*IMAG(Z))/D
Where:
D = COS(2*REAL(Z))+COSH(2*IMAG(Z))
The domain ofTANHincludes all points in the complex plane exceptCMPLX(PI/2,0) and other odd multiples ofPI/2. Also, intermediate values generated during the calculation of the function can also cause over or underflow errors for very large or small values of Z.