package ec.app.regression.testcases;

public class SepticFactory extends FunctionFactory {

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

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

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