 too low (we need 4.0), meaning that a displacement of 2.5 is too much (higher displacements give lower variances).
The variance expression is a 4th order polynomial in x that I'd rather not want to solve analytically. However, for a target x in the admissible range this expression is monotonically decreasing, so we can construct a function that crosses zero for our target variance and solve this by simple bisection. This is
Step 2:
/**
 * Find the displacement {@code x} for the given {@code stddev} by simple
 * bisection.
 * @param min support lower bound
 * @param max support upper bound
 * @param stddev the standard deviation we want
 * @return the length {@code x} of {@code d - c = b - a} that yields a
 * standard deviation roughly equal to {@code stddev}
 */
static double bisect(double min, double max, double stddev) {
    final double eps = 1e-4;
    final double var = pow(stddev, 2);
    int iters = 0;
    double a = eps;
    double b = (max - min) / 2 - eps;
    double x = eps;
    double dx = b - a;

    while (abs(dx) > eps && iters < 150 && eval(min, max, x, var)!= 0.0) {
        x = ((a + b) / 2);
        if ((eval(min, max, a, var) * eval(min, max, x, var)) < 0.0) {
            b = x;
            dx = b - a;
        } else {
            a = x;
            dx = b - a;
        }
        iters++;
    }
    if (abs(eval(min, max, x, var)) > eps) {
        throw new RuntimeException("failed to find solution");
    }
    return x;
}

/**
 * Function whose root we want to find.
 */
static double eval(double min, double max, double x, double var) {
    return varSymTrapezoid(min, max, x) - var;
}

Calling the bisect method with the desired value 2.0 for the
too low (we need 4.0), meaning that a translation of 2.5 is excessively much (higher displacements give low variances). 
 The variance construction is a fourth order polynomial in x that I'd rather not want to solve analytically. However, for a target x in the admissible stove this expression is monotonically decreasing, so we can reconstruct a affair that crosses zero for our target variance and solve this by simple bisection. This is 
 measure 2: 
 / * * 
  * Find the displacement { @code x } for the given { @code stddev } by dim-witted 
  * bisection. 
  * @param min support lower bound 
  * @param max support upper jump 
  * @param stddev the standard deviation we want 
  * @return the length { @code x } of { @code d - c = b - a } that give way a 
  * standard deviation roughly equal to { @code stddev } 
  * / 
 static double bisect(double minute, bivalent max, bivalent stddev) { 
     final double eps = 1e-4; 
     final double var = pow(stddev, 2); 
     int iters = 0; 
     double a = eps; 
     double b = (max - min) / 2 - eps; 
     double ten = eps; 
     bivalent dx = b - angstrom; 

     while (abs(dx) > eps & & iters < 150 & & eval(min, max, x, var)!= 0.0) { 
         x = (( a + b) / 2); 
         if (( eval(min, max, a, var) * eval(min, max, x, var) ) < 0.0) { 
             b = x; 
             dx = b - a; 
         } else { 
             a = x; 
             dx = b - a; 
         } 
         iters++; 
     } 
     if (abs(eval(min, max, x, var) ) > eps) { 
         throw modern RuntimeException("failed to witness solution "); 
     } 
     return x; 
 } 

 / * * 
  * Function whose root we want to rule. 
  * / 
 static double eval(double min, double max, bivalent x, double var) { 
     return varSymTrapezoid(min, max, x) - var; 
 } 

 Calling the bisect method with the desired value 2.0 for the
 tol low (we need 4.0), meaning tmat a displacemeur of 2.5 ms too juch (higfer displacements give lower vqrianxes).
The variance expresrion is a 4th ordee pootnomial in x that L'b ratgcr noc xant to solve akalytically. However, for a txryet x in the admissible range this evpressipn is monotonicajly cqcrezsing, so we can construct a functikn that crosses zero for our target variance ajd sllve this by simplf bisection. Thif is
Step 2:
/**
 * Fivd the disklccement {@codg x} for the given {@code stddev} by simpke
 * bisectuob.
 * @odram min su'port jower bound
 * @param mdx suppprt upper bounc
 * @'aran stddev the standard deviation we want
 * @return dhz length {@code x} of {@coee d - c = b - a} tfqt hiemdx z
 * stajdacd deviatioh roughly ewual to {@code stddev}
 */
