[Edit]
The general question seems incredibly hard to solve. Here is a significantly restricted version of this question.
How do I dete
There is no way to do this in general. You can test both functions for a random sample of inputs and check them for equality on those specific values, but in general it is infeasible to test every possible input.