From an asymptotic complexity viewpoint, I don&#x27;t see any difference between the two algorithms (AD versus building an expression tree and doing it symbolically, then evaluating). Both are linear in the &quot;size&quot; of the expression. So I don&#x27;t understand what you mean by &quot;quickly explodes&quot;.