public void Can_Abs_Minus4() { var x = new Variable { Name = "x", ValueInSI = -4 }; var evaluator = new Evaluator(); Assert.AreEqual(4, Sym.Abs(x).Eval(evaluator)); }
public void Can_Differentiate_Abs() { var x = new Variable { Name = "x", ValueInSI = -3 }; var y = new Variable { Name = "y", ValueInSI = 6 }; var evaluator = new Evaluator(); Assert.AreEqual(6, Sym.Abs(x * y).Diff(evaluator, x)); Assert.AreEqual(3, Sym.Abs(x * y).Diff(evaluator, y)); }