Home | History | Annotate | Download | only in solvers

Lines Matching defs:x2

200         // [x0, x2] is the bracketing interval in each iteration
201 // x1 is the last approximation and an interpolation point in (x0, x2)
207 double x2 = max;
208 double y2 = f.value(x2);
209 double x1 = 0.5 * (x0 + x2);
224 // x0, x1, x2 and x is the zero of the interpolating parabola.
226 // real roots and we choose one in [x0, x2] to be x.
228 final double d12 = (y2 - y1) / (x2 - x1);
229 final double d012 = (d12 - d01) / (x2 - x0);
235 // one of them should lie in (x0, x2)
236 final double x = isSequence(x0, xplus, x2) ? xplus : xminus;
254 boolean bisect = (x < x1 && (x1 - x0) > 0.95 * (x2 - x0)) ||
255 (x > x1 && (x2 - x1) > 0.95 * (x2 - x0)) ||
261 x2 = x > x1 ? x2 : x1;
266 double xm = 0.5 * (x0 + x2);
269 x2 = xm; y2 = ym;
273 x1 = 0.5 * (x0 + x2);
286 * condition, e.g. f(x0), f(x1), f(x2) can have the same sign. If complex
318 * condition, e.g. f(x0), f(x1), f(x2) can have the same sign. If complex
344 // x2 is the last root approximation
345 // x is the new approximation and new x2 for next round
346 // x0 < x1 < x2 does not hold here
352 double x2 = 0.5 * (x0 + x1);
353 double y2 = f.value(x2);
362 // quadratic interpolation through x0, x1, x2
363 final double q = (x2 - x1) / (x1 - x0);
380 x = x2 - 2.0 * c * (x2 - x1) / denominator;
381 // perturb x if it exactly coincides with x1 or x2
383 while (x == x1 || x == x2) {
407 x1 = x2;
409 x2 = x;