static public BigDecimal addRound(final BigDecimal x, final BigDecimal y) {
    """
	Add and round according to the larger of the two ulp’s.
	
	@param x The left summand
	@param y The right summand
	@return The sum x+y.
    """
        BigDecimal resul = x.add(y);
        /* The estimation of the absolute error in the result is |err(y)|+|err(x)|
         */


        double errR = Math.abs(y.ulp().doubleValue() / 2.) + Math.abs(x.ulp().doubleValue() / 2.);
        MathContext mc = new MathContext(err2prec(resul.doubleValue(), errR));


        return resul.round(mc);


    }
static public BigDecimal addRound(final BigDecimal x, final BigDecimal y) {
        BigDecimal resul = x.add(y);
        /* The estimation of the absolute error in the result is |err(y)|+|err(x)|
         */


        double errR = Math.abs(y.ulp().doubleValue() / 2.) + Math.abs(x.ulp().doubleValue() / 2.);
        MathContext mc = new MathContext(err2prec(resul.doubleValue(), errR));


        return resul.round(mc);


    }
static public BigDecimal addRound ( final BigDecimal x , final BigDecimal y ) { BigDecimal resul = x . add ( y ) ; /* The estimation of the absolute error in the result is |err(y)|+|err(x)|
         */ double errR = Math . abs ( y . ulp ( ) . doubleValue ( ) / 2. ) + Math . abs ( x . ulp ( ) . doubleValue ( ) / 2. ) ; MathContext mc = new MathContext ( err2prec ( resul . doubleValue ( ) , errR ) ) ; return resul . round ( mc ) ; }
Add and round according to the larger of the two ulp’s.

@param x The left summand
@param y The right summand
@return The sum x+y.
Add and round according to the larger of the two ulp’s .