On page 17 of the Handbook of Mathematical Functions With Formulas, Graphs and Mathematical Tables by Abramowitz and Stegun, it is written that given the third degree equation:
$$z^3 + a_2\,z^2 + a_1\,z + a_0 = 0$$
and calculating the following values first:
$$q = \frac{1}{3}\,a_1 - \frac{1}{9}\,a_2^2\,, \quad r = \frac{1}{6}\left(a_1\,a_2 - 3\,a_0\right) - \frac{1}{27}\,a_2^3$$
and then these other values:
$$s_1 = \left(r + \left(q^3 + r^2\right)^{\frac{1}{2}}\right)^{\frac{1}{3}} \,, \quad s_2 = \left(r - \left(q^3 + r^2\right)^{\frac{1}{2}}\right)^{\frac{1}{3}}\,,$$
the three desired roots of the cubic equation are:
$$\begin{align*} & z_1 = (s_1 + s_2) - \frac{a_2}{3}\,, \\ & z_2 = - \frac{1}{2}\,(s_1 + s_2) - \frac{a_2}{3} + \frac{\text{i}\,\sqrt{3}}{2}\,(s_1 - s_2)\,, \\ & z_3 = - \frac{1}{2}\,(s_1 + s_2) - \frac{a_2}{3} - \frac{\text{i}\,\sqrt{3}}{2}\,(s_1 - s_2)\,.\end{align*}$$
Unfortunately, writing the following code:
a2 = 0;
a1 = 1;
a0 = 1;
NSolve[z^3 + a2 z^2 + a1 z + a0 == 0, z]
q = 1/3 a1 - 1/9 a2^2;
r = 1/6 (a1 a2 - 3 a0) - 1/27 a2^3;
s1 = (r + (q^3 + r^2)^(1/2))^(1/3);
s2 = (r - (q^3 + r^2)^(1/2))^(1/3);
z1 = (s1 + s2) - a2/3 // N
z2 = -1/2 (s1 + s2) - a2/3 + I Sqrt[3]/2 (s1 - s2) // N
z3 = -1/2 (s1 + s2) - a2/3 - I Sqrt[3]/2 (s1 - s2) // N
I get:
{{z -> -0.682328}, {z -> 0.341164 - 1.16154 I}, {z -> 0.341164 + 1.16154 I}} 0.835342 + 0.876227 I 0.341164 - 0.590913 I -1.17651 - 0.285314 I
so there is definitely something that does not work, but I do not know what! Thank you!