The general form of the 3rd degree equation (or [b]Cubic[/b]) is: ax³ + bx² + cx + d = 0. Cubics have 3 roots. They are given by:
z1 = cbrt((((b / a / 3 - b / a) b / a / 3 + c / a) b / a / 3 - d / a) / 2 + 0ί + sqrt(((-(b / a / 3 - b / a) b / a / 3 - c / a) b / a / 3 + d / a)² / 4 + ((b / a / 3 - b / a) b / a / 3 + c / a - ((-b) / a / 3 + b / a - b / a / 3) b / a / 3)³ / 27 + 0ί)) + ((((-b) / a / 3 + b / a) b / a / 3 - c / a + ((-b) / a / 3 + b / a - b / a / 3) b / a / 3) / 3 + 0ί) / cbrt((((b / a / 3 - b / a) b / a / 3 + c / a) b / a / 3 - d / a) / 2 + 0ί + sqrt(((-(b / a / 3 - b / a) b / a / 3 - c / a) b / a / 3 + d / a)² / 4 + ((b / a / 3 - b / a) b / a / 3 + c / a - ((-b) / a / 3 + b / a - b / a / 3) b / a / 3)³ / 27 + 0ί)) + (-b) / a / 3;
z2 = cbrt(1 / 54) cbrt((-2 b³ - 27a² d + 9a b c + 3sqrt(3) a sqrt(4a c³ + 27a² d² - b² c² + 4b³ d - 18a b c d + 0ί)) / a³) (ί / 2 sqrt(3) - 1 / 2) + 0ί - 1 / 3 b / a + 1 / 3 ((-c) / a + 1 / 3 b / 3 b / a / a + 1 / 3 b * 2 / 3 b / a / a + 0ί) / (cbrt(1 / 54) cbrt((-2 b³ - 27a² d + 9a b c + 3sqrt(3) a sqrt(4a c³ + 27a² d² - b² c² + 4b³ d - 18a b c d + 0ί)) / a³) (ί / 2 sqrt(3) - 1 / 2) + 0ί);
z3 = cbrt(1 / 54) cbrt((-2 b³ - 27a² d + 9a b c + 3sqrt(3) a sqrt(4a c³ + 27a² d² - b² c² + 4b³ d - 18a b c d + 0ί)) / a³) ((-ί) / 2 sqrt(3) - 1 / 2) + 0ί - 1 / 3 b / a + 1 / 3 ((-c) / a + 1 / 3 b / 3 b / a / a + 1 / 3 b * 2 / 3 b / a / a + 0ί) / (cbrt(1 / 54) cbrt((-2 b³ - 27a² d + 9a b c + 3sqrt(3) a sqrt(4a c³ + 27a² d² - b² c² + 4b³ d - 18a b c d + 0ί)) / a³) ((-ί) / 2 sqrt(3) - 1 / 2) + 0ί);