예제 #1
0
        public override IBaseMathOperator CalculateSimplyfy()
        {
            switch (A)
            {
            case ConstantMathOperator _ when Math.Abs(A.Result() - 1) < 0.000001:
                return(new EMathOperator());

            case ConstantMathOperator _ when Math.Abs(A.Result()) < 0.000001:
                return(new ConstantMathOperator(1));
            }
            var instance = new ExpotentialEOperator();

            instance.Instantiate(new [] { A.Simplyfy() });
            return(instance);
        }
예제 #2
0
        public override IBaseMathOperator Derivate()
        {
            if (IsConstant())
            {
                return(new ConstantMathOperator(0));
            }

            var newThis = new ExpotentialEOperator();

            newThis.Instantiate(GetChilds());
            var rightMulti = new MultiplyMathOperator();

            rightMulti.Instantiate(new [] { A.Derivate(), newThis });

            return(rightMulti);
        }