Solve for the rotary frequency index at a chosen rotation count
At index i, the unscaled angular frequency is base^(−2 i/dim). Over orig_max positions it completes orig_max*base^(−2 i/dim)/(2π) rotations. Setting that count equal to rot and solving logarithmically for i gives the displayed correction coordinate. The caller rounds and clamps coordinates to form…