False Position Method Python Program (with Output)
www.codesansar.com › numerical-methods › falsePython Source Code: False Position (Regula Falsi) Method. # Defining Function def f( x): return x **3-5* x -9 # Implementing False Position Method def falsePosition( x0, x1, e): step = 1 print(' *** FALSE POSITION METHOD IMPLEMENTATION ***') condition = True while condition: x2 = x0 - ( x1 - x0) * f ( x0)/( f ( x1) - f ( x0) ) print('Iteration-%d, x2 = %0.6f and f (x2) = %0.6f' % ( step, x2, f ( x2))) if f ( x0) * f ( x2) < 0: x1 = x2 else: x0 = x2 step = step + 1 condition = abs( f ( x2