/*
These functions implement the four basic operations the algorithm uses.
339408
function(q,a,b,x,s,t){
        return __add(__rol(__add(__add(a,q),__add(x,t)),s),b);
    }
61491
function mmult(A, B, n) {
  var C = new Array(n * n);

  for (var i = 0; i < n; i++) {
    for (var j = 0; j < n; j++) {
      C[i * n + j] = 0;
    }

    for (var k = 0; k < n; k++) {
      for (var _j = 0; _j < n; _j++) {
        C[i * n + _j] += A[i * n + k] * B[k * n + _j];
      }
    }
  }

  return C;
}
560983
function step(node) {
  let nodeStatus;

  node = flattenOperands(node);
  node = removeUnnecessaryParens(node, true);

  const simplificationTreeSearches = [
    // Basic simplifications that we always try first e.g. (...)^0 => 1
    basicsSearch,
    // Simplify any division chains so there's at most one division operation.
    // e.g. 2/x/6 -> 2/(x*6)        e.g. 2/(x/6) => 2 * 6/x
    divisionSearch,
    // Adding fractions, cancelling out things in fractions
    fractionsSearch,
    // e.g. 2 + 2 => 4
    arithmeticSearch,
    // e.g. addition: 2x + 4x^2 + x => 4x^2 + 3x
    // e.g. multiplication: 2x * x * x^2 => 2x^3
    collectAndCombineSearch,
    // e.g. (2 + x) / 4 => 2/4 + x/4
    breakUpNumeratorSearch,
    // e.g. 3/x * 2x/5 => (3 * 2x) / (x * 5)
    multiplyFractionsSearch,
    // e.g. (2x + 3)(x + 4) => 2x^2 + 11x + 12
    distributeSearch,
    // e.g. abs(-4) => 4
    functionsSearch,
  ];

  for (let i = 0; i < simplificationTreeSearches.length; i++) {
    nodeStatus = simplificationTreeSearches[i](node);
    // Always update node, since there might be changes that didn't count as
    // a step. Remove unnecessary parens, in case one a step results in more
    // parens than needed.
    node = removeUnnecessaryParens(nodeStatus.newNode, true);
    if (nodeStatus.hasChanged()) {
      node = flattenOperands(node);
      nodeStatus.newNode = clone(node);
      return nodeStatus;
    }
    else {
      node = flattenOperands(node);
    }
  }
  return Node.Status.noChange(node);
}
1189131
function add (a, b, c) {
		binary_arithmetic.call(this, a, b, c, '__add', add_internal);
	}
593069
function main() {
	var len;
	var min;
	var max;
	var f;
	var i;

	min = 1; // 10^min
	max = 6; // 10^max

	for ( i = min; i <= max; i++ ) {
		len = pow( 10, i );
		f = createBenchmark( len );
		bench( pkg+':len='+len, f );
	}
}
1197233
private ArrayList algorithm1(String S, String T) {
    ArrayList candidateList = new ArrayList();
    int bound = (int) (1.0 / tr);
    for (int t = 0; t < S.length(); t++) {
      char chT = S.charAt(t);
      double lastTr = -1;
      for (int u = Math.max(0, t - bound), flag = 0;
           u < Math.min(t + bound + 1, T.length()) && flag == 0; u++) {
        double tr2 = ( (double) Math.abs(t - u));
        if ( (lastTr >= 0.0) && (lastTr < tr2)) {
          flag = 1;
        }
        else {
          char chU = T.charAt(u);
          double charScore = 0.0;
          if(chT==chU){
            charScore = 1.0;
          }
          if (charScore > 0.0) {
            if (charScore == 1.0) {
              lastTr = tr2;
            }
            charScore = charScore - (tr * tr2);
            if (charScore == 1.0) {
              flag = 1;
            }
            candidateList.add(new TagLink.Candidates(t, u, charScore));
          }
        }
      }
    }
    return candidateList;
  }
69345
private LinkedHashSet<Formula> condenseOperandsAnd(final Collection<? extends Formula> operands) {
    final LinkedHashSet<Formula> ops = new LinkedHashSet<>();
    this.cnfCheck = true;
    for (final Formula form : operands)
      if (form.type() == AND) {
        for (final Formula f : ((NAryOperator) form).operands) {
          this.addFormulaAnd(ops, f);
          if (!this.formulaAdditionResult[0])
            return null;
          if (!this.formulaAdditionResult[1])
            this.cnfCheck = false;
        }
      } else {
        this.addFormulaAnd(ops, form);
        if (!this.formulaAdditionResult[0])
          return null;
        if (!this.formulaAdditionResult[1])
          this.cnfCheck = false;
      }
    return ops;
  }
425543
public void process() {
		solver.solve(Y,X);

		double a = X.data[0];
		double b = X.data[1];
		double c = X.data[2];
		double d = X.data[3];
		double e = X.data[4];

		double bottom = 4*a*c - b*b;
		deltaX = (b*e - 2*d*c)/bottom;
		deltaY = (b*d - 2*a*e)/bottom;
	}
1117910
function (m, p, c) {
        var r, all
        this.all(function(a){
            all = a.map(function(e){ return e[p] })
            r = Math[m].apply(Math, all)
        })
        this.fn(m, c).call(this, r)
    }
1072907
public static void main(String[] args){

        /*
            SearchProblem is the structure used by Hipster to store all the
            information about the search query, like: start, goals, transition function,
            cost function, etc. Once created it is used to instantiate the search
            iterators which provide the results.
         */
        SearchProblem p = ProblemBuilder.create()

                /*
                    Initial state of the search. Defined as an array.
                 */
                .initialState(Arrays.asList(5,4,0,7,2,6,8,1,3))

                /*
                    Search problems can be defined with or without actions. In this example
                    we use actions, as the solution results more informative if includes the
                    motions followed to order the pieces of the puzzle (i.e. LEFT, DOWN, DOWN...).
                    But problems without explicit actions can also be defined using the method
                    defineProblemWithoutActions. This is useful when the sequence of actions is not
                    interesting for the solution of the search, like in the 2D maze search
                    problem that you can find in this module.
                 */
                .defineProblemWithExplicitActions()

                /*
                    The action function is the component which calculates for each state the
                    actions that are available to reach other state. In this example the action
                    function discards all motions that are not possible due to the bounds of the
                    puzzle. This code is in the function validMovementsFor of this same class.
                 */
                .useActionFunction(new ActionFunction<Action, List<Integer>>() {
                    @Override
                    public Iterable<Action> actionsFor(List<Integer> state) {
                        // Here we compute the valid movements for the state
                        return validMovementsFor(state);
                    }
                })

                /*
                    The transition
                    function takes the available actions given by the actionFunction defined
                    above and computes the new state that results from applying to the current state
                    each one of the available actions.

                    The transition function returns a collection of transitions.
                    A transition is defined by a class Transition which has two attributes:
                    source point (from) and destination point (to). The source point
                    is the current state that we are exploring, and the destination point
                    is a reachable location from that state.
                */
                .useTransitionFunction(new ActionStateTransitionFunction<Action, List<Integer>>() {
                    @Override
                    public List<Integer> apply(Action action, List<Integer> state) {
                        // Here we compute the state that results from doing an action A to the current state
                        return applyActionToState(action, state);
                    }
                })

                /*
                    The cost function defines the effort moving between states.
                    The CostFunction is an interface with three generic types: S - the state,
                    A - the action type and T - the cost type.
                    In this example we consider an unitary cost for each motion.
                 */
                .useCostFunction(new CostFunction<Action, List<Integer>, Double>() {
                    @Override
                    public Double evaluate(Transition<Action, List<Integer>> transition) {
                        // Every movement has the same cost, 1
                        return 1d;
                    }
                })

                /*
                    With this method the SearchProblem is instantiated using the data introduced with the methods
                    above.
                 */
                .build();

        /**
         * Here the search iterator (Dijkstra's algorithm) is created. Search is executed with until the goal
         * state is explored and the results are printed by console.
         */
        System.out.println(Hipster.createDijkstra(p).search(Arrays.asList(0,1,2,3,4,5,6,7,8)));

    }
