An algorithm to calculate activation energy spectra for structural relaxation in amorphous alloys