changed poly_solve_cubic function