#include <stdio.h>

typedef double real;

real sine( real x ){
   real s1, s=x, r=x, n=2;
   x *= x;
   do{   s1 = s;
      s += r=-r*x/(n*n+n);
      n += 2;
   } while( s != s1 );
   return s;}
      
int main() {
   
   real a=0, b= 1;
   volatile real ostatniX, x, h;
   int n, i;
   
   for( n=10; n<=1000000000; n *= 10 ) {
      h=(b-a)/n;
      x=a;
      for( i=0; i<=n; i++ ) {
         // printf("%0.15f %0.15f %f0.15\n" ,    x, sine(x), sine(a + i*h ) );
         ostatniX = x;
         x += h; }
      x = ostatniX;
      printf("%12d  %0.15f %0.15f %0.15f\n" , n, x, sine(x), sine(a + n*h ));
   }
 
   return 0;
}
}
