Evaluation of algorithms for reconstructing electron spectra from their bremsstrahlung hard X-ray spectra