Accuracy assessment of numerical tracing of three-dimensional magnetic field lines in tokamaks with analytical invariants