Question: prep2trans issue: piecewise with sum

piecewise not suitable to sum:

restart;
with(codegen):
H:=proc(y,a,b) y+piecewise((y>0), a,b); end proc;
prep2trans(H);
Error, (in intrep/StatSeq) invalid terms in sum: if 0 < y then a else b end if


Any walkarounds?

Please Wait...