Вы находитесь на странице: 1из 7

1

: .

: .TI-155
Cornescu R.
: conf. univ.Tutunaru E.

2016
:

I.
:

1) ( ) = -


2) + , + , , = -

II. 104

.

I. .

1)
3 + 0,2 2 + 0,5 1,2 = 0
= {|0,2|, |0,5|, | 1,2|} = 0
1,2
=1+ = 2,2
1

[2,2; 2,2]

( ) = 3 2 + 0,4 + 0,5 = 0

<0

2,2 2,2
() +

2)
1
( 1)2 =
2
1
(0) = (0 1)2 0 = 0,5
2
1
(0,5) = (0,5 1)2 0,5 = 0,25 0,82 = 0,57
2
(0) (0,5) < 0
[0; 0,5]


:
#include <iostream>
using namespace std;
#include <stdlib.h>
#include <iostream>
#include <conio.h>
#include <math.h>

const float eps = 0.0001f;


float a, b;

float f(float x)
{
return x*x*x + 0.2 * x*x + 0.5 * x - 1.2;
}

float f1(float x)
{
return 3 * x*x + 0.4 * x + 0.5;
}
float f2(float x)
{
return 6 * x + 0.4;
}

void Kasat(float a, float b)


{
//
float x0, x1;

if (f(a)*f2(a) > 0) x0 = a;
else x0 = b;
bool found = false;
int k = 0;
do
{
x1 = x0 - (f(x0) / f1(x0));
if (fabs(x1 - x0) < eps) found = true;
else x0 = x1;
k++;
} while (!found);

if (found)
cout << " : x = " << x1 << ". : " << k
<< " f(x) = " << f(x1) << endl;
}

void Combo(float a, float b)


{
//
float x0, x1, t0, t1;

if (f(a)*f2(a) < 0) { x0 = a; t0 = b; }
else { x0 = b; t0 = a; }

bool found = false;


int k = 0;
do
{
x1 = x0 - (f(x0)*(t0-x0) / (f(t0)-f(x0)));
t1 = t0 - f(t0) / f1(t0);
if (fabs(t1 - x1) < eps) {
found = true;
x1 = (t1 + x1) / 2;
}
else {
x0 = x1;
t0 = t1;
}
k++;
} while (!found);

if (found)
cout << " : x = " << x1 << ". : "
<< k << " f(x) = " << f(x1) << endl;
}

int main()
{
bool c = false;
do
{
do
{
cout << endl << " a: "; cin >> a;
cout << " b: "; cin >> b;
if (f(a)*f(b) > 0)
cout << " " << endl;
} while (f(a)*f(b) > 0);

Kasat(a, b);
Combo(a, b);

system("pause");
cout << " '1' '0' - "; cin >> c;
} while (c);
system("pause");
return 0;
}

:
,

.

Оценить