Solves the given equation using the Newton-Raphson method by iteratively refining an initial guess. The method attempts to find a root of the function f(x) = 0 within a specified threshold of accuracy. If the solution does not converge within the given number of tries, it returns a failure.
Solves the given equation using the Newton-Raphson method by iteratively refining an initial guess. The method attempts to find a root of the function f(x) = 0 within a specified threshold of accuracy. If the solution does not converge within the given number of tries, it returns a failure.
Value parameters
initial
The initial guess for the root of the equation.
threshold
The convergence threshold, representing the acceptable difference between f(x) and 0.
tries
The maximum number of iterations allowed for convergence.
Attributes
Returns
A Try[Double] containing the root if converged successfully, or a Failure if the method fails.