As indicated by its name, PiecewiseExpand's most natural application is to Piecewise expressions but nonetheless, it is still documented as being applicable to (unevaluated) If, Which and Switch expressions. Has anyone ever had any experience of usefully applying PiecewiseExpand to these procedural-like conditionals?
Applications like
Clear@f; f[x_] := Which[ EvenQ@x, "even", LessThan[10]@x, "lessThan10", GreaterThan[20]@x, "greaterThan20"]; PiecewiseExpand[f[x], Assumptions -> x \[Element] Integers] don't expand as expected in more general programming contexts whereas PiecewiseExpand's simplifying engine seems more apt in mathematical settings wherein which case Piecewise then seems more natural.
Clear@f; f[x_] := Piecewise[{ {"even", Mod[x, 2] == 0}, {"lessThan10", x < 10}, {"greaterThan20", x > 20}}]; PiecewiseExpand[f[x], Assumptions -> x \[Element] Integers] 
