Order 3 and above derivations throw errors when derivation variable is a vector :
ex = :( (1 - x[1])^2 + 100(x[2] - x[1]^2)^2 )
res = rdiff(ex, x=zeros(2), order=3)
@eval foo(x) = $res
foo([0.5, 2.])
ERROR: DimensionMismatch("tried to assign 2 elements to 4 destinations")
in throw_setindex_mismatch at operators.jl:233
in setindex! at array.jl:338
in foo at none:1
Order 3 and above derivations throw errors when derivation variable is a vector :