For a complex number of the form a+bi, IMTAN implements the following equation:
However, IMTAN determines if b=0 and in this case simply returns tan(a).