Maybe this is a silly question but I'd appreciate the answer. If I have a uniformly distributed number $x\sim U(-1,1)$, then:
$$ y=\mbox{sgn}(x)\sqrt{-\log(|x|)} $$
Should have a gaussian distribution. What is the advantage of using the Box-Muller method over using this technique? Is it that we compute $\sqrt{-\log(|x|)}$ only once for each pair of random values? But this wouldn't require computing $\sin$ and $\cos$ functions and unlike the Marsaglia polar method, it wouldn't reject any samples.
Is there an advantage for the other two methods when $x$ is close to $0$?
You can try it numerically as follows. Doesn't look normal to me
The conceptual issue is how probability densities transform under mappings, as described, e.g., here:
https://en.wikipedia.org/wiki/Probability_density_function#Scalar_to_scalar
You have to also multiply by the inverse of the Jacobian determinant of the mapping.