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/printeq.py CHANGED
@@ -1,5 +1,5 @@
1
1
  from .base import *
2
- from .simplify import solve
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.name[:2] == "d_" and int(item.name[2:]) < 0 for item in lst):
15
- return solve(-eq).fx("neg")
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", [solve(product(num)), solve(product(deno))])
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])