@@ -17,6 +17,7 @@ const { simplify: ms, rationalize } = mathjs;
1717const SIMPLIFY_RULES = [
1818 { l : "n1^(1/n2)" , r : "nthRoot(n1, n2)" } ,
1919 { l : "sqrt(n1)" , r : "nthRoot(n1, 2)" } ,
20+ { l : "nthRoot(-1, 2)" , r : "i" } ,
2021 { l : "(v1-v2)/n" , r : "v1/n-v2/n" } ,
2122 { l : "(v1-n)/n" , r : "v1/n-1" } ,
2223 { l : "n/n1-c1" , r : "(n-c1*n1)/n1" } ,
@@ -33,6 +34,11 @@ const SIMPLIFY_RULES = [
3334 { l : "n1/(-n2)" , r : "-(n1/n2)" } ,
3435 { l : "sin(n*pi)" , r : "0" } ,
3536
37+ // logarithm rules
38+ { l : "log(n1*n2, n3)" , r : "log(n1, n3)+log(n2,n3)" } ,
39+ { l : "log(n1/n2, n3)" , r : "log(n1, n3)-log(n2,n3)" } ,
40+ { l : "log(n1^n2, n3)" , r : "n2*log(n1,n3)" } ,
41+
3642 // trigonometry: defining relations for tangent, cotangent, secant, and cosecant in terms of sine and cosine
3743 { l : "sin(n)/cos(n)" , r : "tan(n)" } ,
3844 { l : "csc(n)" , r : "1/sin(n)" } ,
@@ -167,7 +173,6 @@ export const isMathEqual = (a: any, b: any) => {
167173 let bs : MathNode ;
168174
169175 // apply sort if we are not in a relationalNode
170-
171176 as = a . conditionals ? normalize ( a ) : sort ( normalize ( a ) ) ;
172177
173178 bs = b . conditionals ? normalize ( b ) : sort ( normalize ( b ) ) ;
0 commit comments