#define _USE_MATH_DEFINES
#include <iostream>
#include <math.h>
using namespace std;
double logic(double x);
int main() {
for (double x = - M_PI/2; x <= M_PI; x += 0.2) {
cout << "y = " << logic(x) << endl;
}
return 0;
}
double logic(double x) {
if (x > 2) {
x = sqrt(log(pow(x,2))-1);
}
else if (x >= 0 && x <= 2) {
x = -2 * pow(x, 3);
}
else if (x < 0) {
x = exp(sin(x));
}
return x;
}