Computes the multiplier necessary to make x >= 1,
effectively eliminating miscalculations caused by
finite precision.
194388
function multiplier(x) {
    var parts = x.toString().split('.');
    if (parts.length < 2) {
      return 1;
    }
    return Math.pow(10, parts[1].length);
  }
1149485
public static <T extends Transform> T multiply (
        double m00, double m01, double m10, double m11, double tx, double ty, AffineTransform b, T into) {
        return multiply(m00, m01, m10, m11, tx, ty, b.m00, b.m01, b.m10, b.m11, b.tx, b.ty, into);
    }
454808
function multiply(x, k, base) {
        var m, temp, xlo, xhi,
          carry = 0,
          i = x.length,
          klo = k % SQRT_BASE,
          khi = k / SQRT_BASE | 0;

        for (x = x.slice(); i--;) {
          xlo = x[i] % SQRT_BASE;
          xhi = x[i] / SQRT_BASE | 0;
          m = khi * xlo + xhi * klo;
          temp = klo * xlo + ((m % SQRT_BASE) * SQRT_BASE) + carry;
          carry = (temp / base | 0) + (m / SQRT_BASE | 0) + khi * xhi;
          x[i] = temp % base;
        }

        if (carry) x = [carry].concat(x);

        return x;
      }
397368
def sqr(x, context=None):
    
    return _apply_function_in_current_context(
        BigFloat,
        mpfr.mpfr_sqr,
        (BigFloat._implicit_convert(x),),
        context,
    )
882494
def multiply_and_add(n):
    ''''''
    multiplier, offset = di.resolver.unpack(multiply_and_add)
    return (multiplier * n) + offset
229248
public static double HighAccuracyFunction(double x) {
        if (x < -8 || x > 8)
            return 0;

        double sum = x;
        double term = 0;

        double nextTerm = x;
        double pwr = x * x;
        double i = 1;

        // Iterate until adding next terms doesn't produce
        // any change within the current numerical accuracy.

        while (sum != term) {
            term = sum;

            // Next term
            nextTerm *= pwr / (i += 2);

            sum += nextTerm;
        }

        return 0.5 + sum * Math.exp(-0.5 * pwr - 0.5 * Constants.Log2PI);
    }
642829
public static double round(double x, int precision) {
    double power = Math.pow(10.0, precision);
    return round(x * power) / power;
  }
101131
function(x) { 
                var p = x.power.toString(),
                    m = x.multiplier.toDecimal(), 
                    s = x.toUnitMultiplier().toLinear();
                if(Number(p) === -1) {
                    return _.multiply(new Symbol(m), _.symfunction(LOG, [s]));
                }
                return _.parse(format('({0})*({1})^(({2})+1)/(({2})+1)', m, s, p));
            }
1055508
private static int computeE1(int a, int b, int c, int d, int e, int f)
    {
        if (d == b && e != c || b == f && e != a)
        {
            return b;
        }
        return e;
    }
100563
def _multiply(self, x1, x2, out):
        """"""
        self.tspace._multiply(x1.tensor, x2.tensor, out.tensor)
1093865
def expm1(x):
    
    if isinstance(x, UncertainFunction):
        mcpts = np.expm1(x._mcpts)
        return UncertainFunction(mcpts)
    else:
        return np.expm1(x)
74420
def nhill_a(self,x,threshold=0.1,power=2,ichild=2):
        
        x_pow = np.power(x,power)
        threshold_pow = np.power(threshold,power)
        return x_pow / (x_pow + threshold_pow) * (1 + threshold_pow)
868433
def _can_be_double(x):
    
    return ((np.issubdtype(x.dtype, np.floating) and
            x.dtype.itemsize <= np.dtype(float).itemsize) or
            (np.issubdtype(x.dtype, np.signedinteger) and
            np.can_cast(x, float)))
1194710
@Override
    public double compute(double a, double b) {
        if (Op.isLt(a + b, 1.0)) {
            return Op.max(a, b);
        }
        return 1.0;
    }
1010103
public static double factorial(int x) {
    double result = 1.0;
    for (int i=x; i>1; i--) {
      result *= i;
    }
    return result;
  }
794411
public static int xDigitToInt(int c, int accumulator)
    {
        check: {
            // Use 0..9 < A..Z < a..z
            if (c <= '9') {
                c -= '0';
                if (0 <= c) { break check; }
            } else if (c <= 'F') {
                if ('A' <= c) {
                    c -= ('A' - 10);
                    break check;
                }
            } else if (c <= 'f') {
                if ('a' <= c) {
                    c -= ('a' - 10);
                    break check;
                }
            }
            return -1;
        }
        return (accumulator << 4) | c;
    }
299003
def interpolator(self, x, values):
        
        # hacking the barycentric interpolator by computing the weights in advance
        p = Bary([0.])
        N = len(values)
        weights = np.ones(N)
        weights[0] = .5
        weights[1::2] = -1
        weights[-1] *= .5
        p.wi = weights
        p.xi = x
        p.set_yi(values)
        return p