|
Algebraik va transtsendent tenglamalar yechimlarini taqribiy usullar bilan topish
|
Sana | 24.05.2024 | Hajmi | 164 Kb. | | #253012 |
Bog'liq Algaritmlarni loyihalash
O‘ZBEKISTON RESPUBLIKASI
RAQAMLI TEXNOLOGIYALAR
VAZIRLIGI
MUHAMMAD AL-XOZAZMIY NOMIDAGI TOSHKENT
AXBOROT TEXNOLOGIYALARI UNIVERSITETI
Amaliy ish
Mavzu: Algebraik va transtsendent tenglamalar yechimlarini taqribiy usullar bilan topish.
Bajardi: CAL003-1- guruh talabasi:
Amirov Jahongir
Tekshirdi: Axmedov Oybek
TOSHKENT 2024
Algebraik va transtsendent tenglamalar yechimlarini taqribiy usullar bilan topish.
#include
#include
using namespace std;
double calculatePolynomial(double x) {
double result = 2*pow(x, 3) - x -5;
return result;
}
int main() {
double x;
cout << "Enter the value of x: ";
cin >> x;
double result = calculatePolynomial(x);
cout << "Result: " << result << endl;
return 0;
}
x
|
-3
|
-2
|
-1
|
0
|
1
|
2
|
3
|
y
|
-56
|
-19
|
-6
|
-5
|
-4
|
9
|
46
|
#include
#include
using namespace std;
double calculatePolynomial(double x) {
double result = sqrt(x+1);
return result;
}
int main() {
double x;
cout << "Enter the value of x: ";
cin >> x;
double result = calculatePolynomial(x);
cout << "Result: " << result << endl;
return 0;
}
X
|
-3
|
-2
|
-1
|
0
|
1
|
2
|
3
|
Y
|
n
|
n
|
0
|
1
|
1.41
|
1.71
|
2
|
B= 1.601
#include
#include
double f(double x) {
sqrt(x+1);
return x;
}
int main() {
double a, b, eps;
std::cin >> a >> b >> eps;
double c = (a + b) / 2;
while (std::abs(b - a) > eps) {
if (f(a) * f(c) < 0) {
b = c;
} else {
a = c;
}
c = (a + b) / 2;
}
std::cout << "Yechim = " << (a + b) / 2 << std::endl;
return 0;
}
Yechim : 1.601
|
| |