class BjerksundStenslandModel {

  protected double[] getAlphaAdjoint(double k, double x, double beta) {

    double w1 = Math.pow(x, -beta);
    double w2 = x - k;
    double w3 = w2 * w1;

    double w2Bar = w1;
    double w1Bar = w2;

    double[] res = new double[4];
    res[0] = w3;
    res[1] = -w2Bar; // kBar
    res[2] = w2Bar - beta * w1 / x * w1Bar; // xBar
    res[3] = -Math.log(x) * w3; // betaBar

    return res;
  }

}