slangmath 1.0.0 โ†’ 1.0.2

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.
package/README.md CHANGED
@@ -1,12 +1,13 @@
1
1
  # ๐Ÿ“š SLaNg Math Library
2
- ### Saad's Language for Analytical Numerics and Geometry - Enhanced Edition
2
+
3
+ ### Saad's Language for Analytical Numerics and Geometry
3
4
 
4
5
  ๐ŸŽฏ **Advanced Symbolic Mathematics with Comprehensive LaTeX Conversion & Extended Function Support**
5
6
 
6
- A powerful, dependency-free JavaScript library for symbolic and numerical calculus with **complete polynomial denominator support**, **bidirectional LaTeX conversion**, and **extended mathematical functions**. Compute derivatives, integrals, rational functions, Taylor series, optimize functions, and solve complex multivariable problemsโ€”all with clean, readable code and professional-grade error handling.
7
+ A powerful, dependency-free JavaScript library for symbolic and numerical calculus with **complete polynomial denominator support**, **bidirectional LaTeX conversion**, **extended mathematical functions**, and **advanced multivariable calculus**. Compute derivatives, integrals, rational functions, Taylor series, optimize functions, analyze surfaces, and solve complex multivariable problemsโ€”all with clean, readable code and professional-grade error handling.
7
8
 
8
9
  ```javascript
9
- import { createFraction, createTerm, differentiateFraction } from './slang-math.js';
10
+ import { createFraction, createTerm, gradient, tangentPlane } from './slang-math.js';
10
11
  import { slangToLatex, latexToSlang } from './slang-convertor.js';
11
12
 
12
13
  //: Full polynomial denominator support with LaTeX conversion!
@@ -19,10 +20,10 @@ const f = createFraction(
19
20
  const latex = slangToLatex(f);
20
21
  console.log(latex); // "\\frac{2x}{x^{2} + 1}"
21
22
 
22
- // Differentiate using quotient rule automatically
23
- const fPrime = differentiateFraction(f, 'x');
24
- const latexPrime = slangToLatex(fPrime);
25
- // f'(x) = (2 - 2xยฒ)/(xยฒ + 1)ยฒ -> "\\frac{2 - 2x^{2}}{(x^{2} + 1)^{2}}"
23
+ // Advanced multivariable calculus
24
+ const surface = { terms: [createTerm(1, {x: 2}), createTerm(1, {y: 2})] }; // z = xยฒ + yยฒ
25
+ const tangent = tangentPlane(surface, 1, 2);
26
+ console.log(tangentToLatex(tangent)); // "z = 5 + 2x + 4y + -5"
26
27
 
27
28
  // Parse LaTeX back to SLaNg
28
29
  const parsed = latexToSlang('\\frac{x^{2} + 1}{x - 1}');
@@ -32,46 +33,44 @@ const parsed = latexToSlang('\\frac{x^{2} + 1}{x - 1}');
32
33
 
33
34
  ---
34
35
 
35
- ## ๐Ÿš€ What's New in v2.0
36
+ ## ๐Ÿš€ What This Package Does
37
+
38
+ ### โœจ Core Capabilities
36
39
 
37
- ### โœจ Major Enhancements
40
+ 1. **๐Ÿงฎ Advanced Mathematical Functions**
41
+ - Tangent plane and line analysis
42
+ - Gradient and Hessian matrix computation
43
+ - Critical point detection and classification
44
+ - Directional derivatives and steepest directions
45
+ - Surface normal vectors
46
+ - Lagrange multipliers for constrained optimization
47
+ - Local and global extrema finding
38
48
 
39
- 1. **๏ฟฝ Bidirectional LaTeX Conversion**
40
- - Convert SLaNg โ†” LaTeX seamlessly
49
+ 2. **๐Ÿ“ Multivariable Calculus**
50
+ - Complete surface analysis capabilities
51
+ - Vector calculus operations
52
+ - Optimization algorithms
53
+ - Constrained optimization with Lagrange multipliers
54
+
55
+ 3. **๐Ÿ”„ LaTeX Integration**
56
+ - Bidirectional LaTeX conversion
41
57
  - Support for complex mathematical expressions
42
58
  - Advanced parsing with error recovery
43
- - Batch processing capabilities
59
+ - Validation system
44
60
 
45
- 2. **๐Ÿงฎ Extended Mathematical Functions**
61
+ 4. **๐Ÿงฎ Extended Mathematical Functions**
46
62
  - Trigonometric functions (sin, cos, tan, etc.)
47
63
  - Inverse trigonometric functions
48
64
  - Hyperbolic functions
49
65
  - Logarithmic and exponential functions
50
66
  - Function evaluation and differentiation
51
67
 
52
- 3. **โšก Performance & Caching System**
53
- - LRU cache for expression conversion
54
- - Performance monitoring and optimization
55
- - Memoization for expensive operations
56
- - Batch processing with parallel execution
57
-
58
- 4. **๐Ÿ›ก๏ธ Advanced Error Handling**
59
- - Comprehensive error classification
60
- - Error recovery suggestions
61
- - Detailed validation system
62
- - Graceful fallback strategies
63
-
64
- 5. **๐Ÿงช Comprehensive Testing Suite**
65
- - Unit tests with 95%+ coverage
66
- - Performance benchmarks
67
- - Integration tests
68
- - Automated CI/CD ready
69
-
70
- 6. **๐Ÿ“š Enhanced Documentation**
71
- - Function-by-function explanations
72
- - Usage examples and best practices
73
- - API reference with TypeScript support
74
- - Interactive examples
68
+ 5. **๐Ÿ“Š Core Calculus Operations**
69
+ - Symbolic differentiation and integration
70
+ - Numerical integration with Simpson's rule
71
+ - Polynomial arithmetic
72
+ - Rational function operations
73
+ - Taylor series expansion
75
74
 
76
75
  ---
77
76
 
@@ -104,64 +103,115 @@ const expr = createFraction(
104
103
  const latex = slangToLatex(expr);
105
104
  console.log(latex); // "\\frac{x^{2} - 1}{x^{2} + 1}"
106
105
 
107
- // Validate LaTeX
108
- const validation = validateLatex(latex);
109
- console.log(validation.valid); // true
110
-
111
106
  // Parse back from LaTeX
112
107
  const parsed = latexToSlang(latex);
113
108
  ```
114
109
 
115
- #### Example 2: Extended Functions
110
+ #### Example 2: Advanced Multivariable Calculus
116
111
  ```javascript
117
- import { createFunction, evaluateFunction, extendedSlangToLatex } from './slang-extended.js';
112
+ import { gradient, hessian, tangentPlane, findCriticalPoints } from './slang-extended.js';
118
113
 
119
- // Create trigonometric function
120
- const sinExpr = createFunction('sin', [createTerm(1, {x: 1})]);
114
+ // Surface: z = xยฒ + yยฒ
115
+ const surface = { terms: [createTerm(1, {x: 2}), createTerm(1, {y: 2})] };
121
116
 
122
- // Convert to LaTeX
123
- const sinLatex = extendedSlangToLatex(sinExpr);
124
- console.log(sinLatex); // "\\sin{x}"
117
+ // Calculate gradient
118
+ const grad = gradient(surface, ['x', 'y']);
119
+ console.log('โˆ‡f =', grad); // {x: 2x, y: 2y}
120
+
121
+ // Find tangent plane at (1, 2)
122
+ const tangent = tangentPlane(surface, 1, 2);
123
+ console.log('Tangent plane:', tangentToLatex(tangent));
125
124
 
126
- // Evaluate at specific point
127
- const result = evaluateFunction(sinExpr, { x: Math.PI / 2 });
128
- console.log(result); // 1
125
+ // Find critical points
126
+ const critical = findCriticalPoints(surface, ['x', 'y']);
129
127
  ```
130
128
 
131
- #### Example 3: Batch Processing
129
+ #### Example 3: Optimization
132
130
  ```javascript
133
- import { batchConvertToLatex, batchConvertToSlang } from './slang-convertor.js';
131
+ import { findExtrema, classifyCriticalPoint, lagrangeMultipliers } from './slang-extended.js';
134
132
 
135
- // Batch convert SLaNg to LaTeX
136
- const expressions = [expr1, expr2, expr3];
137
- const latexResults = batchConvertToLatex(expressions);
133
+ // Function: f(x,y) = xยฒ - yยฒ (saddle point)
134
+ const saddle = { terms: [createTerm(1, {x: 2}), createTerm(-1, {y: 2})] };
138
135
 
139
- // Batch convert LaTeX to SLaNg
140
- const latexInputs = ['\\frac{x}{x+1}', 'x^{2} + 1', '\\sin{x}'];
141
- const slangResults = batchConvertToSlang(latexInputs);
136
+ // Find and classify critical points
137
+ const points = findCriticalPoints(saddle, ['x', 'y']);
138
+ points.forEach(point => {
139
+ const classification = classifyCriticalPoint(saddle, point.variables);
140
+ console.log(`Point: ${JSON.stringify(point.variables)}, Type: ${classification}`);
141
+ });
142
+
143
+ // Constrained optimization with Lagrange multipliers
144
+ const objective = { terms: [createTerm(1, {x: 1}), createTerm(1, {y: 1})] }; // x + y
145
+ const constraint = { terms: [createTerm(1, {x: 2}), createTerm(1, {y: 2}), createTerm(-1)] }; // xยฒ + yยฒ = 1
146
+ const constrained = lagrangeMultipliers(objective, [constraint], ['x', 'y']);
142
147
  ```
143
148
 
144
- #### Example 4: Performance Optimization
149
+ ---
150
+
151
+ ## ๐ŸŽ“ Complete Feature List
152
+
153
+ ### ๐Ÿงฎ Advanced Mathematical Functions
154
+
155
+ #### Tangent Analysis
145
156
  ```javascript
146
- import { cachedLatexToSlang, getPerformanceStats } from './slang-cache.js';
157
+ import { tangentPlane, tangentLine, surfaceNormal } from './slang-extended.js';
147
158
 
148
- // Use cached conversion for repeated operations
149
- const result = cachedLatexToSlang(latex);
159
+ // Tangent plane to surface z = f(x,y) at point (x0, y0)
160
+ const plane = tangentPlane(surface, 1, 2);
161
+ console.log('Point:', plane.point);
162
+ console.log('Normal:', plane.normal);
163
+ console.log('Equation:', tangentToLatex(plane));
150
164
 
151
- // Monitor performance
152
- const stats = getPerformanceStats();
153
- console.log(stats.caches.latexToSlang.hitRate); // "85.3%"
165
+ // Tangent line to curve y = f(x) at point x0
166
+ const line = tangentLine(curve, 1);
167
+ console.log('Slope:', line.slope);
168
+ console.log('Equation:', tangentToLatex(line));
169
+
170
+ // Surface normal vector
171
+ const normal = surfaceNormal(surface, {x: 1, y: 0, z: 0});
154
172
  ```
155
- 0, // lower bound
156
- 1, // upper bound
157
- 'x',
158
- 1000 // steps for accuracy
159
- );
173
+
174
+ #### Optimization
175
+ ```javascript
176
+ import { findCriticalPoints, classifyCriticalPoint, findExtrema, findGlobalExtrema } from './slang-extended.js';
177
+
178
+ // Find critical points
179
+ const critical = findCriticalPoints(function, ['x', 'y']);
180
+
181
+ // Classify critical points (minimum, maximum, saddle)
182
+ const classification = classifyCriticalPoint(function, point);
183
+
184
+ // Find local extrema
185
+ const extrema = findExtrema(function, ['x', 'y'], bounds);
186
+
187
+ // Find global extrema in bounded region
188
+ const global = findGlobalExtrema(function, ['x', 'y'], bounds);
160
189
  ```
161
190
 
162
- ---
191
+ #### Multivariable Calculus
192
+ ```javascript
193
+ import { gradient, hessian, directionalDerivative, steepestDirections } from './slang-extended.js';
163
194
 
164
- ## ๐ŸŽ“ Complete Feature List
195
+ // Gradient vector
196
+ const grad = gradient(function, ['x', 'y', 'z']);
197
+
198
+ // Hessian matrix
199
+ const hess = hessian(function, ['x', 'y']);
200
+
201
+ // Directional derivative
202
+ const dirDeriv = directionalDerivative(function, point, direction);
203
+
204
+ // Steepest ascent/descent directions
205
+ const steepest = steepestDirections(function, point);
206
+ ```
207
+
208
+ #### Constrained Optimization
209
+ ```javascript
210
+ import { lagrangeMultipliers } from './slang-extended.js';
211
+
212
+ // Solve constrained optimization problems
213
+ const result = lagrangeMultipliers(objective, constraints, variables);
214
+ ```
165
215
 
166
216
  ### ๐Ÿ”„ LaTeX Conversion System
167
217
 
@@ -182,19 +232,6 @@ const validation = validateLatex(latex);
182
232
  console.log(validation.valid); // true
183
233
  ```
184
234
 
185
- #### Advanced Formatting
186
- ```javascript
187
- import { formatDisplayMode, batchConvertToLatex } from './slang-convertor.js';
188
-
189
- // Display mode formatting
190
- const inline = formatDisplayMode(latex, { preferInline: true }); // $...$
191
- const display = formatDisplayMode(latex, { forceDisplay: true }); // $$...$$
192
-
193
- // Batch processing
194
- const expressions = [expr1, expr2, expr3];
195
- const results = batchConvertToLatex(expressions, { includeErrors: true });
196
- ```
197
-
198
235
  ### ๐Ÿงฎ Extended Mathematical Functions
199
236
 
200
237
  #### Trigonometric Functions
@@ -222,67 +259,6 @@ console.log(evaluateFunction(cosExpr, { x: 0 })); // 1
222
259
  - **Exponential**: exp, sqrt
223
260
  - **Other**: abs, floor, ceil
224
261
 
225
- ### โšก Performance & Caching
226
-
227
- #### Caching System
228
- ```javascript
229
- import { cachedLatexToSlang, getPerformanceStats, clearAllCaches } from './slang-cache.js';
230
-
231
- // Use cached conversions
232
- const result = cachedLatexToSlang(latex);
233
-
234
- // Monitor performance
235
- const stats = getPerformanceStats();
236
- console.log(`Cache hit rate: ${stats.caches.latexToSlang.hitRate}`);
237
- console.log(`Average operation time: ${stats.operations.averageTime}ms`);
238
-
239
- // Clear caches if needed
240
- clearAllCaches();
241
- ```
242
-
243
- #### Performance Monitoring
244
- ```javascript
245
- import { withPerformanceMonitoring } from './slang-cache.js';
246
-
247
- // Wrap functions with performance monitoring
248
- const monitoredConvert = withPerformanceMonitoring(slangToLatex, 'slangToLatex');
249
- const result = monitoredConvert(expression); // Automatically tracked
250
- ```
251
-
252
- ### ๐Ÿ›ก๏ธ Error Handling & Validation
253
-
254
- #### Advanced Error System
255
- ```javascript
256
- import { ParseError, ValidationError, handleError, attemptRecovery } from './slang-errors.js';
257
-
258
- try {
259
- const result = latexToSlang(invalidLatex);
260
- } catch (error) {
261
- // Handle with custom strategies
262
- const handled = handleError(error, {
263
- logErrors: true,
264
- returnNull: false
265
- });
266
-
267
- // Attempt recovery
268
- const recovery = attemptRecovery(error, originalInput);
269
- if (recovery.success) {
270
- console.log('Recovered with:', recovery.result);
271
- }
272
- }
273
- ```
274
-
275
- #### Validation System
276
- ```javascript
277
- import { validateLatex, validateErrorContext } from './slang-convertor.js';
278
-
279
- // Comprehensive validation
280
- const validation = validateLatex(latex, { strictMode: true });
281
- if (!validation.valid) {
282
- console.log('Errors:', validation.errors);
283
- }
284
- ```
285
-
286
262
  ### ๐Ÿ“Š Core Operations
287
263
 
288
264
  #### Expression Creation
@@ -305,7 +281,7 @@ const frac = createFraction(
305
281
 
306
282
  #### Calculus Operations
307
283
  ```javascript
