Here you can download subroutines for solving cubic, quartic or quintic equations:
The program quartic.f (quartic.c) contains the subroutine cubic and quartic and a main program for testing these subroutines. The solutions of quartic.f including the complex solutions can be checked with the program quartchk.f.
Quintic equations can be solved with a hybrid algorithm: 1.) the first root which is always real, is obtained by the numerical Newton-method; 2.) the remaining four roots a calculated analytically by quartic. FORTRAN code: quintic.f (quintic.c); quintchk.f