Logaritm of Negative numbers
Currently new Complex(-Math.E.pow(2), 0).log() returns 2, but because -Math.E.pow(2) is a negative number it should return 2+pi*i
I have to find out how to calculate the logarithm of negative numbers and the logarithm of complex numbers where the real part is negative.
The Euler formula can be used to derive the complex logarithm function. Just use the argument (the "phi" as you call it in your library) as the imaginary value for the output. Negative numbers have an argument of pi, so that will fix your problem.
For reference, the Euler form of the complex function is log(r e^(ti)) = log(r)+ti, where t is a real number between (-pi, pi] (parentheses mean "not-including", square brackets mean "including").