Algorithm(s) for rearranging simple symbolic algebraic expressions
I would like to know if there is a straightforward algorithm for rearranging simple symbolic algebraic expressions. Ideally I would like to be able to rewrite any such expression with one variable alone on the left hand side. For example, given the input:

    m = (x + y) / 2

... I would like to be able to ask about `x` in terms of `m` and `y`, or `y` in terms of `x` and `m`, and get these:

    x = 2*m - y
    y = 2*m - x

Of course we've all done this algorithm on paper for years. But I was wondering if there was a name for it. It seems simple enough but if somebody has already cataloged the various "gotchas" it would make life easier.

For my purposes I won't need it to handle quadratics.

(And yes, CAS systems do this, and yes I know I could just use them as a library. I would like to avoid such a dependency in my application. I really would just like to know if there are named algorithms for approaching this problem.)
Algorithm(s) for rearranging simple symbolic algebraic expressions
===

I would like to know if there is a straightforward algorithm for rearranging simple symbolic algebraic expressions. Ideally I would like to be able to rewrite any such expression with one variable alone on the left hand side. For example, given the input:

    m = (x + y) / 2

... I would like to be able to ask about `x` in terms of `m` and `y`, or `y` in terms of `x` and `m`, and get these:

    x = 2*m - y
    y = 2*m - x

Of course we've all done this algorithm on paper for years. But I was wondering if there was a name for it. It seems simple enough but if somebody has already cataloged the various "gotchas" it would make life easier.

For my purposes I won't need it to handle quadratics.

(And yes, CAS systems do this, and yes I know I could just use them as a library. I would like to avoid such a dependency in my application. I really would just like to know if there are named algorithms for approaching this problem.)