1.A nonlinear algebraic equation f (x) = 0 may also be solved by Halley’s method,7 given as: xn+1 = xn − 2f (xn)f
(xn) 2f
(xn)2 − f (xn)f
(xn) , n = 0, 1,… , with some starting value x0.
a) Implement Halley’s method as a function Halley. Place the function in a module that has a test block, and test the function by solving x2−9 = 0, using x0 = 1000 as your initial guess. b) Compared to Newton’s method, more computations per iteration are needed with Halley’s method, but a convergence rate of 3 may be achieved close to the root. You are now supposed to extend your module with a function compute_rates_decimal, which computes the convergence rates achieved with your implementation of Halley (for the given problem). The implementation of compute_rates_decimal should involve the decimal module (you search for the right documentation!), to better handle very small errors that may enter the rate computations. For comparison, you should also compute the rates without using the decimal module. Test and compare with several parameter values.