为什么下面的代码跑不出来,大致内容是用牛顿迭代法求出x3+2x2+3x+4=0的在1附近的根


#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;

}