$$P^{q}=r$$
$P=e^{\frac{Im(q)arg(r)+iRe(q)arg(r)}{\left(Re(q)\right)^{2}+\left(Im(q)\right)^{2}}-\frac{2\pi n_{1}iRe(q)}{\left(Re(q)\right)^{2}+\left(Im(q)\right)^{2}}-\frac{2\pi n_{1}Im(q)}{\left(Re(q)\right)^{2}+\left(Im(q)\right)^{2}}}\left(|r|\right)^{\frac{Re(q)-iIm(q)}{\left(Re(q)\right)^{2}+\left(Im(q)\right)^{2}}}$
$n_{1}\in \mathrm{Z}$
$\left\{\begin{matrix}q=\frac{2\pi n_{1}i}{\ln(P)}+\log_{P}\left(r\right)\text{, }n_{1}\in \mathrm{Z}\text{, }&r\neq 0\text{ and }P\neq 1\text{ and }P\neq 0\\q\in \mathrm{C}\text{, }&\left(P=0\text{ and }r=0\right)\text{ or }\left(P=1\text{ and }r=1\right)\end{matrix}\right.$
$\left\{\begin{matrix}P=r^{\frac{1}{q}}\text{, }&\left(Numerator(q)\text{bmod}2=1\text{ and }Denominator(q)\text{bmod}2=1\text{ and }r<0\text{ and }r^{\frac{1}{q}}\neq 0\right)\text{ or }\left(r=0\text{ and }q>0\right)\text{ or }\left(r>0\text{ and }q\neq 0\right)\\P=-r^{\frac{1}{q}}\text{, }&\left(r<0\text{ and }Numerator(q)\text{bmod}2=1\text{ and }Numerator(q)\text{bmod}2=0\text{ and }Denominator(q)\text{bmod}2=1\text{ and }r^{\frac{1}{q}}\neq 0\right)\text{ or }\left(q\neq 0\text{ and }r>0\text{ and }Numerator(q)\text{bmod}2=0\text{ and }Denominator(q)\text{bmod}2=1\right)\text{ or }\left(Numerator(q)\text{bmod}2=0\text{ and }r=0\text{ and }q>0\right)\text{ or }\left(r>0\text{ and }q\neq 0\text{ and }r^{\frac{1}{q}}<0\text{ and }Numerator(q)\text{bmod}2=0\right)\\P\neq 0\text{, }&q=0\text{ and }r=1\end{matrix}\right.$
$\left\{\begin{matrix}q=\log_{P}\left(r\right)\text{, }&r>0\text{ and }P\neq 1\text{ and }P>0\\q\in \mathrm{R}\text{, }&\left(P=1\text{ and }r=1\right)\text{ or }\left(P=-1\text{ and }r=-1\text{ and }Denominator(q)\text{bmod}2=1\text{ and }Numerator(q)\text{bmod}2=1\right)\\q>0\text{, }&P=0\text{ and }r=0\end{matrix}\right.$