private void ApproximateOneDac(int numOfDac, int startDivider, int step)
        {
            numOfDac--;

            for (int divider = startDivider; divider >= 0; divider--)
            {
                inp.RestoreAllBelowEqualDacs(numOfDac);

                inp.Divide(numOfDac, dividers[divider]);

                if (numOfDac != 0)
                {
                    ApproximateOneDac(numOfDac, divider, step);

                    //звільняємо память
                    if (result.Count > BorderNumber)
                    {
                        result     = result.OrderByDescending(x => x.n).ThenBy(y => y.error).Take(ListNumber).ToList <DacSet>();
                        bestDacSet = result[0];
                    }
                }
                else
                {
                    //рахуэмо відсоток виконаної роботи
                    currentProgress++;

                    var weights = inp.GetWeightsArray();

                    DacSet dacSet = new DacSet();

                    int iOneWeight;
                    for (iOneWeight = 0; true; iOneWeight++)
                    {
                        if ((0.5 - weights[iOneWeight].weight) <= 0.25)
                        {
                            break;
                        }
                    }
                    double weightToApproximate = weights[iOneWeight].weight;

                    for (int i = 0; true; i++)
                    {
                        if (i >= 2)
                        {
                            weightToApproximate = dacSet.weights[i - 1].weight + dacSet.weights[i - 2].weight;
                        }
                        else if (i == 1)
                        {
                            weightToApproximate = dacSet.weights[i - 1].weight;
                        }

                        var aproximatedWeights = ApproximateOneWeight(weightToApproximate, weights);

                        if (aproximatedWeights == null)
                        {
                            break;
                        }

                        dacSet.AddWeight(aproximatedWeights);
                    }
                    if (dacSet.n >= bestDacSet.n || bestDacSet.n - dacSet.n < 3)
                    {
                        dacSet.dividerArray = (float[])inp.dividerArray.Clone();

                        //comment in PROD
                        //dacSet.residue = inp.GetRange() -Fibonachi.CalculateFibonachiRange(dacSet.n);

                        result.Add(dacSet);
                    }

                    var newPercentageProgress = Math.Round(currentProgress * 100 / maxProgress, 2);

                    //якшо відсоток виконаної роботи змінився до четвертої цифри після коми - виводимо
                    if (newPercentageProgress != percentageProgress)
                    {
                        percentageProgress = newPercentageProgress;
                        //fire an event
                        if (CalculatorChanged != null)
                        {
                            CalculatorChanged(this, new ProgressEventArgs(percentageProgress.ToString()));
                        }
                    }
                }
            }
        }