With the introduction of a precalculated quantity a and thereby f(x) we have that the derivative can be written as
f'(x) = 2xb,which reduces the number of operations from four in the orginal expression to two. This means that if we need to compute f(x) and its derivative (a common task in optimizations), we have reduced the number of operations from six to four in total.
Note that the usage of a symbolic software like SymPy does not include such simplifications and the calculations of the function and the derivatives yield in general more floating point operations.