This document contains code to numerically find the root of a function using the bisection method. It takes in lower and upper bounds for the root as well as the number of iterations. It then iteratively calculates the midpoint between the bounds, evaluates the function there, and narrows the bounds based on the sign of the function to hone in on the root. The root and error are printed at each iteration until reaching the specified number or iterations or finding the root within a given tolerance.
This document contains code to numerically find the root of a function using the bisection method. It takes in lower and upper bounds for the root as well as the number of iterations. It then iteratively calculates the midpoint between the bounds, evaluates the function there, and narrows the bounds based on the sign of the function to hone in on the root. The root and error are printed at each iteration until reaching the specified number or iterations or finding the root within a given tolerance.
This document contains code to numerically find the root of a function using the bisection method. It takes in lower and upper bounds for the root as well as the number of iterations. It then iteratively calculates the midpoint between the bounds, evaluates the function there, and narrows the bounds based on the sign of the function to hone in on the root. The root and error are printed at each iteration until reaching the specified number or iterations or finding the root within a given tolerance.