This isn’t possible yet in the expression editor but I just wrote a feature request for this. In the meantime, I did create a custom widget that does exactly this:
It takes inputs:
X
The operation you want to do: sin,cos,tan,asin,acos,atan
Whenever the value of X changes, the widget will recalculate the value of the result variable.
In the example video above I show the widget itself visible on the app step, but it can be outside of the viewable area of the app and it will still execute.
I would consider, to also start calculating, when the opration changes (and x has a valid value).
That ensures, that you will never have a situation, where you can see a result, that does not fit to your inputs (changing operation after first result was delivered would lead to an unvalid combination on screen).
You could also clear the x value and the result after changing the operation but, I think thts less unser friendly.