The sign of the derivative has swapped, indicating that the function is on the other
side of the dip and that a bracket has been found.

@return The new step.
435316
private double handleCase2() {
		double stpc = SearchInterpolate.cubic2(fp, gp, stp, fx, gx, stx);
		double stpq = SearchInterpolate.quadratic2(gp,stp,gx,stx);

		// use which ever is closest to stp since it is lower than stx
		bracket = true;
		if( Math.abs(stpc - stp) > Math.abs(stpq - stp)) {
			return stpc;
		} else {
			return stpq;
		}
	}
1097590
function(t) {

            if (!this.isDifferentiable()) return null;

            if (t < 0) t = 0;
            else if (t > 1) t = 1;

            var skeletonPoints = this.getSkeletonPoints(t);

            var p1 = skeletonPoints.startControlPoint2;
            var p2 = skeletonPoints.dividerControlPoint1;

            var tangentStart = skeletonPoints.divider;

            var tangentLine = new Line(p1, p2);
            tangentLine.translate(tangentStart.x - p1.x, tangentStart.y - p1.y); // move so that tangent line starts at the point requested

            return tangentLine;
        }
1270283
function (x, y, label, horiz, labelOptions, tickmarkOffset, index, step) {
            var axis = this.axis,
              transA = axis.transA,
              reversed = axis.reversed,
              staggerLines = axis.staggerLines;

            x = x + labelOptions.x - (tickmarkOffset && horiz ?
              tickmarkOffset * transA * (reversed ? -1 : 1) : 0);
            y = y + this.yOffset - (tickmarkOffset && !horiz ?
              tickmarkOffset * transA * (reversed ? 1 : -1) : 0);

            // Correct for staggered labels
            if (staggerLines) {
                label.line = (index / (step || 1) % staggerLines);
                y += label.line * (axis.labelOffset / staggerLines);
            }

            return {
                x: x,
                y: y
            };
        }
826376
private function doTransitionFromF() : self
    {
        if ($this->getToken() === Grammar::T_D) {
            $this
                ->setState(self::STATE_E)
                ->addPosition(1)
                ->addTokenValue(Grammar::T_D);
            return $this;
        }

        if ($this->getToken() === Grammar::T_C && $this->hasToken(1) && $this->getToken(1) === Grammar::T_D) {
            $this
                ->setState(self::STATE_D)
                ->addPosition(2)
                ->addTokenValue(Grammar::T_D, Grammar::T_C);
            return $this;
        }

        if ($this->getToken() === Grammar::T_C && $this->hasToken(1) && $this->getToken(1) === Grammar::T_M) {
            $this
                ->setState(self::STATE_D)
                ->addPosition(2)
                ->addTokenValue(Grammar::T_M, Grammar::T_C);
            return $this;
        }

        $this->setState(self::STATE_E);
        return $this;
    }
1117786
function() {
    var op
      , node = this.additive();
    if (op = this.accept('...') || this.accept('..')) {
      this.operand = true;
      if (!node) this.error('illegal unary "' + op + '", missing left-hand operand');
      node = new nodes.BinOp(op.val, node, this.additive());
      this.operand = false;
    }
    return node;
  }
923927
private Zxid getNextProposedZxid() {
    if (lastProposedZxid.getEpoch() != establishedEpoch) {
      lastProposedZxid = new Zxid(establishedEpoch, -1);
    }
    lastProposedZxid = new Zxid(establishedEpoch,
                                lastProposedZxid.getXid() + 1);
    return lastProposedZxid;
  }
42134
public RandomVariableInterface sin() {
		if(isDeterministic()) {
			double newValueIfNonStochastic = FastMath.sin(valueIfNonStochastic);
			return new RandomVariableLowMemory(time, newValueIfNonStochastic);
		}
		else {
			double[] newRealizations = new double[realizations.length];
			for(int i=0; i<newRealizations.length; i++) {
				newRealizations[i]		 = FastMath.sin(realizations[i]);
			}
			return new RandomVariableLowMemory(time, newRealizations);
		}
	}
877554
def reversed(self):
        """"""
        new_quad = QuadraticBezier(self.end, self.control, self.start)
        if self._length_info['length']:
            new_quad._length_info = self._length_info
            new_quad._length_info['bpoints'] = (
                self.end, self.control, self.start)
        return new_quad
599966
public Weight invertSign() {
        if (isInfinity) {
            if (posOrNeg) {
                return WeightFactory.NEG_INFINITY;
            } else {
                return WeightFactory.POS_INFINITY;
            }
        }
        return new Weight(-val);
    }
