Is it worthwhile thinking of an "alias" for the functional switch?

15 hours ago 4
ARTICLE AD BOX

Consider the functional switch in C#, such as a trivial example (absolute value):

double x = ... x = x switch { < 0 => -x, _ => x };

However, if I have a function instead:

x = fn(x) switch { < 0 => -fn(x), _ => fn(x) };

it would be inefficient, and a support variable should be used.
I wonder pros and cons of "aliasing" the switch argument in order to be used as part of the results.
Let's call "arg" this alias, so that:

x = fn(x) switch { < 0 => -arg, _ => arg };

Is it worthwhile?

Read Entire Article