Курсовая работа: по численным методам
void Calculation()
{
double x=0, x_old=0, m=0;
cout<<"-------------------------------------------------"<<endl
<<"| Xn | f(Xn) | X(n+1)-Xn |"<<endl
<<"-------------------------------------------------"<<endl;
if(fabs(Calc_First(minim))>fabs(Calc_First(maxim))) m=x=x_old=minim;
else m=x=x_old=maxim;
m=fabs(1/Calc_First(m));
cout<<"|";
cout.width(15);cout.precision(10);
cout<<x;
cout<<"|";
cout.width(15);cout.precision(10);
cout<<Calc_Fun(x);
cout<<"| |\n";
if(Calc_First(x)>0)
{
do
{
x_old=x;
x=x_old-m*Calc_Fun(x_old);
cout<<"|";
cout.width(15);cout.precision(10);
cout<<x;
cout<<"|";
cout.width(15);cout.precision(10);
cout<<Calc_Fun(x);
cout<<"|";