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
Since there exist no custom_derivatives::printf_darg0, we set the derivative of printf to be zero.
In principle, we could detect it and return null instead, but this would break cases when printf is used in expressions, e.g. int i = x + printf(...); -> int _d_i = _d_x + 0;. This is an obscure case, but it makes sense to use 0 in such expressions (say, if it is not printf, but some non-differentiable math function, we cannot determine that).
Should we indicate more clearly where does this 0 come from? E.g.
Currently, when Clad fails to generate a derivative or find a custom one, it attempts to use numerical differentiation. And then a warning is produced, which either says that num diff was used or that the function was not differentiated at all. I believe the issue is fixed now.
Currently, if differentiation process meets a function which has no defined derivative in
custom_derivatives
namespace, its derivative is set to be0
.Example:
->
Since there exist no
custom_derivatives::printf_darg0
, we set the derivative ofprintf
to be zero.In principle, we could detect it and return null instead, but this would break cases when
printf
is used in expressions, e.g.int i = x + printf(...);
->int _d_i = _d_x + 0;
. This is an obscure case, but it makes sense to use 0 in such expressions (say, if it is not printf, but some non-differentiable math function, we cannot determine that).Should we indicate more clearly where does this 0 come from? E.g.
The text was updated successfully, but these errors were encountered: