def METHOD_NAME(file_name1, file_name2):
    if file_name1.endswith('\n'):
        file_name1 = file_name1[:-1]
    if file_name2.endswith('\n'):
        file_name2 = file_name2[:-1]
    if not os.path.isfile(file_name1):
        print ('error:file:%s. doesn\'t exist.' % file_name1)
        return -1
    if not os.path.isfile(file_name2):
        print ('error:file:%s. doesn\'t exist.' % file_name2)
        return -1
    print ('comparing %s and %s' % (file_name1, file_name2))
    max_diff = 0.0
    max_diff_line_number = -1
    with open(file_name1) as file1:
        with open(file_name2) as file2:
            lines1 = file1.readlines()
            lines2 = file2.readlines()
            #strip invalid lines
            valid_lines1 = remove_invalid_number(lines1)
            valid_lines2 = remove_invalid_number(lines2)
        if len(valid_lines1) != len(valid_lines2):
            print ('the number of lines is not equal in file %s and %s' % (file_name1, file_name2))
            print ( str(len(valid_lines1))+ " vs " + str(len(valid_lines2)))
            return -1
        # file_name1 and file_name2 have same number of lines, let's compare these two files
        for i in range (0, len(lines1)):
            #print 'processing line %d of %d in file %s and %s' % (i+1, len(lines1), file_name1, file_name2)
                is_line1_valid = is_number(lines1[i])
                is_line2_valid = is_number(lines2[i])
                if not is_line1_valid and not is_line2_valid:
                    continue
                if not is_line1_valid:
                   print ("error: line %d in file %s is a NOT valid number while %d in file %s is a valid number" %
                           (i+1, file_name1, i+1, file_name2))
                   return -1
                if not is_line2_valid:
                   print ("error: line %d in file %s is a valid number while %d in file %s is NOT a valid number" %
                           (i+1, file_name1, i+1, file_name2))
                   return -1
                number1 = float(lines1[i])
                number2 = float(lines2[i])
                diff = number1 - number2
                if diff < 0:
                    diff = -1*diff
                if diff >= error_up_limits:
                    print ('%s and %s differ %f at line %d with %f and %f' % (file_name1, file_name2, diff, i+1,
                        number1, number2))
                    return -1
                if diff > max_diff:
                    max_diff = diff
                    max_diff_line_number = i+1
    if(max_diff_line_number == -1):
        print ('max_diff is 0.')
    else:
        print ('max_diff is %f at line %d' % (max_diff, max_diff_line_number))
    return 0