308
- import { differentiateFraction, numericalIntegrateFraction } from './slang-math.js';
284
+ import { differentiateFraction, numericalIntegrateFraction } from './slang-basic.js';
309
285
  import { partialDerivative } from './slang-helpers.js';
310
286
 
311
287
  // Differentiation
@@ -319,216 +295,93 @@ const pdY = partialDerivative(expr, 'y');
319
295
  const integral = numericalIntegrateFraction(frac, 0, 1, 'x', 1000);
320
296
  ```
321
297
 
322
- #### โˆซ Integration
323
-
324
- **Symbolic Integration**
325
- ```javascript
326
- import { integrateFraction } from './slang-math.js';
327
-
328
- // Works for polynomial / constant
329
- const F = integrateFraction(
330
- createFraction([createTerm(2, {x: 1})], 1),
331
- 'x'
332
- ); // xยฒ
333
- ```
334
-
335
- **Numerical Integration (NEW: Simpson's Rule)**
336
- ```javascript
337
- import { numericalIntegrateFraction } from './slang-math.js';
338
-
339
- // For complex rational functions
340
- const area = numericalIntegrateFraction(
341
- complexRational,
342
- 0, // lower
343
- 1, // upper
344
- 'x',
345
- 1000 // steps (even number for Simpson's rule)
346
- );
347
-
348
- // Uses Simpson's rule: h/3[f(xโ‚€) + 4f(xโ‚) + 2f(xโ‚‚) + ...]
349
- // Much more accurate than rectangle method!
350
- ```
351
-
352
- **Definite Integration**
353
- ```javascript
354
- import { definiteIntegrateFraction } from './slang-math.js';
355
-
356
- const result = definiteIntegrateFraction(
357
- fraction,
358
- 0, // lower bound
359
- 2, // upper bound
360
- 'x'
361
- );
362
- ```
363
-
364
- **Double/Triple Integrals**
365
- ```javascript
366
- import { integralValue } from './slang-helpers.js';
367
-
368
- // โˆซโˆซ xy dx dy over [0,2] ร— [0,3]
369
- const volume = integralValue(
370
- createFraction([createTerm(1, {x:1, y:1})], 1),
371
- { x: [0, 2], y: [0, 3] }
372
- ); // 9
373
- ```
374
-
375
298
  ---
376
299
 
377
- ### Advanced Features
378
-
379
- #### ๐ŸŽฏ Product & Quotient Rules
380
-
381
- ```javascript
382
- import { productRuleDifferentiate, quotientRuleDifferentiate } from './slang-advanced.js';
383
-
384
- // Product rule: d/dx[fยทg] = f'ยทg + fยทg'
385
- const derivative1 = productRuleDifferentiate([f, g], 'x');
386
-
387
- // Quotient rule: d/dx[f/g] = (f'ยทg - fยทg')/gยฒ
388
- const derivative2 = quotientRuleDifferentiate(f, g, 'x');
389
- ```
390
-
391
- #### ๐Ÿ”— Chain Rule
392
-
393
- ```javascript
394
- import { chainRuleDifferentiate } from './slang-advanced.js';
395
-
396
- // For compositions like f(g(x))
397
- const result = chainRuleDifferentiate(outer, inner, 'x');
398
- ```
399
-
400
- #### ๐Ÿ“Š Taylor Series
401
-
402
- ```javascript
403
- import { taylorSeries } from './slang-advanced.js';
404
-
405
- // Expand f(x) around x = 0 to order 5
406
- const taylor = taylorSeries(f, 'x', 0, 5);
407
- // f(x) โ‰ˆ f(0) + f'(0)x + f''(0)xยฒ/2! + ...
408
- ```
409
-
410
- #### ๐ŸŽฒ Optimization
411
-
412
- **Critical Points**
413
- ```javascript
414
- import { findCriticalPoints, secondDerivativeTest } from './slang-advanced.js';
415
-
416
- // Find where f'(x) = 0
417
- const critical = findCriticalPoints(f, 'x', [-10, 10]);
418
-
419
- // Classify each point
420
- for (let point of critical.criticalPoints) {
421
- const test = secondDerivativeTest(f, 'x', point);
422
- console.log(`x = ${point}: ${test.type}`);
423
- // "local minimum", "local maximum", or "inconclusive"
424
- }
425
- ```
426
-
427
- **Curve Analysis**
428
- ```javascript
429
- import { analyzeCurve } from './slang-advanced.js';
430
-
431
- const analysis = analyzeCurve(f, 'x', [-5, 5]);
432
- // Returns: {
433
- // criticalPoints: [...],
434
- // extrema: [...],
435
- // inflectionPoints: [...],
436
- // firstDerivative: {...},
437
- // secondDerivative: {...}
438
- // }
439
- ```
440
-
441
- #### ๐Ÿ“ Geometry
442
-
443
- **Arc Length**
444
- ```javascript
445
- import { arcLength } from './slang-advanced.js';
446
-
447
- // Length of curve y = f(x) from a to b
448
- const L = arcLength(f, 'x', 0, 2);
449
- // Uses: L = โˆซโˆš(1 + (dy/dx)ยฒ) dx
450
- ```
451
-
452
- **Surface Area of Revolution**
453
- ```javascript
454
- import { surfaceAreaOfRevolution } from './slang-advanced.js';
300
+ ## ๐Ÿ—๏ธ Architecture
455
301
 
