#include <cmath>
#include <iostream>
using namespace std;
double z(const double x, const double y) {
static constexpr auto pi = 3.1415926535897932;
const auto n = (x + y * y) * sqrt(x * x + y * y);
const auto d = sqrt((x + pow(tan(y / pi), 2)) * (x * x + exp
));
return n / d;
}
double f(const double a, const double b) {
const auto x1 = 3.0 * a + pow(b, 2);
const auto y1 = a * b + 1.0;
const auto x2 = a + 2.0 * b;
const auto y2 = pow(a, 2) + b;
return z(x1, y1) + z(x2, y2);
}
int main() {
cout.setf(ios::fixed);
cout.precision(4);
cout << "f(0.5, 0.5) = " << f(0.5, 0.5) << '\n';
cout << "f(0.5, 1.0) = " << f(0.5, 1.0) << '\n';
cout << "f(1.0, 0.5) = " << f(1.0, 0.5) << '\n';
cout << "f(1.0, 1.0) = " << f(1.0, 1.0) << '\n';
}