public final double blackForwardVol(final double time1,final double time2,final double strike,final boolean extrapolate){
  final double t1=time1;
  final double t2=time2;
  QL.require(t1 <= t2,"t1 later than t2");
  checkRange(time2,extrapolate);
  checkStrike(strike,extrapolate);
  if (t1 == t2) {
    if (t1 == 0.0) {
      final double epsilon=1.0e-5;
      final double var=blackVarianceImpl(epsilon,strike);
      return Math.sqrt(var / epsilon);
    }
 else {
      final double epsilon=Math.min(1.0e-5,t1);
      final double var1=blackVarianceImpl(t1 - epsilon,strike);
      final double var2=blackVarianceImpl(t1 + epsilon,strike);
      QL.require(var2 >= var1,"variances must be non-decreasing");
      return Math.sqrt((var2 - var1) / (2 * epsilon));
    }
  }
 else {
    final double var1=blackVarianceImpl(time1,strike);
    final double var2=blackVarianceImpl(time2,strike);
    QL.require(var2 >= var1,"variances must be non-decreasing");
    return Math.sqrt((var2 - var1) / (t2 - t1));
  }
}

public final double blackForwardVol ( final double time1 , final double time2 , final double strike , final boolean extrapolate ) { final double t1 = time1 ; final double t2 = time2 ; QL . require ( t1 <= t2 , "t1 later than t2" ) ; checkRange ( time2 , extrapolate ) ; checkStrike ( strike , extrapolate ) ; if ( t1 == t2 ) { if ( t1 == 0.0 ) { final double epsilon = 1.0e-5 ; final double var = blackVarianceImpl ( epsilon , strike ) ; return Math . sqrt ( var / epsilon ) ; } else { final double epsilon = Math . min ( 1.0e-5 , t1 ) ; final double var1 = blackVarianceImpl ( t1 - epsilon , strike ) ; final double var2 = blackVarianceImpl ( t1 + epsilon , strike ) ; QL . require ( var2 >= var1 , "variances must be non-decreasing" ) ; return Math . sqrt ( ( var2 - var1 ) / ( 2 * epsilon ) ) ; } } else { final double var1 = blackVarianceImpl ( time1 , strike ) ; final double var2 = blackVarianceImpl ( time2 , strike ) ; QL . require ( var2 >= var1 , "variances must be non-decreasing" ) ; return Math . sqrt ( ( var2 - var1 ) / ( t2 - t1 ) ) ; } }
future ( a . k . a . forward ) volatility
