To greatly simplify the expression and what was going on, if you entered the expression
V0 ^ V1 + V2
the precedence of ADD is greater than the precedence of XOR, so the implied parentheses end up being
V0 ^ (V1 + V2)
However, for the expression
V0 ** V1 + V2
the precedence of ADD is LESS THAN the precedence of RAISED TO POWER, so the implied parentheses end up being
(V0 ** V1) + V2
In Designer and DirectSOFT, the MATH instruction will ALWAYS regenerate the expression WITH THE IMPLIED PARENTHESES. This is done because WE don't even remember the precedence rules (order of operations), so why should we expect our customers to? Hence, when you enter an expression, the parentheses will AUTOMATICALLY show up where they are IMPLIED. The only time we DON'T add the parentheses is in the EXTREMELY OBVIOUS situation of using binary operators that are in the SAME PRECEDENCE GROUP and that are Commutative AND Associative. So if you entered V0 + V1 + V2, you will end up with V0 + V1 + V2 (no need to insert implied parentheses because ADD is in the same precedence group with itself (duh!) and ADD is Commutative and Associative). However the MATH regeneration of V0 - V1 - V2 WILL insert the implied parentheses (V0 - V1) - V2 because subtraction is NOT Associative (a - b is not the same as b - a).
So, any time you see the "wrong" parentheses placed in a re-generated MATH expression, it's probably because the operator precedence order is NOT what you thought.
You will never be wrong when writing longer arithmetic and/or logical expressions to OVER-USE parentheses to ensure the operator precedence is EXACTLY what you want/need. Once you enter the expression, Designer will REGENERATE the expression with MINIMAL VERBOSE parentheses (not too many, not too few, but JUST right).
In case you were wondering, here is the precedence priority table (based on C/C++ precedence rules):
1. || (logical-OR)
2. && (logical-AND)
3. | (bitwise-OR)
4. ^ (bitwise-XOR)
5. & (bitwise-AND)
6. == != (equality)
7. > >= < <= (relational)
8. >> << >>> (bit shift)
9. + - (add/sub group)
10. * / % (multiply/divide/modulus group)
11. ** (raised-to-power)
12. ~ ! - (unary operators: bitwise invert, logical NOT, unary minus)
I would not bother "memorizing" or utilizing this table (we don't) - just use parentheses to leave no doubt.