Reversible/linear logic is very very interesting, if you already know the answer you're looking for, then there's no need to save any states at all, you can reduce the other side of the equation and end up with a reversible program.
You'll ask, but if you know both sides of the equation, why is there a need to compute at all.
In this little video I show the entropy loss in a standard loop against a version which releases the expected literals for a completely reversible program without states