mathai 0.5.4__py3-none-any.whl → 0.5.5__py3-none-any.whl
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/__init__.py +3 -3
- mathai/base.py +63 -17
- mathai/diff.py +3 -3
- mathai/expand.py +111 -83
- mathai/factor.py +43 -21
- mathai/fraction.py +2 -2
- mathai/integrate.py +19 -15
- mathai/inverse.py +4 -4
- mathai/limit.py +1 -1
- mathai/linear.py +1 -1
- mathai/logic.py +7 -1
- mathai/printeq.py +4 -4
- mathai/simplify.py +490 -382
- mathai/structure.py +2 -2
- mathai/tool.py +2 -2
- mathai/trig.py +42 -25
- mathai/univariate_inequality.py +11 -8
- {mathai-0.5.4.dist-info → mathai-0.5.5.dist-info}/METADATA +1 -1
- mathai-0.5.5.dist-info/RECORD +27 -0
- mathai-0.5.4.dist-info/RECORD +0 -27
- {mathai-0.5.4.dist-info → mathai-0.5.5.dist-info}/WHEEL +0 -0
- {mathai-0.5.4.dist-info → mathai-0.5.5.dist-info}/top_level.txt +0 -0
mathai/printeq.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from .base import *
|
|
2
|
-
from .simplify import
|
|
2
|
+
from .simplify import simplify
|
|
3
3
|
import copy
|
|
4
4
|
from fractions import Fraction
|
|
5
5
|
def abstractexpr(eq):
|
|
@@ -11,14 +11,14 @@ def abstractexpr(eq):
|
|
|
11
11
|
|
|
12
12
|
lst = factor_generation(eq)
|
|
13
13
|
deno = [item.children[0]**int(item.children[1].name[3:]) for item in lst if item.name == "f_pow" and item.children[1].name[:3] == "d_-"]
|
|
14
|
-
if eq.name == "f_mul" and any(item
|
|
15
|
-
return
|
|
14
|
+
if eq.name == "f_mul" and any(frac(item) is not None and frac(item) < 0 for item in lst):
|
|
15
|
+
return simplify(-eq, False).fx("neg")
|
|
16
16
|
if deno != []:
|
|
17
17
|
|
|
18
18
|
num = [item for item in lst if item.name != "f_pow" or item.children[1].name[:3] != "d_-"]
|
|
19
19
|
if num == []:
|
|
20
20
|
num = [tree_form("d_1")]
|
|
21
|
-
return TreeNode("f_div", [
|
|
21
|
+
return TreeNode("f_div", [simplify(product(num), False), simplify(product(deno), False)])
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
return TreeNode(eq.name, [abstractexpr(child) for child in eq.children])
|