#include #include double arctg(double x, double eps); int main(void) { double a=0 ,b=1.0, d=0.000001, x, x1, l, ef, ea, eb; double frac = 5.0 / 7.0; int n = 0; l=b-a; do { x=(a+b)/2; x1=(atan(x)-frac)*(atan(a)-frac); if (x1<0) b=x; else a=x; n++; } while ((b-a)>d); x=(a+b)/2; /* Значение x0 */ printf("%.6f\n",x); ea=x-l/pow(2,n); eb=x+l/pow(2,n); ef=(atan(eb)-frac)-(atan(ea)-frac); /* Погрешность Еf */ printf("%.8f\n", ef); double sum = 0.0, m, dividend = x; int divisor = 1, it = 0; do { m = dividend / divisor; sum += m; divisor += 2; dividend *= -(x * x); it++; } while (fabs(m) > 0.00001); /* Значение суммы ряда */ printf("%.5f\n", sum); /* Значение n */ printf("%d\n", it); }