1098594
def offset(self, mjd, new_scale, eop):
        

        delta = 0
        for one, two in self.steps(new_scale):
            one = one.name.lower()
            two = two.name.lower()
            # find the operation
            oper = "_scale_{}_minus_{}".format(two, one)
            # find the reverse operation
            roper = "_scale_{}_minus_{}".format(one, two)
            if hasattr(self, oper):
                delta += getattr(self, oper)(mjd, eop)
            elif hasattr(self, roper):
                delta -= getattr(self, roper)(mjd, eop)
            else:  # pragma: no cover
                raise DateError("Unknown convertion {} => {}".format(one, two))

        return delta
670080
private double getStartAngle() {
        ScaleDirection scaleDirection = gauge.getScaleDirection();
        Pos            knobPosition   = gauge.getKnobPosition();
        switch(knobPosition) {
            case BOTTOM_LEFT : return ScaleDirection.CLOCKWISE == scaleDirection ? 180 : 90;
            case TOP_LEFT    : return ScaleDirection.CLOCKWISE == scaleDirection ?  90 : 0;
            case TOP_RIGHT   : return ScaleDirection.CLOCKWISE == scaleDirection ?   0 : 270;
            case BOTTOM_RIGHT:
            default          : return ScaleDirection.CLOCKWISE == scaleDirection ? 270 : 180;
        }
    }
219415
final public Step step() throws ParseException {
  Token slash = null;
  String nt;
  Vector pl = null;
  Predicate p;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case SLASH:
      slash = jj_consume_token(SLASH);
      break;
    default:
      jj_la1[2] = jj_gen;
      ;
    }
    nt = nameTest();
    label_1:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case START_BRACKET:
        ;
        break;
      default:
        jj_la1[3] = jj_gen;
        break label_1;
      }
      p = predicate();
          if (pl == null) pl = new Vector();
          pl.add(p);
    }
   // if 'slash != null', then we have '//' versus '/'
   {if (true) return new Step(slash != null, nt, pl);}
    throw new Error("Missing return statement in function");
  }
504897
public PackedDecimal subtract(PackedDecimal operand) {
        if (this.isBruch() || operand.isBruch()) {
            return subtract(operand.toBruch());
        } else {
            return subtract(operand.toBigDecimal());
        }
    }
154903
@Override
    @SuppressWarnings("unchecked")
    public T forward() {
        T x = modIn.getOutput();
        y = (T) x.copyAndConvertAlgebra(s);
        return y;
    }
293030
private void rightDepth(
    DeleteStack.FringeNote      xx,
    int           fbalance)
  {
    switch (fbalance)              /* Original father balance factor        */
    {
      case  1:                     /* Have deleted from right of right-heavy*/
                                   /*  Is now balanced but depth has        */
        xx.depthDecrease = true;   /*  decreased.                           */
        break;
      case  0:                     /* Both sides are t0                     */
        /* G has lost one from whichever side.                              */
        /*   UNLESS lastFringe does an insert fringe re-balancing.          */
        /* In which case it remains balanced and no height change           */
        xx.conditionalDecrease = true;
        xx.conditionalBalance = 0;
        break;
      case -1:                     /* Left side has more than one t0        */
        /* Is now balanced.                                                 */
        /* G has lost one from whichever side.                              */
        /*   UNLESS lastFringe does an insert fringe re-balancing.          */
        /* If true, stack.node(ntop).balance = +1,  G has not lost anything */
        xx.conditionalDecrease = true;
        xx.conditionalBalance = 1;
        break;
      default:
        throw new RuntimeException("Help!  fbalance = " + fbalance);
    }
  }
590878
public String nextToken() {
        /*
         * If next position already computed in hasMoreElements() and
         * delimiters have changed between the computation and this invocation,
         * then use the computed value.
         */

        currentPosition = (newPosition >= 0 && !delimsChanged) ?
            newPosition : skipDelimiters(currentPosition);

        /* Reset these anyway */
        delimsChanged = false;
        newPosition = -1;

        if (currentPosition >= maxPosition)
            throw new NoSuchElementException();
        int start = currentPosition;
        currentPosition = scanToken(currentPosition);
        return str.substring(start, currentPosition);
    }
645073
private double nextRadicalInverse() {
    counter++;
    // Do at most MAXFAST appromate steps
    if(counter >= MAXFAST) {
      counter = 0;
      inverse += MAXFAST;
      current = radicalInverse(inverse);
      return current;
    }
    // Fast approximation:
    double nextInverse = current + invbase;
    if(nextInverse < ALMOST_ONE) {
      current = nextInverse;
      return current;
    }
    else {
      double digit1 = invbase, digit2 = invbase * invbase;
      while(current + digit2 >= ALMOST_ONE) {
        digit1 = digit2;
        digit2 *= invbase;
      }
      current += (digit1 - 1.0) + digit2;
      return current;
    }
  }