// PascalABC.NET 3.3.5, сборка 1636 от 10.03.2018
// Внимание! Если программа не работает, обновите версию!
begin
SeqGen(17,x->0.25*x-2).Tabulate(x->Cos(2*x)).Println(NewLine)
.Select(t->t[1]).Where(y->y<0).Average.Println<br>end.
Результат
(-2,-0.653643620863612)
(-1.75,-0.936456687290796)
(-1.5,-0.989992496600445)
(-1.25,-0.801143615546934)
(-1,-0.416146836547142)
(-0.75,0.0707372016677029)
(-0.5,0.54030230586814)
(-0.25,0.877582561890373)
(0,1)
(0.25,0.877582561890373)
(0.5,0.54030230586814)
(0.75,0.0707372016677029)
(1,-0.416146836547142)
(1.25,-0.801143615546934)
(1.5,-0.989992496600445)
(1.75,-0.936456687290796)
(2,-0.653643620863612)
-0.759476651369786