Return the largest real value h such that all elements in x are integer
    multiples of h.
492920
def _gcd_array(X):
    
    greatest_common_divisor = 0.0
    for x in X:
        greatest_common_divisor = _gcd(greatest_common_divisor, x)

    return greatest_common_divisor
131578
public static int max(int[] values)
    {
        int max = Integer.MIN_VALUE;

        for (int i = 0; i < values.length; ++i)
        {
            if (max < values[i])
            {
                max = values[i];
            }
        }

        return max;
    }
1270758
def HH(n):
    """"""
    if (n<=0):return Context('1')
    else:
        LL1=LL(n-1)
        HH1=HH(n-1)
        r1 = C1(3**(n-1),2**(n-1)) - LL1 - HH1
        r2 = HH1 - HH1 - HH1
        return r1 + r2
247438
public static BigDecimal maximum(BigDecimal... values)
    {
        int len = values.length;
        if (len == 1)
        {
            if (values[0] == null)
            {
                throw new IllegalArgumentException("Cannot passed null BigDecimal entry to maximum()");
            }
            return values[0];
        }
        BigDecimal current = values[0];

        for (int i=1; i < len; i++)
        {
            if (values[i] == null)
            {
                throw new IllegalArgumentException("Cannot passed null BigDecimal entry to maximum()");
            }
            current = values[i].max(current);
        }

        return current;
    }
517589
def _int_size(x):
    """"""
    if -0x80 <= x <= 0x7F:
        return 1
    elif -0x8000 <= x <= 0x7FFF:
        return 2
    elif -0x80000000 <= x <= 0x7FFFFFFF:
        return 4
    elif long(-0x8000000000000000) <= x <= long(0x7FFFFFFFFFFFFFFF):
        return 8
    else:
        raise RuntimeError("Cannot represent value: " + str(x))
1139420
public static /*@pure@*/ int maxIndex(int[] ints) {

    int maximum = 0;
    int maxIndex = 0;

    for (int i = 0; i < ints.length; i++) {
      if ((i == 0) || (ints[i] > maximum)) {
	maxIndex = i;
	maximum = ints[i];
      }
    }

    return maxIndex;
  }
450479
function intFromNumbers(numbers) {
  if (numbers.length === 0) { return }

  // Find the largest number.
  let max = numbers[0]
  let maxi = 0  // max index
  numbers.forEach((n, i) => {if (max < n) { max = n; maxi = i }})

  // Compute the corresponding prior number.
  let priorNumber = intFromNumbers(numbers.slice(0, maxi))
  if (priorNumber === undefined) { priorNumber = 1 }
  let posteriorNumber = intFromNumbers(numbers.slice(maxi + 1))
  if (posteriorNumber === undefined) { posteriorNumber = 0 }

  return priorNumber * max + posteriorNumber
}
1216060
public static double Cosh(double x, int nTerms) {
        if (nTerms < 2) return x;
        if (nTerms == 2) {
            return 1 + (x * x) / 2D;
        } else {

            double mult = x * x;
            double fact = 2;
            int factS = 4;
            double result = 1 + mult / fact;
            for (int i = 3; i <= nTerms; i++) {
                mult *= x * x;
                fact *= factS * (factS - 1);
                factS += 2;
                result += mult / fact;
            }

            return result;
        }
    }
508930
def rargmax(x, eps=1e-8):
    
    idxs = np.where(abs(x - np.max(x, axis=0)) < eps)[0]
    return np.random.choice(idxs)
1269000
public static BigRational max(BigRational... values) {
		if (values.length == 0) {
			return BigRational.ZERO;
		}
		BigRational result = values[0];
		for (int i = 1; i < values.length; i++) {
			result = result.max(values[i]);
		}
		return result;
	}
233528
private int getMax(double data[]) {
        int idx = 0;
        double max = data[0];
        for (int i = 1; i < data.length; i++) {
            if (max < data[i]) {
                max = data[i];
                idx = i;
            }
        }
        return idx;
    }
200704
public static BigFloat max(BigFloat value1, BigFloat... values) {
		BigFloat result = value1;

		for (BigFloat other : values) {
			result = max(result, other);
		}

		return result;
	}
1372202
public static int whichMax(int[] x) {
        int m = x[0];
        int which = 0;

        for (int i = 1; i < x.length; i++) {
            if (x[i] > m) {
                m = x[i];
                which = i;
            }
        }

        return which;
    }
1195638
def logsumexp(x):
    """"""
    max_x = np.max(x)
    return max_x + np.log(np.sum(np.exp(x - max_x)))
460178
def longest_increasing_subsequence(x):
    
    n = len(x)
    p = [None] * n
    h = [None]
    b = [float('-inf')]  # - infinity
    for i in range(n):
        if x[i] > b[-1]:
            p[i] = h[-1]
            h.append(i)
            b.append(x[i])
        else:
            #   -- binary search: b[k - 1] < x[i] <= b[k]
            k = bisect_left(b, x[i])
            h[k] = i
            b[k] = x[i]
            p[i] = h[k - 1]
    # extract solution
    q = h[-1]
    s = []
    while q is not None:
        s.append(x[q])
        q = p[q]
    return s[::-1]
68425
private int maxIntegerDigits(double[] values) {
    int digits = 0;
    for(double value : values) {
      digits = Math.max(digits, integerDigits(value));
    }
    return digits;
  }
1347660
function findLargestInCol (M, i, startAtRow = 0) {
  let me = M.elements;
  let n = M.dimension;
  let offset = i * n;
  let maxIdx = startAtRow;
  let maxVal = _Math.abs(me[offset + maxIdx]);
  for (let i = maxIdx + 1; i < n; ++i) {
    let val = _Math.abs(me[offset + i]);
    if (val > maxVal) {
      maxIdx = i;
      maxVal = val;
    }
  }
  return maxIdx;
}