python 二分法求解函数

Similar to the Bisection algorithm, the False Position Algorithm, also known as Regula Falsi, utilizes a bracketing approach. But unlike the Bisection Algorithm, it does not utilize a brute-force approach of dividing the problem space into half for every iteration. Instead, this algorithm iteratively draws a straight line from f(start) to f(end) and compares the intercept with the target value.

Write a function for Regula Falsi algorithm to find a rood for a given function 𝑓.

f = lambda x: x3 + x2 + 1
start = -2
end = 2

试位法(False position)求根(python,数值积分)_深渊潜航的博客-CSDN博客_试位法