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
Some symbolic operations (e.g., differentiation of functions like max) yield IfElse.ifelse constructs to tell apart the different cases. However, these can lead to extraneous ifelses if the different cases end up being the same expression:
Perhaps this shouldn't even be here in the first place (because the differentiation could detect this), but at least it should be possible to simplify it 0, but it doesn't:
julia>simplify(expr)
IfElse.ifelse(1> x, 0, 0)
(I am not even talking about the other, much deeper problem that this is not even mathematically correct. Technically, the second derivative is that of a discontinuous function, so a delta distribution is missing here, which could come back to bite you if this was used for a numerical scheme.)
Haha, I always receive multiple requests of the same thing around the same time.
Regarding the derivative of non-smooth functions, using the delta distribution is not gonna work for numerical methods either. We plan to add a regularization pass that smooths discontinuous derivatives so that numerical methods can work.
Oh, definitely, that's a separate issue. I just mentioned it here out of interest (and to make it clear that I don't think ∂ₓ(∂ₓ(max(1,x))) should really be 0).
But independent of how to deal with derivatives, IfElse.ifelse(condition, y, y) should still simplify to y...
Some symbolic operations (e.g., differentiation of functions like
max
) yieldIfElse.ifelse
constructs to tell apart the different cases. However, these can lead to extraneousifelses
if the different cases end up being the same expression:Perhaps this shouldn't even be here in the first place (because the differentiation could detect this), but at least it should be possible to simplify it
0
, but it doesn't:(I am not even talking about the other, much deeper problem that this is not even mathematically correct. Technically, the second derivative is that of a discontinuous function, so a delta distribution is missing here, which could come back to bite you if this was used for a numerical scheme.)
┆Issue is synchronized with this Trello card by Unito
The text was updated successfully, but these errors were encountered: