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); }
public void DifferenceIsRelativeOutsideZeroVicinity(double x, double y) { Assert.Equal(JacobianComparison.Difference(x, y), Math.Abs(x - y) / (Math.Abs(x) + Math.Abs(y))); }
public void DifferenceIsAbsoluteInZeroVicinity(double x, double y) { Assert.Equal(JacobianComparison.Difference(x, y), Math.Abs(x - y)); }