Is there a simple way to merge equivalent conditions in Piecewise
? For example, in the following we have (trivially) pw==x
.
pw = Piecewise[{{x, x != 0}}, 0];
Is there some way to force this without cheating? I would call the following cheating:
Assuming[x != 0, Refine[pw]]
(* x *)
As a further example, can I get the simplification (for x
real) pw2==Abs[x]
?
pw2 = Piecewise[{{x, x > 0}}, -x];
Comments
Post a Comment