コード例 #1
0
        public void InfinityZeroDifference()
        {
            var diff = JacobianComparison.Difference(double.PositiveInfinity, double.PositiveInfinity);

            Assert.Equal(0.0, diff);
            diff = JacobianComparison.Difference(double.NegativeInfinity, double.NegativeInfinity);
            Assert.Equal(0.0, diff);
            diff = JacobianComparison.Difference(double.PositiveInfinity, double.NegativeInfinity);
            Assert.NotEqual(0.0, diff);
        }
コード例 #2
0
 public void DifferenceIsRelativeOutsideZeroVicinity(double x, double y)
 {
     Assert.Equal(JacobianComparison.Difference(x, y), Math.Abs(x - y) / (Math.Abs(x) + Math.Abs(y)));
 }
コード例 #3
0
 public void DifferenceIsAbsoluteInZeroVicinity(double x, double y)
 {
     Assert.Equal(JacobianComparison.Difference(x, y), Math.Abs(x - y));
 }