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

double sum(double x, double eps)
{
    double s = x, t = x;
    x *= x;
    for(int n = 1; fabs(t) > eps; ++n)
    {
        s += t *= -x/(2.*n*(2.*n+1));
    }
    return s;
}

int main(int argc, const char * argv[])
{
    for(double x = 0.0; x < 1.0; x += 0.1)
    {
        printf("%3.1lf  %12.9lf   %12.9lf\n",
               x,sin(x),sum(x,1e-7));
    }
}
