/src/main/java/net/finmath/equities/models/SviVolatilitySmile.java
/ ( logStrikes.get( nPoints - 1) - logStrikes.get( nPoints - 2) ) ;/ ( logStrikes.get( 1) - logStrikes.get( 0) ) ;
/ ( logStrikes.get ( 1 ) - logStrikes.get ( 0 ) ) ;
final var w = totalVariances.get(atmIndex); final var d2wdk2 = 2 * (totalVariances.get(atmIndex + 1) * totalVariances.get(atmIndex - 1) - 2 * w) / (Math.pow(logStrikes.get(atmIndex + 1), 2) + Math.pow(logStrikes.get(atmIndex - 1), 2)); final var c = (totalVariances.get(nPoints - 1) - totalVariances.get(nPoints - 2)) / (logStrikes.get(nPoints - 1) - logStrikes.get(nPoints - 2)); final var p = (totalVariances.get(0) - totalVariances.get(1)) <extra_id_0> final var b = 0.5 * (c + p); final var rho = 1 - 2 * p / (c + p); final var m = b * (1 - rho * rho) * Math.abs(rho) / d2wdk2; final var sigma = m * Math.sqrt(1 - rho * rho) / rho; final var a = w - b * sigma * Math.sqrt(1 - rho * rho); return new double[] {a, b, rho, m, sigma};