@cortex-js/compute-engine 0.28.0 → 0.29.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/dist/{compute-engine.js → compute-engine.cjs} +22673 -23299
- package/dist/compute-engine.esm.js +22673 -23299
- package/dist/compute-engine.min.cjs +129 -0
- package/dist/compute-engine.min.esm.js +48 -64
- package/dist/{math-json.js → math-json.cjs} +2 -2
- package/dist/math-json.esm.js +2 -2
- package/dist/{math-json.min.js → math-json.min.cjs} +2 -2
- package/dist/math-json.min.esm.js +2 -2
- package/dist/types/common/ansi-codes.d.ts +1 -1
- package/dist/types/common/fuzzy-string-match.d.ts +1 -1
- package/dist/types/common/grapheme-splitter.d.ts +1 -1
- package/dist/types/common/interruptible.d.ts +1 -1
- package/dist/types/common/json5.d.ts +1 -1
- package/dist/types/common/one-of.d.ts +2 -1
- package/dist/types/common/signals.d.ts +1 -2
- package/dist/types/common/type/boxed-type.d.ts +2 -1
- package/dist/types/common/type/parse.d.ts +1 -1
- package/dist/types/common/type/primitive.d.ts +1 -1
- package/dist/types/common/type/serialize.d.ts +1 -1
- package/dist/types/common/type/subtype.d.ts +1 -1
- package/dist/types/common/type/types.d.ts +102 -107
- package/dist/types/common/type/utils.d.ts +1 -1
- package/dist/types/common/utils.d.ts +1 -1
- package/dist/types/compute-engine/assume.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +11 -14
- package/dist/types/compute-engine/boxed-expression/apply.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/arithmetic-add.d.ts +3 -3
- package/dist/types/compute-engine/boxed-expression/arithmetic-mul-div.d.ts +27 -0
- package/dist/types/compute-engine/boxed-expression/arithmetic-power.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/ascii-math.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/box.d.ts +5 -5
- package/dist/types/compute-engine/boxed-expression/boxed-function-definition.d.ts +12 -13
- package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +4 -7
- package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +6 -8
- package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +2 -3
- package/dist/types/compute-engine/boxed-expression/boxed-symbol-definition.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +6 -7
- package/dist/types/compute-engine/boxed-expression/boxed-tensor.d.ts +5 -8
- package/dist/types/compute-engine/boxed-expression/cache.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/canonical.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/compare.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/expand.d.ts +3 -3
- package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/factor.d.ts +1 -3
- package/dist/types/compute-engine/boxed-expression/flatten.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/hold.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/match.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/negate.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/numerics.d.ts +3 -3
- package/dist/types/compute-engine/boxed-expression/order.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/product.d.ts +5 -5
- package/dist/types/compute-engine/boxed-expression/rules.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/serialize.d.ts +3 -3
- package/dist/types/compute-engine/boxed-expression/sgn.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/simplify.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/solve.d.ts +1 -2
- package/dist/types/compute-engine/boxed-expression/terms.d.ts +2 -2
- package/dist/types/compute-engine/boxed-expression/trigonometry.d.ts +2 -9
- package/dist/types/compute-engine/boxed-expression/utils.d.ts +13 -4
- package/dist/types/compute-engine/boxed-expression/validate.d.ts +8 -9
- package/dist/types/compute-engine/collection-utils.d.ts +1 -1
- package/dist/types/compute-engine/compile.d.ts +2 -4
- package/dist/types/compute-engine/cost-function.d.ts +1 -1
- package/dist/types/compute-engine/function-utils.d.ts +1 -1
- package/dist/types/compute-engine/{boxed-expression/public.d.ts → global-types.d.ts} +835 -807
- package/dist/types/compute-engine/{compute-engine.d.ts → index.d.ts} +7 -10
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-complex.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-relational-operators.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-statistics.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-symbols.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +2 -2
- package/dist/types/compute-engine/latex-syntax/parse-identifier.d.ts +2 -2
- package/dist/types/compute-engine/latex-syntax/parse.d.ts +2 -2
- package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +2 -2
- package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +2 -2
- package/dist/types/compute-engine/latex-syntax/serializer.d.ts +2 -2
- package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/{public.d.ts → types.d.ts} +3 -1
- package/dist/types/compute-engine/library/arithmetic.d.ts +1 -2
- package/dist/types/compute-engine/library/calculus.d.ts +1 -1
- package/dist/types/compute-engine/library/collections.d.ts +2 -2
- package/dist/types/compute-engine/library/complex.d.ts +1 -1
- package/dist/types/compute-engine/library/control-structures.d.ts +1 -1
- package/dist/types/compute-engine/library/core.d.ts +1 -1
- package/dist/types/compute-engine/library/invisible-operator.d.ts +2 -2
- package/dist/types/compute-engine/library/library.d.ts +3 -3
- package/dist/types/compute-engine/library/linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/library/logic.d.ts +1 -1
- package/dist/types/compute-engine/library/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/library/random-expression.d.ts +1 -1
- package/dist/types/compute-engine/library/relational-operator.d.ts +1 -1
- package/dist/types/compute-engine/library/sets.d.ts +1 -1
- package/dist/types/compute-engine/library/statistics.d.ts +1 -1
- package/dist/types/compute-engine/library/trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/library/utils.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/big-numeric-value.d.ts +3 -4
- package/dist/types/compute-engine/numeric-value/exact-numeric-value.d.ts +3 -5
- package/dist/types/compute-engine/numeric-value/machine-numeric-value.d.ts +3 -4
- package/dist/types/compute-engine/numeric-value/{public.d.ts → types.d.ts} +9 -5
- package/dist/types/compute-engine/numerics/bigint.d.ts +1 -1
- package/dist/types/compute-engine/numerics/expression.d.ts +1 -1
- package/dist/types/compute-engine/numerics/interval.d.ts +1 -1
- package/dist/types/compute-engine/numerics/monte-carlo.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
- package/dist/types/compute-engine/numerics/numeric.d.ts +2 -7
- package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
- package/dist/types/compute-engine/numerics/rationals.d.ts +1 -5
- package/dist/types/compute-engine/numerics/richardson.d.ts +1 -1
- package/dist/types/compute-engine/numerics/special-functions.d.ts +4 -4
- package/dist/types/compute-engine/numerics/statistics.d.ts +2 -2
- package/dist/types/compute-engine/numerics/strings.d.ts +1 -1
- package/dist/types/compute-engine/numerics/types.d.ts +30 -0
- package/dist/types/compute-engine/symbolic/derivative.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/distribute.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-rules.d.ts +1 -1
- package/dist/types/compute-engine/{boxed-expression → tensor}/tensor-fields.d.ts +19 -18
- package/dist/types/compute-engine/tensor/tensors.d.ts +9 -12
- package/dist/types/compute-engine/types.d.ts +11 -0
- package/dist/types/compute-engine.d.ts +3 -6
- package/dist/types/math-json/identifiers.d.ts +1 -1
- package/dist/types/math-json/types.d.ts +4 -2
- package/dist/types/math-json/utils.d.ts +1 -1
- package/dist/types/math-json.d.ts +2 -2
- package/package.json +7 -7
- package/dist/compute-engine.min.js +0 -145
- package/dist/types/common/buffer.d.ts +0 -9
- package/dist/types/common/styled-text.d.ts +0 -28
- package/dist/types/common/syntax-highlighter.d.ts +0 -40
- package/dist/types/common/terminal.d.ts +0 -19
- package/dist/types/compute-engine/boxed-expression/arithmetic-divide.d.ts +0 -12
- package/dist/types/compute-engine/boxed-expression/arithmetic-multiply.d.ts +0 -16
- package/dist/types/compute-engine/debug.d.ts +0 -3
- package/dist/types/compute-engine/numerics/bignum.d.ts +0 -12
- package/dist/types/compute-engine/private.d.ts +0 -29
- package/dist/types/compute-engine/public.d.ts +0 -42
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
import { Decimal } from 'decimal.js';
|
|
3
3
|
import { Expression, MathJsonIdentifier, MathJsonNumber } from '../math-json/types';
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { Rational } from './numerics/rationals';
|
|
4
|
+
import { SymbolDefinition, FunctionDefinition, AngularUnit, AssignValue, AssumeResult, BoxedExpression, BoxedFunctionDefinition, BoxedRule, BoxedRuleSet, BoxedSubstitution, BoxedSymbolDefinition, CanonicalOptions, ComputeEngineStats, EvaluateOptions, ExpressionMapInterface, IdentifierDefinitions, Metadata, Rule, RuntimeScope, Scope, SemiBoxedExpression, ComputeEngine as IComputeEngine } from './global-types';
|
|
5
|
+
import type { BigNum, Rational } from './numerics/types';
|
|
7
6
|
import { type IndexedLatexDictionary } from './latex-syntax/dictionary/definitions';
|
|
8
|
-
import { BoxedExpression, BoxedRule, EvaluateOptions, SemiBoxedExpression } from './boxed-expression/public';
|
|
9
7
|
import './boxed-expression/serialize';
|
|
10
|
-
import { ExactNumericValueData, NumericValue, NumericValueData } from './numeric-value/
|
|
8
|
+
import { ExactNumericValueData, NumericValue, NumericValueData } from './numeric-value/types';
|
|
9
|
+
import type { LatexDictionaryEntry, LatexString, LibraryCategory, ParseLatexOptions } from './latex-syntax/types';
|
|
10
|
+
import type { OneOf } from '../common/one-of';
|
|
11
11
|
import { Type, TypeString } from '../common/type/types';
|
|
12
|
-
import { OneOf } from '../common/one-of';
|
|
13
|
-
import { BigNum } from './numerics/bignum';
|
|
14
12
|
import { BoxedType } from '../common/type/boxed-type';
|
|
15
|
-
export
|
|
16
|
-
export * from '../common/type/subtype';
|
|
13
|
+
export * from './global-types';
|
|
17
14
|
/**
|
|
18
15
|
*
|
|
19
16
|
* To use the Compute Engine, create a `ComputeEngine` instance:
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const DEFINITIONS_ALGEBRA: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const DEFINITIONS_ARITHMETIC: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const DEFINITIONS_CALCULUS: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const DEFINITIONS_COMPLEX: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const DEFINITIONS_LINEAR_ALGEBRA: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const DEFINITIONS_LOGIC: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const DEFINITIONS_OTHERS: LatexDictionary;
|
package/dist/types/compute-engine/latex-syntax/dictionary/definitions-relational-operators.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const DEFINITIONS_INEQUALITIES: LatexDictionaryEntry[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const DEFINITIONS_SETS: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const DEFINITIONS_STATISTICS: LatexDictionary;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const DEFINITIONS_TRIGONOMETRY: LatexDictionary;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import { Delimiter, EnvironmentParseHandler, ExpressionParseHandler, InfixParseHandler, LatexDictionary, LatexDictionaryEntry, LatexString, LatexToken, LibraryCategory, MatchfixParseHandler, PostfixParseHandler, Precedence, SerializeHandler } from '../
|
|
1
|
+
/* 0.29.1 */
|
|
2
|
+
import { Delimiter, EnvironmentParseHandler, ExpressionParseHandler, InfixParseHandler, LatexDictionary, LatexDictionaryEntry, LatexString, LatexToken, LibraryCategory, MatchfixParseHandler, PostfixParseHandler, Precedence, SerializeHandler } from '../types';
|
|
3
3
|
export type CommonEntry = {
|
|
4
4
|
/** Note: a name is required if a serialize handler is provided */
|
|
5
5
|
name?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import { Parser } from './
|
|
1
|
+
/* 0.29.1 */
|
|
2
|
+
import { Parser } from './types';
|
|
3
3
|
/** For error handling, if we have a identifier prefix, assume
|
|
4
4
|
* the identifier is invalid (it would have been captured by
|
|
5
5
|
* `matchIdentifier()` otherwise) and return an error expression */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import { ParseLatexOptions, LatexToken, Terminator, Parser, SymbolTable, SymbolType } from './
|
|
1
|
+
/* 0.29.1 */
|
|
2
|
+
import { ParseLatexOptions, LatexToken, Terminator, Parser, SymbolTable, SymbolType } from './types';
|
|
3
3
|
import type { IndexedLatexDictionary, IndexedLatexDictionaryEntry, IndexedInfixEntry, IndexedPostfixEntry, IndexedPrefixEntry, IndexedSymbolEntry, IndexedExpressionEntry, IndexedFunctionEntry } from './dictionary/definitions';
|
|
4
4
|
/**
|
|
5
5
|
* ## THEORY OF OPERATIONS
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import { NumberSerializationFormat } from './
|
|
1
|
+
/* 0.29.1 */
|
|
2
|
+
import { NumberSerializationFormat } from './types';
|
|
3
3
|
/**
|
|
4
4
|
* @param expr - A number, can be represented as a string
|
|
5
5
|
* (particularly useful for arbitrary precision numbers) or a number (-12.45)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import { DelimiterScale } from './
|
|
1
|
+
/* 0.29.1 */
|
|
2
|
+
import { DelimiterScale } from './types';
|
|
3
3
|
export declare function getApplyFunctionStyle(_expr: Expression, _level: number): DelimiterScale;
|
|
4
4
|
export declare function getGroupStyle(_expr: Expression, _level: number): DelimiterScale;
|
|
5
5
|
export declare function getRootStyle(_expr: Expression | null, level: number): 'radical' | 'quotient' | 'solidus';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import { LatexString, SerializeLatexOptions, DelimiterScale } from './
|
|
1
|
+
/* 0.29.1 */
|
|
2
|
+
import { LatexString, SerializeLatexOptions, DelimiterScale } from './types';
|
|
3
3
|
import type { IndexedLatexDictionary, IndexedLatexDictionaryEntry } from './dictionary/definitions';
|
|
4
4
|
export declare class Serializer {
|
|
5
5
|
options: Readonly<SerializeLatexOptions>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
import type { Expression, MathJsonIdentifier } from '../../math-json/types';
|
|
3
3
|
import type { IndexedLatexDictionary, IndexedLatexDictionaryEntry } from './dictionary/definitions';
|
|
4
4
|
export type SymbolType = 'symbol' | 'function' | 'unknown';
|
|
@@ -375,6 +375,7 @@ export declare function isEnvironmentEntry(entry: LatexDictionaryEntry): entry i
|
|
|
375
375
|
export type LatexDictionary = ReadonlyArray<Partial<LatexDictionaryEntry>>;
|
|
376
376
|
/**
|
|
377
377
|
* These options control how numbers are parsed and serialized.
|
|
378
|
+
* @category Serialization
|
|
378
379
|
*/
|
|
379
380
|
export type NumberFormat = {
|
|
380
381
|
positiveInfinity: LatexString;
|
|
@@ -432,6 +433,7 @@ export type NumberFormat = {
|
|
|
432
433
|
truncationMarker: LatexString;
|
|
433
434
|
repeatingDecimal: 'auto' | 'vinculum' | 'dots' | 'parentheses' | 'arc' | 'none';
|
|
434
435
|
};
|
|
436
|
+
/** @category Serialization */
|
|
435
437
|
export type NumberSerializationFormat = NumberFormat & {
|
|
436
438
|
/**
|
|
437
439
|
* The maximum number of significant digits in serialized numbers.
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import { BoxedExpression } from '../boxed-expression/public';
|
|
1
|
+
/* 0.29.1 */
|
|
3
2
|
export type CanonicalArithmeticOperators = 'Add' | 'Negate' | 'Multiply' | 'Divide' | 'Power' | 'Sqrt' | 'Root' | 'Ln';
|
|
4
3
|
export declare const ARITHMETIC_LIBRARY: IdentifierDefinitions[];
|
|
5
4
|
export declare function isPrime(expr: BoxedExpression): boolean | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const CALCULUS_LIBRARY: IdentifierDefinitions[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const DEFAULT_LINSPACE_COUNT = 50;
|
|
3
3
|
export declare const COLLECTIONS_LIBRARY: IdentifierDefinitions;
|
|
4
4
|
/**
|
|
@@ -24,4 +24,4 @@ export declare function rangeLast(r: [lower: number, upper: number, step: number
|
|
|
24
24
|
*/
|
|
25
25
|
export declare function reduceCollection<T>(collection: BoxedExpression, fn: (acc: T, next: BoxedExpression) => T | null, initial: T): Generator<T | undefined>;
|
|
26
26
|
export declare function fromRange(start: number, end: number): number[];
|
|
27
|
-
export declare function canonicalDictionary(engine:
|
|
27
|
+
export declare function canonicalDictionary(engine: ComputeEngine, dict: BoxedExpression): BoxedExpression;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const COMPLEX_LIBRARY: IdentifierDefinitions[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const CONTROL_STRUCTURES_LIBRARY: IdentifierDefinitions[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const CORE_LIBRARY: IdentifierDefinitions[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import {
|
|
1
|
+
/* 0.29.1 */
|
|
2
|
+
import type { IdentifierDefinitions, ComputeEngine } from '../global-types';
|
|
3
3
|
export declare function getStandardLibrary(categories: LibraryCategory[] | LibraryCategory | 'all'): readonly IdentifierDefinitions[];
|
|
4
4
|
export declare const LIBRARIES: {
|
|
5
5
|
[category in LibraryCategory]?: IdentifierDefinitions | IdentifierDefinitions[];
|
|
@@ -14,4 +14,4 @@ export declare const LIBRARIES: {
|
|
|
14
14
|
* or function name that has not yet been added to the symbol table.
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
|
-
export declare function setIdentifierDefinitions(engine:
|
|
17
|
+
export declare function setIdentifierDefinitions(engine: ComputeEngine, table: IdentifierDefinitions): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const LINEAR_ALGEBRA_LIBRARY: IdentifierDefinitions[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const POLYNOMIALS_LIBRARY: IdentifierDefinitions[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare function randomExpression(level?: number): Expression;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const RELOP_LIBRARY: IdentifierDefinitions;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const SETS_LIBRARY: IdentifierDefinitions;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const STATISTICS_LIBRARY: IdentifierDefinitions[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const TRIGONOMETRY_LIBRARY: IdentifierDefinitions[];
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import { NumericValue, NumericValueData } from './
|
|
1
|
+
/* 0.29.1 */
|
|
2
|
+
import { BigNumFactory, NumericValue, NumericValueData } from './types';
|
|
3
3
|
import { ExactNumericValue } from './exact-numeric-value';
|
|
4
4
|
import { Expression } from '../../math-json/types';
|
|
5
|
-
import { SmallInteger } from '../numerics/
|
|
5
|
+
import { SmallInteger } from '../numerics/types';
|
|
6
6
|
import { NumericType } from '../../common/type/types';
|
|
7
|
-
export type BigNumFactory = (value: Decimal.Value) => Decimal;
|
|
8
7
|
export declare class BigNumericValue extends NumericValue {
|
|
9
8
|
__brand: 'BigNumericValue';
|
|
10
9
|
decimal: Decimal;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import { SmallInteger } from '../numerics/
|
|
3
|
-
import {
|
|
4
|
-
import { ExactNumericValueData, NumericValue, NumericValueFactory } from './public';
|
|
1
|
+
/* 0.29.1 */
|
|
2
|
+
import { Rational, SmallInteger } from '../numerics/types';
|
|
3
|
+
import { BigNumFactory, ExactNumericValueData, NumericValue, NumericValueFactory } from './types';
|
|
5
4
|
import { Expression } from '../../math-json/types';
|
|
6
|
-
import { BigNumFactory } from './big-numeric-value';
|
|
7
5
|
import { NumericType } from '../../common/type/types';
|
|
8
6
|
/**
|
|
9
7
|
* An ExactNumericValue is the sum of a Gaussian imaginary and the product of
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import { NumericValue, NumericValueData } from './
|
|
1
|
+
/* 0.29.1 */
|
|
2
|
+
import { BigNumFactory, NumericValue, NumericValueData } from './types';
|
|
3
3
|
import type { Expression } from '../../math-json/types';
|
|
4
|
-
import { SmallInteger } from '../numerics/
|
|
4
|
+
import type { SmallInteger } from '../numerics/types';
|
|
5
5
|
import { NumericType } from '../../common/type/types';
|
|
6
|
-
import { BigNumFactory } from './big-numeric-value';
|
|
7
6
|
export declare class MachineNumericValue extends NumericValue {
|
|
8
7
|
__brand: 'MachineNumericValue';
|
|
9
8
|
decimal: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
*
|
|
3
3
|
* ## THEORY OF OPERATIONS
|
|
4
4
|
*
|
|
@@ -23,20 +23,24 @@
|
|
|
23
23
|
* A float numeric value is never converted to an exact one.
|
|
24
24
|
*
|
|
25
25
|
*/
|
|
26
|
-
import Decimal from 'decimal.js';
|
|
27
|
-
import { SmallInteger } from '../numerics/
|
|
28
|
-
import { Rational } from '../numerics/rationals';
|
|
26
|
+
import { Decimal } from 'decimal.js';
|
|
27
|
+
import type { Rational, SmallInteger } from '../numerics/types';
|
|
29
28
|
import { NumericType } from '../../common/type/types';
|
|
30
|
-
|
|
29
|
+
export type BigNumFactory = (value: Decimal.Value) => Decimal;
|
|
30
|
+
/** The value is equal to `(decimal * rational * sqrt(radical)) + im * i`
|
|
31
|
+
* @category Numerics */
|
|
31
32
|
export type ExactNumericValueData = {
|
|
32
33
|
rational?: Rational;
|
|
33
34
|
radical?: number;
|
|
34
35
|
};
|
|
36
|
+
/** @category Numerics */
|
|
35
37
|
export type NumericValueData = {
|
|
36
38
|
re?: Decimal | number;
|
|
37
39
|
im?: number;
|
|
38
40
|
};
|
|
41
|
+
/** @category Numerics */
|
|
39
42
|
export type NumericValueFactory = (data: number | Decimal | NumericValueData) => NumericValue;
|
|
43
|
+
/** @category Numerics */
|
|
40
44
|
export declare abstract class NumericValue {
|
|
41
45
|
abstract get type(): NumericType;
|
|
42
46
|
/** True if numeric value is the product of a rational and the square root of an integer.
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare function bigint(a: Decimal | number | bigint | string): bigint | null;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare function bigintValue(expr: Expression | null | undefined): bigint | null;
|
|
3
3
|
/** Output a shorthand if possible */
|
|
4
4
|
export declare function numberToExpression(num: number | bigint, fractionalDigits?: string | number): Expression;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare const MACHINE_PRECISION_BITS = 53;
|
|
3
3
|
export declare const MACHINE_PRECISION: number;
|
|
4
4
|
export declare const DEFAULT_TOLERANCE = 1e-10;
|
|
5
5
|
export declare const SMALL_INTEGER = 1000000;
|
|
6
|
-
type IsInteger<N extends number> = `${N}` extends `${string}.${string}` ? never : `${N}` extends `-${string}.${string}` ? never : number;
|
|
7
|
-
export type SmallInteger = IsInteger<number>;
|
|
8
6
|
/** The largest number of digits of a bigint */
|
|
9
7
|
export declare const MAX_BIGINT_DIGITS = 1024;
|
|
10
8
|
export declare const MAX_ITERATION = 1000000;
|
|
@@ -33,9 +31,7 @@ export declare function chop(n: number, tolerance?: number): 0 | number;
|
|
|
33
31
|
* The formula for the 8th-order centered difference approximation for the
|
|
34
32
|
* first derivative is given by:
|
|
35
33
|
*
|
|
36
|
-
* \[
|
|
37
|
-
* f'(x) \approx \frac{1}{280h} \left[ -f(x-4h) + \frac{4}{3}f(x-3h) - \frac{1}{5}f(x-2h) + \frac{8}{5}f(x-h) - \frac{8}{5}f(x+h) + \frac{1}{5}f(x+2h) - \frac{4}{3}f(x+3h) + f(x+4h) \right]
|
|
38
|
-
* \]
|
|
34
|
+
* $$ f'(x) \approx \frac{1}{280h} \left[ -f(x-4h) + \frac{4}{3}f(x-3h) - \frac{1}{5}f(x-2h) + \frac{8}{5}f(x-h) - \frac{8}{5}f(x+h) + \frac{1}{5}f(x+2h) - \frac{4}{3}f(x+3h) + f(x+4h) \right]$$
|
|
39
35
|
*
|
|
40
36
|
* Note: Mathematica uses an 8th order approximation for the first derivative
|
|
41
37
|
*
|
|
@@ -54,4 +50,3 @@ export declare function centeredDiff8thOrder(f: (number: any) => number, x: numb
|
|
|
54
50
|
* @returns
|
|
55
51
|
*/
|
|
56
52
|
export declare function limit(f: (x: number) => number, x: number, dir?: number): number;
|
|
57
|
-
export {};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
/**
|
|
3
|
-
* @category Boxed Expression
|
|
4
|
-
*/
|
|
5
|
-
export type Rational = [SmallInteger, SmallInteger] | [bigint, bigint];
|
|
1
|
+
/* 0.29.1 */
|
|
6
2
|
export declare function isRational(x: any | null): x is Rational;
|
|
7
3
|
export declare function isMachineRational(x: any | null): x is [SmallInteger, SmallInteger];
|
|
8
4
|
export declare function isBigRational(x: any | null): x is [bigint, bigint];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import { BigNum } from './
|
|
1
|
+
/* 0.29.1 */
|
|
2
|
+
import type { BigNum } from './types';
|
|
3
3
|
export declare function gammaln(z: number): number;
|
|
4
4
|
export declare function gamma(z: number): number;
|
|
5
5
|
/**
|
|
@@ -24,5 +24,5 @@ export declare function erfc(x: number): number;
|
|
|
24
24
|
* - NIST: https://dlmf.nist.gov/7.24#i
|
|
25
25
|
*/
|
|
26
26
|
export declare function erf(x: number): number;
|
|
27
|
-
export declare function bigGammaln(ce:
|
|
28
|
-
export declare function bigGamma(ce:
|
|
27
|
+
export declare function bigGammaln(ce: ComputeEngine, z: BigNum): BigNum;
|
|
28
|
+
export declare function bigGamma(ce: ComputeEngine, z: BigNum): BigNum;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/* 0.
|
|
2
|
-
import { BigNum } from './
|
|
1
|
+
/* 0.29.1 */
|
|
2
|
+
import type { BigNum } from './types';
|
|
3
3
|
export declare function mean(values: Iterable<number>): number;
|
|
4
4
|
export declare function bigMean(bignum: BigNumFactory, values: Iterable<BigNum>): BigNum;
|
|
5
5
|
export declare function median(values: Iterable<number>): number;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/* 0.
|
|
1
|
+
/* 0.29.1 */
|
|
2
2
|
export declare function numberToString(num: number | bigint, fractionalDigits?: number | string): string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* 0.29.1 */
|
|
2
|
+
type IsInteger<N extends number> = `${N}` extends `${string}.${string}` ? never : `${N}` extends `-${string}.${string}` ? never : number;
|
|
3
|
+
/** A `SmallInteger` is an integer < 1e6
|
|
4
|
+
* @category Numerics
|
|
5
|
+
*/
|
|
6
|
+
export type SmallInteger = IsInteger<number>;
|
|
7
|
+
/**
|
|
8
|
+
* A rational number is a number that can be expressed as the quotient or fraction p/q of two integers,
|
|
9
|
+
* a numerator p and a non-zero denominator q.
|
|
10
|
+
*
|
|
11
|
+
* A rational can either be represented as a pair of small integers or
|
|
12
|
+
* a pair of big integers.
|
|
13
|
+
*
|
|
14
|
+
* @category Numerics
|
|
15
|
+
*/
|
|
16
|
+
export type Rational = [SmallInteger, SmallInteger] | [bigint, bigint];
|
|
17
|
+
/** @category Numerics */
|
|
18
|
+
export type BigNum = Decimal;
|
|
19
|
+
/** @category Numerics */
|
|
20
|
+
export interface IBigNum {
|
|
21
|
+
readonly _BIGNUM_NAN: BigNum;
|
|
22
|
+
readonly _BIGNUM_ZERO: BigNum;
|
|
23
|
+
readonly _BIGNUM_ONE: BigNum;
|
|
24
|
+
readonly _BIGNUM_TWO: BigNum;
|
|
25
|
+
readonly _BIGNUM_HALF: BigNum;
|
|
26
|
+
readonly _BIGNUM_PI: BigNum;
|
|
27
|
+
readonly _BIGNUM_NEGATIVE_ONE: BigNum;
|
|
28
|
+
bignum(value: string | number | bigint | BigNum): BigNum;
|
|
29
|
+
}
|
|
30
|
+
export {};
|