I believe we already had a discussion in the thread Numerical resolution using cardan method. Next time, please post any further questions there to preserve the discussion in a single place.
I just tested the solution based upon the polynomial companion matrix posted ḣere (or downloadable via gist) using gfortran 5.5 and it works fine. Can you post the error you get during compilation?
PS: you can enclose your error output in brackets like this
```text
$ gfortran-5 -Wall polynomial_companion_matrix.f90 -llapack
/usr/bin/ld: warning: libgfortran.so.4, needed by /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/liblapack.so, may conflict with libgfortran.so.3
```
to make it show up as follows
$ gfortran-5 -Wall polynomial_companion_matrix.f90 -llapack
/usr/bin/ld: warning: libgfortran.so.4, needed by /usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/liblapack.so, may conflict with libgfortran.so.3