1281631
function _mmult(a, m) {
        m = m.slice();

        var m0 = m[0];
        var m1 = m[1];
        var m2 = m[2];
        var m3 = m[3];
        var m4 = m[4];
        var m5 = m[5];
        var m6 = m[6];
        var m7 = m[7];
        var m8 = m[8];

        m[0] = a[0] * m0 + a[1] * m3;
        m[1] = a[0] * m1 + a[1] * m4;
        m[3] = a[3] * m0 + a[4] * m3;
        m[4] = a[3] * m1 + a[4] * m4;
        m[6] = a[6] * m0 + a[7] * m3 + m6;
        m[7] = a[6] * m1 + a[7] * m4 + m7;

        return transform(m);
    }
463140
function composition(f) {
    return forAll(_.Int).satisfy(function(a) {
      function g(x) { return x * 2; }
      function h(x) { return x - 1; }

      function returnComposition(b) {
        return g(h(b));
      }

      return f(a).map(returnComposition).isEqual(f(a).map(h).map(g));
    });
  }
183141
function functs(...f) {
    /**
     * execute all included functions
     * @param {...*} [args] - arguments passed to all included functions
     * @returns {*[]}
     */
    function functs(...args) {
        return functs.run(this, args);
    }

    if(Array.isArray(f[0])) {
        f = f[0];
    }
    
    functs._f = f.filter((f) => {
        return typeof f === 'function';
    });
    functs.add = add.bind(functs);
    functs.remove = remove.bind(functs);
    functs.run = run.bind(functs);
    return functs;
}
808121
function basics(node) {
  for (let i = 0; i < SIMPLIFICATION_FUNCTIONS.length; i++) {
    const nodeStatus = SIMPLIFICATION_FUNCTIONS[i](node);
    if (nodeStatus.hasChanged()) {
      return nodeStatus;
    }
    else {
      node = nodeStatus.newNode;
    }
  }
  return Node.Status.noChange(node);
}
216112
@Override
	public void initialize(double[] initial, int numberOfParameters, double minimumFunctionValue) {
		super.initialize(initial, numberOfParameters,minimumFunctionValue);
		y.reshape(numberOfParameters,1);

		xPrevious.reshape(numberOfParameters,1);
		x.reshape(numberOfParameters,1);

		// set the previous gradient to zero
		gradientPrevious.reshape(numberOfParameters,1);
		gradientPrevious.zero();

		firstIteration = true;
	}
888475
function apply (data, predicates) {
    assert.array(data);

    if (isFunction(predicates)) {
      return data.map(function (value) {
        return predicates(value);
      });
    }

    assert.array(predicates);
    assert.hasLength(data, predicates.length);

    return data.map(function (value, index) {
      return predicates[index](value);
    });
  }
1139568
private static RadialBasisFunction[] rep(RadialBasisFunction rbf, int k) {
        RadialBasisFunction[] arr = new RadialBasisFunction[k];
        Arrays.fill(arr, rbf);
        return arr;
    }