Given an arbitrary algebraic equation, say for example the likelihood of the bernoulli distribution:
$$\prod_{i}^{n}\theta^{x_i}(1-\theta)^{1-x_i}$$
And some arbitrary factorization constraints, say:
$$f(x)g(\theta)e^{\phi(\theta)^{T}u(x)}$$
Can I factor the equation into the form above where f, g, and phi are functions depending only on x, theta, or x respectively? This is something as humans we do all the time. The problem I gave above is an instance of "is this distribution in the exponential family", but of course there are simpler and less puffy versions of this:
Given the equation:
$$f(x,y,z) = x^2 + y^3 - e^{z}$$
Can I factor this into:
$$ f(x)*g(y)*h(y,z)$$
This feels undecidable to me. The tree of legal "algebra moves" from the root is infinite. If a program cannot find a solution in n moves, there is no guarantee that the solution is not at n + 1 moves, so I can't think of a halting condition. There doesn't even seem to be a good greedy solution to this, other than human intuition.
Any mathematica wizards out there know how to write a one liner to this?