#include <stdio.h>
#include <math.h>

#define PI 3.14159265358979323844
#define DELTAX 0.1

int main() {
  FILE * fp = fopen( "daten.txt", "w" );

  double x, taylor;
  
  for ( x=-PI; x<=PI; x+=DELTAX ) {
    taylor = ( sin( x + DELTAX ) - sin( x ) ) / DELTAX;
    fprintf( fp, "%lg %lg %lg %lg\n", x, cos( x ), taylor, cos(x)-taylor );
  }
 
  fclose( fp );
  return 0;
}

