Given:
$$x^y = z_1$$
$$y^x = z_2$$
What, if one exists, is the generalized function such that:
$$f(z_1) = z_2$$
To give a more concrete example, and perhaps a foothold to start from for the generalization:
$$x^2 = z_1$$
$$2^x = z_2$$
$$f(z_1) = z_2$$
What is the function that for all squares the function $f(z_1)$ will yield the corresponding power of 2?
My real question is the generalized case, $x^y = z_1$ into $y^x = z_2$, but if someone can give me some kind of idea how to approach the $y=2$ case, I think I should be able to come to some kind of generalized solution.
I have been working on this problem for quite some time, and just don't seem to be making any progress, and I feel like the solution simply lies outside of my current knowledge.
If anyone can direct me to material that might help with this problem even if you don't have any direct suggestions that would still be greatly appreciated.
Edit:
I forgot to mention part of the impetus for asking this question.
Consider: $$log_x(z) = y$$ and so
$$log_z(x) = \frac{1}{y}$$
This led me to try to find the similar case, if one existed, for $x^y = z_1$ into $y^x = z_2$, as well as (though not the subject of this post) $\sqrt[y]{z} = x_1$ into $\sqrt[z]{y} = x_2$.
The heart of the question essentially being, what must I do to the output of a given power-relationship, such that I am able to swap the two pieces that made it without making reference to those two pieces in the transformation applied to the output.
That transformation for the case of $log_x{z}$ into $log_z{x}$ is to reciprocate your output; $y$ into $\frac{1}{y}$.
We can certainly define $g(x,y)=x^y$ and $h(x,y)=y^x$, though you don't say what kind of numbers $x,y$ are. You are essentially asking to define $f(z)=h(g^{-1}(x,y))$ The problem is that $g(x,y)$ does not have an inverse. There are many cases of different $x,y$ that give the same value for $x^y$ so you don't know what to plug into $h$. Your example with squares shows this. For $x=16, y=2$ you want $f(16^2)=f(256)=2^{16},$ but for $x=2,y=8$ you want $f(2^8)=f(256)=8^2=64$ Of course there are many more real $x,y$ with $x^y=256$ which would give other desired results for $f(256)$. The property you cite of the $\log$ function is quite special.