Running your code millions of times…
Output with the cast:
[120079438] hit perihelion
[0] hit aphelion
orbit 0.000000
dot 1.000000
total 45.734582
angle 45.734582
delta 42.936958
avg 45.734582
[360238317] hit perihelion
[1] hit aphelion
orbit 0.000000
dot 1.000000
total 90.843000
angle 45.108419
delta 42.936958
avg 45.421500
[600397195] hit perihelion
[2] hit aphelion
orbit 0.000000
dot 1.000000
total 140.822554
angle 49.979553
delta 42.936958
avg 46.940851
[840556073] hit perihelion
[3] hit aphelion
orbit 0.000000
dot 1.000000
total 186.503801
angle 45.681247
delta 42.936958
avg 46.625950
[1080714949] hit perihelion
[4] hit aphelion
orbit 0.000000
dot 1.000000
total 231.594201
angle 45.090401
delta 42.936958
avg 46.318840
[1320873825] hit perihelion
[5] hit aphelion
orbit 0.000000
dot 1.000000
total 281.541227
angle 49.947025
delta 42.936958
avg 46.923538
[1561032701] hit perihelion
[6] hit aphelion
orbit 0.000000
dot 1.000000
total 330.816692
angle 49.275466
delta 42.936958
avg 47.259527
[1801191575] hit perihelion
[7] hit aphelion
orbit 0.000000
dot 1.000000
total 375.780764
angle 44.964071
delta 42.936958
avg 46.972595
[2041350450] hit perihelion
Output with masked bits:
[120079431] hit perihelion
[0] hit aphelion
orbit 0.000000
dot 1.000000
total 3.605790
angle 3.605790
delta 42.936958
avg 3.605790
[360238296] hit perihelion
[1] hit aphelion
orbit 0.000000
dot 1.000000
total 12.062117
angle 8.456327
delta 42.936958
avg 6.031059
[600397161] hit perihelion
[2] hit aphelion
orbit 0.000000
dot 1.000000
total 16.093513
angle 4.031396
delta 42.936958
avg 5.364504
[840556023] hit perihelion
[3] hit aphelion
orbit 0.000000
dot 1.000000
total 25.017388
angle 8.923875
delta 42.936958
avg 6.254347
[1080714886] hit perihelion
[4] hit aphelion
orbit 0.000000
dot 1.000000
total 31.391584
angle 6.374196
delta 42.936958
avg 6.278317
[1320873748] hit perihelion
[5] hit aphelion
orbit 0.000000
dot 1.000000
total 39.250222
angle 7.858637
delta 42.936958
avg 6.541704
[1561032609] hit perihelion
[6] hit aphelion
orbit 0.000000
dot 1.000000
total 48.443218
angle 9.192997
delta 42.936958
avg 6.920460
[1801191471] hit perihelion
[7] hit aphelion
orbit 0.000000
dot 1.000000
total 51.565924
angle 3.122706
delta 42.936958
avg 6.445741
[2041350330] hit perihelion
[8] hit aphelion
orbit 0.000000
dot 1.000000
total 59.320469
angle 7.754545
delta 42.936958
avg 6.591163
[-2013458106] hit perihelion
[9] hit aphelion
orbit 0.000000
dot 1.000000
total 69.986539
angle 10.666071
delta 42.936958
avg 6.998654
Seems the same!
Running without without messing on beta at all:
[120079432] hit perihelion
[0] hit aphelion
orbit 0.000000
dot 1.000000
total 12.684491
angle 12.684491
delta 42.936958
avg 12.684491
[360238298] hit perihelion
[1] hit aphelion
orbit 0.000000
dot 1.000000
total 26.591345
angle 13.906855
delta 42.936958
avg 13.295673
[600397162] hit perihelion
[2] hit aphelion
orbit 0.000000
dot 1.000000
total 39.901058
angle 13.309713
delta 42.936958
avg 13.300353
[840556027] hit perihelion
[3] hit aphelion
orbit 0.000000
dot 1.000000
total 54.380449
angle 14.479391
delta 42.936958
avg 13.595112
[1080714890] hit perihelion
[4] hit aphelion
orbit 0.000000
dot 1.000000
total 70.045937
angle 15.665487
delta 42.936958
avg 14.009187
[1320873753] hit perihelion
[5] hit aphelion
orbit 0.000000
dot 1.000000
total 85.183814
angle 15.137878
delta 42.936958
avg 14.197302
[1561032615] hit perihelion
[6] hit aphelion
orbit 0.000000
dot 1.000000
total 97.804080
angle 12.620265
delta 42.936958
avg 13.972011
[1801191477] hit perihelion
[7] hit aphelion
orbit 0.000000
dot 1.000000
total 113.365476
angle 15.561397
delta 42.936958
avg 14.170685
Same results as well.
Comparing numbers for delta on [7], all methods give the same result of 42.936958, 42.936958, 42.936958
Is this any surprise to you? What do i miss?
(I have accidentally swapped framecount ([ ]) and orbitcount for my output, so those printed numbers are garbage, but gave a nice index to compare)