#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

double Func(double x, double eps, double term = 0, int n = 0)
{
    if (n == 0) term = x*x*x;
    else
    {
        if (abs(term) < eps) return term;
        term *= -x*x/(2*n*(2*n-1));
    }
    return term + Func(x,eps,term,n+1);
}

int main(int argc, char * argv[])
{
    for(double x = 0; x < 1; x += 0.1)
        cout << setw(5) << x << setw(15) << Func(x,1e-8) << setw(15)  << x*x*x*cos(x) << endl;
}
