This is the repository for scratch of Numerical Analysis with MATLAB.
main algorithm
while(1)
xrold = xr;
xr = (xl + xu) / 2;
test = func(xl) * func(xr);
if test < 0
xu = xr;
elseif test > 0
xl = xr;
main algorithm
while(1)
xrold = xr;
fl = func(xl);
fu = func(xu);
xr = xu - fu * (xl - xu) / (fl - fu);
test = fl * func(xr);
if test < 0
xu = xr;
elseif test > 0
xl = xr;
main algorithm
while(1)
x1 = u;
error = abs(x1 - x0);
x0 = x1;
u = func(x0);
main algorithm
while(1)
x1 = x0 - u / v;
error = abs(x1 - x0);
x0 = x1;
u = func(x0);
v = df(x0);
main algorithm
while(1)
x = x1 - v * (x1 - x0) / (v - u);
x0 = x1;
u = v;
x1 = x;
v = func(x1);
error = abs(x1 - x0);