/*arctan函数的实现*/
double tarctan(double x)
{
double e = x;
double sqr = x * x;
double r = 0;
int i = 1;
while (e / i > 1e-15)
{
double f = e / i;
r = (i % 4 == 1) ? r + f : r - f;
e = e * sqr;
r += 2;
}
return 2;
}
/*sin函数的实现*/
double tsin(double x)
{
double g = 0;
double t = x;
int n = 1;
do {
g += t;
n++;
t = -t * x * x / (2 * n - 1) / (2 * n - 2);
} while (fabs(t) >= 1e-10);
return g;
}