Celeritas
0.5.0-56+6b053cd
|
Perform Regula Falsi iterations given a root function func and tolerance tol . 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. | |
Perform Regula Falsi iterations given a root function func and tolerance tol .
Using a left and right bound a Regula Falsi approximates the root as:
\[ root = (left * func(right) - right * func(left)) / (func(right) - func(left)) \]
Then value of func at the root is calculated compared to values of func at the bounds. The root is then used update the bounds based on the sign of func(root) and whether it matches the sign of func(left) or func(right) . Performing this update of the bounds allows for the iteration on root, using the convergence criteria based on func(root) proximity to 0.