I have written my blog article to explain how the program I referenced works.
Since the possible range is so wide, a FFT would be a good approach instead of a priori knowledge of which two bins are biggest. Find the peak bin, choose the larger neighbor as the second bin, apply the formulas. In the noiseless case real pure tone case it will yield an exact answer, independent of the sample count. The FFT is a very good "band pass filter" in this regard so no preprocessing should be necessary.
If the frequency is very close to a bin, the parameters can be read right from the bin. In hyper precise applications (frequency within .0000001 or so), I have different equations for and exact answer in the phase and amplitude calculation. Also, in this case my three bin frequency formula should be used centered at the peak.
A comparison of my three bin formula to other approaches can be found here:
As you can see it outperforms all the others, especially in the high SNR region. In the zero noise single pure tone case, it is also exact. When the frequency is between the two bins, the two bin formula outperforms the three bin formula in my noise testing. With no noise, both are exact.
The sample program uses 16 samples. With noise present, you will want to use as many points as possible. If efficiency is required, you can do a FFT on a subset of your points on the full interval (select every Mth point), get a rough estimate of the frequency, then calculate the two DFT bins surrounding the peak using all the points.