nerdamer 1.1.13 → 2.0.0-rc.1
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/LICENSE.md +184 -0
- package/README.md +293 -312
- package/dist/bundle.js +2 -0
- package/dist/bundle.js.LICENSE.txt +7 -0
- package/dist/parser.js +2 -0
- package/dist/parser.js.LICENSE.txt +7 -0
- package/docs-data/parser-functions.json +1960 -0
- package/index.d.ts +10 -426
- package/output/algebra/adapters.d.ts +33 -0
- package/output/algebra/adapters.js +109 -0
- package/output/algebra/algorithms/arith.d.ts +84 -0
- package/output/algebra/algorithms/arith.js +323 -0
- package/output/algebra/algorithms/factor.d.ts +3 -0
- package/output/algebra/algorithms/factor.js +5 -0
- package/output/algebra/algorithms/factorMultivariate.d.ts +23 -0
- package/output/algebra/algorithms/factorMultivariate.js +2393 -0
- package/output/algebra/algorithms/factorUnivariate.d.ts +72 -0
- package/output/algebra/algorithms/factorUnivariate.js +1072 -0
- package/output/algebra/algorithms/gcd.d.ts +22 -0
- package/output/algebra/algorithms/gcd.js +690 -0
- package/output/algebra/algorithms/groebnerBase.d.ts +157 -0
- package/output/algebra/algorithms/groebnerBase.js +1166 -0
- package/output/algebra/algorithms/multiPoly/MultiPoly.d.ts +137 -0
- package/output/algebra/algorithms/multiPoly/MultiPoly.js +346 -0
- package/output/algebra/algorithms/poly.d.ts +228 -0
- package/output/algebra/algorithms/poly.js +1299 -0
- package/output/algebra/algorithms/rational.d.ts +17 -0
- package/output/algebra/algorithms/rational.js +115 -0
- package/output/algebra/factor/factor.d.ts +62 -0
- package/output/algebra/factor/factor.js +158 -0
- package/output/algebra/gcd/gcd.d.ts +29 -0
- package/output/algebra/gcd/gcd.js +141 -0
- package/output/algebra/groebner.d.ts +21 -0
- package/output/algebra/groebner.js +42 -0
- package/output/algebra/partfrac.d.ts +19 -0
- package/output/algebra/partfrac.js +398 -0
- package/output/algebra/polynomialize.d.ts +20 -0
- package/output/algebra/polynomialize.js +24 -0
- package/output/algebra/simplify/complexsimp.d.ts +7 -0
- package/output/algebra/simplify/complexsimp.js +24 -0
- package/output/algebra/simplify/factorCommon.d.ts +13 -0
- package/output/algebra/simplify/factorCommon.js +136 -0
- package/output/algebra/simplify/funcsimp.d.ts +26 -0
- package/output/algebra/simplify/funcsimp.js +633 -0
- package/output/algebra/simplify/invtrigrewrite.d.ts +10 -0
- package/output/algebra/simplify/invtrigrewrite.js +96 -0
- package/output/algebra/simplify/ratsimp.d.ts +21 -0
- package/output/algebra/simplify/ratsimp.js +140 -0
- package/output/algebra/simplify/simplify.d.ts +25 -0
- package/output/algebra/simplify/simplify.js +228 -0
- package/output/algebra/simplify/trigreduce.d.ts +38 -0
- package/output/algebra/simplify/trigreduce.js +424 -0
- package/output/algebra/simplify/trigrewrite.d.ts +17 -0
- package/output/algebra/simplify/trigrewrite.js +156 -0
- package/output/algebra/simplify/trigsimp.d.ts +11 -0
- package/output/algebra/simplify/trigsimp.js +369 -0
- package/output/algebra/simplify/utils.d.ts +32 -0
- package/output/algebra/simplify/utils.js +56 -0
- package/output/algebra/utils.d.ts +32 -0
- package/output/algebra/utils.js +48 -0
- package/output/api/advanced.d.ts +7 -0
- package/output/api/advanced.js +18 -0
- package/output/api/algebra.d.ts +17 -0
- package/output/api/algebra.js +32 -0
- package/output/api/assumptions.d.ts +4 -0
- package/output/api/assumptions.js +11 -0
- package/output/api/calculus.d.ts +9 -0
- package/output/api/calculus.js +21 -0
- package/output/api/core.d.ts +17 -0
- package/output/api/core.js +41 -0
- package/output/api/debug.d.ts +16 -0
- package/output/api/debug.js +23 -0
- package/output/api/parser.d.ts +85 -0
- package/output/api/parser.js +16 -0
- package/output/api/solve.d.ts +10 -0
- package/output/api/solve.js +16 -0
- package/output/api/structures.d.ts +10 -0
- package/output/api/structures.js +22 -0
- package/output/calculus/derivative/diff.d.ts +30 -0
- package/output/calculus/derivative/diff.js +238 -0
- package/output/calculus/fresnel.d.ts +16 -0
- package/output/calculus/fresnel.js +39 -0
- package/output/calculus/integrate/byParts.d.ts +18 -0
- package/output/calculus/integrate/byParts.js +339 -0
- package/output/calculus/integrate/bySubstitution.d.ts +135 -0
- package/output/calculus/integrate/bySubstitution.js +411 -0
- package/output/calculus/integrate/integrate.d.ts +38 -0
- package/output/calculus/integrate/integrate.js +652 -0
- package/output/calculus/integrate/integrationTable.d.ts +2 -0
- package/output/calculus/integrate/integrationTable.js +914 -0
- package/output/calculus/integrate/utils.d.ts +28 -0
- package/output/calculus/integrate/utils.js +96 -0
- package/output/calculus/laplace/ilaplace.d.ts +31 -0
- package/output/calculus/laplace/ilaplace.js +192 -0
- package/output/calculus/laplace/ilaplaceTable.d.ts +2 -0
- package/output/calculus/laplace/ilaplaceTable.js +200 -0
- package/output/calculus/laplace/laplace.d.ts +22 -0
- package/output/calculus/laplace/laplace.js +109 -0
- package/output/calculus/laplace/laplaceTable.d.ts +2 -0
- package/output/calculus/laplace/laplaceTable.js +187 -0
- package/output/calculus/limit/limit.d.ts +35 -0
- package/output/calculus/limit/limit.js +1183 -0
- package/output/calculus/limit/limitsTable.d.ts +2 -0
- package/output/calculus/limit/limitsTable.js +7 -0
- package/output/core/Settings.d.ts +32 -0
- package/output/core/Settings.js +68 -0
- package/output/core/adapters.d.ts +18 -0
- package/output/core/adapters.js +40 -0
- package/output/core/classes/assumption/Assumption.d.ts +218 -0
- package/output/core/classes/assumption/Assumption.js +605 -0
- package/output/core/classes/assumption/assertiveFunctions.d.ts +6 -0
- package/output/core/classes/assumption/assertiveFunctions.js +64 -0
- package/output/core/classes/assumption/assume.d.ts +90 -0
- package/output/core/classes/assumption/assume.js +145 -0
- package/output/core/classes/collection/Collection.d.ts +107 -0
- package/output/core/classes/collection/Collection.js +231 -0
- package/output/core/classes/complex/Complex.d.ts +99 -0
- package/output/core/classes/complex/Complex.js +135 -0
- package/output/core/classes/decimalSet/DecimalSet.d.ts +226 -0
- package/output/core/classes/decimalSet/DecimalSet.js +453 -0
- package/output/core/classes/dictionary/Dictionary.d.ts +102 -0
- package/output/core/classes/dictionary/Dictionary.js +213 -0
- package/output/core/classes/equation/Equation.d.ts +256 -0
- package/output/core/classes/equation/Equation.js +350 -0
- package/output/core/classes/expression/CoeffObject.d.ts +100 -0
- package/output/core/classes/expression/CoeffObject.js +198 -0
- package/output/core/classes/expression/Expression.d.ts +1674 -0
- package/output/core/classes/expression/Expression.js +2332 -0
- package/output/core/classes/expression/analysis.d.ts +25 -0
- package/output/core/classes/expression/analysis.js +218 -0
- package/output/core/classes/expression/collect.d.ts +9 -0
- package/output/core/classes/expression/collect.js +49 -0
- package/output/core/classes/expression/format.d.ts +45 -0
- package/output/core/classes/expression/format.js +217 -0
- package/output/core/classes/expression/products.d.ts +23 -0
- package/output/core/classes/expression/products.js +115 -0
- package/output/core/classes/expression/shortcuts.d.ts +35 -0
- package/output/core/classes/expression/shortcuts.js +129 -0
- package/output/core/classes/expression/traversal.d.ts +31 -0
- package/output/core/classes/expression/traversal.js +216 -0
- package/output/core/classes/expression/trig.d.ts +25 -0
- package/output/core/classes/expression/trig.js +40 -0
- package/output/core/classes/expression/utils.d.ts +52 -0
- package/output/core/classes/expression/utils.js +189 -0
- package/output/core/classes/lookupTable/LookupTable.d.ts +12 -0
- package/output/core/classes/lookupTable/LookupTable.js +55 -0
- package/output/core/classes/matrix/Matrix.d.ts +227 -0
- package/output/core/classes/matrix/Matrix.js +889 -0
- package/output/core/classes/matrix/Sylvester.d.ts +11 -0
- package/output/core/classes/matrix/Sylvester.js +54 -0
- package/output/core/classes/matrix/functions.d.ts +26 -0
- package/output/core/classes/matrix/functions.js +52 -0
- package/output/core/classes/matrix/utils.d.ts +9 -0
- package/output/core/classes/matrix/utils.js +22 -0
- package/output/core/classes/parser/Parser.d.ts +480 -0
- package/output/core/classes/parser/Parser.js +1812 -0
- package/output/core/classes/parser/Token.d.ts +58 -0
- package/output/core/classes/parser/Token.js +137 -0
- package/output/core/classes/parser/constants.d.ts +160 -0
- package/output/core/classes/parser/constants.js +227 -0
- package/output/core/classes/parser/helpers.d.ts +21 -0
- package/output/core/classes/parser/helpers.js +42 -0
- package/output/core/classes/parser/operations/add.d.ts +15 -0
- package/output/core/classes/parser/operations/add.js +238 -0
- package/output/core/classes/parser/operations/comma.d.ts +7 -0
- package/output/core/classes/parser/operations/comma.js +11 -0
- package/output/core/classes/parser/operations/compare.d.ts +21 -0
- package/output/core/classes/parser/operations/compare.js +461 -0
- package/output/core/classes/parser/operations/divide.d.ts +2 -0
- package/output/core/classes/parser/operations/divide.js +72 -0
- package/output/core/classes/parser/operations/functions.d.ts +46 -0
- package/output/core/classes/parser/operations/functions.js +430 -0
- package/output/core/classes/parser/operations/multiply.d.ts +11 -0
- package/output/core/classes/parser/operations/multiply.js +321 -0
- package/output/core/classes/parser/operations/power.d.ts +48 -0
- package/output/core/classes/parser/operations/power.js +673 -0
- package/output/core/classes/parser/operations/subtract.d.ts +3 -0
- package/output/core/classes/parser/operations/subtract.js +35 -0
- package/output/core/classes/parser/preprocess.d.ts +14 -0
- package/output/core/classes/parser/preprocess.js +259 -0
- package/output/core/classes/parser/scripting/controlFlow.d.ts +121 -0
- package/output/core/classes/parser/scripting/controlFlow.js +355 -0
- package/output/core/classes/parser/scripting/evaluate.d.ts +10 -0
- package/output/core/classes/parser/scripting/evaluate.js +112 -0
- package/output/core/classes/parser/scripting/functions.d.ts +14 -0
- package/output/core/classes/parser/scripting/functions.js +59 -0
- package/output/core/classes/parser/scripting/scope.d.ts +35 -0
- package/output/core/classes/parser/scripting/scope.js +155 -0
- package/output/core/classes/parser/types.d.ts +125 -0
- package/output/core/classes/parser/types.js +2 -0
- package/output/core/classes/parser/wrappers/IndexedReference.d.ts +31 -0
- package/output/core/classes/parser/wrappers/IndexedReference.js +68 -0
- package/output/core/classes/parser/wrappers/KeyValuePair.d.ts +24 -0
- package/output/core/classes/parser/wrappers/KeyValuePair.js +51 -0
- package/output/core/classes/polynomial/Polynomial.d.ts +500 -0
- package/output/core/classes/polynomial/Polynomial.js +1149 -0
- package/output/core/classes/polynomial/Term.d.ts +222 -0
- package/output/core/classes/polynomial/Term.js +430 -0
- package/output/core/classes/polynomial/functions.d.ts +69 -0
- package/output/core/classes/polynomial/functions.js +126 -0
- package/output/core/classes/polynomial/utils.d.ts +62 -0
- package/output/core/classes/polynomial/utils.js +206 -0
- package/output/core/classes/rational/Rational.d.ts +504 -0
- package/output/core/classes/rational/Rational.js +779 -0
- package/output/core/classes/seq/SEQ.d.ts +13 -0
- package/output/core/classes/seq/SEQ.js +137 -0
- package/output/core/classes/valuesSet/ValuesSet.d.ts +179 -0
- package/output/core/classes/valuesSet/ValuesSet.js +381 -0
- package/output/core/classes/vector/Vector.d.ts +222 -0
- package/output/core/classes/vector/Vector.js +497 -0
- package/output/core/classes/vector/functions.d.ts +28 -0
- package/output/core/classes/vector/functions.js +47 -0
- package/output/core/common/classes/MathematicalAggregate.d.ts +53 -0
- package/output/core/common/classes/MathematicalAggregate.js +140 -0
- package/output/core/common/classes/Scope.d.ts +62 -0
- package/output/core/common/classes/Scope.js +122 -0
- package/output/core/common/classes/StructuredEntity.d.ts +55 -0
- package/output/core/common/classes/StructuredEntity.js +151 -0
- package/output/core/common/common.d.ts +63 -0
- package/output/core/common/common.js +279 -0
- package/output/core/common/functions/functions.d.ts +14 -0
- package/output/core/common/functions/functions.js +33 -0
- package/output/core/common/functions/structuredEntityUtils.d.ts +27 -0
- package/output/core/common/functions/structuredEntityUtils.js +40 -0
- package/output/core/converters/BaseConverter.d.ts +97 -0
- package/output/core/converters/BaseConverter.js +405 -0
- package/output/core/converters/Converter.d.ts +111 -0
- package/output/core/converters/Converter.js +802 -0
- package/output/core/converters/Pattern.d.ts +71 -0
- package/output/core/converters/Pattern.js +302 -0
- package/output/core/dispatch.d.ts +34 -0
- package/output/core/dispatch.js +304 -0
- package/output/core/errors.d.ts +531 -0
- package/output/core/errors.js +621 -0
- package/output/core/functions/bigint/bigint.d.ts +121 -0
- package/output/core/functions/bigint/bigint.js +392 -0
- package/output/core/functions/bigint/primeFactor.d.ts +49 -0
- package/output/core/functions/bigint/primeFactor.js +267 -0
- package/output/core/functions/bigint/primes.d.ts +1 -0
- package/output/core/functions/bigint/primes.js +11 -0
- package/output/core/functions/build/definitions.d.ts +12 -0
- package/output/core/functions/build/definitions.js +133 -0
- package/output/core/functions/build/index.d.ts +32 -0
- package/output/core/functions/build/index.js +136 -0
- package/output/core/functions/complex.d.ts +90 -0
- package/output/core/functions/complex.js +482 -0
- package/output/core/functions/decimal.d.ts +24 -0
- package/output/core/functions/decimal.js +664 -0
- package/output/core/functions/expand/expand.d.ts +42 -0
- package/output/core/functions/expand/expand.js +376 -0
- package/output/core/functions/fresnelNumeric.d.ts +12 -0
- package/output/core/functions/fresnelNumeric.js +123 -0
- package/output/core/functions/numeric.d.ts +140 -0
- package/output/core/functions/numeric.js +790 -0
- package/output/core/functions/rationalNormalization.d.ts +11 -0
- package/output/core/functions/rationalNormalization.js +117 -0
- package/output/core/functions/setFunction.d.ts +19 -0
- package/output/core/functions/setFunction.js +75 -0
- package/output/core/functions/string.d.ts +26 -0
- package/output/core/functions/string.js +101 -0
- package/output/core/functions/subst.d.ts +90 -0
- package/output/core/functions/subst.js +498 -0
- package/output/core/functions/utils.d.ts +24 -0
- package/output/core/functions/utils.js +51 -0
- package/output/core/types.d.ts +48 -0
- package/output/core/types.js +2 -0
- package/output/index.d.ts +339 -0
- package/output/index.js +715 -0
- package/output/math/defint/defintDecimal.d.ts +37 -0
- package/output/math/defint/defintDecimal.js +320 -0
- package/output/math/defint/defintNative.d.ts +57 -0
- package/output/math/defint/defintNative.js +292 -0
- package/output/math/geometry.d.ts +8 -0
- package/output/math/geometry.js +32 -0
- package/output/math/math.d.ts +655 -0
- package/output/math/math.js +1811 -0
- package/output/math/trig.d.ts +518 -0
- package/output/math/trig.js +1444 -0
- package/output/math/trunc.d.ts +19 -0
- package/output/math/trunc.js +36 -0
- package/output/math/utils.d.ts +60 -0
- package/output/math/utils.js +180 -0
- package/output/solve/classes/DecimalMatrix.d.ts +17 -0
- package/output/solve/classes/DecimalMatrix.js +86 -0
- package/output/solve/classes/FunctionSolver.d.ts +135 -0
- package/output/solve/classes/FunctionSolver.js +433 -0
- package/output/solve/classes/MultivariateSolver.d.ts +84 -0
- package/output/solve/classes/MultivariateSolver.js +240 -0
- package/output/solve/classes/PolynomialSolver.d.ts +85 -0
- package/output/solve/classes/PolynomialSolver.js +292 -0
- package/output/solve/classes/SolutionSet.d.ts +153 -0
- package/output/solve/classes/SolutionSet.js +357 -0
- package/output/solve/classes/Solver.d.ts +17 -0
- package/output/solve/classes/Solver.js +132 -0
- package/output/solve/classes/SymbolicSolver.d.ts +74 -0
- package/output/solve/classes/SymbolicSolver.js +601 -0
- package/output/solve/linsolve.d.ts +51 -0
- package/output/solve/linsolve.js +225 -0
- package/output/solve/solve.d.ts +34 -0
- package/output/solve/solve.js +260 -0
- package/output/solve/solveSystem.d.ts +31 -0
- package/output/solve/solveSystem.js +290 -0
- package/output/solve/utils.d.ts +9 -0
- package/output/solve/utils.js +62 -0
- package/output/utils/array.d.ts +42 -0
- package/output/utils/array.js +98 -0
- package/output/utils/debug.d.ts +131 -0
- package/output/utils/debug.js +295 -0
- package/output/utils/decimal.d.ts +3 -0
- package/output/utils/decimal.js +16 -0
- package/output/utils/numeric.d.ts +14 -0
- package/output/utils/numeric.js +51 -0
- package/output/utils/object.d.ts +26 -0
- package/output/utils/object.js +56 -0
- package/package.json +213 -57
- package/.travis.yml +0 -3
- package/Algebra.js +0 -4568
- package/BREAKING_CHANGES.md +0 -5
- package/CODE_OF_CONDUCT.md +0 -46
- package/CONTRIBUTING.md +0 -14
- package/Calculus.js +0 -2675
- package/Extra.js +0 -622
- package/Solve.js +0 -1783
- package/all.js +0 -16
- package/all.min.js +0 -1
- package/gulpfile.js +0 -16
- package/index.html +0 -158
- package/license.txt +0 -19
- package/nerdamer.core.js +0 -12510
- package/spec/LaTeX.spec.js +0 -302
- package/spec/TeXConvert.spec.js +0 -8
- package/spec/algebra.spec.js +0 -287
- package/spec/basic_parser.spec.js +0 -134
- package/spec/build.spec.js +0 -131
- package/spec/calculus.spec.js +0 -183
- package/spec/core.spec.js +0 -2970
- package/spec/extra.spec.js +0 -54
- package/spec/solve.spec.js +0 -126
- package/spec/support/jasmine.json +0 -11
- package/spec/support/utils.js +0 -42
- package/spec/text.spec.js +0 -132
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.realPart = realPart;
|
|
4
|
+
exports.imagPart = imagPart;
|
|
5
|
+
exports.simplifyImaginary = simplifyImaginary;
|
|
6
|
+
exports.toPolarFormArray = toPolarFormArray;
|
|
7
|
+
exports.polarForm = polarForm;
|
|
8
|
+
exports.rectForm = rectForm;
|
|
9
|
+
exports.arg = arg;
|
|
10
|
+
exports.conjugate = conjugate;
|
|
11
|
+
exports.csgn = csgn;
|
|
12
|
+
const geometry_1 = require("../../math/geometry");
|
|
13
|
+
const trig_1 = require("../../math/trig");
|
|
14
|
+
const Expression_1 = require("../classes/expression/Expression");
|
|
15
|
+
const shortcuts_1 = require("../classes/expression/shortcuts");
|
|
16
|
+
const constants_1 = require("../classes/parser/constants");
|
|
17
|
+
const add_1 = require("../classes/parser/operations/add");
|
|
18
|
+
const divide_1 = require("../classes/parser/operations/divide");
|
|
19
|
+
const multiply_1 = require("../classes/parser/operations/multiply");
|
|
20
|
+
const power_1 = require("../classes/parser/operations/power");
|
|
21
|
+
const expand_1 = require("./expand/expand");
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves the real part of a complex number
|
|
24
|
+
*
|
|
25
|
+
* @param a
|
|
26
|
+
* @returns
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves the real part of a complex number
|
|
30
|
+
*
|
|
31
|
+
* @param a
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
function realPart(a) {
|
|
35
|
+
let retval;
|
|
36
|
+
const x = (0, expand_1.expand)(a);
|
|
37
|
+
// i^p: use principal branch i = exp(i*pi/2). The multiplier is an outer
|
|
38
|
+
// coefficient and must not be folded into the powered base.
|
|
39
|
+
if (x.isVAR() && x.isI()) {
|
|
40
|
+
const p = x.getPower();
|
|
41
|
+
const theta = (0, divide_1.divide)(Expression_1.Expression.Pi(), (0, shortcuts_1.two)());
|
|
42
|
+
const re = (0, trig_1.cos)((0, multiply_1.multiply)(p, theta));
|
|
43
|
+
retval = (0, multiply_1.multiply)(Expression_1.Expression.fromRational(x.getMultiplier()), re);
|
|
44
|
+
}
|
|
45
|
+
// EXP nodes also carry their multiplier outside the powered base.
|
|
46
|
+
else if (x.isEXP()) {
|
|
47
|
+
const p = x.getPower();
|
|
48
|
+
const multiplier = Expression_1.Expression.fromRational(x.getMultiplier());
|
|
49
|
+
if (p.isInteger()) {
|
|
50
|
+
retval = (0, multiply_1.multiply)(multiplier, realPart((0, power_1.power)(x.getBase(), p)));
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const [r, theta] = toPolarFormArray(x.getBase());
|
|
54
|
+
const rp = (0, power_1.power)(r, p);
|
|
55
|
+
const re = (0, trig_1.cos)((0, multiply_1.multiply)(p, theta));
|
|
56
|
+
retval = (0, multiply_1.multiply)(multiplier, (0, multiply_1.multiply)(rp, re));
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// realpart(...) and imagpart(...) are real-valued by definition. Preserve
|
|
60
|
+
// other functions without complex inputs, and keep explicitly complex
|
|
61
|
+
// function components symbolic rather than treating them as zero.
|
|
62
|
+
else if (x.isComplexComponentFunction()) {
|
|
63
|
+
retval = new Expression_1.Expression(x);
|
|
64
|
+
}
|
|
65
|
+
else if (x.isFunction()) {
|
|
66
|
+
retval = x.isComplex()
|
|
67
|
+
? Expression_1.Expression.toFunction(constants_1.REALPART, [x])
|
|
68
|
+
: new Expression_1.Expression(x);
|
|
69
|
+
}
|
|
70
|
+
// Decompose products through their complex factors while preserving real
|
|
71
|
+
// factors as an outer scale.
|
|
72
|
+
else if (x.isProduct() && x.isComplex()) {
|
|
73
|
+
const multiplier = Expression_1.Expression.fromRational(x.getMultiplier());
|
|
74
|
+
let realFactor = (0, shortcuts_1.one)();
|
|
75
|
+
let complexFactor;
|
|
76
|
+
let complexFactorCount = 0;
|
|
77
|
+
const elements = x.getElements();
|
|
78
|
+
for (const e in elements) {
|
|
79
|
+
const factor = elements[e];
|
|
80
|
+
if (factor.isComplex()) {
|
|
81
|
+
complexFactor = factor;
|
|
82
|
+
complexFactorCount++;
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
realFactor = (0, multiply_1.multiply)(realFactor, factor);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
// A real product scales the components of its single complex factor.
|
|
89
|
+
if (complexFactorCount === 1 && complexFactor) {
|
|
90
|
+
retval = (0, multiply_1.multiply)(multiplier, (0, multiply_1.multiply)(realFactor, realPart(complexFactor)));
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
let productReal = (0, shortcuts_1.one)();
|
|
94
|
+
let productImaginary = (0, shortcuts_1.zero)();
|
|
95
|
+
for (const e in elements) {
|
|
96
|
+
const factor = elements[e];
|
|
97
|
+
if (factor.isComplex()) {
|
|
98
|
+
const factorReal = realPart(factor);
|
|
99
|
+
const factorImaginary = imagPart(factor);
|
|
100
|
+
const previousReal = productReal;
|
|
101
|
+
const previousImaginary = productImaginary;
|
|
102
|
+
productReal = (0, multiply_1.multiply)(previousReal, factorReal).minus((0, multiply_1.multiply)(previousImaginary, factorImaginary));
|
|
103
|
+
productImaginary = (0, multiply_1.multiply)(previousReal, factorImaginary).plus((0, multiply_1.multiply)(previousImaginary, factorReal));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
retval = (0, multiply_1.multiply)(multiplier, (0, multiply_1.multiply)(realFactor, productReal));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// The real part will be any known constants.
|
|
110
|
+
// Handle pi, e, numbers, x, a*b
|
|
111
|
+
else if (x.isConstant() ||
|
|
112
|
+
(x.isVAR() && !x.isI()) ||
|
|
113
|
+
(x.isProduct() && !x.isComplex())) {
|
|
114
|
+
retval = new Expression_1.Expression(a);
|
|
115
|
+
}
|
|
116
|
+
// Deal with x+1, y+y^2, ...
|
|
117
|
+
else if (x.isSum()) {
|
|
118
|
+
// Check if the sum has a power attached - if so, treat as single term
|
|
119
|
+
if (!x.getPower().isOne()) {
|
|
120
|
+
retval = new Expression_1.Expression(a);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
retval = (0, shortcuts_1.zero)();
|
|
124
|
+
const elements = x.getElements();
|
|
125
|
+
for (const e in elements) {
|
|
126
|
+
const re = realPart(elements[e]);
|
|
127
|
+
retval = (0, add_1.add)(retval, re);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// Otherwise it's zero
|
|
132
|
+
else {
|
|
133
|
+
retval = (0, shortcuts_1.zero)();
|
|
134
|
+
}
|
|
135
|
+
return retval;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Retrieves the imaginary part of a complex number
|
|
139
|
+
*
|
|
140
|
+
* @param a
|
|
141
|
+
* @returns
|
|
142
|
+
*/
|
|
143
|
+
function imagPart(a) {
|
|
144
|
+
let retval;
|
|
145
|
+
const x = (0, expand_1.expand)(a);
|
|
146
|
+
// i^p: use principal branch i = exp(i*pi/2). The multiplier is an outer
|
|
147
|
+
// coefficient and must not be folded into the powered base.
|
|
148
|
+
if (x.isVAR() && x.isI()) {
|
|
149
|
+
const p = x.getPower();
|
|
150
|
+
const theta = (0, divide_1.divide)(Expression_1.Expression.Pi(), (0, shortcuts_1.two)());
|
|
151
|
+
const im = (0, trig_1.sin)((0, multiply_1.multiply)(p, theta));
|
|
152
|
+
retval = (0, multiply_1.multiply)(Expression_1.Expression.fromRational(x.getMultiplier()), im);
|
|
153
|
+
}
|
|
154
|
+
// EXP nodes also carry their multiplier outside the powered base.
|
|
155
|
+
else if (x.isEXP()) {
|
|
156
|
+
const p = x.getPower();
|
|
157
|
+
const multiplier = Expression_1.Expression.fromRational(x.getMultiplier());
|
|
158
|
+
if (p.isInteger()) {
|
|
159
|
+
retval = (0, multiply_1.multiply)(multiplier, imagPart((0, power_1.power)(x.getBase(), p)));
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
const [r, theta] = toPolarFormArray(x.getBase());
|
|
163
|
+
const rp = (0, power_1.power)(r, p);
|
|
164
|
+
const im = (0, trig_1.sin)((0, multiply_1.multiply)(p, theta));
|
|
165
|
+
retval = (0, multiply_1.multiply)(multiplier, (0, multiply_1.multiply)(rp, im));
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
// realpart(...) and imagpart(...) are real-valued by definition. For other
|
|
169
|
+
// explicitly complex functions, keep the component symbolic rather than
|
|
170
|
+
// silently treating an unevaluated function as zero.
|
|
171
|
+
else if (x.isComplexComponentFunction()) {
|
|
172
|
+
retval = (0, shortcuts_1.zero)();
|
|
173
|
+
}
|
|
174
|
+
else if (x.isFunction() && x.isComplex()) {
|
|
175
|
+
retval = Expression_1.Expression.toFunction(constants_1.IMAGPART, [x]);
|
|
176
|
+
}
|
|
177
|
+
else if (x.isSum()) {
|
|
178
|
+
retval = (0, shortcuts_1.zero)();
|
|
179
|
+
const elements = x.getElements();
|
|
180
|
+
for (const e in elements) {
|
|
181
|
+
retval = (0, add_1.add)(retval, imagPart(elements[e]));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
else if (x.isProduct()) {
|
|
185
|
+
if (x.isComplex()) {
|
|
186
|
+
const multiplier = Expression_1.Expression.fromRational(x.getMultiplier());
|
|
187
|
+
let realFactor = (0, shortcuts_1.one)();
|
|
188
|
+
let complexFactor;
|
|
189
|
+
let complexFactorCount = 0;
|
|
190
|
+
const elements = x.getElements();
|
|
191
|
+
for (const e in elements) {
|
|
192
|
+
const factor = elements[e];
|
|
193
|
+
if (factor.isComplex()) {
|
|
194
|
+
complexFactor = factor;
|
|
195
|
+
complexFactorCount++;
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
realFactor = (0, multiply_1.multiply)(realFactor, factor);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
// A real product scales the components of its single complex factor.
|
|
202
|
+
if (complexFactorCount === 1 && complexFactor) {
|
|
203
|
+
retval = (0, multiply_1.multiply)(multiplier, (0, multiply_1.multiply)(realFactor, imagPart(complexFactor)));
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
let productReal = (0, shortcuts_1.one)();
|
|
207
|
+
let productImaginary = (0, shortcuts_1.zero)();
|
|
208
|
+
for (const e in elements) {
|
|
209
|
+
const factor = elements[e];
|
|
210
|
+
if (factor.isComplex()) {
|
|
211
|
+
const factorReal = realPart(factor);
|
|
212
|
+
const factorImaginary = imagPart(factor);
|
|
213
|
+
const previousReal = productReal;
|
|
214
|
+
const previousImaginary = productImaginary;
|
|
215
|
+
productReal = (0, multiply_1.multiply)(previousReal, factorReal).minus((0, multiply_1.multiply)(previousImaginary, factorImaginary));
|
|
216
|
+
productImaginary = (0, multiply_1.multiply)(previousReal, factorImaginary).plus((0, multiply_1.multiply)(previousImaginary, factorReal));
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
retval = (0, multiply_1.multiply)(multiplier, (0, multiply_1.multiply)(realFactor, productImaginary));
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
retval = (0, shortcuts_1.zero)();
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
retval = (0, shortcuts_1.zero)();
|
|
228
|
+
}
|
|
229
|
+
return retval;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Simplifies a*i^n with numeric powers and coefficients
|
|
233
|
+
*
|
|
234
|
+
* @param x
|
|
235
|
+
*/
|
|
236
|
+
function simplifyImaginary(x) {
|
|
237
|
+
const power = x.getPower();
|
|
238
|
+
if (x.isI() && power.isInteger()) {
|
|
239
|
+
const r = power.mod('4').abs();
|
|
240
|
+
// const sgn = power.sign();
|
|
241
|
+
const rText = r.text();
|
|
242
|
+
let retval;
|
|
243
|
+
switch (rText) {
|
|
244
|
+
case '1':
|
|
245
|
+
retval = Expression_1.Expression.Img();
|
|
246
|
+
break;
|
|
247
|
+
case '2':
|
|
248
|
+
retval = (0, shortcuts_1.minusOne)();
|
|
249
|
+
break;
|
|
250
|
+
case '3':
|
|
251
|
+
retval = Expression_1.Expression.Img().neg();
|
|
252
|
+
break;
|
|
253
|
+
default:
|
|
254
|
+
retval = (0, shortcuts_1.one)();
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
retval = (0, multiply_1.multiply)(retval, Expression_1.Expression.fromRational(x.getMultiplier()));
|
|
258
|
+
return retval;
|
|
259
|
+
}
|
|
260
|
+
return x;
|
|
261
|
+
}
|
|
262
|
+
function toPolarFormArray(x) {
|
|
263
|
+
const re = x.realPart();
|
|
264
|
+
const im = x.imagPart();
|
|
265
|
+
const r = (0, geometry_1.hypot)(re, im);
|
|
266
|
+
// Principal argument (theta)
|
|
267
|
+
let theta;
|
|
268
|
+
if (re.isZero()) {
|
|
269
|
+
if (im.isZero()) {
|
|
270
|
+
theta = (0, shortcuts_1.zero)();
|
|
271
|
+
}
|
|
272
|
+
else if (im.isConstant()) {
|
|
273
|
+
// On the imaginary axis: choose ±pi/2 based on sign(im)
|
|
274
|
+
theta =
|
|
275
|
+
im.sign() < 0
|
|
276
|
+
? (0, multiply_1.multiply)((0, shortcuts_1.minusOne)(), (0, divide_1.divide)(Expression_1.Expression.Pi(), (0, shortcuts_1.two)()))
|
|
277
|
+
: (0, divide_1.divide)(Expression_1.Expression.Pi(), (0, shortcuts_1.two)());
|
|
278
|
+
}
|
|
279
|
+
else {
|
|
280
|
+
theta = (0, trig_1.atan2)(im, re);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
else {
|
|
284
|
+
theta = (0, trig_1.atan2)(im, re);
|
|
285
|
+
}
|
|
286
|
+
return [r, theta];
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Calculates the polar from of a complex number
|
|
290
|
+
* //IMPROVE: Potential speed boost by just returning i.
|
|
291
|
+
*
|
|
292
|
+
* @param x
|
|
293
|
+
* @returns
|
|
294
|
+
*/
|
|
295
|
+
function polarForm(x) {
|
|
296
|
+
let retval;
|
|
297
|
+
if (x.isNUM() || (x.isI() && x.isLinear())) {
|
|
298
|
+
// The polarform of a number is just the number
|
|
299
|
+
retval = new Expression_1.Expression(x);
|
|
300
|
+
}
|
|
301
|
+
else {
|
|
302
|
+
// Get r and theta. Theta will come back as (atan(x) or a*pi/n)
|
|
303
|
+
const [r, theta] = toPolarFormArray((0, expand_1.expand)(x));
|
|
304
|
+
// Calculate the power i * theta
|
|
305
|
+
const p = (0, multiply_1.multiply)(Expression_1.Expression.Img(), theta);
|
|
306
|
+
// return r*e^(i*theta)
|
|
307
|
+
const t = (0, power_1.power)(Expression_1.Expression.Variable(constants_1.E), p);
|
|
308
|
+
retval = (0, multiply_1.multiply)(t, r);
|
|
309
|
+
}
|
|
310
|
+
return retval;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Attempts to convert a polar form complex to rectangular form. If no exact identity
|
|
314
|
+
* is found, the decimal representation in rectangular form is returned.
|
|
315
|
+
*
|
|
316
|
+
* @param x
|
|
317
|
+
* @returns
|
|
318
|
+
*/
|
|
319
|
+
function rectForm(x) {
|
|
320
|
+
x = Expression_1.Expression.create(x);
|
|
321
|
+
let retval;
|
|
322
|
+
function toTheta(t) {
|
|
323
|
+
const elements = t.elementsArray();
|
|
324
|
+
let complexPart = (0, shortcuts_1.one)();
|
|
325
|
+
let realPart = (0, shortcuts_1.one)();
|
|
326
|
+
for (const e of elements) {
|
|
327
|
+
if (e.isComplex()) {
|
|
328
|
+
complexPart = complexPart.times(e);
|
|
329
|
+
}
|
|
330
|
+
else {
|
|
331
|
+
realPart = realPart.times(e);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
// Check if it's in the form i*θ
|
|
335
|
+
if (complexPart.value === Expression_1.Expression.imaginary) {
|
|
336
|
+
if (realPart.isFunction(constants_1.ATAN)) {
|
|
337
|
+
return realPart;
|
|
338
|
+
}
|
|
339
|
+
return realPart.times(t.getMultiplier());
|
|
340
|
+
}
|
|
341
|
+
if (complexPart.isFunction(constants_1.ATAN) &&
|
|
342
|
+
complexPart.getArguments()[0].value === Expression_1.Expression.imaginary) {
|
|
343
|
+
const arg = complexPart.getArguments()[0];
|
|
344
|
+
return Expression_1.Expression.toFunction(constants_1.ATANH, [
|
|
345
|
+
Expression_1.Expression.fromRational(arg.getMultiplier()),
|
|
346
|
+
]).times(t.getMultiplier());
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
if (x.isE()) {
|
|
350
|
+
const p = x.getPower();
|
|
351
|
+
const m = x.getMultiplier();
|
|
352
|
+
if (p.isComplex()) {
|
|
353
|
+
const theta = toTheta(p);
|
|
354
|
+
if (theta) {
|
|
355
|
+
retval = (0, trig_1.cos)(theta).times(m).plus((0, trig_1.sin)(theta).times(m).i());
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
else if (x.isProduct()) {
|
|
360
|
+
let result = Expression_1.Expression.fromRational(x.getMultiplier());
|
|
361
|
+
x.each((e) => {
|
|
362
|
+
result = result.times(rectForm(e));
|
|
363
|
+
});
|
|
364
|
+
retval = result;
|
|
365
|
+
}
|
|
366
|
+
else if (x.isSum()) {
|
|
367
|
+
let result = (0, shortcuts_1.zero)();
|
|
368
|
+
x.each((e) => {
|
|
369
|
+
result = result.plus(rectForm(e));
|
|
370
|
+
});
|
|
371
|
+
retval = result;
|
|
372
|
+
}
|
|
373
|
+
const result = retval ? retval.expand() : x.isComplex() ? x.evaluate() : x;
|
|
374
|
+
return result;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Returns the argument of an expression
|
|
378
|
+
*
|
|
379
|
+
* @param x
|
|
380
|
+
* @returns
|
|
381
|
+
*/
|
|
382
|
+
function arg(x) {
|
|
383
|
+
x = Expression_1.Expression.create(x);
|
|
384
|
+
const [, theta] = toPolarFormArray(x);
|
|
385
|
+
return theta;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Returns the complex conjugate of an expression.
|
|
389
|
+
* For a complex number z = a + bi, the conjugate is a - bi.
|
|
390
|
+
* Distributes over sums, products, integer powers, and powers whose
|
|
391
|
+
* constant base is known not to lie on the principal logarithm's branch cut.
|
|
392
|
+
*
|
|
393
|
+
* @param expr - The expression to conjugate
|
|
394
|
+
* @returns The complex conjugate of the expression
|
|
395
|
+
*
|
|
396
|
+
* @example
|
|
397
|
+
* conjugate('3+2*i') // 3-2*i
|
|
398
|
+
* conjugate('i') // -i
|
|
399
|
+
* conjugate('a+b*i') // a-b*i
|
|
400
|
+
* conjugate('(1+i)^i') // (1-i)^(-i)
|
|
401
|
+
*/
|
|
402
|
+
function conjugate(x) {
|
|
403
|
+
x = Expression_1.Expression.create(x);
|
|
404
|
+
const expr = (0, expand_1.expand)(x);
|
|
405
|
+
let retval = undefined;
|
|
406
|
+
const p = expr.getPower();
|
|
407
|
+
// A power belongs to the whole expression, even when the base is stored as
|
|
408
|
+
// a SUM, PRD, or VAR rather than an EXP node. Handle that before distributing
|
|
409
|
+
// conjugation through the underlying structure. NUM uses a synthetic power of
|
|
410
|
+
// zero, so it must remain a terminal real value rather than entering this path.
|
|
411
|
+
if (expr.isEXP() || (!expr.isNUM() && !p.isOne())) {
|
|
412
|
+
const multiplier = Expression_1.Expression.fromRational(expr.getMultiplier());
|
|
413
|
+
const base = expr.getBase();
|
|
414
|
+
const re = realPart(base);
|
|
415
|
+
const im = imagPart(base);
|
|
416
|
+
const knownOffBranchCut = re.isConstant() &&
|
|
417
|
+
im.isConstant() &&
|
|
418
|
+
(!im.isZero() || (!re.isZero() && re.sign() > 0));
|
|
419
|
+
if (p.isInteger() || knownOffBranchCut) {
|
|
420
|
+
const conjBase = conjugate(base);
|
|
421
|
+
const conjPow = p.isComplex() ? conjugate(p) : p;
|
|
422
|
+
retval = multiplier.times(conjBase.pow(conjPow));
|
|
423
|
+
}
|
|
424
|
+
else {
|
|
425
|
+
retval = Expression_1.Expression.toFunction(constants_1.CONJUGATE, [expr]);
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
else if (expr.isVAR() && expr.isI()) {
|
|
429
|
+
retval = expr.neg();
|
|
430
|
+
}
|
|
431
|
+
else if (expr.isSum()) {
|
|
432
|
+
retval = (0, shortcuts_1.zero)();
|
|
433
|
+
for (const e of expr.elementsArray()) {
|
|
434
|
+
retval = retval.plus(conjugate(e));
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
else if (expr.isProduct()) {
|
|
438
|
+
retval = Expression_1.Expression.fromRational(expr.getMultiplier());
|
|
439
|
+
for (const e of expr.elementsArray()) {
|
|
440
|
+
retval = retval.times(conjugate(e));
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
return retval ?? x;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Returns the complex signum (csgn) of an expression, following the
|
|
447
|
+
* Maple/SymPy convention. Returns 1 if Re(z) > 0, -1 if Re(z) < 0,
|
|
448
|
+
* and sgn(Im(z)) if Re(z) = 0. Returns 0 for z = 0.
|
|
449
|
+
*
|
|
450
|
+
* For expressions containing free variables where the sign cannot be
|
|
451
|
+
* determined, returns an unevaluated symbolic csgn(z).
|
|
452
|
+
*
|
|
453
|
+
* Useful for branch cut decisions in sqrt, log, and power simplification.
|
|
454
|
+
*
|
|
455
|
+
* @param expr - The expression to evaluate the complex sign of
|
|
456
|
+
* @returns 1, -1, 0, or an unevaluated csgn expression
|
|
457
|
+
*
|
|
458
|
+
* @example
|
|
459
|
+
* csgn('3+2*i') // 1
|
|
460
|
+
* csgn('-1+3*i') // -1
|
|
461
|
+
* csgn('2*i') // 1
|
|
462
|
+
* csgn('-5*i') // -1
|
|
463
|
+
* csgn('0') // 0
|
|
464
|
+
* csgn('x+2*i') // csgn(x+2*i)
|
|
465
|
+
*/
|
|
466
|
+
function csgn(x) {
|
|
467
|
+
x = Expression_1.Expression.create(x);
|
|
468
|
+
const expr = (0, expand_1.expand)(x);
|
|
469
|
+
const re = realPart(expr);
|
|
470
|
+
const im = imagPart(expr);
|
|
471
|
+
let retval = undefined;
|
|
472
|
+
if (re.isZero() && im.isZero()) {
|
|
473
|
+
retval = (0, shortcuts_1.zero)();
|
|
474
|
+
}
|
|
475
|
+
else if (!re.isZero() && re.isConstant()) {
|
|
476
|
+
retval = re.sign() > 0 ? (0, shortcuts_1.one)() : (0, shortcuts_1.minusOne)();
|
|
477
|
+
}
|
|
478
|
+
else if (re.isZero() && im.isConstant()) {
|
|
479
|
+
retval = im.sign() > 0 ? (0, shortcuts_1.one)() : (0, shortcuts_1.minusOne)();
|
|
480
|
+
}
|
|
481
|
+
return retval ?? Expression_1.Expression.toFunction(constants_1.CSGN, [expr]);
|
|
482
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import Decimal from 'decimal.js';
|
|
2
|
+
import type { DecimalType } from '../classes/parser/types';
|
|
3
|
+
export declare const EULER_GAMMA: Decimal;
|
|
4
|
+
export declare function erf(x: DecimalType): Decimal;
|
|
5
|
+
/**
|
|
6
|
+
* The gamma function using Spouge approximation.
|
|
7
|
+
* This function is slow converging but appropriate for arbitrary precision. It relies on Decimal.js.
|
|
8
|
+
*
|
|
9
|
+
* Ported from: https://rosettacode.org/wiki/Gamma_function#C++ (the implementation)
|
|
10
|
+
* https://math.stackexchange.com/questions/2204020/definition-of-the-gamma-function-for-non-integer-negative-values (negative gamma)
|
|
11
|
+
* https://en.wikipedia.org/wiki/Spouge%27s_approximation (Spouge's Approximation)
|
|
12
|
+
*
|
|
13
|
+
* @param n The number of elements to be calculated in the coefficient array
|
|
14
|
+
* @param x The number being evaluated
|
|
15
|
+
* @returns
|
|
16
|
+
*/
|
|
17
|
+
export declare function gamma(x: DecimalType): Decimal;
|
|
18
|
+
export declare function sinc(x: DecimalType): Decimal;
|
|
19
|
+
export declare function Si(x: DecimalType): Decimal;
|
|
20
|
+
export declare function Shi(x: DecimalType): Decimal;
|
|
21
|
+
export declare function Ci(x: DecimalType): Decimal;
|
|
22
|
+
export declare function Chi(x: DecimalType): Decimal;
|
|
23
|
+
export declare function Ei(x: DecimalType): Decimal;
|
|
24
|
+
export declare function Li(x: DecimalType): Decimal;
|