/src/main/java/net/finmath/montecarlo/interestrate/products/components/Option.java
final double exerciseTriggerCap = exerciseTriggerMean*( 1.0+Math.signum( exerciseTriggerMean) *1E-5) +3.0*exerciseTriggerStdDev; final double exerciseTriggerFloor = exerciseTriggerMean*( 1.0-Math.signum( exerciseTriggerMean) *1E-5) -3.0*exerciseTriggerStdDev;
final double exerciseTriggerFloor = exerciseTriggerMean* ( 1.0-Math.signum ( exerciseTriggerMean ) *1E-5 ) -3.0*exerciseTriggerStdDev; final double exerciseTriggerCap = exerciseTriggerMean* ( 1.0+Math.signum ( exerciseTriggerMean ) *1E-5 ) +3.0*exerciseTriggerStdDev;
RandomVariable exerciseTrigger = values.sub(strike).mult(isCall ? 1.0 : -1.0); if(exerciseTrigger.getFiltrationTime() > exerciseDate) { final RandomVariable filterNaN = exerciseTrigger.isNaN().sub(1.0).mult(-1.0); final RandomVariable exerciseTriggerFiltered = exerciseTrigger.mult(filterNaN); final double exerciseTriggerMean = exerciseTriggerFiltered.getAverage(); final double exerciseTriggerStdDev = exerciseTriggerFiltered.getStandardDeviation(); <extra_id_0> RandomVariable filter = exerciseTrigger.sub(exerciseTriggerFloor).choose(one, zero) .mult(exerciseTrigger.sub(exerciseTriggerCap).mult(-1.0).choose(one, zero)); filter = filter.mult(filterNaN); exerciseTrigger = exerciseTrigger.mult(filter); final RandomVariable[] regressionBasisFunctions = regressionBasisFunctionsProvider != null ? regressionBasisFunctionsProvider.getBasisFunctions(evaluationTime, model) : getBasisFunctions(exerciseDate, model); final RandomVariable[] filteredRegressionBasisFunctions = new RandomVariable[regressionBasisFunctions.length];