Question: Converting mathematica procedure to a maple 12 procedure tia sal2

Greetings All

I have a module written in mathematica that works but would prefer to use it as a maple 12 procedure.  I tired the MMA in maple but it doesn't convert programs.  Can someone please help out.

 

prevFib[x_] := Module[{m, n, x2, x3}, x2 = SetPrecision[x, 100];
  If[x > 10^15, N[x/GoldenRatio],
   m = (n /.
       FindRoot[Fibonacci[n] - x2 == 0, {n, 100},
        WorkingPrecision -> 100]) - 1;
   If[Abs[m - Round[m]] < 10^-10, Fibonacci[Round[m]],
    N[Fibonacci[m]]]]]
x3 = 40
ans = prevFib[x3]
x3/ans

 

 

TIA

Sal2

Please Wait...