<commit_before>var test = require('./test');

var values = {
    x: 2.1,
    y: 3.3,
    z: 1,
    a: 7.42
};

/* CORE tests*/
var cases = {
    '((((((1+1))))))': {
        expected: '2',
        number_value: 2
    },
    '((((((1+1))+4)))+3)': {
        expected: '9',
        number_value: 9
    },
    '1+1': {
        expected: '2',
        number_value: 2
    },
    '4^2': {
        expected: '16',
        number_value: 16
    },
    '2*-4': {
        expected: '-8',
        number_value: -8
    },
    '2+(3/4)': {
        expected: '11/4',
        number_value: 2.75
    },
    '2/3+2/3': {
        expected: '4/3',
        number_value: 1.3333333333333333
    },
    'x+x': {
        expected: '2*x',
        number_value: 4.2
    },
    'x+1': {
        expected: '1+x',
        number_value: 3.1
    },
    'x+y': {
        expected: 'x+y',
        number_value: 5.2
    },
    '-9-x+y-11': {
        expected: '-20-x+y',
        number_value: -18.8 
    },
    '(x+1)+(1+x)': {
        expected: '2*(1+x)',
        number_value: 6.2
    },
    '9+(x+1)-(1+x)': {
        expected: '9',
        number_value: 9
    },
    '0-x-2*x+6': {
        expected: '-3*x+6',
        number_value: -0.3
    },
    '(x+y)+(a+x)': {
        expected: '2*x+a+y',
        number_value: 14.92
    },
    '7*(x+y)+2*(a+x)': { //
        expected: '2*a+7*y+9*x',
        number_value: 56.84,
        note: 'This test is a huge compromise. Do I expand as much as possible or '+
                     'do I simplify only at the highest level?'
    },
    '(x+x^2)+x': {
        expected: '2*x+x^2',
        number_value: 8.61
    },
    '(x+1)+4': {
        expected: '5+x',
        number_value: 7.1
    },
    'x+x+1+x': {
        expected: '1+3*x',
        number_value: 7.3
    },
    '(x+1)+(8+y)': {
        expected: '9+x+y',
        number_value: 14.4
    },
    '(x+1)+(a+y)': {
        expected: '1+a+x+y',
        number_value: 13.82
    },
    '(x+x^2)+(x^3+x)': {
        expected: '2*x+x^2+x^3',
        number_value: 17.871
    },
    '3*(x+x^2)+5*(x^3+x)': {
        expected: '3*x^2+5*x^3+8*x',
        number_value: 76.335
    },
    'x^y+x^y': {
        expected: '2*x^y',
        number_value: 23.13948390048293
    },
    //power
    '2^(1/2)': {
        expected: 'sqrt(2)',
        number_value: 23.13948390048293
    },
    '(2/5)^(1/2)': {
        expected: 'sqrt(2)*sqrt(5)^(-1)',
        number_value: 0.6324555320336759
    },
    '2^(1/2)+sqrt(2)': {
        expected: '2*sqrt(2)',
        number_value: 2.8284271247461903
    },
    'sqrt(2)*sqrt(2)': {
        expected: '2',
        number_value: 2
    },
    'x*x': {
        expected: 'x^2',
        number_value: 4.41
    },
    '-x*x': {
        expected: '-x^2',
        number_value: -4.41
    },<commit_msg>added tests for division negative fractions<commit_after>var test = require('./test');

var values = {
    x: 2.1,
    y: 3.3,
    z: 1,
    a: 7.42
};

/* CORE tests*/
var cases = {
    '((((((1+1))))))': {
        expected: '2',
        number_value: 2
    },
    '((((((1+1))+4)))+3)': {
        expected: '9',
        number_value: 9
    },
    '1+1': {
        expected: '2',
        number_value: 2
    },
    '4^2': {
        expected: '16',
        number_value: 16
    },
    '2*-4': {
        expected: '-8',
        number_value: -8
    },
    '2+(3/4)': {
        expected: '11/4',
        number_value: 2.75
    },
    '2/3+2/3': {
        expected: '4/3',
        number_value: 1.3333333333333333
    },
    'x+x': {
        expected: '2*x',
        number_value: 4.2
    },
    'x+1': {
        expected: '1+x',
        number_value: 3.1
    },
    'x+y': {
        expected: 'x+y',
        number_value: 5.2
    },
    '-9-x+y-11': {
        expected: '-20-x+y',
        number_value: -18.8 
    },
    '(x+1)+(1+x)': {
        expected: '2*(1+x)',
        number_value: 6.2
    },
    '9+(x+1)-(1+x)': {
        expected: '9',
        number_value: 9
    },
    '0-x-2*x+6': {
        expected: '-3*x+6',
        number_value: -0.3
    },
    '(x+y)+(a+x)': {
        expected: '2*x+a+y',
        number_value: 14.92
    },
    '7*(x+y)+2*(a+x)': { //
        expected: '2*a+7*y+9*x',
        number_value: 56.84,
        note: 'This test is a huge compromise. Do I expand as much as possible or '+
                     'do I simplify only at the highest level?'
    },
    '(x+x^2)+x': {
        expected: '2*x+x^2',
        number_value: 8.61
    },
    '(x+1)+4': {
        expected: '5+x',
        number_value: 7.1
    },
    'x+x+1+x': {
        expected: '1+3*x',
        number_value: 7.3
    },
    '(x+1)+(8+y)': {
        expected: '9+x+y',
        number_value: 14.4
    },
    '(x+1)+(a+y)': {
        expected: '1+a+x+y',
        number_value: 13.82
    },
    '(x+x^2)+(x^3+x)': {
        expected: '2*x+x^2+x^3',
        number_value: 17.871
    },
    '3*(x+x^2)+5*(x^3+x)': {
        expected: '3*x^2+5*x^3+8*x',
        number_value: 76.335
    },
    'x^y+x^y': {
        expected: '2*x^y',
        number_value: 23.13948390048293
    },
    //power
    '2^(1/2)': {
        expected: 'sqrt(2)',
        number_value: 23.13948390048293
    },
    '3/4/-5/7': {
        expected: '-3/140',
        number_value: -0.02142857142857143
    },
    '(2/5)^(1/2)': {
        expected: 'sqrt(2)*sqrt(5)^(-1)',
        number_value: 0.6324555320336759
    },
    '2^(1/2)+sqrt(2)': {
        expected: '2*sqrt(2)',
        number_value: 2.8284271247461903
    },
    'sqrt(2)*sqrt(2)': {
        expected: '2',
        number_value: 2
    },
    'x*x': {
        expected: 'x^2',
        number_value: 4.41
    },
    '-x*x': {
        expected: '-x^2',
        number_value: -4.41
    },
{'fraction_non_alphanumeric': 0.22169645986680686, 'fraction_numerical': 0.09603925692253767, 'mean_word_length': 1.558045719408337, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6045842', 'n_tokens_mistral': 2624, 'n_tokens_neox': 2366, 'n_words': 392}