gn="justify">// ----------- умова збіжності методу дотичних -----------//
f (coef, power, a, func); _a = func [0]; (coef, power, b, func); _b = func [0];
_1 (coef, power, a, func); _a_1 = func [1]; _2 (coef, power, a, func); _a_2 = func [2];
_1 (coef, power, b, func); _b_1 = func [1]; _2 (coef, power, b, func); _b_2 = func [2];
(f_a * f_b> 0 | | f_a_1 == 0 | | f_a_2 == 0 | | f_b_1 == 0 | | f_b_2 == 0)
{
cout <<"The method of tangents (Nuton's method) is not applicable" <
break;
}
// ---------------------------------------- ---------------------// n = 0; min_a, min_b, min; = a; _1 (coef, power, x, func); _a = func [1]; = b; _1 (coef, power, x, func); _b = func [1]; (fabs (min_a)> fabs (min_b))
{min = fabs (min_b);}
{min = fabs (min_a);}
max_a, max_b, max; = a; _2 (coef, power, x, func); _a = func [2]; = b; _2 (coef, power, x, func); _b = func [2]; (fabs (max_a)> fabs (max_b))
{max = fabs (max_a);}
{max = fabs (max_b);}
= sqrt ((2 * min * E)/max);
roots [64]; = b; _1 (coef, power, x, func); _b_1 = func [1]; _2 (coef, power, x, func); _b_2 = func [2 ]; (f_b_1 * f_b_2> 0)
{root = b;}
{
x = a;
derivative_1 (coef, power, x, func);
f_a_1 = func [1];
derivative_2 (coef, power, x, func);
f_a_2 = func [2];
if (f_a_1 * f_a_2 <0)
{root = a;}
} (fabs (roots [n]-root 1)
{root = roots [n];} (coef, power, root, func); _1 (coef, power, root, func); [n] = root-(func [0]/ func [1]);
} i = n; <<"x =" <> again;
}
}