/src/main/java/net/finmath/functions/AnalyticFormulas.java
term1 = nu * ( underlying-strike) / x;term1 = alpha * z2 * z * ( underlying-strike) / x;
term1 = alpha * z2 * z * ( underlying-strike ) / x;
double term1; if(Math.abs(underlying - strike) < 1E-8 * (1+Math.abs(underlying))) { term1 = alpha * Math.pow(underlying, beta); } else { final double z2 = (1.0 - beta) / (Math.pow(underlying, 1.0-beta) - Math.pow(strike, 1.0-beta)); <extra_id_0> } final double sigma = term1 * (1.0 + maturity * ((-beta*(2-beta)*alpha*alpha)/(24*Math.pow(forwardStrikeAverage,2.0*(1.0-beta))) + beta*alpha*rho*nu / (4*Math.pow(forwardStrikeAverage,(1.0-beta))) + (2.0 -3.0*rho*rho)*nu*nu/24)); return Math.max(sigma, 0.0); } public static double sabrAlphaApproximation(final double normalVolatility, final double beta, final double rho, final double nu, final double displacement, double underlying, final double maturity) {