3. Real numbers $x, y, z$ satisfy $x^{2}+y^{2}-x+y=1$. Then the range of the function
$$
f(x, y, z)=(x+1) \sin z+(y-1) \cos z
$$
is . $\qquad$
3. $\left[-\frac{3 \sqrt{2}+\sqrt{6}}{2}, \frac{3 \sqrt{2}+\sqrt{6}}{2}\right]$.
$$
f(x, y, z)=\sqrt{x^{2}+y^{2}+2 x-2 y+2} \sin (z+\theta),
$$

where, $\cos \theta=\frac{x+1}{\sqrt{(x+1)^{2}+(y-1)^{2}}}$,
$$
\sin \theta=\frac{y-1}{\sqrt{(x+1)^{2}+(y-1)^{2}}} \text {. }
$$

Since $z$ can take any value in $\mathbf{R}$, $z+\theta$ can also take any value in $\mathbf{R}$. Therefore, the range of $\sin (z+\theta)$ is $[-1,1]$.

Next, we find the range of $g(x, y)=x^{2}+y^{2}+2 x-2 y+2$.
$$
\begin{array}{l}
\text { From } x^{2}+y^{2}-x+y=1 \text { we get } \\
\left(x-\frac{1}{2}\right)^{2}+\left(y+\frac{1}{2}\right)^{2}=\left(\sqrt{\frac{3}{2}}\right)^{2} \text {. } \\
\text { Let }\left\{\begin{array}{l}
x-\frac{1}{2}=\sqrt{\frac{3}{2}} \cos \varphi, \\
y+\frac{1}{2}=\sqrt{\frac{3}{2}} \sin \varphi .
\end{array}\right. \text { Then } \\
g(x, y)=(1+x-y)+2 x-2 y+2 \\
=3(x-y+1) \\
=3\left[\sqrt{\frac{3}{2}}(\cos \varphi-\sin \varphi)+2\right] \\
=3 \sqrt{3} \sin (\varphi+\alpha)+6 \text {. } \\
\end{array}
$$

Since $\varphi+\alpha$ can take any value in $\mathbf{R}$, the range of $g(x, y)$ is $[6-3 \sqrt{3}, 6+3 \sqrt{3}]$.
Therefore, the range of $f(x, y, z)$ is
$$
\begin{array}{l}
{[-\sqrt{6+3 \sqrt{3}}, \sqrt{6+3 \sqrt{3}}]} \\
=\left[-\frac{3 \sqrt{2}+\sqrt{6}}{2}, \frac{3 \sqrt{2}+\sqrt{6}}{2}\right] .
\end{array}
$$