Method | Description | |
---|---|---|
solve ( callable $function, number $p₀, number $p₁, number $tol ) : number | Use the Secant Method to find the x which produces $f(x) = 0 by calculating the average change between our initial approximations and moving our approximations closer to the root. |
Method | Description | |
---|---|---|
validate ( number $p₀, number $p₁, number $tol ) | Verify the input arguments are valid for correct use of the secant method If the tolerance is less than zero, an Exception will be thrown. If $p₀ = $p₁, then we cannot run our loop because the slope with be undefined, so we throw an Exception. |