mathai 0.4.8__py3-none-any.whl → 0.7.2__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.
@@ -1,234 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: mathai
3
- Version: 0.4.8
4
- Summary: Mathematics solving Ai tailored to NCERT
5
- Home-page: https://github.com/infinity390/mathai4
6
- Author: educated indians are having a low iq and are good for nothing
7
- Requires-Python: >=3.7
8
- Description-Content-Type: text/markdown
9
- Requires-Dist: lark-parser
10
- Dynamic: author
11
- Dynamic: description
12
- Dynamic: description-content-type
13
- Dynamic: home-page
14
- Dynamic: requires-dist
15
- Dynamic: requires-python
16
- Dynamic: summary
17
-
18
- # Math AI Documentation
19
- ## Source
20
- Github repository of the code
21
- https://github.com/infinity390/mathai4
22
-
23
- ## Philosophy
24
- I think it is a big realization in computer science and programming to realize that computers can solve mathematics.
25
- This understanding should be made mainstream. It can help transform education, mathematical research, and computation of mathematical equations for work.
26
-
27
- ## Societal Implications Of Such A Computer Program And The Author's Comment On Universities Of India
28
- I think mathematics is valued by society because of education. Schools and universities teach them.
29
- So this kind of software, if made mainstream, could bring real change.
30
-
31
- ### The Author's Comments On The Universities In His Country
32
- > Educated Indians are having a low IQ and are good for nothing.
33
- > The Indian Institute of Technology (IITs) graduates are the leader of the fools.
34
- > Every educated Indian is beneath me.
35
- > Now learn how this Python library can solve the math questions of your exams.
36
-
37
- ## The Summary Of How Computer "Solves" Math
38
- Math equations are a tree data structure (`TreeNode` class).
39
- We can manipulate the math equations using various algorithms (functions provided by the `mathai` library).
40
- We first parse the math equation strings to get the tree data structure (`parse` function in `mathai`).
41
-
42
- ## The Library
43
- Import the library by doing:
44
-
45
- ```python
46
- from mathai import *
47
- ```
48
-
49
- ### str_form
50
- It is the string representation of a `TreeNode` math equation.
51
-
52
- #### Example
53
- ```text
54
- (cos(x)^2)+(sin(x)^2)
55
- ```
56
-
57
- Is represented internally as:
58
-
59
- ```text
60
- f_add
61
- f_pow
62
- f_cos
63
- v_0
64
- d_2
65
- f_pow
66
- f_sin
67
- v_0
68
- d_2
69
- ```
70
-
71
- #### Leaf Nodes
72
-
73
- **Variables** (start with a `v_` prefix):
74
-
75
- - `v_0` -> x
76
- - `v_1` -> y
77
- - `v_2` -> z
78
- - `v_3` -> a
79
-
80
- **Numbers** (start with `d_` prefix; only integers):
81
-
82
- - `d_-1` -> -1
83
- - `d_0` -> 0
84
- - `d_1` -> 1
85
- - `d_2` -> 2
86
-
87
- #### Branch Nodes
88
- - `f_add` -> addition
89
- - `f_mul` -> multiplication
90
- - `f_pow` -> power
91
-
92
- ### parse
93
- Takes a math equation string and outputs a `TreeNode` object.
94
-
95
- ```python
96
- from mathai import *
97
-
98
- equation = parse("sin(x)^2+cos(x)^2")
99
- print(equation)
100
- ```
101
-
102
- #### Output
103
- ```text
104
- (cos(x)^2)+(sin(x)^2)
105
- ```
106
-
107
- ### printeq, printeq_str, printeq_log
108
- Prints math equations in a more readable form than usual `print`.
109
-
110
- ```python
111
- from mathai import *
112
-
113
- equation = simplify(parse("(x+1)/x"))
114
- print(equation)
115
- printeq(equation)
116
- ```
117
-
118
- #### Output
119
- ```text
120
- (1+x)*(x^-1)
121
- (1+x)/x
122
- ```
123
-
124
- ### solve, simplify
125
- `simplify` performs what `solve` does and more.
126
- It simplifies and cleans up a given math equation.
127
-
128
- ```python
129
- from mathai import *
130
-
131
- equation = simplify(parse("(x+x+x+x-1-1-1-1)*(4*x-4)*sin(sin(x+x+x)*sin(3*x))"))
132
- printeq(equation)
133
- ```
134
-
135
- #### Output
136
- ```text
137
- ((-4+(4*x))^2)*sin((sin((3*x))^2))
138
- ```
139
-
140
- ### Incomplete Documentation, Will be updated and completed later on
141
-
142
- ### Example Demonstration [limits questions can also be solved other than this these, try limit()]
143
- ![pip-install-mathai-mathematics-solving-ai-system-in-python-v0-xcg3c22k51sf1](https://github.com/user-attachments/assets/799f576f-27d0-4d7c-86e9-ad55ff221bcc)
144
- ```python
145
- import sys, os, time
146
- from mathai import *
147
-
148
- sys.setrecursionlimit(10000)
149
-
150
- def integration_byparts(item): return simplify(fraction(simplify(byparts(simplify(parse(item)))[0])))
151
- def integration_apart(item): return simplify(fraction(integrate(apart(factor2(simplify(parse(item)))))[0]))
152
- def integration_direct(item): return simplify(fraction(simplify(integrate(simplify(parse(item)))[0])))
153
- def integration_trig(item): return simplify(trig0(integrate(trig1(simplify(parse(item))))[0]))
154
- def algebra(item): return logic0(simplify(expand(simplify(parse(item)))))
155
- def trig_basic(item): return logic0(simplify(expand(trig3(simplify(parse(item))))))
156
- def trig_advanced(item): return logic0(simplify(trig0(trig1(trig4(simplify(fraction(trig0(simplify(parse(item))))))))))
157
-
158
- all_tasks = [
159
- *[(item, trig_advanced) for item in [
160
- "cos(x)/(1+sin(x)) + (1+sin(x))/cos(x) = 2*sec(x)",
161
- "(1+sec(x))/sec(x) = sin(x)^2/(1-cos(x))"]],
162
- *[(item, integration_byparts) for item in ["sin(x)*x","x*sin(3*x)","x*log(abs(x))","arctan(x)"]],
163
- *[(item, integration_apart) for item in ["x/((x+1)*(x+2))","1/(x^2-9)"]],
164
- *[(item, integration_direct) for item in [
165
- "x*sqrt(x+2)","sin(cos(x))*sin(x)","2*x/(1+x^2)","sqrt(a*x+b)","cos(sqrt(x))/sqrt(x)","e^(arctan(x))/(1+x^2)","sqrt(sin(2*x))*cos(2*x"]],
166
- *[(item, integration_trig) for item in ["sin(2*x+5)^2","sin(x)^4","cos(2*x)^4"]],
167
- *[(item, algebra) for item in ["(x+1)^2 = x^2+2*x+1","(x+1)*(x-1) = x^2-1"]],
168
- *[(item, trig_basic) for item in ["2*sin(x)*cos(x)=sin(2*x)"]],
169
- ]
170
-
171
- def run_task(task):
172
- item, func = task
173
- try: result = func(item)
174
- except Exception as e: result = str(e)
175
- return item, result
176
-
177
- if __name__=="__main__":
178
- print(f"Solving {len(all_tasks)} math questions...\n")
179
- start_time = time.time()
180
- for task in all_tasks:
181
- item, result = run_task(task)
182
- print(f"{item} => {result}\n")
183
- print(f"All tasks completed in {time.time()-start_time:.2f} seconds")
184
- ```
185
- ### Output
186
-
187
- ```
188
- Running 21 tasks asynchronously on 8 cores...
189
-
190
- x*log(abs(x)) => ((-2*(x^2))+(4*log(abs(x))*(x^2)))*(8^-1)
191
-
192
- arctan(x) => (log((abs((1+(x^2)))^-1))+(2*arctan(x)*x))*(2^-1)
193
-
194
- sin(cos(x))*sin(x) => cos(cos(x))
195
-
196
- 1/(x^2-9) => (log(abs((-3+x)))+log((abs((3+x))^-1)))*(6^-1)
197
-
198
- x/((x+1)*(x+2)) => log((abs((1+x))^-1))+log(((2+x)^2))
199
-
200
- x*sin(3*x) => ((-9*cos((3*x))*x)+(3*sin((3*x))))*(27^-1)
201
-
202
- (1+sec(x))/sec(x) = sin(x)^2/(1-cos(x)) => true
203
-
204
- e^(arctan(x))/(1+x^2) => e^arctan(x)
205
-
206
- cos(sqrt(x))/sqrt(x) => 2*sin((x^(2^-1)))
207
-
208
- sqrt(a*x+b) => 2*(3^-1)*(((x*a)+b)^(3*(2^-1)))*(a^-1)
209
-
210
- sin(x)*x => (-1*cos(x)*x)+sin(x)
211
-
212
- (x+1)^2 = x^2+2*x+1 => true
213
-
214
- (x+1)*(x-1) = x^2-1 => true
215
-
216
- cos(x)/(1+sin(x)) + (1+sin(x))/cos(x) = 2*sec(x) => true
217
-
218
- 2*sin(x)*cos(x)=sin(2*x) => true
219
-
220
- sqrt(sin(2*x))*cos(2*x) => (3^-1)*(sin((2*x))^(3*(2^-1)))
221
-
222
- 2*x/(1+x^2) => log(abs((1+(x^2))))
223
-
224
- sin(2*x+5)^2 => ((-1*(4^-1)*sin((10+(4*x))))+x)*(2^-1)
225
-
226
- cos(2*x)^4 => ((4^-1)*x)+((64^-1)*sin((8*x)))+((8^-1)*sin((4*x)))+((8^-1)*x)
227
-
228
- x*sqrt(x+2) => ((-1*(4^-1)*((2+x)^(2+(2^-1))))+(-2*((2+x)^(2+(2^-1))))+(5*((2+x)^(1+(2^-1)))*x)+((2^-1)*((2+x)^(1+(2^-1)))*x)+((8^-1)*((2+x)^(1+(2^-1)))*x))*((1+(2^-1))^-3)*((2+(2^-1))^-1)
229
-
230
- sin(x)^4 => (-1*(4^-1)*sin((2*x)))+((32^-1)*sin((4*x)))+((4^-1)*x)+((8^-1)*x)
231
-
232
- All tasks completed in 129.78 seconds
233
- ```
234
-
@@ -1,25 +0,0 @@
1
- mathai/__init__.py,sha256=p5Sx7a7I0lh_16izDFlwkI0FiRtJKUlRM3TDuCMAV3I,1450
2
- mathai/apart.py,sha256=VSS3khE9PNuxiRvdU5JDl4IN-KJBSIFjwR17pkhviXI,4197
3
- mathai/base.py,sha256=Ma1oCRbaZP0bp0Qnt_ZjKAh3rt9nZXQ_rmJL0sAoz5c,12730
4
- mathai/console.py,sha256=Sn58iwYE79MLEh67s8X3q6vZjw6g7f9XM1T8_dBBR2o,3048
5
- mathai/diff.py,sha256=YUBpRsz0qmBkq5vGxeGnvR4nMKjdOQiIXlNMxpij2ns,3051
6
- mathai/expand.py,sha256=SnBltkpIENMGkP0AYmbMlSc4H-CF5RslO2PcBEkn1BQ,3359
7
- mathai/factor.py,sha256=Xkx2_lxq-Z-t55dA9F2W4EH-3Uc1CFXj_6oESQdWAHM,11332
8
- mathai/fraction.py,sha256=Q2ztsh5Bpz6YhML2QU0tfufbAs0Q6J319AhlzKephIY,4396
9
- mathai/integrate.py,sha256=ewV46QDD0-oiTWpSkmcpcZhBz9StcntbTV1tBLCo1Wo,16502
10
- mathai/inverse.py,sha256=QCvDrzKquWsZv-BDAzZd9HnU0c3gZvcc44UztHVO5LQ,2919
11
- mathai/limit.py,sha256=bn7eofIOJv4AIh0-FmLppZ3DKnGfbwOzXks2XOPTOs0,4932
12
- mathai/linear.py,sha256=BzSnm941Zlod_l6hON4Rs6J4pdAA3MGpRVqr6-66ZBk,5524
13
- mathai/logic.py,sha256=UvHzRmKcO9AD51tRzHmpNSEhgW5gmaf4XPaQKFjGfC4,9653
14
- mathai/ode.py,sha256=zxxTXAOpt7oSsfpgI4vHsCWKXevmM96ZOBZWWs-vj8Y,4801
15
- mathai/parser.py,sha256=f7bemieFmp0sbup1NlraMLvZDVFvqKGFknEVtlFRMVk,6979
16
- mathai/printeq.py,sha256=gIes-pstFOa6FcnpVIVvkjVKuWdsVdo11LlEnmHhakU,1303
17
- mathai/simplify.py,sha256=nR5IReewrJ7HbxEUzQ2zg9xoFcwI1R5lGjWnX1pBKko,16885
18
- mathai/structure.py,sha256=4Ww2IAx62RcQSO7_17TZES-DjMWBpcFQtL939FBIHwY,4103
19
- mathai/tool.py,sha256=r8ejBY4Bnk_t8USYQCuxwmmJ4M-5H5OR6A3VbV7W-5w,6066
20
- mathai/trig.py,sha256=BQd_Gl_u0g5ZuZIwKozuXKbMinqb6K-OYicrtftn7eg,11174
21
- mathai/univariate_inequality.py,sha256=_r-kkiS4Hr-jRN7f-EL_E4svAMFWJP1Ea50HJKKbjfk,14778
22
- mathai-0.4.8.dist-info/METADATA,sha256=bmi6y4GCl3l9iKkCHL9Yz3yTM2wV2lnJkuHPMEajVH4,7103
23
- mathai-0.4.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
24
- mathai-0.4.8.dist-info/top_level.txt,sha256=ROP4l3OhGYw3ihkQGASr18xM9GsK4z3_6whV5AyXLwE,7
25
- mathai-0.4.8.dist-info/RECORD,,