Closed j-fu closed 3 years ago
Ok, looking into dual.jl in ForwardDiff gives the idea to just define:
function GSL.sf_fermi_dirac_half(d::ForwardDiff.Dual{T}) where T
x=ForwardDiff.value(d)
val=GSL.sf_fermi_dirac_half(x)
deriv=GSL.sf_fermi_dirac_mhalf(x)
ForwardDiff.Dual{T}(val, deriv * ForwardDiff.partials(d))
end
This works for my purpose, and it is easier than I thought...
Hi, I am trying to add
as a diffrule. To make this work I need to import GSL to ForwardDiff, creating a dependency on GSL which likely should be avoided. It indeed seems to work well.
Is there another way to proceed here ?