Improved cubic solver.