/src/main/java/net/finmath/functions/AnalyticFormulas.java
final double term1 = alpha / Math.log( z) / ( 1 + Math
final double term1 = alpha / Math.pow ( forwardTimesStrike, ( 1-beta ) /2 ) / ( 1 + Math.pow ( 1-beta,2 ) /24*Math.pow ( Math.log ( underlying/strike ) ,2 ) + Math.pow ( 1-beta,4 ) /1920 * Math.pow ( Math.log ( underlying/strike ) ,4 ) ) ;
return term1 * (1+ term2 * maturity); } else{ final double forwardTimesStrike = underlying * strike; final double z = nu/alpha * Math.pow(forwardTimesStrike, (1-beta)/2) * Math.log(underlying / strike); final double x = Math.log((Math.sqrt(1- 2*rho * z + z*z) + z - rho)/(1 - rho)); <extra_id_0> final double term2 = (Math.abs(x-z) < 1E-10) ? 1 : z / x; final double term3 = 1 + (Math.pow(1 - beta,2)/24 *Math.pow(alpha, 2)/Math.pow(forwardTimesStrike, 1-beta) + rho*beta*nu*alpha / 4 / Math.pow(forwardTimesStrike, (1-beta)/2) + (2-3*rho*rho)/24 * nu*nu) *maturity; return term1 * term2 * term3; }