#!/usr/bin/env python3

import numpy as np
import sys


def check(x: np.ndarray, y: np.ndarray) -> tuple:
    error = np.abs(x - y)
    diff1 = np.sum(error)/np.sum(np.abs(x))
    diff2 = np.sqrt(np.sum(error**2)/np.sum(x**2))

    max = np.max(error)
    mean = np.mean(error)
    return diff1, diff2, max, mean

if "__main__" == __name__:
    # read command line arguments
    x = np.loadtxt(sys.argv[1])
    y = np.loadtxt(sys.argv[2])
    # compute mean squared error
    diff1, diff2, max, mean = check(x, y)

    print("diff1: ", diff1)
    print("diff2: ", diff2)
    print("max error: ", max)
    print("mean error: ", mean)
