Solution (source code)

= Solution

Multiply numerator and denominator by the <complex conjugate> of $1+z$. For $z\ne-1$ this gives
$$
\frac{1-z}{1+z}=\frac{1-x^2-y^2-2iy}{(1+x)^2+y^2}.
$$
Thus its <real part> and <imaginary part> are respectively
$$
\boxed{\frac{1-x^2-y^2}{(1+x)^2+y^2},\qquad\frac{-2y}{(1+x)^2+y^2}.}
$$