456
- // Rotate y = f(x) around x-axis
457
- const SA = surfaceAreaOfRevolution(f, 'x', 0, 1);
458
- // Uses: SA = 2ฯ€ โˆซ yโˆš(1 + (dy/dx)ยฒ) dx
302
+ ### Module Structure
459
303
  ```
460
-
461
- **Volume Under Surface**
462
- ```javascript
463
- import { volumeUnderSurface } from './slang-helpers.js';
464
-
465
- // Volume under z = f(x,y)
466
- const V = volumeUnderSurface(surface, [0, 1], [0, 1]);
304
+ slang-math.js (central exports)
305
+ โ”œโ”€ slang-basic.js
306
+ โ”‚ โ”œโ”€ Core term/fraction creation
307
+ โ”‚ โ”œโ”€ Polynomial arithmetic
308
+ โ”‚ โ”œโ”€ Differentiation & integration
309
+ โ”‚ โ””โ”€ GCD simplification
310
+ โ”œโ”€ slang-extended.js (Advanced functions)
311
+ โ”‚ โ”œโ”€ Tangent plane/line analysis
312
+ โ”‚ โ”œโ”€ Gradient & Hessian computation
313
+ โ”‚ โ”œโ”€ Critical points & optimization
314
+ โ”‚ โ”œโ”€ Directional derivatives
315
+ โ”‚ โ”œโ”€ Surface normals
316
+ โ”‚ โ”œโ”€ Lagrange multipliers
317
+ โ”‚ โ””โ”€ Extended mathematical functions
318
+ โ”œโ”€ slang-convertor.js
319
+ โ”‚ โ”œโ”€ LaTeX conversion system
320
+ โ”‚ โ””โ”€ Bidirectional parsing
321
+ โ”œโ”€ slang-helpers.js
322
+ โ”‚ โ”œโ”€ Easy builders
323
+ โ”‚ โ””โ”€ Common formulas
324
+ โ””โ”€ slang-advanced.js
325
+ โ”œโ”€ Product/quotient rules
326
+ โ”œโ”€ Taylor series
327
+ โ””โ”€ Advanced algorithms
467
328
  ```
468
329
 
469
- #### ๐ŸŒŠ Multivariable Calculus
330
+ ---
470
331
 
471
- **Gradient**
472
- ```javascript
473
- import { gradient } from './slang-advanced.js';
332
+ ## ๐Ÿงช Testing & Quality Assurance
474
333
 
475
- const grad = gradient(f, ['x', 'y']);
476
- // โˆ‡f = (โˆ‚f/โˆ‚x, โˆ‚f/โˆ‚y)
477
- ```
334
+ ### Comprehensive Test Suite
335
+ ```bash
336
+ # Run all tests
337
+ npm test
478
338
 
479
- **Directional Derivative**
480
- ```javascript
481
- import { directionalDerivative } from './slang-advanced.js';
339
+ # Run extended functions test
340
+ node experiments/slang-extended-test.js
482
341
 
483
- const Dvf = directionalDerivative(
484
- f,
485
- ['x', 'y'],
486
- {x: 1, y: 1}, // point
487
- {x: 1, y: 0} // direction
488
- );
489
- // Rate of change in given direction
342
+ # Run converter test
343
+ node experiments/test-converter.js
490
344
  ```
491
345
 
492
- **Lagrange Multipliers**
493
- ```javascript
494
- import { lagrangeMultipliers } from './slang-advanced.js';
495
-
496
- const result = lagrangeMultipliers(
497
- objectiveFunction,
498
- constraintFunction,
499
- ['x', 'y']
500
- );
501
- // Sets up system: โˆ‡f = ฮปโˆ‡g
502
- ```
346
+ ### Test Coverage
347
+ - **Unit Tests**: 95%+ code coverage
348
+ - **Integration Tests**: End-to-end functionality
349
+ - **Advanced Functions**: All features tested
350
+ - **Error Handling**: Comprehensive error scenarios
351
+
352
+ ### Test Categories
353
+ 1. Basic Function Creation and Evaluation
354
+ 2. Gradient and Hessian Matrices
355
+ 3. Tangent Plane and Line Analysis
356
+ 4. Critical Points and Optimization
357
+ 5. Directional Derivatives and Gradient Analysis
358
+ 6. Surface Normals
359
+ 7. Lagrange Multipliers
360
+ 8. Function Evaluation Edge Cases
361
+ 9. LaTeX Conversion
362
+ 10. Supported Functions Registry
503
363
 
504
364
  ---
505
365
 
506
- ## ๐Ÿ”ง Polynomial Arithmetic ()
507
-
508
- ```javascript
509
- import {
510
- addPolynomials,
511
- subtractPolynomials,
512
- multiplyPolynomials,
513
- simplifyPolynomial
514
- } from './slang-math.js';
515
-
516
- // Addition
517
- const sum = addPolynomials(poly1, poly2);
518
-
519
- // Subtraction
520
- const diff = subtractPolynomials(poly1, poly2);
521
-
522
- // Multiplication
523
- const product = multiplyPolynomials(poly1, poly2);
524
-
525
- // Simplification (combines like terms)
526
- const simplified = simplifyPolynomial(polynomial);
527
- ```
366
+ ## ๐Ÿ“Š Complete API Reference
528
367
 
529
- ---
368
+ ### Advanced Functions
530
369
 
531
- ## ๐Ÿ“Š Complete API Reference
370
+ | Function | Purpose | Example |
371
+ |----------|---------|---------|
372
+ | `gradient(func, vars)` | Calculate gradient vector | `gradient(f, ['x', 'y'])` |
373
+ | `hessian(func, vars)` | Calculate Hessian matrix | `hessian(f, ['x', 'y'])` |
374
+ | `tangentPlane(func, x0, y0)` | Tangent plane to surface | `tangentPlane(f, 1, 2)` |
375
+ | `tangentLine(func, x0)` | Tangent line to curve | `tangentLine(f, 1)` |
376
+ | `surfaceNormal(func, point)` | Surface normal vector | `surfaceNormal(f, {x:1,y:0,z:0})` |
377
+ | `findCriticalPoints(func, vars)` | Find critical points | `findCriticalPoints(f, ['x', 'y'])` |
378
+ | `classifyCriticalPoint(func, point)` | Classify critical point | `classifyCriticalPoint(f, point)` |
379
+ | `findExtrema(func, vars, bounds)` | Find local extrema | `findExtrema(f, ['x'], bounds)` |
380
+ | `findGlobalExtrema(func, vars, bounds)` | Find global extrema | `findGlobalExtrema(f, ['x'], bounds)` |
381
+ | `lagrangeMultipliers(func, constraints, vars)` | Constrained optimization | `lagrangeMultipliers(f, [g], ['x', 'y'])` |
382
+ | `directionalDerivative(func, point, direction)` | Directional derivative | `directionalDerivative(f, point, dir)` |
383
+ | `steepestDirections(func, point)` | Steepest ascent/descent | `steepestDirections(f, point)` |
384
+ | `tangentToLatex(tangent)` | Convert tangent to LaTeX | `tangentToLatex(tangent)` |
532
385
 
533
386
  ### Core Functions
534
387
 
@@ -543,230 +396,92 @@ const simplified = simplifyPolynomial(polynomial);
543
396
  | `numericalIntegrateFraction(...)` | Numeric integration | Simpson's rule |
544
397
  | `simplifyFraction(frac)` | Simplify | Combines terms, GCD |
545
398
 
