is the formula for the atan of complex x. The formula is right but the evaluation is not, because internally log of a complex number will call atan, and get this one instead of the real atan. Trouble ensues, to put it politely.
Internal calls to things like EvalUnary(c, "atan") should be guaranteed to get the real one. Should be easy if we have a builtin context. Or maybe not.
This program:
op atan x = 0j0.5 * log(1-x)/1+z
is the formula for the atan of complex x. The formula is right but the evaluation is not, because internally log of a complex number will call atan, and get this one instead of the real atan. Trouble ensues, to put it politely.
Internal calls to things like EvalUnary(c, "atan") should be guaranteed to get the real one. Should be easy if we have a builtin context. Or maybe not.