mathai 0.2.3__py3-none-any.whl → 0.2.4__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/limit.py CHANGED
@@ -23,19 +23,22 @@ def subslimit(equation, var):
23
23
  def check(num, den, var):
24
24
  n, d = None, None
25
25
 
26
- n, d = (dowhile(replace(e, var, tree_form("d_0")), lambda x: trig0(simplify(x))) for e in (num, den))
26
+ n, d = (dowhile(replace(e, tree_form(var), tree_form("d_0")), lambda x: trig0(simplify(x))) for e in (num, den))
27
+
27
28
  if n is None or d is None:
28
29
  return False
29
30
  if n == 0 and d == 0: return True
30
- if d != 0: return simplify(num/den)
31
+ if d != 0:
32
+ return simplify(n/d)
31
33
  return False
32
34
  def lhospital(num, den, steps,var):
33
35
  logs = []
36
+
34
37
  out = check(num, den, var)
35
38
  if isinstance(out, TreeNode):
36
39
  return out,[]
37
40
  for _ in range(steps):
38
- num2, den2 = map(lambda e: simplify(diff(e, var.name)), (num, den))
41
+ num2, den2 = map(lambda e: simplify(diff(e, var)), (num, den))
39
42
  out = check(num2, den2, var)
40
43
  if out is True:
41
44
  num, den = num2, den2
@@ -49,7 +52,7 @@ def lhospital2(eq, var):
49
52
  eq= simplify(eq)
50
53
  if eq is None:
51
54
  return None
52
- if not contain(eq, var):
55
+ if not contain(eq, tree_form(var)):
53
56
  return eq,[]
54
57
  num, dem = [simplify(item) for item in num_dem(eq)]
55
58
  if num is None or dem is None:
@@ -110,14 +113,15 @@ def approx(eq, var):
110
113
  def approx_limit(equation, var):
111
114
  return dowhile(equation, lambda x: approx(x, var))
112
115
 
113
- def limit(equation, var=tree_form("v_0")):
116
+ def limit(equation, var="v_0"):
114
117
  logs = [(0,"lim x->0 "+printeq_str(simplify(equation)))]
115
- eq2 = dowhile(replace(equation, var, tree_form("d_0")), lambda x: trig0(simplify(x)))
116
- if eq2 is not None and not contain(equation, var):
118
+ eq2 = dowhile(replace(equation, tree_form(var), tree_form("d_0")), lambda x: trig0(simplify(x)))
119
+ if eq2 is not None and not contain(equation, tree_form(var)):
117
120
  return eq2,logs
121
+
118
122
  equation, tmp = lhospital2(equation, var)
119
123
  equation = simplify(expand(simplify(equation)))
120
- if not contain(equation, var):
124
+ if not contain(equation, tree_form(var)):
121
125
  return equation,logs+tmp
122
126
  '''
123
127
  if equation.name == "f_add":
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: mathai
3
- Version: 0.2.3
3
+ Version: 0.2.4
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
@@ -8,7 +8,7 @@ mathai/factor.py,sha256=1-Bxl3MX6P1mYM-CX0hRskCrTZWHFdaUL-V1OqX48hY,5316
8
8
  mathai/fraction.py,sha256=KGldpi8mndp5cvp6qbN7ZdMZyVmK6popa3AwkWmHXl4,2573
9
9
  mathai/integrate.py,sha256=I_9hIi3m9eoYjYwBbp_Bu1VXVRiXbUqYcJfL3cpLBPk,12652
10
10
  mathai/inverse.py,sha256=QCvDrzKquWsZv-BDAzZd9HnU0c3gZvcc44UztHVO5LQ,2919
11
- mathai/limit.py,sha256=hmh7hgZHMHqkfLui5KSNtGfkUBzNTBvVmDkFNiXupXo,4862
11
+ mathai/limit.py,sha256=RA8YAehgYCGVWv9qBc8uQ34BQ9mFthWl2OrVTwcHl2g,4920
12
12
  mathai/linear.py,sha256=eVnDbJYC1TWwg4J7ovBKsaHYlSoDmXk5jQpsqwtVPyI,5481
13
13
  mathai/logic.py,sha256=UvHzRmKcO9AD51tRzHmpNSEhgW5gmaf4XPaQKFjGfC4,9653
14
14
  mathai/parser.py,sha256=ENtMMm7Q_5QZL6cjbwsXGVJv-H53ueCPGEosJy4LcjY,6809
@@ -18,7 +18,7 @@ mathai/structure.py,sha256=Hgw2y43dwasa6G8z6OS2lmReh7JHwlChGn-FUdEaWY8,4106
18
18
  mathai/tool.py,sha256=87N5Ya7DmHdFOobTYDAjPHNWZuMzMIDjYN0ZtlHjxqE,1099
19
19
  mathai/trig.py,sha256=ywu89MJfAB81JCzsVPBLpGGv8od0LhLn5cgDtLtYwmw,6897
20
20
  mathai/univariate_inequality.py,sha256=osifXsXDAbyv6Rr6AaiBONBPu4kzaaNxTjuMKTphUEQ,14739
21
- mathai-0.2.3.dist-info/METADATA,sha256=6jMZWRA0amOclCUg4xA0HGDNlpijkN_G6JkDDT3FEno,7087
22
- mathai-0.2.3.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
23
- mathai-0.2.3.dist-info/top_level.txt,sha256=ROP4l3OhGYw3ihkQGASr18xM9GsK4z3_6whV5AyXLwE,7
24
- mathai-0.2.3.dist-info/RECORD,,
21
+ mathai-0.2.4.dist-info/METADATA,sha256=GjziVn9NwmfvXMo9PuyRYC9uMma-VS_4jRqEW8OJIiA,7087
22
+ mathai-0.2.4.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
23
+ mathai-0.2.4.dist-info/top_level.txt,sha256=ROP4l3OhGYw3ihkQGASr18xM9GsK4z3_6whV5AyXLwE,7
24
+ mathai-0.2.4.dist-info/RECORD,,
File without changes