Be careful. Fitting general sums of decaying exponentials is an
ill-conditioned problem for which one is usually cautioned against
general least-squares routines. There are specialised routines in
some non-free Fortran subroutine libraries that I know of (IMSL,
Harwell and probably CERNlib and others). Good places to look for a
treatment of the problem might be the journals `Nuclear Instruments
and Methods' and `Computer Physics Communications'.