#include #include #include typedef double complex Complex; Complex f(Complex x){ return x*x+x+1; } Complex df(Complex x){ return 2*x+1; } Complex newton(Complex x){ return x-f(x)/df(x); } int main(){ Complex x=0.5-I; for(int i=1;i<10;i++){ x=newton(x); printf("x_%d = %.15g+i*%.15g\n",i,creal(x),cimag(x)); } return 0; }