New optimization for today:

If x and y does not have common algebraic kernels, either:

1. they don't have algebraic kernels at all, so they are
canonical under FRAC SMP, so previous check is enough.

2. they have different algebraic kernels.  Then there's
no way they can be equal.

For mapleok.input, this saves around 30% memory and 15% time.

- Qian

diff --git a/src/algebra/expr.spad b/src/algebra/expr.spad
index ed89a42f..08fecfcc 100644
--- a/src/algebra/expr.spad
+++ b/src/algebra/expr.spad
@@ -103,9 +103,11 @@
             x : % / y : %        == algreduc(x /$Rep y, commonk(x, y))
             x : % = y : % ==
                 denom(x) = denom(y) => numer(x) = numer(y)
+                lk := commonk(x, y)
+                empty? lk => false
                 -- we only need to care about the numerator of (x - y)
                 res := (numer(x)*denom(y) - numer(y)*denom(x))::Rep
-                zero?(reduc(res, commonk(x, y)))$Rep
+                zero?(reduc(res, lk))$Rep

             number?(x : %) : Boolean ==
                 if R has RetractableTo(Integer) then

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/fricas-devel/74de9c95-3b7a-483e-a7d1-0cc6e473f9d9%40gmail.com.

Reply via email to