Symbolics.jl may not be exactly what you ask for, but it is related and perhaps useful for the problem that you want to address. Specially the symbolic solver:

Cool. I don’t want it solve it at run time but want it to have done it algebraically at compile time. But I suspect we may be able to wrangle it and put that in a macro

The second equation doesn’t follow from the first on its own, though, it’s not known whether b is positive or negative. So it’s not enough to work with a single equation, rather I guess the implementation of the feature you desire would need to solve systems of polynomial inequalities. Which is very demanding.