double x = this.result.getInput(); double fx = this.result.getOutput(); double slope = this.dfdx.differentiate(x);
double x = this.result.getInput(); double fx = this.result.getOutput(); double slope = this.dfdx.differentiate(x);
double x = this.result.getInput(); double fx = this.result.getOutput(); double slope = this.dfdx.differentiate(x);
public double differentiate( double input ) { double output; if( this.lastEvaluation == null ) { output = this.evaluate(input); this.lastEvaluation = new DefaultInputOutputPair<Double, Double>(input,output); } else if( this.lastEvaluation.getInput() == input ) { output = this.lastEvaluation.getOutput(); } else { output = this.evaluate(input); this.lastEvaluation.setInput(input); this.lastEvaluation.setOutput(output); } double dx = FORWARD_DIFFERENCE; double dy = this.evaluate( input + dx ) - output; return dy / dx; }
public double differentiate( double input ) { double output; if( this.lastEvaluation == null ) { output = this.evaluate(input); this.lastEvaluation = new DefaultInputOutputPair<Double, Double>(input,output); } else if( this.lastEvaluation.getInput() == input ) { output = this.lastEvaluation.getOutput(); } else { output = this.evaluate(input); this.lastEvaluation.setInput(input); this.lastEvaluation.setOutput(output); } double dx = FORWARD_DIFFERENCE; double dy = this.evaluate( input + dx ) - output; return dy / dx; }
public double differentiate( double input ) { double output; if( this.lastEvaluation == null ) { output = this.evaluate(input); this.lastEvaluation = new DefaultInputOutputPair<Double, Double>(input,output); } else if( this.lastEvaluation.getInput() == input ) { output = this.lastEvaluation.getOutput(); } else { output = this.evaluate(input); this.lastEvaluation.setInput(input); this.lastEvaluation.setOutput(output); } double dx = FORWARD_DIFFERENCE; double dy = this.evaluate( input + dx ) - output; return dy / dx; }
new DefaultInputOutputPair<Double, Double>(input,output); else if( this.lastEvaluation.getInput() == input )
new DefaultInputOutputPair<Double, Double>(input,output); else if( this.lastEvaluation.getInput() == input )
new DefaultInputOutputPair<Double, Double>(input,output); else if( this.lastEvaluation.getInput() == input )