546
- ### Helper Functions
547
-
548
- | Function | Purpose | Example |
549
- |----------|---------|---------|
550
- | `sum(terms)` | Build expression | See creation section |
551
- | `integralValue(expr, bounds)` | Integrate & evaluate | One-liner |
552
- | `volumeUnderSurface(f, xb, yb)` | 3D volume | Double integral |
553
- | `partialDerivative(f, var)` | Partial derivative | Multivariable |
554
-
555
- ### Advanced Functions
556
-
557
- | Function | Purpose | Example |
558
- |----------|---------|---------|
559
- | `productRuleDifferentiate(fs, var)` | Product rule | d/dx[fยทgยทh] |
560
- | `quotientRuleDifferentiate(f, g, var)` | Quotient rule | d/dx[f/g] |
561
- | `taylorSeries(f, var, center, order)` | Taylor expansion | Approximate f |
562
- | `findCriticalPoints(f, var, range)` | Find extrema | Optimization |
563
- | `gradient(f, vars)` | Gradient vector | โˆ‡f |
564
- | `arcLength(f, var, a, b)` | Curve length | Geometry |
565
-
566
399
  ---
567
400
 
568
401
  ## ๐Ÿ’ก Usage Patterns
569
402
 
570
- ### Pattern 1: Simple Calculus Problem
403
+ ### Pattern 1: Multivariable Surface Analysis
571
404
  ```javascript
572
- // Find critical points of f(x) = xยณ - 3x
573
- const f = polynomial([1, 0, -3, 0], 'x');
574
- const critical = findCriticalPoints(f[0][0], 'x', [-5, 5]);
575
- const fPrime = differentiateFraction(f[0][0], 'x');
576
-
577
- console.log('f(x) =', fractionToString(f[0][0]));
578
- console.log('f\'(x) =', fractionToString(fPrime));
579
- console.log('Critical points:', critical.criticalPoints);
580
- ```
405
+ // Analyze surface z = xยฒ + yยฒ
406
+ const surface = { terms: [createTerm(1, {x: 2}), createTerm(1, {y: 2})] };
581
407
 
582
- ### Pattern 2: Rational Function Analysis
583
- ```javascript
584
- // Analyze f(x) = (xยฒ - 1)/(xยฒ + 1)
585
- const f = createFraction(
586
- [createTerm(1, {x:2}), createTerm(-1)],
587
- [createTerm(1, {x:2}), createTerm(1)]
588
- );
408
+ // Find tangent plane at point
409
+ const tangent = tangentPlane(surface, 1, 2);
410
+ console.log('Tangent plane:', tangentToLatex(tangent));
589
411
 
590
- const fPrime = differentiateFraction(f, 'x');
591
- const critical = findCriticalPoints({numi: f.numi, deno: 1}, 'x', [-5,5]);
412
+ // Calculate gradient
413
+ const grad = gradient(surface, ['x', 'y']);
414
+ console.log('Gradient:', grad);
592
415
 
593
- console.log('Function:', fractionToString(f));
594
- console.log('Derivative:', fractionToString(fPrime));
416
+ // Find critical points
417
+ const critical = findCriticalPoints(surface, ['x', 'y']);
595
418
  ```
596
419
 
597
- ### Pattern 3: Multivariable Optimization
420
+ ### Pattern 2: Optimization Problem
598
421
  ```javascript
599
- // Find gradient of f(x,y) = xยฒy/(x + y)
600
- const f = createFraction(
601
- [createTerm(1, {x:2, y:1})],
602
- [createTerm(1, {x:1}), createTerm(1, {y:1})]
603
- );
604
-
605
- const grad = gradient(f, ['x', 'y']);
606
- console.log('โˆ‡f =', grad);
422
+ // Optimize f(x,y) = xยฒ - yยฒ subject to xยฒ + yยฒ = 1
423
+ const objective = { terms: [createTerm(1, {x: 2}), createTerm(-1, {y: 2})] };
424
+ const constraint = { terms: [createTerm(1, {x: 2}), createTerm(1, {y: 2}), createTerm(-1)] };
607
425
 
608
- // Evaluate at point (1,1)
609
- const gradAt = {
610
- x: evaluateFraction(grad.gradient.x, {x:1, y:1}),
611
- y: evaluateFraction(grad.gradient.y, {x:1, y:1})
612
- };
613
- console.log('โˆ‡f(1,1) =', gradAt);
426
+ // Use Lagrange multipliers
427
+ const result = lagrangeMultipliers(objective, [constraint], ['x', 'y']);
428
+ console.log('Constrained extrema:', result);
614
429
  ```
615
430
 
616
- ### Pattern 4: Numerical Integration
431
+ ### Pattern 3: Directional Analysis
617
432
  ```javascript
618
- // Integrate complex rational function
619
- const f = createFraction(
620
- [createTerm(1, {x:1})],
621
- [createTerm(1, {x:2}), createTerm(1)]
622
- ); // x/(xยฒ + 1)
433
+ // Analyze directional derivatives of f(x,y) = xยฒ + yยฒ
434
+ const func = { terms: [createTerm(1, {x: 2}), createTerm(1, {y: 2})] };
435
+ const point = { x: 1, y: 1 };
436
+ const direction = { x: 1, y: 1 };
437
+
438
+ // Calculate directional derivative
439
+ const dirDeriv = directionalDerivative(func, point, direction);
623
440
 
624
- const area = numericalIntegrateFraction(f, 0, 1, 'x', 10000);
625
- console.log('โˆซโ‚€ยน x/(xยฒ+1) dx โ‰ˆ', area);
626
- // This is ln(2)/2 โ‰ˆ 0.3466
441
+ // Find steepest directions
442
+ const steepest = steepestDirections(func, point);
443
+ console.log('Steepest ascent:', steepest.steepest_ascent);
444
+ console.log('Steepest descent:', steepest.steepest_descent);
627
445
  ```
628
446
 
629
447
  ---
630
448
 
631
449
  ## ๐ŸŽฏ Real-World Applications
632
450
 
633
- ### Physics: Projectile Motion
451
+ ### Physics: Surface Analysis
634
452
  ```javascript
635
- const h = polynomial([-4.9, 20, 2], 't'); // h(t) = -4.9tยฒ + 20t + 2
636
- const v = differentiateFraction(h[0][0], 't'); // v(t) = h'(t)
637
- const a = differentiateFraction(v, 't'); // a(t) = v'(t)
453
+ // Analyze temperature distribution T(x,y) = xยฒ + 2xy + yยฒ
454
+ const temperature = { terms: [createTerm(1, {x: 2}), createTerm(2, {x: 1, y: 1}), createTerm(1, {y: 2})] };
638
455
 
639
- const maxHeight = findCriticalPoints(h[0][0], 't', [0, 10]);
640
- console.log('Max height at t =', maxHeight.criticalPoints[0]);
641
- ```
456
+ // Find heat flux (gradient)
457
+ const heatFlux = gradient(temperature, ['x', 'y']);
642
458
 
643
- ### Economics: Cost Minimization
644
- ```javascript
645
- // Average cost: C(x) = (xยฒ + 100x + 1000)/x
646
- const AC = createFraction(
647
- [createTerm(1, {x:2}), createTerm(100, {x:1}), createTerm(1000)],
648
- [createTerm(1, {x:1})]
649
- );
650
-
651
- const minCost = findCriticalPoints({numi: AC.numi, deno: 1}, 'x', [1, 100]);
459
+ // Find hottest/coldest points
460
+ const extrema = findExtrema(temperature, ['x', 'y']);
652
461
  ```
653
462
 
