Free cookie consent management tool by TermsFeed Policy Generator

Changeset 16769


Ignore:
Timestamp:
04/05/19 12:13:54 (6 years ago)
Author:
gkronber
Message:

#2966: added error-thresholds for comparisons in unit tests (hopefully fixing tests)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4/IntervalInterpreterTest.cs

    r16758 r16769  
    8888      localVarRanges.Add("x5", new Interval(Math.PI/4, Math.PI*3.0/4));
    8989
    90       EvaluateTest("sin(x1)", new Interval(Math.Sin(-1), Math.Sin(1)), localVarRanges);
    91       EvaluateTest("sin(x2)", new Interval(-1, 0), localVarRanges);
    92       EvaluateTest("sin(x3)", new Interval(0, 1), localVarRanges);
    93       EvaluateTest("sin(x4)", new Interval(-1, 1), localVarRanges);
    94       EvaluateTest("sin(x5)", new Interval(Math.Sin(Math.PI/4), 1), localVarRanges);
     90      EvaluateTest("sin(x1)", new Interval(Math.Sin(-1), Math.Sin(1)), localVarRanges, 1E-8, 1E-8);
     91      EvaluateTest("sin(x2)", new Interval(-1, 0), localVarRanges, 1E-8, 1E-8);
     92      EvaluateTest("sin(x3)", new Interval(0, 1), localVarRanges, 1E-8, 1E-8);
     93      EvaluateTest("sin(x4)", new Interval(-1, 1), localVarRanges, 1E-8, 1E-8);
     94      EvaluateTest("sin(x5)", new Interval(Math.Sin(Math.PI/4), 1), localVarRanges, 1E-8, 1E-8);
    9595    }
    9696
     
    110110      localVarRanges.Add("x5", new Interval(Math.PI / 4, Math.PI * 3.0 / 4));
    111111
    112       EvaluateTest("cos(x1)", new Interval(Math.Cos(-1), 1), localVarRanges);
    113       EvaluateTest("cos(x2)", new Interval(0, 1), localVarRanges);
    114       EvaluateTest("cos(x3)", new Interval(0, 1), localVarRanges);
    115       EvaluateTest("cos(x4)", new Interval(-1, 1), localVarRanges);
    116       EvaluateTest("cos(x5)", new Interval(Math.Cos(Math.PI *3.0/ 4), Math.Cos(Math.PI/ 4)), localVarRanges);
     112      EvaluateTest("cos(x1)", new Interval(Math.Cos(-1), 1), localVarRanges, 1E-8, 1E-8);
     113      EvaluateTest("cos(x2)", new Interval(0, 1), localVarRanges, 1E-8, 1E-8);
     114      EvaluateTest("cos(x3)", new Interval(0, 1), localVarRanges, 1E-8, 1E-8);
     115      EvaluateTest("cos(x4)", new Interval(-1, 1), localVarRanges, 1E-8, 1E-8);
     116      EvaluateTest("cos(x5)", new Interval(Math.Cos(Math.PI *3.0/ 4), Math.Cos(Math.PI/ 4)), localVarRanges, 1E-8, 1E-8);
    117117
    118118    }
Note: See TracChangeset for help on using the changeset viewer.