used by DoublesAuxiliary and UtilTest
513819
static void blockyTandemMergeSort(final double[] keyArr, final long[] valArr, final int arrLen,
      final int blkSize) {
    assert blkSize >= 1;
    if (arrLen <= blkSize) { return; }
    int numblks = arrLen / blkSize;
    if ((numblks * blkSize) < arrLen) { numblks += 1; }
    assert ((numblks * blkSize) >= arrLen);

    // duplicate the input is preparation for the "ping-pong" copy reduction strategy.
    final double[] keyTmp = Arrays.copyOf(keyArr, arrLen);
    final long[] valTmp   = Arrays.copyOf(valArr, arrLen);

    blockyTandemMergeSortRecursion(keyTmp, valTmp,
                                   keyArr, valArr,
                                   0, numblks,
                                   blkSize, arrLen);
  }
389218
function _universal2axis(universal, axisX, axisY, defaultValue) {
  let x;
  let y;
  if (typeof universal === 'object') {
    x = universal.x;
    y = universal.y;
  } else if (typeof universal === 'number') {
    x = y = universal;
  }

  axisX = +axisX;
  if (!isNaN(axisX)) {
    x = axisX;
  }

  axisY = +axisY;
  if (!isNaN(axisY)) {
    y = axisY;
  }

  return [x || defaultValue || 0, y || defaultValue || 0];
}
795160
private String doubleErasure(TypeMirror elementType) {
    String name = typeUtils.erasure(elementType).toString();
    int typeParamStart = name.indexOf('<');
    if (typeParamStart != -1) {
      name = name.substring(0, typeParamStart);
    }
    return name;
  }
273288
static Object doubleBinaryOperation(double lhs, double rhs, int kind)
        throws UtilEvalError
    {
        switch(kind)
        {
            // arithmetic
            case PLUS:
                if ( lhs > 0d && (Double.MAX_VALUE - lhs) < rhs )
                    break;
                return lhs + rhs;

            case MINUS:
                if ( lhs < 0d && (-Double.MAX_VALUE - lhs) > -rhs )
                    break;
                return lhs - rhs;

            case STAR:
                if ( lhs != 0 && Double.MAX_VALUE / lhs < rhs )
                    break;
                return lhs * rhs;

            case SLASH:
                return lhs / rhs;

            case MOD:
            case MODX:
                return lhs % rhs;

            case POWER:
            case POWERX:
                double check = Math.pow(lhs, rhs);
                if ( Double.isInfinite(check) )
                    break;
                return check;

            // can't shift floating-point values
            case LSHIFT:
            case LSHIFTX:
            case RSIGNEDSHIFT:
            case RSIGNEDSHIFTX:
            case RUNSIGNEDSHIFT:
            case RUNSIGNEDSHIFTX:
                throw new UtilEvalError("Can't shift floatingpoint values");

        }
        if ( OVERFLOW_OPS.contains(kind) )
            return bigDecimalBinaryOperation(BigDecimal.valueOf(lhs), BigDecimal.valueOf(rhs), kind);

        throw new InterpreterError(
                "Unimplemented binary double operator");
    }
952991
function useStrictEquality(b, a) {
			if (b instanceof a.constructor || a instanceof b.constructor) {
				// to catch short annotaion VS 'new' annotation of a
				// declaration
				// e.g. var i = 1;
				// var j = new Number(1);
				return a == b;
			} else {
				return a === b;
			}
		}
90444
public static Function<? super ReactiveSeq<Double>, ? extends ReactiveSeq<Double>> flatMapDoubles(DoubleFunction<? extends DoubleStream> b){

        return a->a.doubles(i->i,s->s.flatMap(b));
    }
116911
public JFeatureSpec<T> cross(final String x1, final String x2,
                               final BiFunction<Double, Double, Double> f) {
    Function2<Object, Object, Object> g = JavaOps.crossFn(f);
    return wrap(self.cross(Tuple2.apply(x1, x2), g));
  }
55653
def _double_prefix(self):
        
        new_len = max(len(self._buf[0]) * 2, (len(self._buf[0]) + len(self._buf[1])))
        self._merge_prefix(new_len)
807448
static DoublesUnionImpl heapifyInstance(final DoublesSketch sketch) {
    final int k = sketch.getK();
    final DoublesUnionImpl union = new DoublesUnionImpl(k);
    union.maxK_ = k;
    union.gadget_ = copyToHeap(sketch);
    return union;
  }
