 nextPoint) <= (f currentPoint) - nextStep * gradientLength ^ 2 = (nextPoint, nextStep)
        | otherwise                                                         = getNextPointAndStep currentPoint nextStep
        where
            x = fst currentPoint 
            y = snd currentPoint
            (gradX, gradY) = gradient currentPoint
            gradientLength = measure (0, 0) (gradX, gradY)
            nextPoint = (x - currentStep * gradX, y - currentStep * gradY)
            nextStep = currentStep / 2;

stepDivision :: Point -> Double -> Integer -> Double ->
getNextPointAndStep currentPoint currentStep
        | (f nextPoint) <= (f currentPoint) - nextStep * gradientLength ^ 2 = (nextPoint, nextStep)
        | otherwise                                                         = getNextPointAndStep currentPoint nextStep
        where
            x = fst currentPoint 
            y = snd currentPoint
            (gradX, gradY) = gradient currentPoint
            gradientLength = measure (0, 0) (gradX, gradY)
            nextPoint = (x - currentStep * gradX, y - currentStep * gradY)
            nextStep = currentStep / 2;
getNextPointAndStep currentPoint currentStep
        | (f nextPoint) <= (f currentPoint) - nextStep * gradientLength ^ 2 = (nextPoint, nextStep)
        | otherwise                                                         = getNextPointAndStep currentPoint nextStep
        where
            x = fst currentPoint 
            y = snd currentPoint
            (gradX, gradY) = gradient currentPoint
            gradientLength = measure (0, 0) (gradX, gradY)
            nextPoint = (x - currentStep * gradX, y - currentStep * gradY)
            nextStep = currentStep / 2;