PowerShell, 8080 74 bytes
param($n)for($a=1$a,0;$a[0]$b=1,0;$a-lt$n;$a=lt$n;$a,$b=$b,($a[0]+$a[1]$a+$b)+$a){}$a[+($a[0]$b,$a)[($b-$n-gt$n-$a[1]$a)]
(Try it online! temporarily unresponsive)
Iterative solution. Takes input $n
, sets $a,$b
to be (1,0)
, and prepends ontothen loops with Fibonacci until $a
the next Fibonacci number until we reach a numberis larger than the input. At that point, we index into ($b,$a)
based on Boolean of whether the difference between the first element and $n
is greater than between $n
and the second element. That's left on the pipeline, output is implicit.