1307103
function (util) {

      function printable(str) {
        return ('' + str).replace(/\n/g, '\\n').replace(/\r/g, '\\r')
      }
      function compare(actual, expected) {
        var pass = actual === expected
        return {
          pass: pass,
          message: util.buildFailureMessage(
            'toHasLinesLike', pass, printable(actual), printable(expected))
        }
      }

      return {compare: compare}
    }
1787
private void assertApplicable( FunctionInputDef inputDef) throws IllegalArgumentException
    {
    try
      {
      for( VarNamePattern varNamePattern : getIncludedVars())
        {
        assertApplicable( inputDef, varNamePattern);
        }
      for( VarNamePattern varNamePattern : getExcludedVars())
        {
        assertApplicable( inputDef, varNamePattern);
        }
      }
    catch( Exception e)
      {
      throw new IllegalArgumentException( "Can't apply " + this + " to " + inputDef, e);
      }
    }
868104
private Iterator<Tuple> getSatisfyingTuples( final TestCaseDef testCase, VarTupleSet varTupleSet)
    {
    final Comparator<VarBindingDef> byUsage = byUsage( varTupleSet);

    return
      IteratorUtils.transformedIterator(
        // Iterate over all combinations of bindings...
        new CartesianProduct<VarBindingDef>(

          // ...combining members from all sets of bindings...
          new ArrayList<Set<VarBindingDef>>(
            CollectionUtils.collect(
              // ...where each set of bindings is derived from a disjunct of unsatisfied test case conditions....
              testCase.getRequired().getDisjuncts(),

              // ...and contains the set of compatible bindings that could satisfy this disjunct...
              disjunct ->
                {
                Set<String> unsatisfied =
                  CollectionUtils.collect(
                    disjunct.getAssertions(),
                    assertion -> assertion.getProperty(),
                    new HashSet<String>());

                Iterator<VarBindingDef> satisfyingBindings =
                  IteratorUtils.filteredIterator(
                    getPropertyProviders( unsatisfied).iterator(),
                    binding -> testCase.isCompatible( binding));

                // ...arranging satisfying bindings in order of decreasing preference...
                return
                  CollectionUtils.collect(
                    satisfyingBindings,
                    nopTransformer(),
                    new TreeSet<VarBindingDef>( byUsage));
                },

              // ...arranging sets in a well-defined order for repeatable combinations...
              new TreeSet<Set<VarBindingDef>>( varBindingSetSorter_))),
          
          // ...ignoring any infeasible combinations...
          bindings -> Tuple.of( bindings) != null),
        
         // ... forming each combination of satisfying bindings into a tuple...
        Tuple::of);
    }
1011635
@Override
    public double[] sample(long sampleSize) {
        if (sampleSize <= 0) {
            throw new NotStrictlyPositiveException(LocalizedFormats.NUMBER_OF_SAMPLES, sampleSize);
        }
        // FIXME: int cast
        double[] out = new double[(int) sampleSize];
        for (int i = 0; i < sampleSize; i++) {
            out[i] = sample();
        }
        return out;
    }
168242
@javax.annotation.Nonnull
  public static double[] op(@javax.annotation.Nonnull final double[] a, @javax.annotation.Nonnull final double[] b, @javax.annotation.Nonnull final DoubleBinaryOperator fn) {
    assert a.length == b.length;
    @javax.annotation.Nonnull final double[] c = new double[a.length];
    for (int j = 0; j < a.length; j++) {
      c[j] = fn.applyAsDouble(a[j], b[j]);
    }
    return c;
  }
893021
public static Function<Object,Double> d(final String methodName, final Object... optionalParameters) {
        return methodForDouble(methodName, optionalParameters);
    }
61600
def main():
    
    parser = argparse.ArgumentParser()
    sub_parser = parser.add_subparsers()

    lint_parser = sub_parser.add_parser('lint')
    lint_parser.set_defaults(func=lint)

    unit_test_parser = sub_parser.add_parser('unit-test')
    unit_test_parser.set_defaults(func=unit_test)

    test_suite_parser = sub_parser.add_parser('test-suite')
    test_suite_parser.set_defaults(func=test_suite)

    args, extra_args = parser.parse_known_args()

    if extra_args:
        args.func(extra_args)
    else:
        args.func()
834094
function DoubleMatcherIterator(node, match) {
  this.n = node;
  this.m = match;
  this.p = match.length;
  this.c = node._map['**'];
}