RegulaFalsiSolver.FindZero Method

Finds the zero of the function using the Regula Falsi method.

Definition

Namespace: Numerics.NET.EquationSolvers
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.1.4
C#
public static double FindZero(
	Func<double, double> function,
	double lowerBound,
	double upperBound,
	double tolerance = 1.49011611938477E-08,
	int maxIterations = 200,
	RegulaFalsiVariant variant = RegulaFalsiVariant.Pegasus
)

Parameters

function  Func<Double, Double>
The target function.
lowerBound  Double
The lower bound of the interval.
upperBound  Double
The upper bound of the interval.
tolerance  Double  (Optional)
The tolerance for convergence.
maxIterations  Int32  (Optional)
The maximum number of iterations.
variant  RegulaFalsiVariant  (Optional)
Optional. The Regula Falsi variant to use. The default is the Pegasus algorithm.

Return Value

Double
The zero of the function.

Exceptions

ArgumentOutOfRangeException

The tolerance is less than zero.

InvalidOperationException Thrown if the interval is invalid.
ConvergenceExceptionThrown if the algorithm fails to converge.

See Also