I have reduced an error in my program to this line of code:
FindRoot[Nest[# (1 - #) k &, 1/2, 2^4] - 1/2, {k, 3.5}]
It works for $2^1, 2^2, 2^3, 2^4,$ but then for $2^n, n\ge5,$ it stops. Nothing happens. Mathematica is "thinking" forever. FindRoot
is not doing a single iteration.
Why does this happen?
I have some ideas of my own, none of which have gotten me anywhere:
The values are very small, is it a precision problem?
Maybe I'm not using
Nest
properly?
Expand
your expression andChop
the small parts at every nesting:Nest[Chop[Expand[# (1 - #) k]] &, 0.5, 2^4] - 0.5
$\endgroup$