Can someone explain how the sophisticated rep system works?

How are reps calculated?