Best_fit_idealfunction