Function Repository Resource:

# InverseFibonacci

Compute the inverse Fibonacci function

Contributed by: Carl Woll
 ResourceFunction["InverseFibonacci"][s] gives the inverse Fibonacci function obtained as the solution for z in s=Fibonacci[z].

## Details and Options

Mathematical function, suitable for both symbolic and numerical manipulation.
Explicit numerical values are given only for real values of s1.
For certain special arguments, ResourceFunction["InverseFibonacci"] automatically evaluates to exact values.
ResourceFunction["InverseFibonacci"] can be evaluated to arbitrary numerical precision.

## Examples

### Basic Examples (2)

Evaluate InverseFibonacci numerically:

 In[1]:=
 Out[1]=

Plot InverseFibonacci over a subset of the reals:

 In[2]:=
 Out[2]=

### Scope (6)

#### Numerical Evaluation (4)

Evaluate numerically to high precision:

 In[3]:=
 Out[3]=

The precision of the output tracks the precision of the input:

 In[4]:=
 Out[4]=

Evaluate InverseFibonacci efficiently at high precision:

 In[5]:=
 Out[5]=

InverseFibonacci threads elementwise over lists and arrays:

 In[6]:=
 Out[6]=

#### Specific Values (1)

Fibonacci integer inputs return integer results:

 In[7]:=
 Out[7]=

#### Differentiation (1)

InverseFibonacci can be differentiated:

 In[8]:=
 Out[8]=

Carl Woll

## Version History

• 1.0.0 – 18 October 2019

## Author Notes

I modified the error estimate (which was purely heuristic before). I don’t know where this goes, but here’s an idea of how the code works, and how I obtained the new error estimate. First FunctionExpand Fibonacci:

 In[1]:=

Then, an approximation to the inverse for large n:

 In[2]:=

Series expand:

 In[3]:=

So, the leading order approximation is the first term, which can be rewritten as Log[GoldenRatio,Sqrt[5]z]. The error (which should be larger than the actual error because Abs[Cos[x]]<1) is:

 In[4]:=

So, an approximation to the relative error is , implying that the precision of the answer is less than . Now, Root only needs an approximate root sufficiently close so that there is only 1 actual root in the vicinity of the approximate root. Hence, we can construct a Root object by specifying the needed relation, and using an approximate root. For large enough inputs, the above approximation is sufficient to enable Root to work.