#include #include int main () { double const learning_rate{ 0.1 }; double const threshold{ 0.000001 }; double x_previous{ !0 }; double y_previous{ !0 }; double x_current{ 0 }; double y_current{ 0 }; (void)learning_rate; size_t i{ 1 }; size_t const max_iterations{ 1024 }; while ( i <= max_iterations && threshold < sqrt( pow(x_current-x_previous, 2) + pow(y_current-y_previous, 2) ) ) { std::cout << i << ": ( " << x_current << ", " << y_current << " )\n"; x_previous = x_current; y_previous = y_current; ++i; } std::cout << i << ": ( " << x_current << ", " << y_current << " )\n"; }