JuliaAttic / ReverseDiffSource.jl

Reverse automated differentiation from source
MIT License
47 stars 12 forks source link

Failures for order 3 derivations #8

Closed fredo-dedup closed 9 years ago

fredo-dedup commented 10 years ago

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
fredo-dedup commented 9 years ago

Numerous bugs corrected in the last commit. Results are now much more stable for higher order derivatives (the example above now works)