Surface gravity waves from direct numerical simulations of the Euler equations: A comparison with second-order theory