#!/usr/bin/perl
#

$startx = -5.0;
$endx = 5.0;
$dx = 0.01;
for ($x = $startx; $x < $endx; $x += $dx) {

  $y8 = cos(8*$x);
  $y9 = cos(9*$x);
  $y10 = cos(10*$x);
  $y11 = cos(11*$x);
  $y12 = cos(12*$x);

  $sum3 = $y9 + $y10 + $y11;

  $sum5 = $y8 + $y9 + $y10 + $y11 + $y12;


  $bigsum = 0.0;
  for ($k = 8.0; $k < 12.0; $k += 0.1) {
    $bigsum += cos($k*$x);
  }

  printf "%6.3f %6.3f %6.3f %6.3f   %6.3f %6.3f   %6.3f \n",
         $x, $y10, $y9, $y11,    $sum3, $sum5,   $bigsum;

}




exit 0;
