I have the impression that these functions have different evaluation rules. I cannot produce a minimal example right now, but in general, what are the differences between these functions? That is, besides the obvious difference in the calling interface. I am interested in knowing when and how these functions will exhibit different behavior.
For example, it is recommended to use Piecewise if the expression will be used inside Integrate. Why? Naively I'd expect that Piecewise[{{val1,cond1},{val2,cond2}...}]
, Which[cond1,val1,cond2,val2,...]
and If[cond1,val1, If[cond2,val2,...]]
be all equivalent, but there are subtle differences that I wish to understand.
Which
is used to replace nestedIf
. $\endgroup$