1

I have (with the help of this forum) managed to plot a bifurcation diagram with the following code:

F = (r # (1 - #) &)
S = (Subdivide[3.84, 3.855, 1200])

nestedlist = Table[{r, #} & /@ NestList[F, 0.00000000001, 1000][[-100 ;;]], {r, S}];
flatlist = Flatten[nestedlist, 1];

ListPlot[flatlist, PlotRange -> {.45, .55}

I'm trying to change my plot to 16-bit accuracy, and I was told to use the code:

to16bits[#_] := Floor[2^16*#]*2.^-16

How exactly can I integrate this into the code above? I've tried many different things but I only manage to get "Options expected (instead of Null) beyond position 1" or "infinity" as an output. Any help would be appreciated!

  • 1
    The correct syntax to define your function is to16bits[a_] := Floor[2^16*a] * 2.^-16. You can then map that function on flatlist by replacing to16bits /@ flatlist inside ListPlot. You may want to further familiarize yourself with basic Mathematica syntax before wading in any deeper, especially when you get into numerical minutiae. For instance, the rounding you are imposing is minimal and hard to see on a plot. – MarcoB Apr 28 '16 at 19:09
  • your syntax is wrong, # should be some symbol, eg to16bits[x_] := Floor[2^16*x]*2.^-16 I cant see what that will accomplish though, i.m sure that tiny roundoff is too small to discern on a plot. (Or do you mean to do that rounding at every iteration?) – george2079 Apr 28 '16 at 19:09
  • Ah! Perfect, thanks MarcoB! It worked...although I don't really see any discernable difference..which is sort of what I expected. Thanks! – The Physics Student Apr 28 '16 at 19:22

0 Answers0