#include double funcos(double e, double x)
{
\x09int i, j=0, k=0,count=0;
\x09long int sum;
\x09double s=0, n=1;
\x09
\x09while (fabs(x)>3.141592)
\x09{
\x09\x09x=fabs(x)-3.141592;
\x09\x09count++;
\x09}
\x09
\x09while (fabs(n)>e)
\x09{
\x09\x09sum=1;
\x09\x09if(j==0)
\x09\x09{
\x09\x09\x09sum=1;
\x09\x09}
\x09\x09else
\x09\x09{
\x09\x09\x09for (i=1; i<=j; i++)
\x09\x09\x09{
\x09\x09\x09\x09sum=sum*i;
\x09\x09\x09}
\x09\x09}
\x09\x09if (sum<0)
\x09\x09{
\x09\x09\x09if (count%2!=0)
\x09\x09\x09{
\x09\x09\x09\x09s=s*-1;
\x09\x09\x09}
\x09\x09\x09break;
\x09\x09}
\x09\x09n=pow(x, j)/sum;
\x09\x09n=n*pow(-1, k++);
\x09\x09s+=n;
\x09\x09j+=2;
\x09}
\x09return s;
}
int main(int argc, char *argv[])
{
\x09double e, x, s;
\x09scanf("%lf%lf", &e, &x);
\x09s=funcos(e, x);
\x09printf("cos%lf=%lf\n", x, s);
\x09printf("%lf\n", cos(x));
\x09return 0;
}