The result of phase()
or log()
on a complex argument is broken if that argument has a real component of zero. The former is the new name for carg()
. It might only be in the LLVM version of the compiler. The phase returns a NaN. The imaginary component of the complex logarithm (which is the phase of the original argument) also returns an NaN. It should be one of +/-pi/2
.
I can post a simple fix for the former soon but I am not sure what a simple (but still accurate robust) fix for the latter is.