Off[General::"spell"];
Off[General::"spell1"];

Secant-method "secantFindRoot" with Options

Options[secantFindRoot]={Verbosity ->  False,MaxIterations ->  100,Precision->10^(-90),WorkingPrecision ->  90 }

\(secantFindRoot[f_, {var_, x0_, x1_}, opts___] := 
      Module[
{xk, xk1, k, d, β, dk, dk1, 
          wrkpre}, 

 (*\ 
          Constants\ *) 
β = \(1\/2\) \((1 + \@5)\); \  (*\ Order\ of\ secant\ method, \ 
          incidentally\ the\ Golden\ Ratio\ *) 

 (*\ 
          Initialisation\ *) 
max = \((\(MaxIterations /. 
                Flatten[{opts}]\) /. 
              Options[secantFindRoot])\); 
wrkpre = \((\(WorkingPrecision /. Flatten[{opts}]\) /. 
              Options[secantFindRoot])\); 
xk\  = \ 
          SetPrecision[x0, wrkpre]; \  (*\ 
          x\_k\  == \ Leftmost\ start\ guess, \ 
          treated\ as\ numeric\ *) 
xk1\  = \ 
          SetPrecision[x1, wrkpre]; \  (*\ 
          x\_\(k - 1\)\  == \ Rightmost\ start\ guess, \ 
          treated\ as\ numeric\ *) 

 (*\ 
          Print\ header\ *) 
If[\(Verbosity /. 
              Flatten[{opts}]\) /. Options[secantFindRoot], 
          Print["  k", "	", \*"" (x^k)"", "					", \*""(d^k)=(x^k)-(x^(k - 1))"", "			", \*"" ((||(d^k)||)/(((||((d^(k - 1)))||))^β))""]]; 
If[\(Verbosity /. Flatten[{opts}]\) /. 
            Options[secantFindRoot], 
          Print["--------------------------------------------------------------------"]]; 

For[k = 1, 
          k < max\  + 1, \(k++\), 
 (*\ 
            Calculate\ the\ change, \ 
            by\ the\ Secant\ Method\ *) 
d = \(-SetPrecision[\((f /. {var -> \ xk})\), wrkpre]\)\ *\((\ 
                SetPrecision[xk - xk1, 
                    wrkpre]/\((SetPrecision[\((f /. {var -> \ xk})\), 
                        wrkpre]\  - 
                      SetPrecision[\((\ f /. {var -> \ xk1})\), 
                        wrkpre])\))\); 

 (*\ save\ old\ values\ *) 
xk1\  = \ 
            xk; 
dk1 = 
            dk; 

 (*\ 
            new\ x - value\ *) 
xk = 
            xk\  + \ d; 

 (*\ 
            change\ between\ values\ *) 
dk = 
            xk - xk1; 

If[\(Verbosity /. 
                Flatten[{opts}]\) /. 
              Options[secantFindRoot], 
\(Print[
                PaddedForm[k, Length[IntegerDigits[max]]], "	", 
                pretty[xk], "	", pretty[dk], "	", 
                pretty[SetPrecision[Abs[dk]\/Abs[dk1]\^β, 
                    wrkpre]]];\)
]; 

If[
            dk\  == 
              0, 
If[\(Verbosity /. Flatten[{opts}]\) /. 
                Options[secantFindRoot], 
Print[
                k, \ "'th Iteration did not provide a new best guess - Maximum machine precision reached, terminating..."]]; 
Break[]
]; 

If[\(Abs[dk] < \ Precision /. Flatten[{opts}]\) /. 
              Options[secantFindRoot], 
If[\(Verbosity /. 
                  Flatten[{opts}]\) /. 
                Options[
                  secantFindRoot], 
Print["Desired precision reached, terminating..."]]; 
Break[]
];
]; 
{var -> \ 
            xk}
]\)