def check_correctness(pin, pout, v, dt, n, integrate_0, integrate_1):
    pin_ref = np.zeros_like(pin)
    pout_ref = np.zeros_like(pout)
    v_ref = np.zeros_like(v)
    randomize_bodies(pin_ref, v_ref, 1.54, 8.0, n)
    integrate_0(pout_ref, pin, np.copy(v), dt, n)
    integrate_1(pout,     pin, np.copy(v), dt, n)
 
    errt = 0
    errmax = 0

    errs = np.fabs(pout_ref - pout).reshape(4 * n)
    errt = errs.sum()
    errmax = errs.max()

    print("Maximum error: %0.4f -- Total error: %0.4f" % (errmax, errt))
dataset/ETHPy150Open numba/numba/examples/nbody/nbody_modified_by_MarkHarris.py/check_correctness/original