JuliaAttic / ReverseDiffSource.jl

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

Bug in rdiff() #5

Closed carloalbert closed 10 years ago

carloalbert commented 10 years ago

The following code produces an NaN in the expression for the derivative. Dividing by sigma^2 seems to cause a problem:

Pkg.checkout("ReverseDiffSource","devl3") using ReverseDiffSource

N = 10 sigma = 1.

ex = quote H = 0. for a = 1:N H += q[a] end H = H/(sigma^2) end

res = rdiff( ex, outsym=:H, q=ones(Float64,N) )

fredo-dedup commented 10 years ago

Thanks for finding this. Will look into it ....