mathjs 10.0.2 → 10.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. package/HISTORY.md +11 -0
  2. package/NOTICE +1 -1
  3. package/README.md +10 -2
  4. package/bin/cli.js +1 -1
  5. package/docs/expressions/syntax.md +1 -1
  6. package/docs/reference/functions/invmod.md +41 -0
  7. package/docs/reference/functions.md +1 -0
  8. package/lib/browser/math.js +6 -6
  9. package/lib/browser/math.js.map +1 -1
  10. package/lib/cjs/entry/dependenciesAny/dependenciesInvmod.generated.js +41 -0
  11. package/lib/cjs/entry/dependenciesAny/dependenciesRationalize.generated.js +15 -0
  12. package/lib/cjs/entry/dependenciesAny/dependenciesSimplify.generated.js +15 -0
  13. package/lib/cjs/entry/dependenciesAny.generated.js +8 -0
  14. package/lib/cjs/entry/dependenciesNumber/dependenciesRationalize.generated.js +15 -0
  15. package/lib/cjs/entry/dependenciesNumber/dependenciesSimplify.generated.js +15 -0
  16. package/lib/cjs/entry/impureFunctionsAny.generated.js +11 -0
  17. package/lib/cjs/entry/impureFunctionsNumber.generated.js +10 -0
  18. package/lib/cjs/entry/pureFunctionsAny.generated.js +14 -2
  19. package/lib/cjs/expression/embeddedDocs/embeddedDocs.js +6 -1
  20. package/lib/cjs/expression/embeddedDocs/function/arithmetic/invmod.js +15 -0
  21. package/lib/cjs/expression/embeddedDocs/function/matrix/forEach.js +1 -1
  22. package/lib/cjs/factoriesAny.js +8 -0
  23. package/lib/cjs/function/algebra/rationalize.js +18 -4
  24. package/lib/cjs/function/algebra/simplify/simplifyConstant.js +223 -29
  25. package/lib/cjs/function/algebra/simplify/simplifyCore.js +34 -6
  26. package/lib/cjs/function/algebra/simplify.js +70 -22
  27. package/lib/cjs/function/arithmetic/invmod.js +73 -0
  28. package/lib/cjs/header.js +3 -3
  29. package/lib/cjs/version.js +1 -1
  30. package/lib/esm/entry/dependenciesAny/dependenciesInvmod.generated.js +24 -0
  31. package/lib/esm/entry/dependenciesAny/dependenciesRationalize.generated.js +10 -0
  32. package/lib/esm/entry/dependenciesAny/dependenciesSimplify.generated.js +10 -0
  33. package/lib/esm/entry/dependenciesAny.generated.js +1 -0
  34. package/lib/esm/entry/dependenciesNumber/dependenciesRationalize.generated.js +10 -0
  35. package/lib/esm/entry/dependenciesNumber/dependenciesSimplify.generated.js +10 -0
  36. package/lib/esm/entry/impureFunctionsAny.generated.js +12 -1
  37. package/lib/esm/entry/impureFunctionsNumber.generated.js +10 -0
  38. package/lib/esm/entry/pureFunctionsAny.generated.js +12 -1
  39. package/lib/esm/expression/embeddedDocs/embeddedDocs.js +4 -1
  40. package/lib/esm/expression/embeddedDocs/function/arithmetic/invmod.js +8 -0
  41. package/lib/esm/expression/embeddedDocs/function/matrix/forEach.js +1 -1
  42. package/lib/esm/factoriesAny.js +1 -0
  43. package/lib/esm/function/algebra/rationalize.js +18 -4
  44. package/lib/esm/function/algebra/simplify/simplifyConstant.js +197 -29
  45. package/lib/esm/function/algebra/simplify/simplifyCore.js +35 -7
  46. package/lib/esm/function/algebra/simplify.js +70 -22
  47. package/lib/esm/function/arithmetic/invmod.js +57 -0
  48. package/lib/esm/header.js +1 -1
  49. package/lib/esm/version.js +1 -1
  50. package/package.json +2 -1
package/lib/cjs/header.js CHANGED
@@ -6,11 +6,11 @@
6
6
  * It features real and complex numbers, units, matrices, a large set of
7
7
  * mathematical functions, and a flexible expression parser.
8
8
  *
9
- * @version 10.0.2
10
- * @date 2021-12-29
9
+ * @version 10.1.0
10
+ * @date 2022-01-15
11
11
  *
12
12
  * @license
13
- * Copyright (C) 2013-2021 Jos de Jong <wjosdejong@gmail.com>
13
+ * Copyright (C) 2013-2022 Jos de Jong <wjosdejong@gmail.com>
14
14
  *
15
15
  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
16
16
  * use this file except in compliance with the License. You may obtain a copy
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.version = void 0;
7
- var version = '10.0.2'; // Note: This file is automatically generated when building math.js.
7
+ var version = '10.1.0'; // Note: This file is automatically generated when building math.js.
8
8
  // Changes made in this file will be overwritten.
9
9
 
10
10
  exports.version = version;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * THIS FILE IS AUTO-GENERATED