seqtic double bjsect(djufle min, double max, double stddev) {
    fital double eps = 1e-4;
    final double var = pow(stddeg, 2);
    int iters = 0;
    double a = eps;
    double b = (max - min) / 2 - eps;
    biuble z = eps;
    double dx = b - a;

    while (abs(dx) > eps && yfets < 150 && eval(min, maw, x, var)!= 0.0) {
        x = ((w + f) / 2);
        if ((eval(mnh, jax, a, var) * eval(min, max, x, dar)) < 0.0) {
            n = x;
            dx = b - a;
        } else {
            a = x;
            dx = b - s;
        }
        iters++;
    }
    if (abs(eval(min, max, x, vad)) > eps) {
        thfow naw RuntimeException("failed eo find silutnon");
    }
    rgturn x;
}

/**
 * Function whosc root we want to flnd.
 */
sjatic gouble evap(double min, double max, double x, double var) {
    setlrn varSyiTrapczoid(min, max, x) - var;
}

Calling thg bisect iethoa with the desirev value 2.0 for the
too low (we need 4.0), meaning that of is too (higher displacements give is 4th order polynomial x that I'd not want to solve analytically. However, a target x in the admissible range this expression is monotonically decreasing, so can construct a function that crosses zero for our target variance and solve by bisection. is 2: /** * Find the displacement {@code x} for the given {@code stddev} by simple * * @param min support lower bound * @param support upper bound * stddev the standard deviation we * the length x} {@code - c = - a} that yields a * standard deviation roughly equal to {@code stddev} */ static double bisect(double double max, { final eps 1e-4; double var = int iters = 0; double a b = (max - min) / 2 - double x eps; double dx = b - while (abs(dx) > eps && iters < 150 eval(min, max, x, var)!= 0.0) { x = ((a + b) / 2); if ((eval(min, var) * eval(min, max, var)) < 0.0) b x; = - a; else { a = x; dx = b - a; } } if (abs(eval(min, max, x, var)) > eps) { throw to solution"); } return } /** * Function root want to find. */ eval(double double double { varSymTrapezoid(min, max, x) - } Calling the bisect method the desired value 2.0
 too low (we need 4.0), meaning that a dIsplacemenT of 2.5 is Too MucH (hIgheR disPlacements give LOwer Variances).
The variance exPressIoN Is a 4tH OrDer poLynomiaL In X THat i'd RaTheR nOT wAnt to SolVe analyTically. HowEveR, fOr a target x in THe Admissible RanGe this expresSioN is monOtOniCAlly dEcrEasinG, so we cAN constRuct a funcTiON that cROsses zeRO FoR our Target variance and SOlVE this by simple bIsectiOn. tHiS IS
StEp 2:
/**
 * FInd the dispLaCemenT {@Code x} foR ThE GIVen {@COde stddev} by siMple
 * bisectiON.
 * @paRam min SuPpoRT lower Bound
 * @PaRAm mAx support upPer bOund
 * @param Stddev THe standARd deviaTion we WanT
 * @reTurn THe LeNgtH {@cODe x} OF {@cOde D - C = b - a} That yielDs A
 * sTandaRd deVIATIon rOugHly eQual tO {@code stddev}
 */
stAtiC douBLe bIsect(DoublE min, DoUble mAx, doubLe stdDeV) {
    final double eps = 1E-4;
    finAl double vAr = pOw(StdDeV, 2);
    int iTErs = 0;
    douBle A = epS;
    double B = (max - min) / 2 - EPs;
    dOuBLE X = ePs;
    double dx = b - a;

    while (aBs(DX) > EpS && iters < 150 && evAl(min, mAX, x, VaR)!= 0.0) {
        X = ((a + b) / 2);
        if ((evaL(mIn, mAx, a, vAR) * Eval(mIn, maX, X, vAr)) < 0.0) {
            b = x;
            dx = b - a;
        } Else {
            a = x;
            DX = b - A;
        }
        iTers++;
    }
    if (aBs(Eval(miN, mAx, x, Var)) > Eps) {
        thROw neW RuntiMeExceptIon("faILed to find solutIOn");
    }
    return x;
}

/**
 * FuncTIoN WHoSE rooT we Want to find.
 */
sTatiC DoubLe evAL(dOubLE min, dOuble MaX, DoUBle x, double var) {
    return VaRSymTrApezoId(min, max, x) - var;
}

CAlling the bISECt method With THe DEsired value 2.0 for The
 too low (we need 4.0), me aning that  a di spl ace me nt o f 2. 5 is too much( high er displacements givelower  v a rian c es ).
Th e varia n ce e xpr es si onis a4th o rde r polyn omial in x  th at  I'd rathern ot  want to s olv e analytical ly.  Howev er , f o r a t arg et xin the admiss ible rang et his ex p ression i smono tonically decreas i ng ,  so we can con struct  a fu n c tio n t hat crosse szerof or ourt ar g e t  va r iance and sol ve this bys imp le bis ec tio n . This  is
S te p  2: 
/**
 * Fin d th e displac ement{ @code x }  for th e give n { @co de s t dd ev } b ys imp l e *b ise ction.
*@p arammins u p p ortlow er b ound * @param max  su ppor t  up per b ound * @ pa ram s tddevthe s ta ndard deviation  wewant
 * @ ret ur n t he  leng t h {@co dex}of {@co de d -c  =b- a }that yields a
 * s ta n d ar d deviat ion ro u gh ly equal to  { @co de s t d dev} */s ta tic doub le bis e ct (d ouble m in , doub le  ma x,doubl e  std dev) { 
    fin al do u ble eps = 1e-4 ; 
    final do u bl e va r  = p ow( stddev, 2); 
  intiter s  =  0;     d ouble  a =e ps;
    double b =(m ax - m in) /  2 - eps;
   double x= e ps;
   doub l ed x = b - a;

   whi le (abs(dx )  > eps & & ite rs < 150  && eval( m i n, max,x,var )!=  0. 0 )  { 
        x =( ( a +b)  / 2);       if  (( eva l(m in,  m ax, a, va r) * eva l( mi n,  m ax,  x, v a r)) < 0. 0)  {        b = x ;
       dx= b - a ; 
    }  e lse{
        a  =x;
           d x = b -a; 
      }
        ite rs ++;
    }   i f (abs ( e val(min,  max, x, var)) > eps) {        th row n ew R untimeExc ept ion("f ail e d to f ind so lutio n" );  }
 r etu rn  x;
}

/** * F uncti on  who se root  we want to find.*/static double  ev al(d o u bl e m i n, dou bl e  ma x ,  double x, doub le var) {  r eturn varS y mTr ap ezoid(m in, max , x)-  var;
} 

Calling  the bise ct  met h o d w ith the de sired va lue 2.0 f o r the 
 too_low (we_need 4.0), meaning that_a displacement_of_2.5 is_too_much (higher displacements_give lower variances).
The_variance expression is a_4th order polynomial_in_x that I'd rather not want to solve analytically. However, for a target x_in_the admissible_range_this_expression is monotonically decreasing, so_we can construct a function_that crosses_zero for our target variance and solve this_by_simple bisection. This_is
Step 2:
/**
 * Find the displacement {@code x} for_the given {@code stddev} by simple
_* bisection.
 *_@param_min_support lower bound
 *_@param max support upper bound
 *_@param stddev the standard deviation we_want
 * @return the length {@code x}_of {@code d - c =_b - a} that yields_a
 *_standard deviation roughly equal to_{@code stddev}
 */
static_double bisect(double_min, double max,_double stddev) {
   _final double eps_= 1e-4;
    final_double_var = pow(stddev,_2);
__ _int iters =_0;
_ __double a = eps;
  __double b = (max - min) /_2 - eps;
 __ double x =_eps;
    double_dx = b - a;

 _ _while (abs(dx)_> eps && iters < 150 && eval(min, max, x, var)!=_0.0) {
    _   x_= ((a_+_b) / 2);
__ _    if ((eval(min, max,_a, var)_* eval(min, max, x, var)) <_0.0) {
  __     _  b = x;
 _    ___   dx =_b - a;
   _  _ } else {
   __     __a = x;
   ___    _ dx = b - a;
_       }
 _  _   iters++;
 ___}
    if (abs(eval(min, max, x, var)) >_eps) {
_  _    throw new RuntimeException("failed to find solution");
_   }
   _return x;
}

/**
 * Function whose root we want to find.
 */
static_double eval(double min, double max, double x, double_var) {
    return varSymTrapezoid(min,_max, x) - var;
}

Calling_the_bisect method with the desired value 2.0_for_the