Const a: Double = 1; b: Double = 4; epsMax: Real = 0.000001; Var h3, ba, ban, S1, S2, Fab, Simp0, Simp : Double; n, i : Integer; eps : Real; Function Func(x : Double) : Double; Begin Func := 4 * Sqr(x) - Ln(0.5 * x); End; Begin ba := b - a; h3 := ba / 3; Fab := Func(a) + Func(b); Simp0 := h3 * Fab; n := 1; S2 := 0; Repeat n := 2 * n; S1 := 0; ban := ba / n; i := 1; Repeat S1 := S1 + Func(a + i * ban); i := i + 2; Until (i > n); Simp := h3 / n * (Fab + 4 * S1 + 2 * S2); eps := Abs((Simp - Simp0) / Simp); Simp0 := Simp; S2 := S2 + S1; writeln(n:3, Simp:15:7, eps:12:8); Until (eps <= epsMax); End.