#include <iostream>
#include <cmath>
using namespace std;
int main()
{
float x, f_x, df_x; // Metodo Newton-Rapson
x=0;
do{
f_x = x*x*x - 5*x*x + 14*x - 2;
df_x = 3*x*x - 10*x + 14;
x = x-f_x/df_x;
cout << x << endl;
}while( abs(f_x) >= pow(10,-12) );
cout << "raiz: " << x << endl;
return 0;
}