Bisection Solver.Find Zero Method
Finds the zero of the specified function using the bisection method.
Definition
Namespace: Numerics.NET.EquationSolvers
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.1.4
C#
The approximated zero of the function.
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.1.4
public static double FindZero(
Func<double, double> function,
double lowerBound,
double upperBound,
double tolerance = 1.49011611938477E-08,
int maxIterations = 200
)
Parameters
- function Func<Double, Double>
- The function to find the zero for.
- lowerBound Double
- The lower bound of the interval.
- upperBound Double
- The upper bound of the interval.
- tolerance Double (Optional)
- The tolerance for the zero approximation.
- maxIterations Int32 (Optional)
- The maximum number of iterations.
Return Value
DoubleThe approximated zero of the function.
Exceptions
[!:InvalidIntervalException] | Thrown if the interval is invalid. |
Convergence | Thrown if the algorithm fails to converge. |