Ignore:
Timestamp:
10/02/19 17:03:17 (3 years ago)
Author:
gkronber
Message:

#2994: another unit test for interval arithmetic

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2994-AutoDiffForIntervals/HeuristicLab.Tests/HeuristicLab.Problems.DataAnalysis-3.4/AutoDiffIntervalTest.cs

    r17290 r17293  
    11using System;
     2using System.Collections.Generic;
    23using HeuristicLab.Problems.DataAnalysis.Symbolic;
    34using Microsoft.VisualStudio.TestTools.UnitTesting;
     
    3132        Assert.IsTrue(double.IsNaN(b.LowerBound.Value));
    3233      } else {
    33         Assert.AreEqual(a.LowerBound.Value.Value, b.LowerBound.Value.Value, 1e-10);
     34        Assert.AreEqual(a.LowerBound.Value.Value, b.LowerBound.Value.Value, Math.Abs(a.LowerBound.Value.Value)*1e-4); // relative error < 0.1%
    3435      }
    3536
     
    3738        Assert.IsTrue(double.IsNaN(b.UpperBound.Value));
    3839      } else {
    39         Assert.AreEqual(a.UpperBound.Value.Value, b.UpperBound.Value.Value, 1e-10);
     40        Assert.AreEqual(a.UpperBound.Value.Value, b.UpperBound.Value.Value, Math.Abs(a.UpperBound.Value.Value) * 1e-4);
    4041      }
    4142    }
Note: See TracChangeset for help on using the changeset viewer.