AutoDiff does not support compiling a function with a partial subset of variables. The only purpose of providing variables to Compile() is to specify the
order of arguments when you use the resulting compiled form.
For example, here are two cases:
compiledTerm = term.Compile(x, y)
compiledTerm = term.Compile(y, x)
Both of them product a compiled term for the same function. But
has a different meaning in both cases. In the first case, the meaning is to differentiate with
and in the second case it differentiates with