cleaned up solve_univariate_real

Removed the  solve_as_poly_gen_is_pow function and moved the logic
to the invert function.