package ec.app.regression.testcases;

/**
 * @author Tomasz Pawlak
 */
public class Nguyen12Factory extends FunctionFactory {

    @Override
    protected int arity() {
        return 2;
    }

    @Override
    protected double function(Double... x) {
        //return x[0] * x[0] * x[0] * x[0] - x[0] * x[0] * x[0] + 0.5 * x[1] * x[1] - x[1];
        return x[0] * x[0] * x[0] * (x[0] - 1) + x[1] * (0.5 * x[1] - 1);
    }

    @Override
    public String getSymbolicRepresentation() {
        return "x0 * x0 * x0 * x0 - x0 * x0 * x0 + 0.5 * x1 * x1 - x1";
    }
}
