How do you check if two algorithms return the same result for any input?
In contrast to what the nay-sayers say, there are many effective techniques for doing this.


Bisimulation is one approach. See for example, Gordon's paper on Coinduction and Functional Programming.
Another approach is to use operational theories of program equivalence, such as the work of Pitts.
A third approach is to verify that both programs satisfy the same functional specification. There are thousands of papers on this approach.
A fourth approach is to show that one program can be rewritten into the other using sound program transformations.


Of course none of these methods is complete due undecidability, but volumes and volumes of work has been produced to address the problem.