For the records, you are partially correct, it is not "OR" but rather both.
First it is a limit of 5.7 joules, and if it is over this, then they chrony it. The calculation is done with measurements taken at muzzle.
So correctly... 5.7 joules (or more) and over 500 fps >>> is considered a fire arm.