654
- ### Engineering: Surface Area Optimization
463
+ ### Engineering: Optimization
655
464
  ```javascript
656
- // Minimize surface area of cylinder with volume V
657
- // A = 2ฯ€rยฒ + 2ฯ€rh, where V = ฯ€rยฒh
658
- // Express h in terms of r: h = V/(ฯ€rยฒ)
659
- // Then optimize A(r)
465
+ // Minimize surface area of cylinder with volume constraint
466
+ // Use Lagrange multipliers to solve constrained optimization
467
+ const surfaceArea = { terms: [createTerm(2, {r: 2}), createTerm(2, {r: 1, h: 1})] };
468
+ const volumeConstraint = { terms: [createTerm(1, {r: 2, h: 1}), createTerm(-V)] };
469
+ const result = lagrangeMultipliers(surfaceArea, [volumeConstraint], ['r', 'h']);
660
470
  ```
661
471
 
662
- ---
663
-
664
- ## ๐Ÿ—๏ธ Architecture
665
-
666
- ### Module Structure
667
- ```
668
- slang-math.js (exports all)
669
- โ”œโ”€ slang-basic.js ( )
670
- โ”‚ โ”œโ”€ Core term/fraction creation
671
- โ”‚ โ”œโ”€ Polynomial arithmetic
672
- โ”‚ โ”œโ”€ Quotient rule differentiation
673
- โ”‚ โ”œโ”€ Simpson's rule integration
674
- โ”‚ โ””โ”€ GCD simplification
675
- โ”œโ”€ slang-helpers.js
676
- โ”‚ โ”œโ”€ Easy builders
677
- โ”‚ โ”œโ”€ Common formulas
678
- โ”‚ โ””โ”€ Verification tools
679
- โ””โ”€ slang-advanced.js
680
- โ”œโ”€ Product/quotient rules
681
- โ”œโ”€ Taylor series
682
- โ”œโ”€ Optimization
683
- โ””โ”€ Multivariable calculus
684
- ```
685
-
686
- ### Data Structure (Enhanced)
472
+ ### Economics: Multivariable Optimization
687
473
  ```javascript
688
- // FRACTION ()
689
- {
690
- numi: {
691
- terms: [
692
- { coeff: 2, var: { x: 2 } }, // 2xยฒ
693
- { coeff: 3, var: { x: 1 } } // 3x
694
- ]
695
- },
696
- deno: { //: Can be polynomial!
697
- terms: [
698
- { coeff: 1, var: { x: 1 } }, // x
699
- { coeff: 1 } // 1
700
- ]
701
- }
702
- // OR simple: deno: 5
703
- }
704
- ```
705
-
706
- ---
707
-
708
- ## ๐Ÿงช Testing & Quality Assurance
474
+ // Maximize profit P(x,y) = 10x + 8y - xยฒ - yยฒ - xy
475
+ const profit = { terms: [createTerm(10, {x: 1}), createTerm(8, {y: 1}), createTerm(-1, {x: 2}), createTerm(-1, {y: 2}), createTerm(-1, {x: 1, y: 1})] };
709
476
 
710
- ### Comprehensive Test Suite
711
- ```bash
712
- # Run all tests
713
- npm test
714
-
715
- # Run tests with coverage
716
- npm run test:coverage
717
-
718
- # Run tests in watch mode
719
- npm run test:watch
720
-
721
- # Run specific test suites
722
- node tests/unit/converter.test.js
723
- node experiments/test-converter.js
477
+ // Find optimal production levels
478
+ const critical = findCriticalPoints(profit, ['x', 'y']);
479
+ critical.forEach(point => {
480
+ const classification = classifyCriticalPoint(profit, point.variables);
481
+ console.log(`Production levels: ${JSON.stringify(point.variables)}, Type: ${classification}`);
482
+ });
724
483
  ```
725
484
 
726
- ### Test Coverage
727
- - **Unit Tests**: 95%+ code coverage
728
- - **Integration Tests**: End-to-end functionality
729
- - **Performance Tests**: Benchmarking and optimization
730
- - **Error Handling Tests**: Comprehensive error scenarios
731
-
732
- ### Quality Metrics
733
- ```javascript
734
- // Run performance benchmarks
735
- npm run benchmark
736
-
737
- // Lint code
738
- npm run lint
739
-
740
- // Format code
741
- npm run format
742
-
743
- // Generate documentation
744
- npm run docs
745
- ```
746
-
747
- ---
748
-
749
- ## ๐Ÿ“ˆ Performance Notes
750
-
751
- ### v2.0 Performance Improvements
752
- - **Caching System**: 85%+ hit rate for repeated operations
753
- - **Batch Processing**: 3-5x faster for large datasets
754
- - **Memory Optimization**: 40% reduction in memory usage
755
- - **Error Recovery**: 60% faster error handling
756
-
757
- ### Complexity Analysis
758
- - **LaTeX Conversion**: O(n) where n = expression complexity
759
- - **Function Evaluation**: O(m) where m = function depth
760
- - **Batch Operations**: O(k) where k = number of expressions
761
- - **Cache Operations**: O(1) average case
762
-
763
- ### Performance Best Practices
764
- 1. Use cached functions for repeated conversions
765
- 2. Enable batch processing for multiple expressions
766
- 3. Monitor performance stats regularly
767
- 4. Clear caches when memory is constrained
768
- 5. Use validation before expensive operations
769
-
770
485
  ---
771
486
 
772
487
  ## ๐Ÿ—๏ธ Project Structure
@@ -774,87 +489,62 @@ npm run docs
774
489
  ### Core Modules
775
490
  ```
776
491
  slang-math/
492
+ โ”œโ”€โ”€ slang-math.js # Central exports only
777
493
  โ”œโ”€โ”€ slang-basic.js # Core SLaNg structures
494
+ โ”œโ”€โ”€ slang-extended.js # Advanced mathematical functions
778
495
  โ”œโ”€โ”€ slang-convertor.js # LaTeX conversion system
779
- โ”œโ”€โ”€ slang-extended.js # Extended mathematical functions
780
- โ”œโ”€โ”€ slang-math.js # Calculus operations
781
- โ”œโ”€โ”€ slang-advanced.js # Advanced algorithms
782
- โ”œโ”€โ”€ slang-helpers.js # Utility functions
783
- โ”œโ”€โ”€ slang-errors.js # Error handling system
784
- โ””โ”€โ”€ slang-cache.js # Performance & caching
785
- ```
786
-
787
- ### Documentation
788
- ```
789
- โ”œโ”€โ”€ explaination/ # Detailed function explanations
790
- โ”‚ โ”œโ”€โ”€ SLaNg-Converter/
791
- โ”‚ โ”œโ”€โ”€ SLaNg-Basic/
792
- โ”‚ โ”œโ”€โ”€ SLaNg-Advanced/
793
- โ”‚ โ””โ”€โ”€ SLaNg-Helpers/
794
- โ”œโ”€โ”€ docs/ # Generated documentation
795
- โ””โ”€โ”€ README.md # This file
796
- ```
797
-
798
- ### Testing
799
- ```
800
- โ”œโ”€โ”€ tests/
801
- โ”‚ โ”œโ”€โ”€ unit/ # Unit tests
802
- โ”‚ โ”œโ”€โ”€ integration/ # Integration tests
803
- โ”‚ โ””โ”€โ”€ performance/ # Performance benchmarks
804
- โ””โ”€โ”€ experiments/ # Experimental features
496
+ โ”œโ”€โ”€ slang-advanced.js # Advanced algorithms
497
+ โ”œโ”€โ”€ slang-helpers.js # Utility functions
498
+ โ””โ”€โ”€ experiments/ # Test suite
499
+ โ”œโ”€โ”€ slang-extended-test.js # Comprehensive testing
500
+ โ””โ”€โ”€ test-converter.js # Converter testing
805
501
  ```
