I need to factor this function so it is entirely dependent on x- semicircle displacement. In the attached image are three functions. The first is a displacement function which takes angle $t$, and returns a radius. The third one is a semicircle and the second one is a semicircle with the displacement function $d()$ applied.
Note that the second function includes $y$ in the right hand side (inside $\text{atan2}$). I need to factor this equation so that it is entirely dependent on $x$, and there is no $y$ variable on the right hand side of the equation.
Reproduced here, the equation is:
$y=\sqrt{ d(\text{atan2}( y, x ) )^2 - x^2 }$
I need to get this ^ y moved to the left.

edit: bigger picture, I'm trying to do raycasting of a sphere with a displacement map using an orthographic camera. This is why I only care about the greatest y, because lower y are not visible to the camera due to occlusion.  My thought was that if I could scan across with a single x, on a 2 dimension version of the problem I'd be closer to solving the 3 dimensional version.
edit: let me ask this a different way. Given a line, how can I find the location of a the points which this line intersects with the equation? 
edit again: it seems the answer is binary search.
http://http.developer.nvidia.com/GPUGems3/gpugems3_ch21.html
 A: As Rahul has already commented, you can't solve this for $y$ because $y$ is not a single-valued function of $x$. I also doubt that you can express the greatest $y$ for a given $x$ in closed form.
In polar coordinates, your equation is just $r(\phi)=d(\phi)$, and this allows you to write both $x$ and $y$ as functions of the single parameter $\phi$:
$$
x=r\cos\phi=d(\phi)\cos\phi\;,\\
y=r\sin\phi=d(\phi)\sin\phi\;.
$$
Now you could express $y$ as a function of $x$ if you could solve the first of these equations for $x$. With $d(\phi)=1+\sin(20\phi)/5$, this is $x=(1+\sin(20\phi)/5)\cos\phi$. You could express $\sin(20\phi)$ in terms of $\sin\phi$ and $\cos\phi$, but that would lead to a high-order polynomial in $\sin\phi$ and $\cos\phi$ whose roots are unlikely to have a closed form.
Often people post questions about parts of their problems, which turn out to be unsolvable because they've gone down a dead end with their bigger problem. If you tell us why you want to do this, we might be able to help you more, e.g. by suggesting how to do it in polar coordinates instead.
[Edit in response to the edit in the question:]
You could consider scanning through values of $\phi$ instead. Since
$$\dot x=\dot d\cos\phi-d\sin\phi=4\cos(20\phi)\cos\phi-(1+\sin(20\phi)/5)\sin\phi$$
(where the dot signifies differentiation with respect to $\phi$), you have $\Delta x\lt\sqrt{4^2+1.2^2}\Delta\phi\approx4\Delta\phi$, so with $\phi\in[0,\pi]$ instead of $x\in[-1.2,1.2]$ you'd only need about five times as many steps to get the same density of $x$ values everywhere.
