For non-trivial addre/C.re(m) and addim/C.im(m) the previous code works fine. Yes, I too agree this is too much code. I thought of writing a function which takes complex numbers as arguments and multiplies them handling these trivial cases and returns a correct output. Can we do anything better ?