This is a followup to a question I posted earlier today. Suppose you have a piecewise function such as "snap=max[x,0]= x if x>0, 0 otherwise".
Then you would think that it must be straightworward to apply a function to this, i.e. to obtain "f[x] if x > 0, f[0] otherwise".
My intuition is that I should be able to say "f[snap]", but this doesn't work. The best I can do (after help from AccidentalFourierTransform) is quite complicated:
snap = PiecewiseExpand[Max[0, x]]
MapAt[f[#] &, Map[MapAt[f[#] &, 1], snap, {2}], -1]
This produces the desired result, but it seems strange that I need to do this. Is there a more straight-forward solution?
Ramp
? $\endgroup$