Search in sources :

Example 11 with RealUnaryExpression

use of org.evosuite.symbolic.expr.fp.RealUnaryExpression in project evosuite by EvoSuite.

the class ArithmeticVM method DNEG.

@Override
public void DNEG() {
    RealValue param = env.topFrame().operandStack.popFp64();
    double param_concrete_value = ((Double) param.getConcreteValue()).doubleValue();
    if (!param.containsSymbolicVariable()) {
        param = ExpressionFactory.buildNewRealConstant(param_concrete_value);
    }
    double con = -param_concrete_value;
    RealValue realExpr = new RealUnaryExpression(param, Operator.NEG, con);
    env.topFrame().operandStack.pushFp64(realExpr);
}
Also used : RealValue(org.evosuite.symbolic.expr.fp.RealValue) RealUnaryExpression(org.evosuite.symbolic.expr.fp.RealUnaryExpression)

Example 12 with RealUnaryExpression

use of org.evosuite.symbolic.expr.fp.RealUnaryExpression in project evosuite by EvoSuite.

the class ArithmeticVM method FNEG.

@Override
public void FNEG() {
    RealValue param = env.topFrame().operandStack.popFp32();
    float param_concrete_value = ((Double) param.getConcreteValue()).floatValue();
    if (!param.containsSymbolicVariable()) {
        param = ExpressionFactory.buildNewRealConstant(param_concrete_value);
    }
    float con = -param_concrete_value;
    RealValue realExpr = new RealUnaryExpression(param, Operator.NEG, (double) con);
    env.topFrame().operandStack.pushFp32(realExpr);
}
Also used : RealValue(org.evosuite.symbolic.expr.fp.RealValue) RealUnaryExpression(org.evosuite.symbolic.expr.fp.RealUnaryExpression)

Example 13 with RealUnaryExpression

use of org.evosuite.symbolic.expr.fp.RealUnaryExpression in project evosuite by EvoSuite.

the class CEIL method executeFunction.

@Override
public Object executeFunction() {
    double res = this.getConcDoubleRetVal();
    RealValue realExpression = this.getSymbRealArgument(0);
    RealValue ceilExpr;
    if (realExpression.containsSymbolicVariable()) {
        Operator op = Operator.CEIL;
        ceilExpr = new RealUnaryExpression(realExpression, op, res);
    } else {
        ceilExpr = this.getSymbRealRetVal();
    }
    return ceilExpr;
}
Also used : RealValue(org.evosuite.symbolic.expr.fp.RealValue) Operator(org.evosuite.symbolic.expr.Operator) RealUnaryExpression(org.evosuite.symbolic.expr.fp.RealUnaryExpression)

Example 14 with RealUnaryExpression

use of org.evosuite.symbolic.expr.fp.RealUnaryExpression in project evosuite by EvoSuite.

the class EXP method executeFunction.

@Override
public Object executeFunction() {
    double res = this.getConcDoubleRetVal();
    RealValue realExpression = this.getSymbRealArgument(0);
    RealValue expExpr;
    if (realExpression.containsSymbolicVariable()) {
        Operator op = Operator.EXP;
        expExpr = new RealUnaryExpression(realExpression, op, res);
    } else {
        expExpr = this.getSymbRealRetVal();
    }
    return expExpr;
}
Also used : RealValue(org.evosuite.symbolic.expr.fp.RealValue) Operator(org.evosuite.symbolic.expr.Operator) RealUnaryExpression(org.evosuite.symbolic.expr.fp.RealUnaryExpression)

Example 15 with RealUnaryExpression

use of org.evosuite.symbolic.expr.fp.RealUnaryExpression in project evosuite by EvoSuite.

the class LOG method executeFunction.

@Override
public Object executeFunction() {
    double res = this.getConcDoubleRetVal();
    RealValue realExpression = this.getSymbRealArgument(0);
    RealValue logExpr;
    if (realExpression.containsSymbolicVariable()) {
        Operator op = Operator.LOG;
        logExpr = new RealUnaryExpression(realExpression, op, res);
    } else {
        logExpr = this.getSymbRealRetVal();
    }
    return logExpr;
}
Also used : RealValue(org.evosuite.symbolic.expr.fp.RealValue) Operator(org.evosuite.symbolic.expr.Operator) RealUnaryExpression(org.evosuite.symbolic.expr.fp.RealUnaryExpression)

Aggregations

RealUnaryExpression (org.evosuite.symbolic.expr.fp.RealUnaryExpression)23 RealValue (org.evosuite.symbolic.expr.fp.RealValue)23 Operator (org.evosuite.symbolic.expr.Operator)21