I'm aware questions very similar to this one have been asked before, so I'd like to clarify I already know how to treat the cases where $m$ and $n$ are coprime or where $G$ is abelian, or to prove that the order of the product is at most the least common multiple of the orders. I'm not interested in that, I'd just like to know whether there actually is a general formula depending on $m$ and $n$.
But if there isn't, I'd really like to know what's the least we can impose on $G$ and $m, n$ so that we can find a formula (that doesn't fit what I said above, of course - I'd also like to know how flexible the order of the product is, in the sense of how bad does it get if we don't impose anything else other than what I wrote). I'm taking a group theory course this semester and this exercise is homework, but someone asked my professor whether or not the exercise was missing any hypothesis and she said it wasn't, that there is indeed a general formula and we just need to consider the cases where $x, y$ are generated by a single element and when they're not. I've been unable to verifiy this and I'm not even convinced it's true, so I'd appreciate some clarification.