/// <summary>
        /// Start solution
        /// </summary>
        /// <returns> Result solution</returns>
        public double StartSolution(ExtendedPoint point)
        {
            int count          = 0;
            var actualTestStep = testStep;

            point.ValueFunction = ResultFunction(point.X, point.Y);
            try
            {
                do
                {
                    var vectors = GenerateVectors(actualTestStep, point);
                    var bestDot = vectors.Where(x => x.ValueFunction == vectors.Min(y => y.ValueFunction)).First();
                    if (bestDot.ValueFunction > point.ValueFunction)
                    {
                        actualTestStep = actualTestStep / 2;
                    }
                    else
                    {
                        point = MakeWorkStep(point, bestDot);
                        count++;
                    }
                }while (actualTestStep > 0.001);
            }
            catch (Bestcode.MathParser.ParserException)
            {
                MessageBox.Show("Incorrect input function");
            }

            EndPoint = point;
            return(point.ValueFunction);
        }
        /// <summary>
        /// We do work step
        /// </summary>
        /// <param name="point"></param>
        /// <returns></returns>
        private ExtendedPoint MakeWorkStep(ExtendedPoint point, ExtendedPoint bestDot)
        {
            if (workStep == 0)
            {
                workStep = testStep * 2;
            }
            var x = point.X + (workStep * Math.Cos(bestDot.Angle));
            var y = point.Y + (workStep * Math.Sin(bestDot.Angle));

            point.X             = x;
            point.Y             = y;
            point.ValueFunction = ResultFunction(point.X, point.Y);
            return(point);
        }
        /// <summary>
        /// Generate vectors in starting point
        /// </summary>
        /// <param name="step"></param>
        /// <param name="point"></param>
        private IList <ExtendedPoint> GenerateVectors(double step, ExtendedPoint point)
        {
            var    resultList = new List <ExtendedPoint>();
            Random random     = new Random(DateTime.Now.Millisecond);

            for (int i = 0; i < countVectrors; i++)
            {
                double randomAngle = random.NextDouble() + random.Next(-3, 3);
                var    x           = point.X + (step * Math.Cos(randomAngle));
                var    y           = point.Y + (step * Math.Sin(randomAngle));

                resultList.Add(new ExtendedPoint(x, y, ResultFunction(x, y), randomAngle));
            }

            return(resultList);
        }