Great observations.  For the purposes of this exploration, I am entirely assuming arbitrary precision integers (and the math geek in me is really enjoying your use of the adjective &quot;junk&quot;, above).<p>Bigger picture, I want to rewrite &quot;sum(reverse(x))&quot; without explicitly saying so.  How do we optimize that expression using the definitions of sum and reverse?  Note that in my discussion of this in my second example, I am inconsistent here: I expand the definition of reverse() but treat sum() as a primitive.  That said, I am pretty sure that the example still works if you substitute the appropriate definition of sum as &quot;reduce(add,x)&quot;; the derivation is just longer.