#include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int main()
{
float k(float x);
int a = 1;
int b = 2;
int c = 3;
int d = 4;
float x = 1;
float y;
float t;
y= (a * pow(x, 3) + b * pow(x, 2) + c * pow(x, 1) + d);
while (fabs(y) >=1e-3)
{ t = y - k(x);
x = (-t) / k(x);
y = (a * pow(x, 3) + b * pow(x, 2) + c*pow(x,1) + d);
}
cout << setiosflags(ios::fixed) << setprecision(4) << x;
return 0;
}
float k(float x)
{
float k;
k = 3 * pow(x, 2) + 4 * pow(x, 1) + 3;
return k;
}