Kernel: Octave
In [0]:
In [1]:
current approx: 1.321237e+00
At Iter [1]: the rel. error is:-5.433378e-03
current approx: 1.314107e+00
At Iter [2]: the rel. error is:-8.131713e-06
current approx: 1.314097e+00
At Iter [3]: the rel. error is:-1.821527e-11
current approx: 1.314097e+00
At Iter [4]: the rel. error is:0.000000e+00
the approximated value of x is: 1.314097e+00
In [12]:
Initial approx. err:5.000000e-01 and input tolerance: 1.000000e-08
x_bar [ 1 ] = 1.250000e+00 and error = 2.500000e-01
x_bar [ 2 ] = 1.375000e+00 and error = 1.250000e-01
x_bar [ 3 ] = 1.312500e+00 and error = 6.250000e-02
x_bar [ 4 ] = 1.343750e+00 and error = 3.125000e-02
x_bar [ 5 ] = 1.328125e+00 and error = 1.562500e-02
x_bar [ 6 ] = 1.320312e+00 and error = 7.812500e-03
x_bar [ 7 ] = 1.316406e+00 and error = 3.906250e-03
x_bar [ 8 ] = 1.314453e+00 and error = 1.953125e-03
x_bar [ 9 ] = 1.313477e+00 and error = 9.765625e-04
x_bar [ 10 ] = 1.313965e+00 and error = 4.882812e-04
x_bar [ 11 ] = 1.314209e+00 and error = 2.441406e-04
x_bar [ 12 ] = 1.314087e+00 and error = 1.220703e-04
x_bar [ 13 ] = 1.314148e+00 and error = 6.103516e-05
x_bar [ 14 ] = 1.314117e+00 and error = 3.051758e-05
x_bar [ 15 ] = 1.314102e+00 and error = 1.525879e-05
ans = 1.3141
In [5]:
fun = @f
root = 1.3141
current approx: 1.270772e+00
At Iter [1]: the rel. error is:3.296944e-02
current approx: 1.316883e+00
At Iter [2]: the rel. error is:-2.120151e-03
current approx: 1.314072e+00
At Iter [3]: the rel. error is:1.925183e-05
current approx: 1.314097e+00
At Iter [4]: the rel. error is:1.124360e-08
current approx: 1.314097e+00
At Iter [5]: the rel. error is:-5.964686e-14
current approx: 1.314097e+00
At Iter [6]: the rel. error is:0.000000e+00
the approximated value of a is: 1.314097e+00