File tree Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Expand file tree Collapse file tree 3 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ namespace xFunc . Maths . Analyzers2 . Rules ;
2
+
3
+ public class ExpLnUnaryRule : Rule < Exp >
4
+ {
5
+ protected override Result ExecuteInternal ( Exp expression , RuleContext context )
6
+ => expression . Argument switch
7
+ {
8
+ Ln ln => Handled ( ln . Argument ) ,
9
+ _ => NotHandled ( ) ,
10
+ } ;
11
+
12
+ public override string Name => "Exponential Ln Rule" ;
13
+
14
+ public override string Description => "" ;
15
+ }
Original file line number Diff line number Diff line change
1
+ namespace xFunc . Maths . Analyzers2 . Rules ;
2
+
3
+ public class ExpUnaryRule : UnaryRule < Exp >
4
+ {
5
+ protected override Exp Create ( IExpression argument )
6
+ => new Exp ( argument ) ;
7
+
8
+ public override string Name => "Exponential Unary Rule" ;
9
+
10
+ public override string Description => "" ;
11
+ }
Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ public Simplifier2()
44
44
. WithNext ( new DivConstUnit ( ) )
45
45
. WithNext ( new DivBySameExpression ( ) )
46
46
. WithNext ( new DivGroupRule ( ) ) )
47
+ . WithChain < Exp > ( builder => builder
48
+ . WithRule ( new ExpUnaryRule ( ) )
49
+ . WithNext ( new ExpLnUnaryRule ( ) ) )
47
50
. WithChain < Sub > ( builder => builder
48
51
. WithRule ( new SubBinaryRule ( ) )
49
52
. WithNext ( new SubZeroRule ( ) )
You can’t perform that action at this time.
0 commit comments