3
+ * DON'T MAKE CHANGES HERE
4
+ */
5
+ import { BigNumberDependencies } from './dependenciesBigNumberClass.generated.js';
6
+ import { addDependencies } from './dependenciesAdd.generated.js';
7
+ import { equalDependencies } from './dependenciesEqual.generated.js';
8
+ import { isIntegerDependencies } from './dependenciesIsInteger.generated.js';
9
+ import { modDependencies } from './dependenciesMod.generated.js';
10
+ import { smallerDependencies } from './dependenciesSmaller.generated.js';
11
+ import { typedDependencies } from './dependenciesTyped.generated.js';
12
+ import { xgcdDependencies } from './dependenciesXgcd.generated.js';
13
+ import { createInvmod } from '../../factoriesAny.js';
14
+ export var invmodDependencies = {
15
+ BigNumberDependencies,
16
+ addDependencies,
17
+ equalDependencies,
18
+ isIntegerDependencies,
19
+ modDependencies,
20
+ smallerDependencies,
21
+ typedDependencies,
22
+ xgcdDependencies,
23
+ createInvmod
24
+ };
@@ -4,8 +4,12 @@
4
4
  */
5
5
  import { bignumberDependencies } from './dependenciesBignumber.generated.js';
6
6
  import { fractionDependencies } from './dependenciesFraction.generated.js';
7
+ import { AccessorNodeDependencies } from './dependenciesAccessorNode.generated.js';
8
+ import { ArrayNodeDependencies } from './dependenciesArrayNode.generated.js';
7
9
  import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js';
8
10
  import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js';
11
+ import { IndexNodeDependencies } from './dependenciesIndexNode.generated.js';
12
+ import { ObjectNodeDependencies } from './dependenciesObjectNode.generated.js';
9
13
  import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js';
10
14
  import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.generated.js';
11
15
  import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js';
@@ -13,6 +17,7 @@ import { addDependencies } from './dependenciesAdd.generated.js';
13
17
  import { divideDependencies } from './dependenciesDivide.generated.js';
14
18
  import { equalDependencies } from './dependenciesEqual.generated.js';
15
19
  import { isZeroDependencies } from './dependenciesIsZero.generated.js';
20
+ import { matrixDependencies } from './dependenciesMatrix.generated.js';
16
21
  import { multiplyDependencies } from './dependenciesMultiply.generated.js';
17
22
  import { parseDependencies } from './dependenciesParse.generated.js';
18
23
  import { powDependencies } from './dependenciesPow.generated.js';
