Ordinary noise function.

@param x X Value.
@param y Y Value.
@return
336304
private double Noise(int x, int y) {
        int n = x + y * 57;
        n = (n << 13) ^ n;

        return (1.0 - ((n * (n * n * 15731 + 789221) + 1376312589) & 0x7fffffff) / 1073741824.0);
    }
1311848
public static String pointToString (int x, int y) {
        StringBuilder buf = new StringBuilder();
        if (x >= 0) buf.append("+");
        buf.append(x);
        if (y >= 0) buf.append("+");
        buf.append(y);
        return buf.toString();
    }
1169570
public boolean lt(int x, int y) {
    return this.vars.get(x).activity() > this.vars.get(y).activity();
  }
1279489
public int divide(int x, int y) {
    assert(x >= 0 && x < getFieldSize() && y > 0 && y < getFieldSize());
    return divTable[x][y];
  }
1074768
public static String vectorToString (float x, float y) {
        return MathUtil.toString(x) + MathUtil.toString(y);
    }
797934
private static double log(double x) {
        double y = 0.0;
        if (x < 1E-300) {
            y = -690.7755;
        } else {
            y = java.lang.Math.log(x);
        }
        return y;
    }
966214
def noise3(self, x, y, z, repeat, base=0.0):
		
		i = int(fmod(floor(x), repeat))
		j = int(fmod(floor(y), repeat))
		k = int(fmod(floor(z), repeat))
		ii = (i + 1) % repeat
		jj = (j + 1) % repeat
		kk = (k + 1) % repeat
		if base:
			i += base; j += base; k += base
			ii += base; jj += base; kk += base

		x -= floor(x); y -= floor(y); z -= floor(z)
		fx = x**3 * (x * (x * 6 - 15) + 10)
		fy = y**3 * (y * (y * 6 - 15) + 10)
		fz = z**3 * (z * (z * 6 - 15) + 10)

		perm = self.permutation
		A = perm[i]
		AA = perm[A + j]
		AB = perm[A + jj]
		B = perm[ii]
		BA = perm[B + j]
		BB = perm[B + jj]
		
		return lerp(fz, lerp(fy, lerp(fx, grad3(perm[AA + k], x, y, z),
										  grad3(perm[BA + k], x - 1, y, z)),
								 lerp(fx, grad3(perm[AB + k], x, y - 1, z),
										  grad3(perm[BB + k], x - 1, y - 1, z))),
						lerp(fy, lerp(fx, grad3(perm[AA + kk], x, y, z - 1),
										  grad3(perm[BA + kk], x - 1, y, z - 1)),
								 lerp(fx, grad3(perm[AB + kk], x, y - 1, z - 1),
										  grad3(perm[BB + kk], x - 1, y - 1, z - 1))))
675246
def lessgreater(x, y):
    
    x = BigFloat._implicit_convert(x)
    y = BigFloat._implicit_convert(y)
    return mpfr.mpfr_lessgreater_p(x, y)
188508
public static boolean sameZero(Object x, Object y) {
        if (!typeof(x).equals(typeof(y))) {
            return false;
        }
        if (x instanceof Number) {
            if (isNaN(x) && isNaN(y)) {
                return true;
            }
            final double dx = ((Number)x).doubleValue();
            if (y instanceof Number) {
                final double dy = ((Number)y).doubleValue();
                if (((dx == negativeZero) && (dy == 0.0)) ||
                    ((dx == 0.0) && dy == negativeZero)) {
                        return true;
                }
            }
            return eqNumber(dx, y);
        }
        return eq(x, y);
    }
313511
public float turbulence2(float x, float y, float octaves) {
        float t = 0.0f;

        for (float f = 1.0f; f <= octaves; f *= 2)
            t += Math.abs(noise2(f * x, f * y)) / f;
        return t;
    }
213782
public static double SquaredEuclidean(double[] x, double[] y) {
        double d = 0.0, u;

        for (int i = 0; i < x.length; i++) {
            u = x[i] - y[i];
            d += u * u;
        }

        return d;
    }
1310320
public static float dot(FloatMatrix x, FloatMatrix y) {
		//return NativeBlas.sdot(x.length, x.data, 0, 1, y.data, 0, 1);
		return JavaBlas.rdot(x.length, x.data, 0, 1, y.data, 0, 1);
	}
1269012
double error(int[] x, int[] y) {
        int e = 0;

        for (int i = 0; i < x.length; i++) {
            if (x[i] != y[i]) {
                e++;
            }
        }

        return (double) e / x.length;
    }
122249
public int multiply(int x , int y ) {
		if( x==0 || y == 0)
			return 0;
		return exp[ log[x] + log[y]];
	}
654251
public static double distance(SparseArray x, SparseArray y) {
        return Math.sqrt(squaredDistance(x, y));
    }
1367979
private int getSourcePixel(int x,int y)
    {
        x = Math.max(0,x);
        x = Math.min(width-1,x);
        y = Math.max(0,y);
        y = Math.min(height-1,y);
        
        return srcImage[x+(y*width)];
    }
247052
static public double sphere_noise(double[] x) {

    double sum = 0.0;

    for (int i = 0; i < x.length; i++) {
      sum += x[i] * x[i];
    }

    // NOISE
    // Comment the next line to remove the noise
    sum *= (1.0 + 0.1 * Math.abs(random.nextGaussian()));

    return (sum);
  }