mathai 0.5.8__tar.gz → 0.6.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mathai-0.5.8 → mathai-0.6.0}/PKG-INFO +1 -1
- {mathai-0.5.8 → mathai-0.6.0}/mathai/factor.py +2 -2
- {mathai-0.5.8 → mathai-0.6.0}/mathai/simplify.py +2 -2
- {mathai-0.5.8 → mathai-0.6.0}/mathai/univariate_inequality.py +2 -1
- {mathai-0.5.8 → mathai-0.6.0}/mathai.egg-info/PKG-INFO +1 -1
- {mathai-0.5.8 → mathai-0.6.0}/setup.py +1 -1
- {mathai-0.5.8 → mathai-0.6.0}/README.md +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/__init__.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/apart.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/base.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/bivariate_inequality.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/console.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/diff.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/expand.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/fraction.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/integrate.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/inverse.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/limit.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/linear.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/logic.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/matrix.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/ode.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/parser.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/printeq.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/structure.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/tool.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai/trig.py +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai.egg-info/SOURCES.txt +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai.egg-info/dependency_links.txt +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai.egg-info/requires.txt +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/mathai.egg-info/top_level.txt +0 -0
- {mathai-0.5.8 → mathai-0.6.0}/setup.cfg +0 -0
|
@@ -57,10 +57,10 @@ def _factorconst(eq):
|
|
|
57
57
|
if not numbers:
|
|
58
58
|
return None # empty list
|
|
59
59
|
n = 1
|
|
60
|
+
if math.prod(numbers) < 0:
|
|
61
|
+
n = -1
|
|
60
62
|
hcf = numbers[0]
|
|
61
63
|
for num in numbers[1:]:
|
|
62
|
-
if num < 0:
|
|
63
|
-
n = -1
|
|
64
64
|
hcf = math.gcd(hcf, abs(num))
|
|
65
65
|
return hcf*n
|
|
66
66
|
def extractnum(eq):
|
|
@@ -433,7 +433,7 @@ def other_node(eq):
|
|
|
433
433
|
out = frac(b*c)
|
|
434
434
|
if out is not None:
|
|
435
435
|
out2 = frac(b)
|
|
436
|
-
if out.numerator % 2 == 0 or out2.numerator % 2 != 0:
|
|
436
|
+
if out.numerator % 2 == 0 or (out2 is not None and out2.numerator % 2 != 0):
|
|
437
437
|
return eq.children[0].children[0] ** (b*c)
|
|
438
438
|
else:
|
|
439
439
|
return eq.children[0].children[0].fx("abs") ** (b*c)
|
|
@@ -495,7 +495,7 @@ def solve3(eq):
|
|
|
495
495
|
a = lambda x: multiply_node(x)
|
|
496
496
|
b = lambda x: addition_node(x)
|
|
497
497
|
c = lambda x: other_node(x)
|
|
498
|
-
return dowhile(eq, lambda x: c(b(a(x))))
|
|
498
|
+
return dowhile(eq, lambda x: flatten_tree(c(b(a(x)))))
|
|
499
499
|
|
|
500
500
|
def simplify(eq, basic=True):
|
|
501
501
|
if eq is None:
|
|
@@ -198,9 +198,10 @@ def prepare(eq):
|
|
|
198
198
|
return None
|
|
199
199
|
out = poly(eq, vlist(eq)[0])
|
|
200
200
|
if out is None or len(out) > 3:
|
|
201
|
+
|
|
201
202
|
output = []
|
|
202
203
|
for item in factor_generation(eq):
|
|
203
|
-
if item.name == "f_pow" and item.children[1].name == "
|
|
204
|
+
if item.name == "f_pow" and item.children[1].name == "d_-1":
|
|
204
205
|
out2 = poly(item.children[0], vlist(eq)[0])
|
|
205
206
|
if out2 is not None and len(out2) <= 3:
|
|
206
207
|
output.append(poly_simplify(item.children[0])**-1)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|