#include
#include
using namespace std;
const double OUT = 1e-6;
double sinx(double x);
int main() {
double r, s, k;
cout << "请输入两个数:";
cin >> r >> s;
if (r*r<=s*s)
k = sqrt(sinx(r) * sinx(r) + sinx(s) * sinx(s));
else
k = 1 / 2 * sinx(r * s);
cout << k << endl;
return 0;
}
double sinx(double x) {
double val = x * x;
double e = x;
double n = 0;
int i = 1;
int f = 1;
while (fabs(e/f) >= OUT) {
i % 4 == 1 ? n += e/f: n -= e/f;
i += 2;
f = f * (i - 1) * i;
e *= val;
}
return n;
}