keisoku

False Position Method (Regula Falsi) Solver

A numerical tool that solves your equation f(x)=0 with the false position method (linear interpolation, regula falsi). Enter an interval and a tolerance to get the approximate root, f(root), the iteration count, and a table and chart of the iteration process.

Input

Examples: x^2 - 2, cos(x) - x, exp(x) - 3, sin(x) - 0.5. You can use sin/cos/exp/log/sqrt, the constants pi and e, and ^ for powers.

iters

Note: the false position method requires f(x) to have opposite signs at the left endpoint a and the right endpoint b.

Result

Approximate root x

1.414213552

Converged within the tolerance 1.000000e-7

f(root)

-3.034065e-8

Iterations

11 iters

Final error |f(x)|

3.034065e-8


-0.30.220.741.261.782.33.82-2.530x≈1.4142

Iteration history

nabc (interpolated point)f(c)
1021-1
2121.3333333-0.222222
31.333333321.4-0.04
41.421.4117647-0.00692042
51.411764721.4137931-0.00118906
61.413793121.4141414-0.000204061
71.414141421.4142012-3.501278e-5
81.414201221.4142114-6.007287e-6
91.414211421.4142132-1.030689e-6
101.414213221.4142135-1.768383e-7
111.414213521.4142136-3.034065e-8

Note: c is the x-intercept of the line through the endpoints (a, f(a)) and (b, f(b)). Depending on the sign of f(c), either a or b is replaced by c, narrowing the interval.

How it works

  • The false position method takes the x-intercept of the line through the endpoints (a, f(a)) and (b, f(b)) of the interval [a, b] as the next approximation c, then narrows the interval according to the sign of f(c) to approach the root of f(x)=0.
  • Before you start, choose an interval where f(x) has opposite signs at the left endpoint a and the right endpoint b. If the signs are the same, the root cannot be bracketed and the calculation cannot run.
  • The tolerance is used as an upper bound on |f(x)|. Smaller values increase the precision of the root but tend to require more iterations. If the error is still large after the maximum number of iterations, review the interval or the expression.
  • For f(x) you can use the four arithmetic operations and ^ (power), parentheses, functions such as sin, cos, tan, exp, log, and sqrt, the constant pi, and the base of the natural logarithm e. Examples: x^2 - 2, cos(x) - x, exp(x) - 3.
  • Whereas the bisection method always halves the interval, the false position method uses the slope of the function to pick the intercept, so it often converges in fewer iterations. On the other hand, convergence can slow down when only one endpoint keeps being updated.
  • Use the iteration table to follow the changes in a, b, c, and f(c), and the chart to check the shape of f(x) and the position of the computed approximate root. It is a handy aid for study and for double-checking your work.