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

float Series(float x, unsigned int N)
{
    x = fmod(x,2*3.1415925358979323846);
    float term = x*x*x;
    x *= -x;
    float sum = term, tr = 8;

    for(int n = 2; n <= N; ++n)
    {
        term /= tr;
        tr = (tr+1)*9-1;
        term *= x*tr/(2*n*(2*n+1));
        sum += term;
    }
    return sum;
}


int main(int argc, const char * argv[])
{
    for(float x = 0.1; x < 1500; x = x*2)
    {
        printf("%f  %f\n",Series(x,30),sin(x)*sin(x)*sin(x));
    }
}
