/src/main/java/net/finmath/montecarlo/automaticdifferentiation/forward/RandomVariableDifferentiableAD.java
derivative = derivative.mult( X.sub( epsilon/2).choose( new RandomVariableFromDoubleArray( 0.0) , new RandomVariableFromDoubleArray( 6.0) ) ) ;
derivative = derivative.mult ( X.sub ( epsilon/2 ) .choose ( new RandomVariableFromDoubleArray ( 0.0 ) , new RandomVariableFromDoubleArray ( 1.0 ) ) ) ;
break; case BARRIER: if(differentialIndex == 0) { derivative = Y.sub(Z); final double epsilon = 0.2*X.getStandardDeviation(); derivative = derivative.mult(X.add(epsilon/2).choose(new RandomVariableFromDoubleArray(1.0), new RandomVariableFromDoubleArray(0.0))); <extra_id_0> derivative = derivative.div(epsilon); } else if(differentialIndex == 1) { derivative = X.choose(one, zero); } else { derivative = X.choose(zero, one); }