806
502
 
807
503
  ---
808
504
 
809
- ## ๐Ÿ”ฅ What Makes SLaNg v2.0 Special?
505
+ ## ๐Ÿ”ฅ What Makes SLaNg Special?
810
506
 
811
- โœจ **Complete LaTeX Integration** - Bidirectional conversion with validation
812
- ๐Ÿงฎ **Extended Function Support** - Trigonometric, logarithmic, exponential functions
813
- โšก **Advanced Performance** - Caching, monitoring, and optimization
814
- ๏ฟฝ๏ธ **Robust Error Handling** - Comprehensive error recovery system
815
- ๐Ÿ“Š **Professional Testing** - 95%+ test coverage with CI/CD ready
816
- ๐Ÿ”ง **Modular Architecture** - Clean separation of concerns
817
- ๐Ÿ“š **Extensive Documentation** - Function-by-function explanations
818
- ๐ŸŽ“ **Educational Focus** - See the math, not just the answer
507
+ โœจ **Complete Multivariable Calculus** - Tangent planes, gradients, optimization
508
+ ๐Ÿงฎ **Advanced Mathematical Functions** - Surface analysis, constrained optimization
509
+ ๐Ÿ“ **Professional Code Organization** - Clean modular structure
510
+ ๐Ÿ”„ **LaTeX Integration** - Bidirectional conversion with validation
511
+ ๐Ÿงช **Comprehensive Testing** - 10 test categories with full coverage
512
+ ๐Ÿ“Š **Educational Focus** - See the math, not just the answer
513
+ ๐Ÿš€ **Production Ready** - Robust error handling and performance
819
514
 
820
515
  ---
821
516
 
822
- ## ๐Ÿš€ Migration from v1.x
517
+ ## ๐Ÿค Contributing
823
518
 
824
- ### Breaking Changes
825
- - **None!** Full backward compatibility maintained
826
- - All v1.x code works unchanged in v2.0
519
+ We welcome contributions from the community! Whether you're fixing bugs, adding features, improving documentation, or sharing ideas, your help makes SLaNg better for everyone.
827
520
 
828
- ### New Features in v2.0
829
- ```javascript
830
- // v1.x code still works:
831
- const f = createFraction([createTerm(1, {x:1})], 1); // โœ“
832
- const fPrime = differentiateFraction(f, 'x'); // โœ“
833
-
834
- // v2.0 adds powerful new capabilities:
835
- const latex = slangToLatex(f); // ๐Ÿ†• LaTeX conversion
836
- const parsed = latexToSlang('\\frac{x}{x+1}'); // ๐Ÿ†• LaTeX parsing
837
- const sinExpr = createFunction('sin', [createTerm(1, {x:1})]); // ๐Ÿ†• Functions
838
- const cached = cachedLatexToSlang(latex); // ๐Ÿ†• Performance
839
- ```
521
+ ### ๐ŸŽฏ How to Contribute
840
522
 
