Returns a new complex number that is the sum of the given
complex numbers.

@param x The first addend
@param y The second addend
@return The sum of the given addends
540295
public static  cuDoubleComplex cuCadd (cuDoubleComplex x, cuDoubleComplex y)
    {
        return cuCmplx (cuCreal(x) + cuCreal(y), cuCimag(x) + cuCimag(y));
    }
311788
public static ComplexNumber Multiply(ComplexNumber z1, ComplexNumber z2) {
        double z1R = z1.real, z1I = z1.imaginary;
        double z2R = z2.real, z2I = z2.imaginary;

        return new ComplexNumber(z1R * z2R - z1I * z2I, z1R * z2I + z1I * z2R);
    }
1227696
public static Double evaluate(double x, double y) {
        return (
            0.75 * Math.exp(-Math.pow((9 * x - 2), 2.0) / 4.0 - Math.pow((9 * y - 2), 2.0) / 4.0) +
            0.75 * Math.exp(-Math.pow((9 * x + 1), 2.0) / 49.0 - (9 * y + 1) / 10.0) +
            0.5 * Math.exp(-Math.pow((9 * x - 7), 2.0) / 4.0 - Math.pow((9 * y - 3), 2.0) / 4.0) -
            0.2 * Math.exp(-Math.pow((9 * x - 4), 2.0) - Math.pow((9 * y - 7), 2.0))
        );
    }
46040
public int add(int x, int y) {
    assert(x >= 0 && x < getFieldSize() && y >= 0 && y < getFieldSize());
    return x ^ y;
  }
91366
public Vector2i mul(int x, int y, Vector2i dest) {
        dest.x = this.x * x;
        dest.y = this.y * y;
        return dest;
    }
532680
public double Function2D(double x, double y) {
        return Math.exp(-(x * x + y * y) / (2 * sqrSigma)) / (2 * Math.PI * sqrSigma);
    }
762615
public static ComplexNumber Divide(ComplexNumber z1, ComplexNumber z2) {

        ComplexNumber conj = ComplexNumber.Conjugate(z2);

        double a = z1.real * conj.real + ((z1.imaginary * conj.imaginary) * -1);
        double b = z1.real * conj.imaginary + (z1.imaginary * conj.real);

        double c = z2.real * conj.real + ((z2.imaginary * conj.imaginary) * -1);

        return new ComplexNumber(a / c, b / c);
    }
494796
public void add(double x, double y)
    {
        if (count >= xarr.length)
        {
            grow();
        }
        xarr[count] = x;
        yarr[count++] = y;
        minX = Math.min(minX, x);
        minY = Math.min(minY, y);
        maxX = Math.max(maxX, x);
        maxY = Math.max(maxY, y);
    }
302922
public static ComplexNumber Subtract(ComplexNumber z1, double scalar) {
        return new ComplexNumber(z1.real - scalar, z1.imaginary);
    }
555682
public Vector2i add(int x, int y, Vector2i dest) {
        dest.x = this.x + x;
        dest.y = this.y + y;
        return dest;
    }
1106872
public static ComplexNumber Add(ComplexNumber z1, double scalar) {
        return new ComplexNumber(z1.real + scalar, z1.imaginary);
    }
305074
public static int mulAndCheck (int x, int y) throws ArithmeticException {
		long m = ((long)x) * ((long)y);
		if (m < Integer.MIN_VALUE || m > Integer.MAX_VALUE) {
			throw new ArithmeticException();
		}
		return (int)m;
	}
29369
public void add(double x, double y) {
		resize(m_pointCount + 1);
		Point2D pt = new Point2D();
		pt.setCoords(x, y);
		setXY(m_pointCount - 1, pt);
	}
1082462
public void add(double x, double y) {
    data.add(x);
    data.add(y);
    minx = Math.min(minx, x);
    maxx = Math.max(maxx, x);
    miny = Math.min(miny, y);
    maxy = Math.max(maxy, y);
  }
1080422
@javax.annotation.Nonnull
  public static double[] sum(@javax.annotation.Nonnull final double[] a, final double b) {
    return com.simiacryptus.util.ArrayUtil.op(a, (x) -> x + b);
  }
930144
public static double Y(int n, double x) {
        double by, bym, byp, tox;

        if (n == 0) return Y0(x);
        if (n == 1) return Y(x);

        tox = 2.0 / x;
        by = Y(x);
        bym = Y0(x);
        for (int j = 1; j < n; j++) {
            byp = j * tox * by - bym;
            bym = by;
            by = byp;
        }
        return by;
    }
848519
public long getIdx(int x,int y){
		long idx=-1;
		if(x>=0&&x<dim1&&y>=0&&y<dim2)
			idx = dim1*x+y;
		return idx;
	}