function [x, itr] = newtonraphson2(f, a, b, acc)
f1 = @(x) (imag(f(x + 1i*10^-20)) / 10^-20);
x = (a + b) / 2;

itr = 0;
disp(["itr", "x", "y"])
while true
    itr = itr + 1;
    
    x = x - f(x)/f1(x);
    y = f(x);
    disp([itr, x, y])

    if (abs(y) < acc)
        break;
    end
end