Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const eps = 0.00001;
- x = 1/5;
- x2 = 1/239;
- var
- s, s1, s2, next : real;
- i : integer;
- begin
- next := 1; s1 := 1;
- i := 2;
- repeat
- next := next * i * sqr(x) / succ(i) / (sqr(x) + 1);
- inc(i, 2);
- s1 := s1 + next;
- until next < eps;
- s1 := s1 * x / (1 + sqr(x));
- next := 1; s2 := 1;
- i := 2;
- repeat
- next := next * i * sqr(x2) / succ(i) / (sqr(x2) + 1);
- inc(i, 2);
- s2 := s2 + next;
- until next < eps;
- s2 := s2 * x2 / (1 + sqr(x2));
- s := (16 * s1) - (4 * s2);
- writeln(s);
- end.
Advertisement
Add Comment
Please, Sign In to add comment