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