Analytical benchmarks for precision particle tracking in electric and magnetic rings