1

In Mathematica, I have the following code:

f1[x_] := 1;
f2[x_] := 2;
f[x_] := If[x > 5, f1[x], If[x < 0, f2[x], 3]]

f[x]

Which produces the following output:

If[x > 5, f1[x], If[x < 0, f2[x], 3]]

How can I get this output:

If[x > 5, 1, If[x < 0, 2, 3]]
Chameleon
  • 275
  • 1
  • 4

0 Answers0