Secant constructor
const
Secant({})
Instantiates a new object to find the root of an equation by using the Secant method. Ideally, the two guesses should be close to the root.
function
: the function f(x)- firstGuess: the first interval in which evaluate f(a)
- secondGuess: the second interval in which evaluate f(b)
tolerance
: how accurate the algorithm has to bemaxSteps
: how many iterations at most the algorithm has to do
Implementation
const Secant({
required String function,
required this.firstGuess,
required this.secondGuess,
double tolerance = 1.0e-10,
int maxSteps = 15,
}) : super(
function: function,
tolerance: tolerance,
maxSteps: maxSteps,
);