BaroneAdesiWhaleyModel { protected double sCrit(final double s0, final double k, final double r, final double b, final double t, final double sigma, final boolean isCall) { if (isCall) { final CallSolver solver = new CallSolver(s0, k, r, b, t, sigma); return solver.getSStar(); } final PutSolver solver = new PutSolver(s0, k, r, b, t, sigma); return solver.getSStar(); }  double price(final double s0, final double k, final double r, final double b, final double t, final double sigma, final boolean isCall); double[] getPriceAdjoint(final double s0, final double k, final double r, final double b, final double t, final double sigma, final boolean isCall); double[] getPriceDeltaGamma(final double s0, final double k, final double r, final double b, final double t, final double sigma, final boolean isCall); double[] getPriceAndVega(final double s0, final double k, final double r, final double b, final double t, final double sigma, final boolean isCall); Function1D<Double, double[]> getPriceAndVegaFunction(final double s0, final double k, final double r, final double b, final double t, final boolean isCall); double impliedVolatility(final double price, final double s0, final double k, final double r, final double b, final double t, final boolean isCall);  }
@Test(enabled = false) public void sCritTest() { final double s0 = 110; final double k = 110; ; final double r = 0.1; final double b = -0.04; final double sigma = 0.35; final boolean isCall = true; final BaroneAdesiWhaleyModel baw = new BaroneAdesiWhaleyModel(); for (int i = 0; i < 100; i++) { final double t = Math.exp(i / 15.0 - 6.0); final double sCrit = baw.sCrit(s0, k, r, b, t, sigma, isCall); System.out.println(t + "\t" + sCrit); } }