Celeritas 0.7.0-dev.127+develop.e63889793
|
Find a local root using the Regula Falsi algorithm. More...
#include <RegulaFalsiRootFinder.hh>
Public Member Functions | |
CELER_FUNCTION | RegulaFalsiRootFinder (F &&func, real_type tol) |
Construct from function. | |
CELER_FUNCTION real_type | operator() (real_type left, real_type right) |
Solve for a root between the two points. | |
Find a local root using the Regula Falsi algorithm.
Using left bound \( x_l \) and right bound \( x_r \), Regula Falsi approximates the root x' as
\[ x' = \frac{x_l * f(x_r) - x_r * f(x_l)}{f(x_r) f(x_l)} \]
Then value of f at the root is calculated compared to values of f at the bounds. The root is then used to update the bounds based on the sign of \( f(x') \) and whether it matches the sign of \( f(x_l) \) or \( f(x_r) \) .