#include "stdlib.h"
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <iomanip>
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double a, b, x, f, dx;
cout << left;
cout << "Input a: ";
cin >> a;
cout << "Input b: ";
cin >> b;
cout << "Input dx: ";
cin >> dx;
if ((a <= b) && (dx > 0.0))
{
cout << endl << setw(15) << "Results:" << endl << endl;
cout << left << setw(15) << "x" << setw(15) << "F(x)" << endl;
for (x = a; x <= b; x += dx)
{
if (x < 1)
{
double sd = 5 + (abs(7 * x));
f = (log10(sd)) + (3 * M_PI * x);
}
else
{
if ((x >= 1) && (x < 5))
{
f = (2 * (atan(x + 1))) + (3 * (pow(x, 7))) / (cos(log(x)) * cos(log(x)));
}
else
{
if (x >= 5)
{
f = -2;
}
}
}
cout << setw(15) << x << setw(15) << f << endl;
}
}
else
{
cout << "Incorrect Data..." << endl;
}
system("pause");
return 0;
}