mathai 0.3.4__py3-none-any.whl → 0.3.6__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/integrate.py CHANGED
@@ -134,7 +134,8 @@ def solve_integrate(eq):
134
134
  eq2 = dowhile(eq, _solve_integrate)
135
135
  eq2 = dowhile(eq2, handle_try)
136
136
  eq2 = rm(eq2)
137
- eq2.children = list(set(eq2.children))
137
+ if eq2.name == "f_try":
138
+ eq2.children = list(set(eq2.children))
138
139
  return eq2
139
140
  def integrate_subs(equation, term, v1, v2):
140
141
  output = []
@@ -376,24 +377,27 @@ def rm_const(equation):
376
377
  return rm_const(TreeNode("f_integrate",[equation, wrt])) *const
377
378
  equation = eq2
378
379
  return TreeNode(equation.name, [rm_const(child) for child in equation.children])
380
+
379
381
  def integrate_formula(equation):
380
382
  if equation.name == "f_ref":
381
- return equation
383
+ return equation.copy_tree()
382
384
  eq2 = equation.copy_tree()
383
385
  if eq2.name == "f_integrate":
384
- equation = eq2.children[0]
386
+ integrand = eq2.children[0]
385
387
  wrt = eq2.children[1]
386
- if equation == wrt:
387
- return equation**2/2
388
- if not contain(equation,wrt):
389
- return wrt*equation
390
- out = transform_formula(simplify(trig0(equation)), wrt.name, formula_gen[0], formula_gen[1], formula_gen[2])
388
+ if integrand == wrt:
389
+ return wrt**2/2 # x^2/2
390
+ if not contain(integrand, wrt):
391
+ return integrand*wrt
392
+ out = transform_formula(simplify(trig0(integrand)), wrt.name, formula_gen[0], formula_gen[1], formula_gen[2])
391
393
  if out is not None:
394
+
392
395
  return out
393
-
394
- if str_form(equation).count("f_sin")+str_form(equation).count("f_cos")>2:
395
- out = transform_formula(equation, wrt.name, formula_gen4[0], formula_gen4[1], formula_gen4[2])
396
- if out is not None:
397
- return out
398
- equation = eq2
399
- return TreeNode(equation.name, [integrate_formula(child) for child in equation.children])
396
+ expr_str = str_form(integrand)
397
+ if expr_str.count("f_sin") + expr_str.count("f_cos") > 2:
398
+ out = transform_formula(integrand, wrt.name, formula_gen4[0], formula_gen4[1], formula_gen4[2])
399
+ if out is not None:
400
+
401
+ return out
402
+ return TreeNode(eq2.name, [integrate_formula(child) for child in eq2.children])
403
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mathai
3
- Version: 0.3.4
3
+ Version: 0.3.6
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
@@ -6,7 +6,7 @@ mathai/diff.py,sha256=YUBpRsz0qmBkq5vGxeGnvR4nMKjdOQiIXlNMxpij2ns,3051
6
6
  mathai/expand.py,sha256=SnBltkpIENMGkP0AYmbMlSc4H-CF5RslO2PcBEkn1BQ,3359
7
7
  mathai/factor.py,sha256=NPXxET52TacNExuvw6p1jbC6g3wY6_VOCdlGlexXZio,5916
8
8
  mathai/fraction.py,sha256=Q2ztsh5Bpz6YhML2QU0tfufbAs0Q6J319AhlzKephIY,4396
9
- mathai/integrate.py,sha256=85qM7nvALtYjVMp17Tx5Kvevdz0d1UPDKQBBTnDqgrs,14828
9
+ mathai/integrate.py,sha256=jV-RWxsUuvyW7ThmdIvLFdIiMvOGy0pPSSixk1VTaeE,14887
10
10
  mathai/inverse.py,sha256=QCvDrzKquWsZv-BDAzZd9HnU0c3gZvcc44UztHVO5LQ,2919
11
11
  mathai/limit.py,sha256=RA8YAehgYCGVWv9qBc8uQ34BQ9mFthWl2OrVTwcHl2g,4920
12
12
  mathai/linear.py,sha256=wyiLpIxRDmD96xXktkgvc5gegIB3zblLB1EuV3TFdmU,5474
@@ -19,7 +19,7 @@ mathai/structure.py,sha256=4Ww2IAx62RcQSO7_17TZES-DjMWBpcFQtL939FBIHwY,4103
19
19
  mathai/tool.py,sha256=UyccamiJy_CkFPakfufyPzdhtlEO6v2D7qwbXQ9V7Rg,2000
20
20
  mathai/trig.py,sha256=5P0RNS4eetNds2l-wyA4BAKqJdFIUws_8RGS_dH7gp8,9348
21
21
  mathai/univariate_inequality.py,sha256=_r-kkiS4Hr-jRN7f-EL_E4svAMFWJP1Ea50HJKKbjfk,14778
22
- mathai-0.3.4.dist-info/METADATA,sha256=9GJrc9O57rUoFpZgOLOjOmmuNx6knLIrEw26STVJgpA,7021
23
- mathai-0.3.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
24
- mathai-0.3.4.dist-info/top_level.txt,sha256=ROP4l3OhGYw3ihkQGASr18xM9GsK4z3_6whV5AyXLwE,7
25
- mathai-0.3.4.dist-info/RECORD,,
22
+ mathai-0.3.6.dist-info/METADATA,sha256=G3lVXVLtRsQ-eskr6BOvA_iDKScciA4fazAXsVyHD4E,7021
23
+ mathai-0.3.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
24
+ mathai-0.3.6.dist-info/top_level.txt,sha256=ROP4l3OhGYw3ihkQGASr18xM9GsK4z3_6whV5AyXLwE,7
25
+ mathai-0.3.6.dist-info/RECORD,,
File without changes