public void Get_derivative_simplified2() { BigFunction func = new BigFunction(); string input = "/(+(*(7,x),+(-(6,-(*(8,x),*(4,x))),*(n(12),x))),*(2,x))"; func.RootFunc = func.Insert(ref input); OxyPlot.WindowsForms.PlotView pv1 = new PlotView(); pv1.Model = new PlotModel { }; FunctionSeries serie = new FunctionSeries(); serie = func.GetFunctionSerieForDerivativeAnalyticallySimplify(); pv1.Model.Series.Add(serie); Assert.AreEqual(func.ParseToString(func.RootFunc.GetDerivativeAnalytically().SimplifyFunction()), "((((7 + (( - 4) + 12)) * (2 * x )) - (((7 * x ) + ((6 - ((8 * x ) - (4 * x ))) + (12 * x ))) * 2)) / ((2 * x ) ^ 2))"); }
public void Get_derivative_simplified1() { BigFunction func = new BigFunction(); string input = "-(*(/(c(*(r(-5.7),x)),s(l(+(n(27),*(3,^(p,8)))))),!(4)),e(-2))"; func.RootFunc = func.Insert(ref input); OxyPlot.WindowsForms.PlotView pv1 = new PlotView(); pv1.Model = new PlotModel { }; FunctionSeries serie = new FunctionSeries(); serie = func.GetFunctionSerieForDerivativeAnalyticallySimplify(); pv1.Model.Series.Add(serie); Assert.AreEqual(func.ParseToString(func.RootFunc.GetDerivativeAnalytically().SimplifyFunction()), "((((5.7 * sin ((-5.7 * x ))) * sin ( ln ((27 + (3 * ( p ^ 8)))))) / ( sin ( ln ((27 + (3 * ( p ^ 8))))) ^ 2)) * 4 ! )"); }