<commit_before>/**
 * Requires ComplexFunctions (in solver.js)
 */

/* Defined functions */
/* Arithmetic */
Functions["+"] = new ComplexFunction(0,false, 
        function(a,b) {
            return a + b;
        });
Functions["-"] = new ComplexFunction(0,false,
        function(a,b) {
            return a - b;
        });
Functions["*"] = new ComplexFunction(1,false,
        function(a,b) {
            return a * b;
        });
Functions["/"] = new ComplexFunction(1,false,
        function(a,b) {
            return a / b;
        });
Functions["^"] = new ComplexFunction(2,false,
        function(a,b) {
            return Math.pow(a,b);
        });
Functions["sqrt"] = new ComplexFunction(1,true,
        function(a) {
            return Math.sqrt(a);
        });
        
/* Sinusoidal */
Functions["sin"] = new ComplexFunction(1,true,
        function(a) {
            var result = Math.sin(a);
            return result;
        });
Functions["cos"] = new ComplexFunction(1,true,
        function(a) {
            return Math.cos(a);
        });
Functions["tan"] = new ComplexFunction(1,true,
        function(a) {
            return Math.tan(a);
        });
Functions["asin"] = new ComplexFunction(1,true,
        function(a) {
            return Math.asin(a);
        });
Functions["acos"] = new ComplexFunction(1,true,
        function(a) {
            return Math.acos(a);
        });
Functions["atan"] = new ComplexFunction(1,true,
        function(a) {
            return Math.atan(a);
        });

/* Logarithms */
// Log-10
Functions["log"] = new ComplexFunction(1,true,
        function(a) {
            return Math.log(a)/Math.LN10;
        });
// Log-e
Functions["ln"] = new ComplexFunction(1,true,
        function(a) {
            return Math.log(a);
        });
        
/* Rectifiers */
Functions["abs"] = new ComplexFunction(1,true,
        function(a) {
            return Math.abs(a);
        });
Functions["ceil"] = new ComplexFunction(1,true,
        function(a) {
            return Math.ceil(a);
        });
Functions["floor"] = new ComplexFunction(1,true,
        function(a) {
            return Math.floor(a);
        });
Functions["average"] = new ComplexFunction(1,true,
        function() {
            var results = 0,
              len = arguments.length;
            for(var i = 0; i < len; i++)
            {
                results += arguments[i];
            }
            if(len > 0)
            {
                results /= len;
            }
            return result;
        },true);
        
/* Combinators */
Functions["average"] = new ComplexFunction(1,true,
        function() {
            var results = 0,
              len = arguments.length;
            for(var i = 0; i < len; i++)
            {
                results += arguments[i];
            }
            if(len > 0)
            {
                results /= len;
            }
            return result;
        },true);

/* Defined constants */
// PI : ~3.14159
Constants["pi"] = new Constant(Math.PI);
// E : ~2.71828
Constants["e"] = new Constant(Math.E);






/* Custom functions */
Functions["cheese"] = new ComplexFunction(1,true,
        function(a,b,c,d,e,f) {
            return a * b * c * d * e * f;<commit_msg>Adding sum and product functions<commit_after>/**
 * Requires ComplexFunctions (in solver.js)
 */

/* Defined functions */
/* Arithmetic */
Functions["+"] = new ComplexFunction(0,false, 
        function(a,b) {
            return a + b;
        });
Functions["-"] = new ComplexFunction(0,false,
        function(a,b) {
            return a - b;
        });
Functions["*"] = new ComplexFunction(1,false,
        function(a,b) {
            return a * b;
        });
Functions["/"] = new ComplexFunction(1,false,
        function(a,b) {
            return a / b;
        });
Functions["^"] = new ComplexFunction(2,false,
        function(a,b) {
            return Math.pow(a,b);
        });
Functions["sqrt"] = new ComplexFunction(1,true,
        function(a) {
            return Math.sqrt(a);
        });
        
/* Sinusoidal */
Functions["sin"] = new ComplexFunction(1,true,
        function(a) {
            var result = Math.sin(a);
            return result;
        });
Functions["cos"] = new ComplexFunction(1,true,
        function(a) {
            return Math.cos(a);
        });
Functions["tan"] = new ComplexFunction(1,true,
        function(a) {
            return Math.tan(a);
        });
Functions["asin"] = new ComplexFunction(1,true,
        function(a) {
            return Math.asin(a);
        });
Functions["acos"] = new ComplexFunction(1,true,
        function(a) {
            return Math.acos(a);
        });
Functions["atan"] = new ComplexFunction(1,true,
        function(a) {
            return Math.atan(a);
        });

/* Logarithms */
// Log-10
Functions["log"] = new ComplexFunction(1,true,
        function(a) {
            return Math.log(a)/Math.LN10;
        });
// Log-e
Functions["ln"] = new ComplexFunction(1,true,
        function(a) {
            return Math.log(a);
        });
        
/* Rectifiers */
Functions["abs"] = new ComplexFunction(1,true,
        function(a) {
            return Math.abs(a);
        });
Functions["ceil"] = new ComplexFunction(1,true,
        function(a) {
            return Math.ceil(a);
        });
Functions["floor"] = new ComplexFunction(1,true,
        function(a) {
            return Math.floor(a);
        });
Functions["average"] = new ComplexFunction(1,true,
        function() {
            var results = 0,
              len = arguments.length;
            for(var i = 0; i < len; i++)
            {
                results += arguments[i];
            }
            if(len > 0)
            {
                results /= len;
            }
            return result;
        },true);
        
/* Combinators */
Functions["sum"] = new ComplexFunction(1,true,
        function() {
            var results = 0,
              len = arguments.length;
            for(var i = 0; i < len; i++)
            {
                results += arguments[i];
            }

            return result;
        },true);
Functions["product"] = new ComplexFunction(1,true,
        function() {
            var results = 1,
              len = arguments.length;
            for(var i = 0; i < len; i++)
            {
                results *= arguments[i];
            }

            return result;
        },true);

/* Defined constants */
// PI : ~3.14159
Constants["pi"] = new Constant(Math.PI);
// E : ~2.71828
Constants["e"] = new Constant(Math.E);






/* Custom functions */
Functions["cheese"] = new ComplexFunction(1,true,
        function(a,b,c,d,e,f) {
            return a * b * c * d * e * f;
{'fraction_non_alphanumeric': 0.15350223546944858, 'fraction_numerical': 0.012816691505216096, 'mean_word_length': 1.6421259842519684, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6925740', 'n_tokens_mistral': 2016, 'n_tokens_neox': 1955, 'n_words': 411}