76-Variant
Guruh: cal015-2 (520-22)
Download
2,42 Mb.
Pdf ko'rish
Sana
15.05.2024
Hajmi
2,42 Mb.
#234025
Bog'liq
Algoritmlash mustaqil ishi
Bu sahifa navigatsiya:
76-Variant
MUHAMMAD AL-XORAZMIY
NOMIDAGI TOSHKENT
AXBOROT
TEXNOLOGIYALARI UNIVERSITETI
Algoritmlarni
loyihalash
Mustaqil ish
Fakultet:
Televizion texnologiyalari
Guruh: CAL015-2 (520-22).
Bajardi:
Uralov Abror
Tekshirdi:
Qo’ldoshev Hakim
Toshkent-2024
76-Variant
#include
#include
using
namespace std
;
double f(double x) {
return pow(x, 3) + pow(x, x) - x - 4;
}
double f_derivative(double x) {
return 3 * pow(x, 2) + pow(x, x - 1) * (1 + log(x)) - 1;
}
double newton_method(double initial_guess, double
tolerance
, int
max_iterations)
{
double x = initial_guess;
int iterations = 0;
while (abs(f(x)) > tolerance && iterations < max_iterations) {
x = x - f(x) / f_derivative(x);
iterations++;
}
if (abs(f(x)) <= tolerance) {
cout << "Yechim topildi: x = " << x << endl;
return x;
} else {
cout << "Yechim topilmadi." << endl;
return NAN;
}
}
int main() {
double initial_guess = 1.0;
double tolerance = 0.0001;
int max_iterations = 1000;
newton_method(initial_guess, tolerance, max_iterations);
return 0;
}
Download
2,42 Mb.
Download
2,42 Mb.
Pdf ko'rish
Bosh sahifa
Aloqalar
Bosh sahifa
Dərs
Mühazirə
Qaydalar
Referat
Xülasə
Yazı
Guruh: cal015-2 (520-22)
Download
2,42 Mb.
Pdf ko'rish