Numerical calculation of the classical deflection function