Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/07/19 14:20:33 (5 years ago)
Author:
gkronber
Message:

#2915: Corrected calculation of cuberoot function in all interpreters and updated all formatters.
I tested a run with all interpreters and got the same results with all of them.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Interpreter/SymbolicDataAnalysisExpressionCompiledTreeInterpreter.cs

    r16668 r16905  
    247247        case OpCodes.CubeRoot: {
    248248            var arg = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
    249             return Expression.Power(arg, Expression.Constant(1.0 / 3.0));
     249            return Expression.Condition(Expression.LessThan(arg, Expression.Constant(0.0)),
     250              Expression.Negate(Expression.Power(Expression.Negate(arg), Expression.Constant(1.0 / 3.0))),
     251              Expression.Power(arg, Expression.Constant(1.0 / 3.0)));
    250252          }
    251253        case OpCodes.Root: {
     
    514516            var x1 = MakeExpr(node.GetSubtree(0), variableIndices, row, columns);
    515517            var x2 = MakeExpr(node.GetSubtree(1), variableIndices, row, columns);
    516             return Expression.Divide(x1, 
    517               Expression.Call(Sqrt, 
     518            return Expression.Divide(x1,
     519              Expression.Call(Sqrt,
    518520              Expression.Add(
    519521                Expression.Constant(1.0),
Note: See TracChangeset for help on using the changeset viewer.