예제 #1
0
        static void Main()
        {
            //Type the function you want to simplify
            Expression <Func <double, double, double, double, double> > function =
                (x, y, z, u) => (x + 42) / 1 + y * 0 / (z - 0) + 43 - Math.Pow(x, 0) * Math.Pow(u, 1) / (0 + 5);

            var tree           = Expressions2Tree.Parse(function);
            var simplifiedTree = ComputerAlgebra.Simplify(tree);

            Console.WriteLine("Initial function:{1}F(x,y,z,u) = {0}{1}", tree, Environment.NewLine);
            Console.WriteLine("Result of simplification:{1}{0}", simplifiedTree, Environment.NewLine);
        }
예제 #2
0
파일: Tests.cs 프로젝트: okulovsky/CA
 public static INode SimplifyLogicTree(INode root)
 {
     return(ComputerAlgebra.Simplify(root));
 }
예제 #3
0
파일: Tests.cs 프로젝트: okulovsky/CA
 public static INode SimplifyBinaryExpression(Expression e)
 {
     return(ComputerAlgebra.Simplify(Expressions2Tree.Parse(e)));
 }