@@ -23,8 +28,12 @@ import { createRationalize } from '../../factoriesAny.js';
23
28
  export var rationalizeDependencies = {
24
29
  bignumberDependencies,
25
30
  fractionDependencies,
31
+ AccessorNodeDependencies,
32
+ ArrayNodeDependencies,
26
33
  ConstantNodeDependencies,
27
34
  FunctionNodeDependencies,
35
+ IndexNodeDependencies,
36
+ ObjectNodeDependencies,
28
37
  OperatorNodeDependencies,
29
38
  ParenthesisNodeDependencies,
30
39
  SymbolNodeDependencies,
@@ -32,6 +41,7 @@ export var rationalizeDependencies = {
32
41
  divideDependencies,
33
42
  equalDependencies,
34
43
  isZeroDependencies,
44
+ matrixDependencies,
35
45
  multiplyDependencies,
36
46
  parseDependencies,
37
47
  powDependencies,
@@ -4,8 +4,12 @@
4
4
  */
5
5
  import { bignumberDependencies } from './dependenciesBignumber.generated.js';
6
6
  import { fractionDependencies } from './dependenciesFraction.generated.js';
7
+ import { AccessorNodeDependencies } from './dependenciesAccessorNode.generated.js';
8
+ import { ArrayNodeDependencies } from './dependenciesArrayNode.generated.js';
7
9
  import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js';
8
10
  import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js';
11
+ import { IndexNodeDependencies } from './dependenciesIndexNode.generated.js';
12
+ import { ObjectNodeDependencies } from './dependenciesObjectNode.generated.js';
9
13
  import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js';
10
14
  import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.generated.js';
11
15
  import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js';
@@ -13,6 +17,7 @@ import { addDependencies } from './dependenciesAdd.generated.js';
13
17
  import { divideDependencies } from './dependenciesDivide.generated.js';
14
18
  import { equalDependencies } from './dependenciesEqual.generated.js';
15
19
  import { isZeroDependencies } from './dependenciesIsZero.generated.js';
20
+ import { matrixDependencies } from './dependenciesMatrix.generated.js';
16
21
  import { multiplyDependencies } from './dependenciesMultiply.generated.js';
17
22
  import { parseDependencies } from './dependenciesParse.generated.js';
18
23
  import { powDependencies } from './dependenciesPow.generated.js';
@@ -22,8 +27,12 @@ import { createSimplify } from '../../factoriesAny.js';
22
27
  export var simplifyDependencies = {
23
28
  bignumberDependencies,
24
29
  fractionDependencies,
30
+ AccessorNodeDependencies,
31
+ ArrayNodeDependencies,
25
32
  ConstantNodeDependencies,
26
33
  FunctionNodeDependencies,
34
+ IndexNodeDependencies,
35
+ ObjectNodeDependencies,
27
36
  OperatorNodeDependencies,
28
37
  ParenthesisNodeDependencies,
29
38
  SymbolNodeDependencies,
@@ -31,6 +40,7 @@ export var simplifyDependencies = {
31
40
  divideDependencies,
32
41
  equalDependencies,
33
42
  isZeroDependencies,
43
+ matrixDependencies,
34
44
  multiplyDependencies,
35
45
  parseDependencies,
36
46
  powDependencies,
@@ -148,6 +148,7 @@ export { InfinityDependencies } from './dependenciesAny/dependenciesInfinity.gen
148
148
  export { intersectDependencies } from './dependenciesAny/dependenciesIntersect.generated.js';
149
149
  export { invDependencies } from './dependenciesAny/dependenciesInv.generated.js';
150
150
  export { inverseConductanceQuantumDependencies } from './dependenciesAny/dependenciesInverseConductanceQuantum.generated.js';
151
+ export { invmodDependencies } from './dependenciesAny/dependenciesInvmod.generated.js';
151
152
  export { isIntegerDependencies } from './dependenciesAny/dependenciesIsInteger.generated.js';
152
153
  export { isNaNDependencies } from './dependenciesAny/dependenciesIsNaN.generated.js';
153
154
  export { isNegativeDependencies } from './dependenciesAny/dependenciesIsNegative.generated.js';
@@ -2,8 +2,12 @@
2
2
  * THIS FILE IS AUTO-GENERATED
3
3
  * DON'T MAKE CHANGES HERE
4
4
  */
5
+ import { AccessorNodeDependencies } from './dependenciesAccessorNode.generated.js';
6
+ import { ArrayNodeDependencies } from './dependenciesArrayNode.generated.js';
5
7
  import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js';
6
8
  import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js';
9
+ import { IndexNodeDependencies } from './dependenciesIndexNode.generated.js';
10
+ import { ObjectNodeDependencies } from './dependenciesObjectNode.generated.js';
7
11
  import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js';
8
12
  import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.generated.js';
9
13
  import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js';
@@ -11,6 +15,7 @@ import { addDependencies } from './dependenciesAdd.generated.js';
11
15
  import { divideDependencies } from './dependenciesDivide.generated.js';
12
16
  import { equalDependencies } from './dependenciesEqual.generated.js';
13
17
  import { isZeroDependencies } from './dependenciesIsZero.generated.js';
18
+ import { matrixDependencies } from './dependenciesMatrix.generated.js';
14
19
  import { multiplyDependencies } from './dependenciesMultiply.generated.js';
15
20
  import { parseDependencies } from './dependenciesParse.generated.js';
16
21
  import { powDependencies } from './dependenciesPow.generated.js';
@@ -19,8 +24,12 @@ import { subtractDependencies } from './dependenciesSubtract.generated.js';
19
24
  import { typedDependencies } from './dependenciesTyped.generated.js';
20
25
  import { createRationalize } from '../../factoriesNumber.js';
21
26
  export var rationalizeDependencies = {
27
+ AccessorNodeDependencies,
28
+ ArrayNodeDependencies,
22
29
  ConstantNodeDependencies,
23
30
  FunctionNodeDependencies,
31
+ IndexNodeDependencies,
32
+ ObjectNodeDependencies,
24
33
  OperatorNodeDependencies,
25
34
  ParenthesisNodeDependencies,
26
35
  SymbolNodeDependencies,
@@ -28,6 +37,7 @@ export var rationalizeDependencies = {
28
37
  divideDependencies,
29
38
  equalDependencies,
30
39
  isZeroDependencies,
40
+ matrixDependencies,
31
41
  multiplyDependencies,
32
42
  parseDependencies,
33
43
  powDependencies,
@@ -2,8 +2,12 @@
2
2
  * THIS FILE IS AUTO-GENERATED
3
3
  * DON'T MAKE CHANGES HERE
4
4
  */
5
+ import { AccessorNodeDependencies } from './dependenciesAccessorNode.generated.js';
6
+ import { ArrayNodeDependencies } from './dependenciesArrayNode.generated.js';
5
7
  import { ConstantNodeDependencies } from './dependenciesConstantNode.generated.js';
6
8
  import { FunctionNodeDependencies } from './dependenciesFunctionNode.generated.js';
9
+ import { IndexNodeDependencies } from './dependenciesIndexNode.generated.js';
10
+ import { ObjectNodeDependencies } from './dependenciesObjectNode.generated.js';
7
11
  import { OperatorNodeDependencies } from './dependenciesOperatorNode.generated.js';
8
12
  import { ParenthesisNodeDependencies } from './dependenciesParenthesisNode.generated.js';
9
13
  import { SymbolNodeDependencies } from './dependenciesSymbolNode.generated.js';
@@ -11,6 +15,7 @@ import { addDependencies } from './dependenciesAdd.generated.js';
11
15
  import { divideDependencies } from './dependenciesDivide.generated.js';
12
16
  import { equalDependencies } from './dependenciesEqual.generated.js';
13
17
  import { isZeroDependencies } from './dependenciesIsZero.generated.js';
18
+ import { matrixDependencies } from './dependenciesMatrix.generated.js';
14
19
  import { multiplyDependencies } from './dependenciesMultiply.generated.js';
15
20
  import { parseDependencies } from './dependenciesParse.generated.js';
16
21
  import { powDependencies } from './dependenciesPow.generated.js';
@@ -18,8 +23,12 @@ import { subtractDependencies } from './dependenciesSubtract.generated.js';
18
23
  import { typedDependencies } from './dependenciesTyped.generated.js';
19
24
  import { createSimplify } from '../../factoriesNumber.js';
20
25
  export var simplifyDependencies = {
26
+ AccessorNodeDependencies,
27
+ ArrayNodeDependencies,
21
28
  ConstantNodeDependencies,
22
29
  FunctionNodeDependencies,
30
+ IndexNodeDependencies,
31
+ ObjectNodeDependencies,
23
32
  OperatorNodeDependencies,
24
33
  ParenthesisNodeDependencies,
25
34
  SymbolNodeDependencies,
@@ -27,6 +36,7 @@ export var simplifyDependencies = {
27
36
  divideDependencies,
28
37
  equalDependencies,
29
38
  isZeroDependencies,
39
+ matrixDependencies,
30
40
  multiplyDependencies,
31
41
  parseDependencies,
32
42
  powDependencies,
@@ -7,7 +7,7 @@ import _extends from "@babel/runtime/helpers/extends";
7
7
  import { config } from './configReadonly.js';
8
8
  import { createChainClass, createNode, createObjectNode, createOperatorNode, createParenthesisNode, createRelationalNode, createArrayNode, createBlockNode, createConditionalNode, createConstantNode, createRangeNode, createReviver, createChain, createFunctionAssignmentNode, createAccessorNode, createAssignmentNode, createIndexNode, createSymbolNode, createFunctionNode, createParse, createCompile, createEvaluate, createHelpClass, createParserClass, createParser, createSimplify, createDerivative, createHelp, createRationalize, createFilterTransform, createForEachTransform, createMapTransform, createApplyTransform, createDiffTransform, createIndexTransform, createSubsetTransform, createConcatTransform, createMaxTransform, createMinTransform, createRangeTransform, createRowTransform, createSumTransform, createColumnTransform, createMeanTransform, createVarianceTransform, createStdTransform } from '../factoriesAny.js';
9
9
  import { BigNumber, Complex, e, _false, fineStructure, Fraction, i, _Infinity, LN10, LOG10E, Matrix, _NaN, _null, phi, Range, ResultSet, SQRT1_2, // eslint-disable-line camelcase
10
- sackurTetrode, tau, _true, version, DenseMatrix, efimovFactor, LN2, pi, replacer, SQRT2, typed, unaryPlus, weakMixingAngle, abs, acos, acot, acsc, addScalar, arg, asech, asinh, atan, atanh, bignumber, bitNot, boolean, clone, combinations, complex, conj, cosh, coth, csc, cube, equalScalar, erf, exp, expm1, filter, forEach, format, getMatrixDataType, hex, im, isInteger, isNegative, isPositive, isZero, LOG2E, log10, log2, map, multiplyScalar, not, number, oct, pickRandom, print, random, re, sec, sign, sin, SparseMatrix, splitUnit, square, string, tan, typeOf, acosh, acsch, apply, asec, bin, combinationsWithRep, cos, csch, isNaN, isPrime, randomInt, sech, sinh, sparse, sqrt, tanh, unaryMinus, acoth, cot, fraction, isNumeric, matrix, matrixFromFunction, mod, nthRoot, numeric, or, prod, reshape, size, smaller, squeeze, subset, subtract, to, transpose, xgcd, zeros, and, bitAnd, bitXor, cbrt, compare, compareText, concat, count, ctranspose, diag, divideScalar, dotDivide, equal, flatten, gcd, hasNumericValue, hypot, ImmutableDenseMatrix, Index, kron, largerEq, leftShift, lsolve, matrixFromColumns, min, mode, nthRoots, ones, partitionSelect, resize, rightLogShift, round, smallerEq, unequal, usolve, xor, add, atan2, bitOr, catalan, compareNatural, deepEqual, diff, dot, equalText, floor, identity, larger, log, lsolveAll, matrixFromRows, multiply, pow, qr, range, rightArithShift, row, setCartesian, setDistinct, setIsSubset, setPowerset, slu, sum, trace, usolveAll, asin, ceil, column, composition, cross, distance, dotMultiply, FibonacciHeap, fix, gamma, index, lcm, max, quantileSeq, setDifference, setMultiplicity, setSymDifference, sort, Unit, vacuumImpedance, wienDisplacement, atomicMass, bohrMagneton, boltzmann, conductanceQuantum, createUnit, deuteronMass, dotPow, electricConstant, elementaryCharge, factorial, fermiCoupling, gasConstant, gravity, intersect, inverseConductanceQuantum, klitzing, loschmidt, magneticConstant, molarMass, molarPlanckConstant, neutronMass, nuclearMagneton, permutations, planckConstant, planckMass, planckTime, quantumOfCirculation, reducedPlanckConstant, rydberg, setIntersect, setUnion, Spa, stefanBoltzmann, unit, avogadro, bohrRadius, coulomb, electronMass, faraday, hartreeEnergy, log1p, magneticFluxQuantum, molarMassC12, planckCharge, planckTemperature, secondRadiation, speedOfLight, stirlingS2, bellNumbers, firstRadiation, lup, molarVolume, protonMass, setSize, thomsonCrossSection, classicalElectronRadius, det, gravitationConstant, inv, lusolve, sqrtm, divide, expm, kldivergence, mean, median, planckLength, variance, std, eigs, multinomial, mad, norm, rotationMatrix, rotate } from './pureFunctionsAny.generated.js';
10
+ sackurTetrode, tau, _true, version, DenseMatrix, efimovFactor, LN2, pi, replacer, SQRT2, typed, unaryPlus, weakMixingAngle, abs, acos, acot, acsc, addScalar, arg, asech, asinh, atan, atanh, bignumber, bitNot, boolean, clone, combinations, complex, conj, cosh, coth, csc, cube, equalScalar, erf, exp, expm1, filter, forEach, format, getMatrixDataType, hex, im, isInteger, isNegative, isPositive, isZero, LOG2E, log10, log2, map, multiplyScalar, not, number, oct, pickRandom, print, random, re, sec, sign, sin, SparseMatrix, splitUnit, square, string, tan, typeOf, acosh, acsch, apply, asec, bin, combinationsWithRep, cos, csch, isNaN, isPrime, randomInt, sech, sinh, sparse, sqrt, tanh, unaryMinus, acoth, cot, fraction, isNumeric, matrix, matrixFromFunction, mod, nthRoot, numeric, or, prod, reshape, size, smaller, squeeze, subset, subtract, to, transpose, xgcd, zeros, and, bitAnd, bitXor, cbrt, compare, compareText, concat, count, ctranspose, diag, divideScalar, dotDivide, equal, flatten, gcd, hasNumericValue, hypot, ImmutableDenseMatrix, Index, kron, largerEq, leftShift, lsolve, matrixFromColumns, min, mode, nthRoots, ones, partitionSelect, resize, rightLogShift, round, smallerEq, unequal, usolve, xor, add, atan2, bitOr, catalan, compareNatural, deepEqual, diff, dot, equalText, floor, identity, invmod, larger, log, lsolveAll, matrixFromRows, multiply, pow, qr, range, rightArithShift, row, setCartesian, setDistinct, setIsSubset, setPowerset, slu, sum, trace, usolveAll, asin, ceil, column, composition, cross, distance, dotMultiply, FibonacciHeap, fix, gamma, index, lcm, max, quantileSeq, setDifference, setMultiplicity, setSymDifference, sort, Unit, vacuumImpedance, wienDisplacement, atomicMass, bohrMagneton, boltzmann, conductanceQuantum, createUnit, deuteronMass, dotPow, electricConstant, elementaryCharge, factorial, fermiCoupling, gasConstant, gravity, intersect, inverseConductanceQuantum, klitzing, loschmidt, magneticConstant, molarMass, molarPlanckConstant, neutronMass, nuclearMagneton, permutations, planckConstant, planckMass, planckTime, quantumOfCirculation, reducedPlanckConstant, rydberg, setIntersect, setUnion, Spa, stefanBoltzmann, unit, avogadro, bohrRadius, coulomb, electronMass, faraday, hartreeEnergy, log1p, magneticFluxQuantum, molarMassC12, planckCharge, planckTemperature, secondRadiation, speedOfLight, stirlingS2, bellNumbers, firstRadiation, lup, molarVolume, protonMass, setSize, thomsonCrossSection, classicalElectronRadius, det, gravitationConstant, inv, lusolve, sqrtm, divide, expm, kldivergence, mean, median, planckLength, variance, std, eigs, multinomial, mad, norm, rotationMatrix, rotate } from './pureFunctionsAny.generated.js';
11
11
  var math = {}; // NOT pure!
12
12
 
13
13
  var mathWithTransform = {}; // NOT pure!
@@ -124,8 +124,12 @@ export var parser = createParser({
124
124
  export var simplify = createSimplify({
125
125
  bignumber,
126
126
  fraction,
127
+ AccessorNode,
128
+ ArrayNode,
127
129
  ConstantNode,
128
130
  FunctionNode,
131
+ IndexNode,
132
+ ObjectNode,
129
133
  OperatorNode,
130
134
  ParenthesisNode,
131
135
  SymbolNode,
@@ -135,6 +139,7 @@ export var simplify = createSimplify({
135
139
  equal,
136
140
  isZero,
137
141
  mathWithTransform,
142
+ matrix,
138
143
  multiply,
139
144
  parse,
140
145
  pow,
@@ -163,8 +168,12 @@ export var help = createHelp({
163
168
  export var rationalize = createRationalize({
164
169
  bignumber,
165
170
  fraction,
171
+ AccessorNode,
172
+ ArrayNode,
166
173
  ConstantNode,
167
174
  FunctionNode,
175
+ IndexNode,
176
+ ObjectNode,
168
177
  OperatorNode,
169
178
  ParenthesisNode,
170
179
  SymbolNode,
@@ -174,6 +183,7 @@ export var rationalize = createRationalize({
174
183
  equal,
175
184
  isZero,
176
185
  mathWithTransform,
186
+ matrix,
177
187
  multiply,
178
188
  parse,
179
189
  pow,
@@ -348,6 +358,7 @@ _extends(math, {
348
358
  equalText,
349
359
  floor,
350
360
  identity,
361
+ invmod,
351
362
  larger,
352
363
  log,
353
364
  lsolveAll,
@@ -103,8 +103,12 @@ export var parse = createParse({
103
103
  typed
104
104
  });
105
105
  export var simplify = createSimplify({
106
+ AccessorNode,
107
+ ArrayNode,
106
108
  ConstantNode,
107
109
  FunctionNode,
110
+ IndexNode,
111
+ ObjectNode,
108
112
  OperatorNode,
109
113
  ParenthesisNode,
110
114
  SymbolNode,
@@ -114,6 +118,7 @@ export var simplify = createSimplify({
114
118
  equal,
115
119
  isZero,
116
120
  mathWithTransform,
121
+ matrix,
117
122
  multiply,
118
123
  parse,
119
124
  pow,
@@ -149,8 +154,12 @@ export var derivative = createDerivative({
149
154
  typed
150
155
  });
151
156
  export var rationalize = createRationalize({
157
+ AccessorNode,
158
+ ArrayNode,
152
159
  ConstantNode,
153
160
  FunctionNode,
161
+ IndexNode,
162
+ ObjectNode,
154
163
  OperatorNode,
155
164
  ParenthesisNode,
156
165
  SymbolNode,
@@ -160,6 +169,7 @@ export var rationalize = createRationalize({
160
169
  equal,
161
170
  isZero,
162
171
  mathWithTransform,
172
+ matrix,
163
173
  multiply,
164
174
  parse,
165
175
  pow,
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { config } from './configReadonly.js';
6
6
  import { createBigNumberClass, createComplexClass, createE, createFalse, createFineStructure, createFractionClass, createI, createInfinity, createLN10, createLOG10E, createMatrixClass, createNaN, createNull, createPhi, createRangeClass, createResultSet, createSQRT1_2, // eslint-disable-line camelcase
7
- createSackurTetrode, createTau, createTrue, createVersion, createDenseMatrixClass, createEfimovFactor, createLN2, createPi, createReplacer, createSQRT2, createTyped, createUnaryPlus, createWeakMixingAngle, createAbs, createAcos, createAcot, createAcsc, createAddScalar, createArg, createAsech, createAsinh, createAtan, createAtanh, createBignumber, createBitNot, createBoolean, createClone, createCombinations, createComplex, createConj, createCosh, createCoth, createCsc, createCube, createEqualScalar, createErf, createExp, createExpm1, createFilter, createForEach, createFormat, createGetMatrixDataType, createHex, createIm, createIsInteger, createIsNegative, createIsPositive, createIsZero, createLOG2E, createLog10, createLog2, createMap, createMultiplyScalar, createNot, createNumber, createOct, createPickRandom, createPrint, createRandom, createRe, createSec, createSign, createSin, createSparseMatrixClass, createSplitUnit, createSquare, createString, createTan, createTypeOf, createAcosh, createAcsch, createApply, createAsec, createBin, createCombinationsWithRep, createCos, createCsch, createIsNaN, createIsPrime, createRandomInt, createSech, createSinh, createSparse, createSqrt, createTanh, createUnaryMinus, createAcoth, createCot, createFraction, createIsNumeric, createMatrix, createMatrixFromFunction, createMod, createNthRoot, createNumeric, createOr, createProd, createReshape, createSize, createSmaller, createSqueeze, createSubset, createSubtract, createTo, createTranspose, createXgcd, createZeros, createAnd, createBitAnd, createBitXor, createCbrt, createCompare, createCompareText, createConcat, createCount, createCtranspose, createDiag, createDivideScalar, createDotDivide, createEqual, createFlatten, createGcd, createHasNumericValue, createHypot, createImmutableDenseMatrixClass, createIndexClass, createKron, createLargerEq, createLeftShift, createLsolve, createMatrixFromColumns, createMin, createMode, createNthRoots, createOnes, createPartitionSelect, createResize, createRightLogShift, createRound, createSmallerEq, createUnequal, createUsolve, createXor, createAdd, createAtan2, createBitOr, createCatalan, createCompareNatural, createDeepEqual, createDiff, createDot, createEqualText, createFloor, createIdentity, createLarger, createLog, createLsolveAll, createMatrixFromRows, createMultiply, createPow, createQr, createRange, createRightArithShift, createRow, createSetCartesian, createSetDistinct, createSetIsSubset, createSetPowerset, createSlu, createSum, createTrace, createUsolveAll, createAsin, createCeil, createColumn, createComposition, createCross, createDistance, createDotMultiply, createFibonacciHeapClass, createFix, createGamma, createIndex, createLcm, createMax, createQuantileSeq, createSetDifference, createSetMultiplicity, createSetSymDifference, createSort, createUnitClass, createVacuumImpedance, createWienDisplacement, createAtomicMass, createBohrMagneton, createBoltzmann, createConductanceQuantum, createCreateUnit, createDeuteronMass, createDotPow, createElectricConstant, createElementaryCharge, createFactorial, createFermiCoupling, createGasConstant, createGravity, createIntersect, createInverseConductanceQuantum, createKlitzing, createLoschmidt, createMagneticConstant, createMolarMass, createMolarPlanckConstant, createNeutronMass, createNuclearMagneton, createPermutations, createPlanckConstant, createPlanckMass, createPlanckTime, createQuantumOfCirculation, createReducedPlanckConstant, createRydberg, createSetIntersect, createSetUnion, createSpaClass, createStefanBoltzmann, createUnitFunction, createAvogadro, createBohrRadius, createCoulomb, createElectronMass, createFaraday, createHartreeEnergy, createLog1p, createMagneticFluxQuantum, createMolarMassC12, createPlanckCharge, createPlanckTemperature, createSecondRadiation, createSpeedOfLight, createStirlingS2, createBellNumbers, createFirstRadiation, createLup, createMolarVolume, createProtonMass, createSetSize, createThomsonCrossSection, createClassicalElectronRadius, createDet, createGravitationConstant, createInv, createLusolve, createSqrtm, createDivide, createExpm, createKldivergence, createMean, createMedian, createPlanckLength, createVariance, createStd, createEigs, createMultinomial, createMad, createNorm, createRotationMatrix, createRotate } from '../factoriesAny.js';
7
+ createSackurTetrode, createTau, createTrue, createVersion, createDenseMatrixClass, createEfimovFactor, createLN2, createPi, createReplacer, createSQRT2, createTyped, createUnaryPlus, createWeakMixingAngle, createAbs, createAcos, createAcot, createAcsc, createAddScalar, createArg, createAsech, createAsinh, createAtan, createAtanh, createBignumber, createBitNot, createBoolean, createClone, createCombinations, createComplex, createConj, createCosh, createCoth, createCsc, createCube, createEqualScalar, createErf, createExp, createExpm1, createFilter, createForEach, createFormat, createGetMatrixDataType, createHex, createIm, createIsInteger, createIsNegative, createIsPositive, createIsZero, createLOG2E, createLog10, createLog2, createMap, createMultiplyScalar, createNot, createNumber, createOct, createPickRandom, createPrint, createRandom, createRe, createSec, createSign, createSin, createSparseMatrixClass, createSplitUnit, createSquare, createString, createTan, createTypeOf, createAcosh, createAcsch, createApply, createAsec, createBin, createCombinationsWithRep, createCos, createCsch, createIsNaN, createIsPrime, createRandomInt, createSech, createSinh, createSparse, createSqrt, createTanh, createUnaryMinus, createAcoth, createCot, createFraction, createIsNumeric, createMatrix, createMatrixFromFunction, createMod, createNthRoot, createNumeric, createOr, createProd, createReshape, createSize, createSmaller, createSqueeze, createSubset, createSubtract, createTo, createTranspose, createXgcd, createZeros, createAnd, createBitAnd, createBitXor, createCbrt, createCompare, createCompareText, createConcat, createCount, createCtranspose, createDiag, createDivideScalar, createDotDivide, createEqual, createFlatten, createGcd, createHasNumericValue, createHypot, createImmutableDenseMatrixClass, createIndexClass, createKron, createLargerEq, createLeftShift, createLsolve, createMatrixFromColumns, createMin, createMode, createNthRoots, createOnes, createPartitionSelect, createResize, createRightLogShift, createRound, createSmallerEq, createUnequal, createUsolve, createXor, createAdd, createAtan2, createBitOr, createCatalan, createCompareNatural, createDeepEqual, createDiff, createDot, createEqualText, createFloor, createIdentity, createInvmod, createLarger, createLog, createLsolveAll, createMatrixFromRows, createMultiply, createPow, createQr, createRange, createRightArithShift, createRow, createSetCartesian, createSetDistinct, createSetIsSubset, createSetPowerset, createSlu, createSum, createTrace, createUsolveAll, createAsin, createCeil, createColumn, createComposition, createCross, createDistance, createDotMultiply, createFibonacciHeapClass, createFix, createGamma, createIndex, createLcm, createMax, createQuantileSeq, createSetDifference, createSetMultiplicity, createSetSymDifference, createSort, createUnitClass, createVacuumImpedance, createWienDisplacement, createAtomicMass, createBohrMagneton, createBoltzmann, createConductanceQuantum, createCreateUnit, createDeuteronMass, createDotPow, createElectricConstant, createElementaryCharge, createFactorial, createFermiCoupling, createGasConstant, createGravity, createIntersect, createInverseConductanceQuantum, createKlitzing, createLoschmidt, createMagneticConstant, createMolarMass, createMolarPlanckConstant, createNeutronMass, createNuclearMagneton, createPermutations, createPlanckConstant, createPlanckMass, createPlanckTime, createQuantumOfCirculation, createReducedPlanckConstant, createRydberg, createSetIntersect, createSetUnion, createSpaClass, createStefanBoltzmann, createUnitFunction, createAvogadro, createBohrRadius, createCoulomb, createElectronMass, createFaraday, createHartreeEnergy, createLog1p, createMagneticFluxQuantum, createMolarMassC12, createPlanckCharge, createPlanckTemperature, createSecondRadiation, createSpeedOfLight, createStirlingS2, createBellNumbers, createFirstRadiation, createLup, createMolarVolume, createProtonMass, createSetSize, createThomsonCrossSection, createClassicalElectronRadius, createDet, createGravitationConstant, createInv, createLusolve, createSqrtm, createDivide, createExpm, createKldivergence, createMean, createMedian, createPlanckLength, createVariance, createStd, createEigs, createMultinomial, createMad, createNorm, createRotationMatrix, createRotate } from '../factoriesAny.js';
8
8
  export var BigNumber = /* #__PURE__ */createBigNumberClass({
9
9
  config
10
10
  });
@@ -758,6 +758,17 @@ export var identity = /* #__PURE__ */createIdentity({
758
758
  matrix,
759
759
  typed
760
760
  });
761
+ export var invmod = /* #__PURE__ */createInvmod({
762
+ BigNumber,
763
+ add,
764
+ config,
765
+ equal,
766
+ isInteger,
767
+ mod,
768
+ smaller,
769
+ typed,
770
+ xgcd
771
+ });
761
772
  export var larger = /* #__PURE__ */createLarger({
762
773
  DenseMatrix,
763
774
  config,
@@ -1,4 +1,5 @@
1
1
  import { bignumberDocs } from './construction/bignumber.js';
2
+ import { printDocs } from './function/utils/print.js';
2
3
  import { typeOfDocs } from './function/utils/typeOf.js';
3
4
  import { isZeroDocs } from './function/utils/isZero.js';
4
5
  import { isPrimeDocs } from './function/utils/isPrime.js';
@@ -135,6 +136,7 @@ import { bitOrDocs } from './function/bitwise/bitOr.js';
135
136
  import { bitNotDocs } from './function/bitwise/bitNot.js';
136
137
  import { bitAndDocs } from './function/bitwise/bitAnd.js';
137
138
  import { xgcdDocs } from './function/arithmetic/xgcd.js';
139
+ import { invmodDocs } from './function/arithmetic/invmod.js';
138
140
  import { unaryPlusDocs } from './function/arithmetic/unaryPlus.js';
139
141
  import { unaryMinusDocs } from './function/arithmetic/unaryMinus.js';
140
142
  import { squareDocs } from './function/arithmetic/square.js';
@@ -507,6 +509,7 @@ export var embeddedDocs = {
507
509
  unaryMinus: unaryMinusDocs,
508
510
  unaryPlus: unaryPlusDocs,
509
511
  xgcd: xgcdDocs,
512
+ invmod: invmodDocs,
510
513
  // functions - bitwise
511
514
  bitAnd: bitAndDocs,
512
515
  bitNot: bitNotDocs,
@@ -668,7 +671,7 @@ export var embeddedDocs = {
668
671
  isPositive: isPositiveDocs,
669
672
  isPrime: isPrimeDocs,
670
673
  isZero: isZeroDocs,
671
- // print: printDocs // TODO: add documentation for print as soon as the parser supports objects.
674
+ print: printDocs,
672
675
  typeOf: typeOfDocs,
673
676
  numeric: numericDocs
674
677
  };
@@ -0,0 +1,8 @@
1
+ export var invmodDocs = {
2
+ name: 'invmod',
3
+ category: 'Arithmetic',
4
+ syntax: ['invmod(a, b)'],
5
+ description: 'Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)',
6
+ examples: ['invmod(8, 12)=NaN', 'invmod(7, 13)=2', 'math.invmod(15151, 15122)=10429'],
7
+ seealso: ['gcd', 'xgcd']
8
+ };
@@ -3,6 +3,6 @@ export var forEachDocs = {
3
3
  category: 'Matrix',
4
4
  syntax: ['forEach(x, callback)'],
5
5
  description: 'Iterates over all elements of a matrix/array, and executes the given callback function.',
6
- examples: ['forEach([1, 2, 3], function(val) { console.log(val) })'],
6
+ examples: [],
7
7
  seealso: ['map', 'sort', 'filter']
8
8
  };
@@ -53,6 +53,7 @@ export { createSqrt } from './function/arithmetic/sqrt.js';
53
53
  export { createSquare } from './function/arithmetic/square.js';
54
54
  export { createSubtract } from './function/arithmetic/subtract.js';
55
55
  export { createXgcd } from './function/arithmetic/xgcd.js';
56
+ export { createInvmod } from './function/arithmetic/invmod.js';
56
57
  export { createDotMultiply } from './function/arithmetic/dotMultiply.js';
57
58
  export { createBitAnd } from './function/bitwise/bitAnd.js';
58
59
  export { createBitNot } from './function/bitwise/bitNot.js';
@@ -3,7 +3,7 @@ import { factory } from '../../utils/factory.js';
3
3
  import { createSimplifyConstant } from './simplify/simplifyConstant.js';
4
4
  import { createSimplifyCore } from './simplify/simplifyCore.js';
5
5
  var name = 'rationalize';
6
- var dependencies = ['config', 'typed', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'parse', 'simplify', '?bignumber', '?fraction', 'mathWithTransform', 'ConstantNode', 'OperatorNode', 'FunctionNode', 'SymbolNode', 'ParenthesisNode'];
6
+ var dependencies = ['config', 'typed', 'equal', 'isZero', 'add', 'subtract', 'multiply', 'divide', 'pow', 'parse', 'simplify', '?bignumber', '?fraction', 'mathWithTransform', 'matrix', 'AccessorNode', 'ArrayNode', 'ConstantNode', 'FunctionNode', 'IndexNode', 'ObjectNode', 'OperatorNode', 'SymbolNode', 'ParenthesisNode'];
7
7
  export var createRationalize = /* #__PURE__ */factory(name, dependencies, _ref => {
8
8
  var {
9
9
  config,
@@ -20,9 +20,14 @@ export var createRationalize = /* #__PURE__ */factory(name, dependencies, _ref =
20
20
  fraction,
21
21
  bignumber,
22
22
  mathWithTransform,
23
+ matrix,
24
+ AccessorNode,
25
+ ArrayNode,
23
26
  ConstantNode,
24
- OperatorNode,
25
27
  FunctionNode,
28
+ IndexNode,
29
+ ObjectNode,
30
+ OperatorNode,
26
31
  SymbolNode,
27
32
  ParenthesisNode
28
33
  } = _ref;
@@ -30,11 +35,16 @@ export var createRationalize = /* #__PURE__ */factory(name, dependencies, _ref =
30
35
  typed,
31
36
  config,
32
37
  mathWithTransform,
38
+ matrix,
33
39
  fraction,
34
40
  bignumber,
41
+ AccessorNode,
42
+ ArrayNode,
35
43
  ConstantNode,
36
- OperatorNode,
37
44
  FunctionNode,
45
+ IndexNode,
46
+ ObjectNode,
47
+ OperatorNode,
38
48
  SymbolNode
39
49
  });
40
50
  var simplifyCore = createSimplifyCore({
@@ -45,9 +55,13 @@ export var createRationalize = /* #__PURE__ */factory(name, dependencies, _ref =
45
55
  multiply,
46
56
  divide,
47
57
  pow,
58
+ AccessorNode,
59
+ ArrayNode,
48
60
  ConstantNode,
49
- OperatorNode,
50
61
  FunctionNode,
62
+ IndexNode,
63
+ ObjectNode,
64
+ OperatorNode,
51
65
  ParenthesisNode
52
66
  });
53
67
  /**