You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To get both rem2pi and mod2pi, it should be sufficient to just define a rule for rem2pi, as mod2pi is implemented in terms of rem2pi in Base. Unfortunately, rem2pi, with its RoundingMode argument, doesn't really fit the mold of functions accepting only numeric arguments (and thus having derivatives with respect to all of the arguments). I also don't really think it makes sense to define rules for the lower-level functions that are called in rem2pi (e.g., ieee754_rem_pio2, add22condh), as those seem more like implementation details.
Do you have any plans for how to handle this case? I can help implement this, but if you could give me an idea of what the required changes to DiffBase (and possibly dependent packages) would be, that would be very helpful.
If a derivative for an argument doesn't exist/make sense, my general strategy has just been to pop a NaN in there (see the bessel* diffrules, for example).
To get both
rem2pi
andmod2pi
, it should be sufficient to just define a rule forrem2pi
, asmod2pi
is implemented in terms ofrem2pi
in Base. Unfortunately,rem2pi
, with itsRoundingMode
argument, doesn't really fit the mold of functions accepting only numeric arguments (and thus having derivatives with respect to all of the arguments). I also don't really think it makes sense to define rules for the lower-level functions that are called inrem2pi
(e.g.,ieee754_rem_pio2
,add22condh
), as those seem more like implementation details.Do you have any plans for how to handle this case? I can help implement this, but if you could give me an idea of what the required changes to DiffBase (and possibly dependent packages) would be, that would be very helpful.
Ref: JuliaDiff/ForwardDiff.jl#113.
The text was updated successfully, but these errors were encountered: