mathai 0.2.5__py3-none-any.whl → 0.2.7__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.
@@ -365,9 +365,8 @@ def absolute(equation):
365
365
  equation = TreeNode("f_or", out2)
366
366
  return equation
367
367
  def handle_sqrt(eq):
368
- eq = domain(eq)
369
368
  def helper2(eq):
370
- if eq.name in ["f_lt", "f_gt", "f_le", "f_ge"]:
369
+ if eq.name in ["f_lt", "f_gt", "f_le", "f_ge","f_eq"]:
371
370
  out = []
372
371
  def helper(eq):
373
372
  nonlocal out
@@ -376,15 +375,15 @@ def handle_sqrt(eq):
376
375
  x = [helper(child) for child in eq.children]
377
376
  helper(eq)
378
377
  for item in out:
379
-
380
- eq2, sgn = inverse(simplify(eq.children[0]), str_form(item), True)
381
378
  n = tree_form("d_1")
382
- if sgn == False:
383
- n = tree_form("d_-1")
379
+ if eq.name == "f_eq":
380
+ eq2 = inverse(simplify(eq.children[0]), str_form(item))
381
+ else:
382
+ eq2, sgn = inverse(simplify(eq.children[0]), str_form(item), True)
383
+ if sgn == False:
384
+ n = tree_form("d_-1")
384
385
  eq3 = simplify(expand(simplify(eq2**2)))
385
- eq2 = simplify(eq2)
386
- if "v_" in str_form(eq3) and not (eq2.name == "f_pow" and frac(eq2.children[1]) == Fraction(1,2)):
387
- return simplify(TreeNode(eq.name, [simplify(n*item.children[0]-eq3*n), tree_form("d_0")])) & TreeNode("f_ge", [eq2, tree_form("d_0")])
386
+
388
387
  return simplify(TreeNode(eq.name, [simplify(n*item.children[0]-eq3*n), tree_form("d_0")]))
389
388
  return TreeNode(eq.name, [helper2(child) for child in eq.children])
390
389
  return helper2(eq)
@@ -394,9 +393,13 @@ def domain(eq):
394
393
  def helper2(eq):
395
394
  nonlocal out
396
395
  if eq.name == "f_pow" and frac(eq.children[1]) is not None and frac(eq.children[1]).denominator == 2:
397
- out.append(TreeNode("f_ge", [eq.children[0], tree_form("d_0")]))
396
+ if "v_" in str_form(eq.children[0]):
397
+ out.append(TreeNode("f_ge", [eq.children[0], tree_form("d_0")]))
398
+ out.append(TreeNode("f_ge", [eq, tree_form("d_0")]))
398
399
  if eq.name == "f_pow" and frac(eq.children[1]) is not None and frac(eq.children[1]) <0:
399
- out.append(TreeNode("f_eq", [eq.children[0], tree_form("d_0")]).fx("not"))
400
+ tmp = TreeNode("f_eq", [eq.children[0], tree_form("d_0")]).fx("not")
401
+ if "v_" in str_form(tmp):
402
+ out.append(tmp)
400
403
  x = [helper2(child) for child in eq.children]
401
404
  helper2(eq)
402
405
  out = list(set([simplify(item) for item in out]))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: mathai
3
- Version: 0.2.5
3
+ Version: 0.2.7
4
4
  Summary: Mathematics solving Ai tailored to NCERT
5
5
  Home-page: https://github.com/infinity390/mathai4
6
6
  Author: educated indians are having a low iq and are good for nothing
@@ -17,8 +17,8 @@ mathai/simplify.py,sha256=FZrQkG-dhUJqD-V856139Ogj2SAQQ8pNkvUCyfTwZr0,15034
17
17
  mathai/structure.py,sha256=Hgw2y43dwasa6G8z6OS2lmReh7JHwlChGn-FUdEaWY8,4106
18
18
  mathai/tool.py,sha256=87N5Ya7DmHdFOobTYDAjPHNWZuMzMIDjYN0ZtlHjxqE,1099
19
19
  mathai/trig.py,sha256=ywu89MJfAB81JCzsVPBLpGGv8od0LhLn5cgDtLtYwmw,6897
20
- mathai/univariate_inequality.py,sha256=BnNi7WEddFVJyQqdb7PpbF7COXRLYginGKq_EsSkF7E,14707
21
- mathai-0.2.5.dist-info/METADATA,sha256=wF_mjRlO9LN2VzLyXnc0LpkYbrsi2Rvd8FIQW2d3GEA,7087
22
- mathai-0.2.5.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
23
- mathai-0.2.5.dist-info/top_level.txt,sha256=ROP4l3OhGYw3ihkQGASr18xM9GsK4z3_6whV5AyXLwE,7
24
- mathai-0.2.5.dist-info/RECORD,,
20
+ mathai/univariate_inequality.py,sha256=zSbpMMaG0QVAU74b6hQstv4gmBJkRGjkn9jHWLBotEE,14725
21
+ mathai-0.2.7.dist-info/METADATA,sha256=0lJc4A1TrhIkka4RMILKnZfIn08WqVVT9wQThDIe6rw,7087
22
+ mathai-0.2.7.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
23
+ mathai-0.2.7.dist-info/top_level.txt,sha256=ROP4l3OhGYw3ihkQGASr18xM9GsK4z3_6whV5AyXLwE,7
24
+ mathai-0.2.7.dist-info/RECORD,,
File without changes