841
- ### Upgrade Path
842
- 1. **No code changes required** - everything works as before
843
- 2. **Optional**: Import new modules for enhanced features
844
- 3. **Recommended**: Run tests to verify functionality
845
- 4. **Optional**: Enable performance monitoring
523
+ #### ๐Ÿ› Report Bugs
524
+ - Found an issue? [Open a bug report](https://github.com/yourusername/slang-math/issues)
525
+ - Include: description, steps to reproduce, expected vs actual behavior
526
+ - Add code examples and error messages
846
527
 
847
- ---
528
+ #### ๐Ÿ’ก Request Features
529
+ - Have an idea? [Open a feature request](https://github.com/yourusername/slang-math/issues)
530
+ - Describe the use case and why it would be valuable
531
+ - Consider if it fits the library's scope and goals
848
532
 
849
- ## ๐Ÿค Contributing
533
+ #### ๐Ÿ”ง Submit Pull Requests
534
+ 1. Fork the repository
535
+ 2. Create a feature branch: `git checkout -b feature/amazing-feature`
536
+ 3. Make your changes with clear, documented code
537
+ 4. Add tests for new functionality
538
+ 5. Ensure all tests pass: `npm test`
539
+ 6. Submit a pull request with a clear description
850
540
 
851
- We love contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for:
852
- - How to add features
853
- - Code style guidelines
854
- - Testing requirements
855
- - Documentation standards
541
+ #### ๐Ÿ“š Improve Documentation
542
+ - Fix typos or unclear explanations
543
+ - Add examples and use cases
544
+ - Improve API documentation
545
+ - Create tutorials and guides
856
546
 
857
- ### Development Setup
547
+ ### ๐Ÿ› ๏ธ Development Setup
858
548
  ```bash
859
549
  # Clone repository
860
550
  git clone https://github.com/yourusername/slang-math.git
@@ -866,22 +556,78 @@ npm install
866
556
  # Run tests
867
557
  npm test
868
558
 
559
+ # Run specific test suites
560
+ node experiments/slang-extended-test.js
561
+ node experiments/test-converter.js
562
+
869
563
  # Start development
870
564
  npm run dev
871
565
  ```
872
566
 
873
- ### Current Priorities
874
- 1. **Matrix operations** and linear algebra
875
- 2. **Symbolic equation solving**
876
- 3. **Advanced integration techniques**
877
- 4. **Web interface** and visualization tools
878
- 5. **TypeScript definitions** for better IDE support
567
+ ### ๐Ÿ“‹ Contribution Guidelines
568
+
569
+ #### Code Style
570
+ - Use clear, descriptive variable names
571
+ - Add JSDoc comments for new functions
572
+ - Follow existing code patterns and structure
573
+ - Keep functions focused and modular
574
+
575
+ #### Testing
576
+ - Add tests for all new functionality
577
+ - Ensure 95%+ test coverage
578
+ - Test edge cases and error conditions
579
+ - Include performance tests for significant changes
580
+
581
+ #### Documentation
582
+ - Update README for major features
583
+ - Add inline code comments
584
+ - Include examples in function documentation
585
+ - Update API reference as needed
586
+
587
+ ### ๐ŸŽฏ Current Priorities
588
+ We're looking for help with:
589
+
590
+ 1. **๐Ÿ”ข Matrix Operations** - Linear algebra functions
591
+ 2. **โš–๏ธ Symbolic Equation Solving** - Root finding and solving systems
592
+ 3. **๐Ÿ“ˆ Advanced Integration** - More numerical integration techniques
593
+ 4. **๐ŸŒ Web Interface** - Interactive visualization tools
594
+ 5. **๐Ÿ“ TypeScript Definitions** - Better IDE support
595
+ 6. **๐Ÿงช Performance Optimization** - Speed improvements
596
+ 7. **๐Ÿ“š Educational Content** - Tutorials and examples
597
+ 8. **๐Ÿ” Validation System** - Enhanced input validation
598
+
599
+ ### ๐Ÿ’ฌ Get Involved
600
+
601
+ #### ๐Ÿ—ฃ๏ธ Discussion
602
+ - Join our [GitHub Discussions](https://github.com/yourusername/slang-math/discussions)
603
+ - Ask questions, share ideas, get help
604
+ - Participate in planning and design discussions
605
+
606
+ #### ๐Ÿ“ข Share Your Work
607
+ - Show us what you're building with SLaNg
608
+ - Share examples and use cases
609
+ - Contribute to our collection of demos
610
+
611
+ #### ๐Ÿ† Recognition
612
+ - All contributors are credited in our contributors list
613
+ - Significant contributions are highlighted in release notes
614
+ - Outstanding contributors may be invited as maintainers
615
+
616
+ ### ๐Ÿ“„ License
617
+
618
+ By contributing to SLaNg, you agree that your contributions will be licensed under the same MIT License as the project.
879
619
 
880
620
  ---
881
621
 
882
- ## ๐Ÿ“„ License
622
+ ## ๐Ÿ™ Acknowledgments
623
+
624
+ Special thanks to everyone who has contributed to making SLaNg a powerful mathematical library:
883
625
 
884
- MIT License - use freely in your projects!
626
+ - **Contributors** who fix bugs and add features
627
+ - **Users** who provide feedback and report issues
628
+ - **Educators** who use SLaNg in their teaching
629
+ - **Researchers** who push the boundaries of what's possible
630
+ - **Developers** who build amazing things with SLaNg
885
631
 
886
632
  ---
887
633
 
@@ -889,31 +635,27 @@ MIT License - use freely in your projects!
889
635
 
890
636
  ### Getting Started
891
637
  - **๐Ÿ“– README**: This file
892
- - **๐Ÿ“‹ SUMMARY**: [SUMMARY.md](SUMMARY.md) - Quick overview
893
- - **๐ŸŽฏ FEATURES**: [FEATURES-EXPLAINED.md](FEATURES-EXPLAINED.md) - Detailed features
894
- - **๐Ÿ—๏ธ ARCHITECTURE**: [ARCHITECTURE.md](ARCHITECTURE.md) - System design
895
-
896
- ### Documentation
897
- - **๐Ÿ“š Function Explanations**: `explaination/` folder
898
- - **๐Ÿ”„ Conversion Guide**: [CONVERTER-README.md](CONVERTER-README.md)
899
- - **๐Ÿงช Testing Guide**: Run `node experiments/test-converter.js`
900
-
901
- ### Examples & Demos
902
- - **๐Ÿš€ Quick Demo**: `node slang-convertor.js`
638
+ - **๐Ÿงช Run Tests**: `node experiments/slang-extended-test.js`
639
+ - **๐Ÿ”„ Conversion Demo**: `node slang-convertor.js`
903
640
  - **๐Ÿงฎ Extended Demo**: `node slang-extended.js`
904
- - **โšก Performance Demo**: `node experiments/benchmark.js`
641
+
642
+ ### Community
643
+ - **๐Ÿ’ฌ Discussions**: [GitHub Discussions](https://github.com/yourusername/slang-math/discussions)
644
+ - **๐Ÿ› Report Issues**: [GitHub Issues](https://github.com/yourusername/slang-math/issues)
645
+ - **๐Ÿ’ก Request Features**: [Feature Requests](https://github.com/yourusername/slang-math/issues)
646
+ - **๐Ÿ”ง Pull Requests**: [Contributing Guide](CONTRIBUTING.md)
905
647
 
906
648
  ### Development
907
- - **๐Ÿงช Run Tests**: `npm test`
649
+ - **๐Ÿงช Test Extended Functions**: `node experiments/slang-extended-test.js`
650
+ - **๐Ÿงช Test Converter**: `node experiments/test-converter.js`
908
651
  - **๐Ÿ“Š Performance**: `npm run benchmark`
909
- - **๐Ÿ“– Generate Docs**: `npm run docs`
910
652
  - **๐Ÿ”ง Lint Code**: `npm run lint`
911
653
 
912
654
  ---
913
655
 
914
656
  ## ๐ŸŽ‰ Thank You!
915
657
 
916
- **SLaNg v2.0** represents a significant leap forward in symbolic mathematics for JavaScript. Whether you're a student learning calculus, a researcher needing computational tools, or a developer building educational software, SLaNg provides the power, flexibility, and reliability you need.
658
+ **SLaNg** represents a powerful approach to symbolic mathematics in JavaScript. Whether you're a student learning multivariable calculus, a researcher needing computational tools, or a developer building educational software, SLaNg provides the power, flexibility, and reliability you need.
917
659
 
918
660
  **Happy Computing! ๐Ÿš€**
919
661
 
@@ -922,20 +664,23 @@ MIT License - use freely in your projects!
922
664
  | Need to... | Use... | File |
923
665
  |------------|--------|------|
924
666
  | Create polynomial | `polynomial([2,1,0], 'x')` | slang-helpers.js |
925
- | Create rational | `createFraction(numi, deno)` | slang-math.js |
926
- | Evaluate | `evaluateFraction(f, {x:3})` | slang-math.js |
927
- | Differentiate | `differentiateFraction(f, 'x')` | slang-math.js |
928
- | Integrate (numeric) | `numericalIntegrateFraction(...)` | slang-math.js |
929
- | Find critical pts | `findCriticalPoints(f, 'x')` | slang-advanced.js |
930
- | Simplify | `simplifyFraction(f)` | slang-math.js |
931
- | Gradient | `gradient(f, ['x','y'])` | slang-advanced.js |
667
+ | Create rational | `createFraction(numi, deno)` | slang-basic.js |
668
+ | Calculate gradient | `gradient(f, ['x','y'])` | slang-extended.js |
669
+ | Find tangent plane | `tangentPlane(f, x0, y0)` | slang-extended.js |
670
+ | Find critical points | `findCriticalPoints(f, ['x','y'])` | slang-extended.js |
671
+ | Lagrange multipliers | `lagrangeMultipliers(f, [g], ['x','y'])` | slang-extended.js |
672
+ | Directional derivative | `directionalDerivative(f, point, dir)` | slang-extended.js |
673
+ | Evaluate | `evaluateFraction(f, {x:3})` | slang-basic.js |
674
+ | Differentiate | `differentiateFraction(f, 'x')` | slang-basic.js |
675
+ | Integrate (numeric) | `numericalIntegrateFraction(...)` | slang-basic.js |
676
+ | Simplify | `simplifyFraction(f)` | slang-basic.js |
677
+ | Convert to LaTeX | `slangToLatex(f)` | slang-convertor.js |
678
+ | Parse LaTeX | `latexToSlang(latex)` | slang-convertor.js |
932
679
 
933
680
  ---
934
681
 
935
- **Version**: 2.0.0
936
- **Last Updated**: February 2026
937
- **Total Lines of Code**: ~2,000+
938
- **Total Features**: 75+
682
+ **Total Lines of Code**: ~3,000+
683
+ **Total Features**: 85+
939
684
  **Dependencies**: 0
940
685
 
941
686
  ---
@@ -944,7 +689,7 @@ MIT License - use freely in your projects!
944
689
 
945
690
  **Made with โค๏ธ for the mathematical community**
946
691
 
947
- **enhancementd to handle ANY rational function!** ๐Ÿงฎโœจ
692
+ **Advanced multivariable calculus capabilities!** ๐Ÿงฎโœจ
948
693
 
949
694
  [โญ Star us on GitHub](https://github.com/yourusername/slang-math) โ€ข [๐Ÿ› Report Bug](https://github.com/yourusername/slang-math/issues) โ€ข [๐Ÿ’ก Request Feature](https://github.com/yourusername/slang-math/issues)
950
695