@cortex-js/compute-engine 0.60.0 → 0.61.0
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/compile.esm.js +1270 -25
- package/dist/compile.min.esm.js +324 -78
- package/dist/compile.min.umd.cjs +324 -78
- package/dist/compile.umd.cjs +1270 -25
- package/dist/compute-engine.esm.js +867 -26
- package/dist/compute-engine.min.esm.js +329 -83
- package/dist/compute-engine.min.umd.cjs +329 -83
- package/dist/compute-engine.umd.cjs +867 -26
- package/dist/core.esm.js +855 -24
- package/dist/core.min.esm.js +330 -84
- package/dist/core.min.umd.cjs +330 -84
- package/dist/core.umd.cjs +855 -24
- package/dist/identities.esm.js +2 -2
- package/dist/identities.min.esm.js +2 -2
- package/dist/identities.min.umd.cjs +2 -2
- package/dist/identities.umd.cjs +2 -2
- package/dist/integration-rules.esm.js +2 -2
- package/dist/integration-rules.min.esm.js +2 -2
- package/dist/integration-rules.min.umd.cjs +2 -2
- package/dist/integration-rules.umd.cjs +2 -2
- package/dist/interval.esm.js +2 -2
- package/dist/interval.min.esm.js +2 -2
- package/dist/interval.min.umd.cjs +2 -2
- package/dist/interval.umd.cjs +2 -2
- package/dist/latex-syntax.esm.js +2 -2
- package/dist/latex-syntax.min.esm.js +2 -2
- package/dist/latex-syntax.min.umd.cjs +2 -2
- package/dist/latex-syntax.umd.cjs +2 -2
- package/dist/math-json.esm.js +2 -2
- package/dist/math-json.min.esm.js +2 -2
- package/dist/math-json.min.umd.cjs +2 -2
- package/dist/math-json.umd.cjs +2 -2
- package/dist/numerics.esm.js +2 -2
- package/dist/numerics.min.esm.js +2 -2
- package/dist/numerics.min.umd.cjs +2 -2
- package/dist/numerics.umd.cjs +2 -2
- package/dist/types/big-decimal/big-decimal.d.ts +1 -1
- package/dist/types/big-decimal/index.d.ts +1 -1
- package/dist/types/big-decimal/transcendentals.d.ts +1 -1
- package/dist/types/big-decimal/utils.d.ts +1 -1
- package/dist/types/common/ansi-codes.d.ts +1 -1
- package/dist/types/common/configuration-change.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/one-of.d.ts +1 -1
- package/dist/types/common/signals.d.ts +1 -1
- package/dist/types/common/type/ast-nodes.d.ts +1 -1
- package/dist/types/common/type/boxed-type.d.ts +1 -1
- package/dist/types/common/type/lexer.d.ts +1 -1
- package/dist/types/common/type/parse.d.ts +1 -1
- package/dist/types/common/type/parser.d.ts +1 -1
- package/dist/types/common/type/primitive.d.ts +1 -1
- package/dist/types/common/type/reduce.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/type-builder.d.ts +1 -1
- package/dist/types/common/type/types.d.ts +1 -1
- package/dist/types/common/type/utils.d.ts +1 -1
- package/dist/types/common/utils.d.ts +1 -1
- package/dist/types/compile.d.ts +2 -1
- package/dist/types/compute-engine/assume.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/apply.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/arithmetic-add.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/arithmetic-mul-div.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/arithmetic-power.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/ascii-math.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/box.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-operator-definition.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-tensor.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/boxed-value-definition.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/cache.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/canonical-utils.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/constants.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/constraint-subject.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/exp-to-trig.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/expand.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/factor.d.ts +1 -1
- 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/inequality-bounds.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/init-lazy-refs.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/invisible-operator.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/match.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/multivariate-gcd.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/multivariate-poly.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/negate.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/numerics.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/order.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/pattern-utils.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/polynomial-degree.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/predicates.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/rule-index.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/rules.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/serialize.d.ts +1 -1
- 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-linear-system.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/solve.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/stochastic-equal.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/trigonometry.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/type-guards.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/utils.d.ts +1 -1
- package/dist/types/compute-engine/boxed-expression/validate.d.ts +1 -1
- package/dist/types/compute-engine/collection-utils.d.ts +1 -1
- package/dist/types/compute-engine/compilation/base-compiler.d.ts +79 -1
- package/dist/types/compute-engine/compilation/compile-expression.d.ts +1 -1
- package/dist/types/compute-engine/compilation/constant-folding.d.ts +1 -1
- package/dist/types/compute-engine/compilation/glsl-target.d.ts +2 -2
- package/dist/types/compute-engine/compilation/gpu-target.d.ts +7 -1
- package/dist/types/compute-engine/compilation/interval-glsl-target.d.ts +49 -0
- package/dist/types/compute-engine/compilation/interval-javascript-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/javascript-target.d.ts +30 -2
- package/dist/types/compute-engine/compilation/python-target.d.ts +1 -1
- package/dist/types/compute-engine/compilation/types.d.ts +54 -2
- package/dist/types/compute-engine/compilation/wgsl-target.d.ts +1 -1
- package/dist/types/compute-engine/cost-function.d.ts +1 -1
- package/dist/types/compute-engine/engine-assumptions.d.ts +1 -1
- package/dist/types/compute-engine/engine-cache.d.ts +1 -1
- package/dist/types/compute-engine/engine-common-symbols.d.ts +1 -1
- package/dist/types/compute-engine/engine-compilation-targets.d.ts +1 -1
- package/dist/types/compute-engine/engine-configuration-lifecycle.d.ts +1 -1
- package/dist/types/compute-engine/engine-declarations.d.ts +1 -1
- package/dist/types/compute-engine/engine-expression-entrypoints.d.ts +1 -1
- package/dist/types/compute-engine/engine-extension-contracts.d.ts +1 -1
- package/dist/types/compute-engine/engine-library-bootstrap.d.ts +1 -1
- package/dist/types/compute-engine/engine-numeric-configuration.d.ts +1 -1
- package/dist/types/compute-engine/engine-runtime-state.d.ts +1 -1
- package/dist/types/compute-engine/engine-scope.d.ts +1 -1
- package/dist/types/compute-engine/engine-sequences.d.ts +1 -1
- package/dist/types/compute-engine/engine-simplification-rules.d.ts +1 -1
- package/dist/types/compute-engine/engine-startup-coordinator.d.ts +1 -1
- package/dist/types/compute-engine/engine-type-resolver.d.ts +1 -1
- package/dist/types/compute-engine/engine-validation-entrypoints.d.ts +1 -1
- package/dist/types/compute-engine/free-functions.d.ts +1 -1
- package/dist/types/compute-engine/function-properties/index.d.ts +1 -1
- package/dist/types/compute-engine/function-utils.d.ts +1 -1
- package/dist/types/compute-engine/fungrim/loader.d.ts +1 -1
- package/dist/types/compute-engine/fungrim/types.d.ts +1 -1
- package/dist/types/compute-engine/global-types.d.ts +1 -1
- package/dist/types/compute-engine/index.d.ts +10 -1
- package/dist/types/compute-engine/interval/arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/interval/comparison.d.ts +1 -1
- package/dist/types/compute-engine/interval/elementary.d.ts +1 -1
- package/dist/types/compute-engine/interval/index.d.ts +1 -1
- package/dist/types/compute-engine/interval/trigonometric.d.ts +1 -1
- package/dist/types/compute-engine/interval/types.d.ts +1 -1
- package/dist/types/compute-engine/interval/util.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/default-dictionary.d.ts +1 -1
- 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-colors.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-units.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/dictionary/indexed-types.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/latex-syntax.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse-number.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse-symbol.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/parse.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serialize-dms.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/serializer.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/types.d.ts +1 -1
- package/dist/types/compute-engine/latex-syntax/utils.d.ts +1 -1
- package/dist/types/compute-engine/library/arithmetic.d.ts +1 -1
- package/dist/types/compute-engine/library/calculus.d.ts +1 -1
- package/dist/types/compute-engine/library/collections.d.ts +1 -1
- package/dist/types/compute-engine/library/colors.d.ts +1 -1
- package/dist/types/compute-engine/library/combinatorics.d.ts +1 -1
- 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/fractals.d.ts +1 -1
- package/dist/types/compute-engine/library/library.d.ts +1 -1
- package/dist/types/compute-engine/library/linear-algebra.d.ts +1 -1
- package/dist/types/compute-engine/library/logic-analysis.d.ts +1 -1
- package/dist/types/compute-engine/library/logic.d.ts +1 -1
- package/dist/types/compute-engine/library/number-theory.d.ts +1 -1
- package/dist/types/compute-engine/library/polynomials.d.ts +1 -1
- package/dist/types/compute-engine/library/quantity-arithmetic.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/special-functions.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/type-handlers.d.ts +1 -1
- package/dist/types/compute-engine/library/unit-data.d.ts +1 -1
- package/dist/types/compute-engine/library/units.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 +1 -1
- package/dist/types/compute-engine/numeric-value/exact-numeric-value.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/machine-numeric-value.d.ts +1 -1
- package/dist/types/compute-engine/numeric-value/types.d.ts +1 -1
- package/dist/types/compute-engine/numerics/bernoulli.d.ts +1 -1
- package/dist/types/compute-engine/numerics/bigint.d.ts +1 -1
- package/dist/types/compute-engine/numerics/complex-esm-augment.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/linear-algebra.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 +1 -1
- package/dist/types/compute-engine/numerics/oscillatory-quadrature.d.ts +1 -1
- package/dist/types/compute-engine/numerics/polynomial-roots.d.ts +1 -1
- package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
- package/dist/types/compute-engine/numerics/random.d.ts +1 -1
- package/dist/types/compute-engine/numerics/rationals.d.ts +1 -1
- package/dist/types/compute-engine/numerics/richardson.d.ts +1 -1
- package/dist/types/compute-engine/numerics/special-functions.d.ts +1 -1
- package/dist/types/compute-engine/numerics/statistics.d.ts +1 -1
- package/dist/types/compute-engine/numerics/strings.d.ts +1 -1
- package/dist/types/compute-engine/numerics/types.d.ts +1 -1
- package/dist/types/compute-engine/numerics/unit-data.d.ts +1 -1
- package/dist/types/compute-engine/oeis.d.ts +1 -1
- package/dist/types/compute-engine/rubi/compile.d.ts +1 -1
- package/dist/types/compute-engine/rubi/driver.d.ts +1 -1
- package/dist/types/compute-engine/rubi/loader.d.ts +1 -1
- package/dist/types/compute-engine/rubi/match.d.ts +1 -1
- package/dist/types/compute-engine/rubi/normal-form.d.ts +1 -1
- package/dist/types/compute-engine/rubi/rubi-utils.d.ts +1 -1
- package/dist/types/compute-engine/rubi/types.d.ts +1 -1
- package/dist/types/compute-engine/sequence.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/antiderivative.d.ts +1 -1
- 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/fu-cost.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/fu-transforms.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/fu.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/limit.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/logic-utils.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/residue.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-abs.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-divide.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-factorial.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-hyperbolic.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-infinity.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-log.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-logic.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-power.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-product.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-rules.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-sum.d.ts +1 -1
- package/dist/types/compute-engine/symbolic/simplify-trig.d.ts +1 -1
- package/dist/types/compute-engine/tensor/tensor-fields.d.ts +1 -1
- package/dist/types/compute-engine/tensor/tensors.d.ts +1 -1
- package/dist/types/compute-engine/types-definitions.d.ts +1 -1
- package/dist/types/compute-engine/types-engine.d.ts +11 -1
- package/dist/types/compute-engine/types-evaluation.d.ts +1 -1
- package/dist/types/compute-engine/types-expression.d.ts +1 -1
- package/dist/types/compute-engine/types-kernel-evaluation.d.ts +1 -1
- package/dist/types/compute-engine/types-kernel-serialization.d.ts +1 -1
- package/dist/types/compute-engine/types-serialization.d.ts +1 -1
- package/dist/types/compute-engine/types.d.ts +1 -1
- package/dist/types/compute-engine.d.ts +1 -1
- package/dist/types/core.d.ts +1 -1
- package/dist/types/identities.d.ts +1 -1
- package/dist/types/integration-rules.d.ts +1 -1
- package/dist/types/interval.d.ts +1 -1
- package/dist/types/latex-syntax.d.ts +2 -2
- package/dist/types/math-json/symbols.d.ts +1 -1
- package/dist/types/math-json/types.d.ts +1 -1
- package/dist/types/math-json/utils.d.ts +1 -1
- package/dist/types/math-json.d.ts +2 -2
- package/dist/types/numerics.d.ts +1 -1
- package/package.json +1 -1
package/dist/compile.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** Compile 0.
|
|
1
|
+
/** Compile 0.61.0 */
|
|
2
2
|
(function(global,factory){typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : typeof define === 'function' && define.amd ? define(['exports'],factory):(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Compile = {}));})(this, (function (exports) { 'use strict';
|
|
3
3
|
"use strict";
|
|
4
4
|
var Compile = (() => {
|
|
@@ -26,6 +26,7 @@ var Compile = (() => {
|
|
|
26
26
|
BaseCompiler: () => BaseCompiler,
|
|
27
27
|
GLSLTarget: () => GLSLTarget,
|
|
28
28
|
GPUShaderTarget: () => GPUShaderTarget,
|
|
29
|
+
IntervalGLSLTarget: () => IntervalGLSLTarget,
|
|
29
30
|
IntervalJavaScriptTarget: () => IntervalJavaScriptTarget,
|
|
30
31
|
JavaScriptTarget: () => JavaScriptTarget,
|
|
31
32
|
PythonTarget: () => PythonTarget,
|
|
@@ -4558,10 +4559,18 @@ var Compile = (() => {
|
|
|
4558
4559
|
}
|
|
4559
4560
|
function canonicalFunctionLiteralArguments(ce, ops) {
|
|
4560
4561
|
if (ops.length === 0) return void 0;
|
|
4561
|
-
const block = ops[0].operator === "Block" ? ops[0].canonical : ce.function("Block", [ops[0]]);
|
|
4562
4562
|
const params = ops.slice(1).map(
|
|
4563
4563
|
(x) => isSymbol2(x) ? x : ce.error("expected-a-symbol", x.toString())
|
|
4564
4564
|
);
|
|
4565
|
+
ce._pushShadowedParameters(
|
|
4566
|
+
params.filter((p) => isSymbol2(p)).map((p) => p.symbol)
|
|
4567
|
+
);
|
|
4568
|
+
let block;
|
|
4569
|
+
try {
|
|
4570
|
+
block = ops[0].operator === "Block" ? ops[0].canonical : ce.function("Block", [ops[0]]);
|
|
4571
|
+
} finally {
|
|
4572
|
+
ce._popShadowedParameters();
|
|
4573
|
+
}
|
|
4565
4574
|
console.assert(block.isScoped);
|
|
4566
4575
|
for (const param of params) {
|
|
4567
4576
|
if (isSymbol2(param) && !block.localScope.bindings.has(param.symbol)) {
|
|
@@ -16755,6 +16764,13 @@ ${lines.join("\n")}`;
|
|
|
16755
16764
|
|
|
16756
16765
|
// src/compute-engine/compilation/base-compiler.ts
|
|
16757
16766
|
var BaseCompiler = class _BaseCompiler {
|
|
16767
|
+
/**
|
|
16768
|
+
* Precedence used when compiling a folded symbol value. Higher than any
|
|
16769
|
+
* target's infix operator precedence, so a compound value parenthesizes
|
|
16770
|
+
* itself when spliced into a surrounding expression. See
|
|
16771
|
+
* `tryFoldKnownSymbol`.
|
|
16772
|
+
*/
|
|
16773
|
+
static FOLD_OPERAND_PREC = 1e3;
|
|
16758
16774
|
/**
|
|
16759
16775
|
* Compile an expression to target language source code
|
|
16760
16776
|
*/
|
|
@@ -16771,7 +16787,9 @@ ${lines.join("\n")}`;
|
|
|
16771
16787
|
if (op !== void 0) {
|
|
16772
16788
|
return `(a,b) => a ${op[0]} b`;
|
|
16773
16789
|
}
|
|
16774
|
-
|
|
16790
|
+
const resolved = target.var?.(s);
|
|
16791
|
+
if (resolved !== void 0) return resolved;
|
|
16792
|
+
return _BaseCompiler.tryFoldKnownSymbol(expr.engine, s, target) ?? s;
|
|
16775
16793
|
}
|
|
16776
16794
|
if (isNumber(expr)) {
|
|
16777
16795
|
if (expr.im !== 0) {
|
|
@@ -17097,10 +17115,10 @@ ${lines.join("\n")}`;
|
|
|
17097
17115
|
)
|
|
17098
17116
|
);
|
|
17099
17117
|
const needsWrap2 = target.number(0) !== "0";
|
|
17100
|
-
const bodyTarget2 =
|
|
17118
|
+
const bodyTarget2 = {
|
|
17101
17119
|
...target,
|
|
17102
|
-
var: (id) => loopVarSet.has(id) ? target.number(0).replace("0", id) : target.var(id)
|
|
17103
|
-
}
|
|
17120
|
+
var: (id) => loopVarSet.has(id) ? needsWrap2 ? target.number(0).replace("0", id) : id : target.var(id)
|
|
17121
|
+
};
|
|
17104
17122
|
const bodyCode = _BaseCompiler.compile(body, bodyTarget2);
|
|
17105
17123
|
let inner = `result.push(${bodyCode});`;
|
|
17106
17124
|
for (let i = narrowedElements.length - 1; i >= 0; i--) {
|
|
@@ -17398,6 +17416,167 @@ ${lines.join("\n")}`;
|
|
|
17398
17416
|
if (isNumber(expr)) return expr.im === 0 && expr.re >= 0;
|
|
17399
17417
|
return expr.isNonNegative === true;
|
|
17400
17418
|
}
|
|
17419
|
+
/**
|
|
17420
|
+
* If `id` names a symbol that is *known* to the engine — it has an assigned
|
|
17421
|
+
* value (`ce.assign("a", 1.5)`) or is a declared constant — return the
|
|
17422
|
+
* compiled target code for that value, i.e. **fold** the value into the
|
|
17423
|
+
* generated code the way `evaluate()` does. Returns `undefined` for a
|
|
17424
|
+
* genuinely free symbol (no value), so the caller falls back to its
|
|
17425
|
+
* free-symbol plumbing (a `vars` mapping, a `_.id` argument lookup, or a
|
|
17426
|
+
* declarable identifier).
|
|
17427
|
+
*
|
|
17428
|
+
* This keeps the compiled output consistent with `expr.unknowns` and
|
|
17429
|
+
* `evaluate()`: a symbol they treat as known (folded / dropped) is also
|
|
17430
|
+
* folded by `compile()`, instead of being emitted as a bare, dangling
|
|
17431
|
+
* reference (an undeclared GLSL identifier, or a bare JS global that throws
|
|
17432
|
+
* `ReferenceError` at run time).
|
|
17433
|
+
*
|
|
17434
|
+
* Callers MUST resolve any `vars` mapping for `id` **before** calling this,
|
|
17435
|
+
* so an explicitly `vars`-mapped symbol is never folded — the GPU/JS live
|
|
17436
|
+
* path relies on a mapped symbol staying a per-frame uniform / argument.
|
|
17437
|
+
*
|
|
17438
|
+
* `target` is the in-flight target: nested symbols inside the value resolve
|
|
17439
|
+
* through the same `vars`/constant/fold rules as the top-level expression.
|
|
17440
|
+
*
|
|
17441
|
+
* The value is compiled at a high precedence so a compound (operator) value
|
|
17442
|
+
* self-parenthesizes: folding `b = c + 1` into `b * x` must yield
|
|
17443
|
+
* `(c + 1) * x`, not `c + 1 * x`, and must stay safe when a handler splices
|
|
17444
|
+
* the folded string into its own expression (e.g. `Power`'s `(code * code)`).
|
|
17445
|
+
* An atomic value (number, symbol, function call) ignores the precedence, so
|
|
17446
|
+
* no redundant parentheses are added in the common assigned-number case.
|
|
17447
|
+
*/
|
|
17448
|
+
static tryFoldKnownSymbol(engine, id, target) {
|
|
17449
|
+
const value = engine._getSymbolValue(id);
|
|
17450
|
+
if (value === void 0) return void 0;
|
|
17451
|
+
return _BaseCompiler.compile(value, target, _BaseCompiler.FOLD_OPERAND_PREC);
|
|
17452
|
+
}
|
|
17453
|
+
/**
|
|
17454
|
+
* Operator heads the compiler lowers directly in `compileExpr`, independent
|
|
17455
|
+
* of any target operator/function mapping (control-flow, binding, and
|
|
17456
|
+
* indexing-set forms). `analyzeReferences` never reports these as
|
|
17457
|
+
* "unsupported".
|
|
17458
|
+
*/
|
|
17459
|
+
static STRUCTURAL_HEADS = /* @__PURE__ */ new Set([
|
|
17460
|
+
"Sequence",
|
|
17461
|
+
"Sum",
|
|
17462
|
+
"Product",
|
|
17463
|
+
"Function",
|
|
17464
|
+
"Declare",
|
|
17465
|
+
"Assign",
|
|
17466
|
+
"Return",
|
|
17467
|
+
"Break",
|
|
17468
|
+
"Continue",
|
|
17469
|
+
"Loop",
|
|
17470
|
+
"If",
|
|
17471
|
+
"Which",
|
|
17472
|
+
"When",
|
|
17473
|
+
"Block",
|
|
17474
|
+
// Indexing-set wrappers consumed by Sum/Product/Loop — never compiled
|
|
17475
|
+
// standalone.
|
|
17476
|
+
"Limits",
|
|
17477
|
+
"Element"
|
|
17478
|
+
]);
|
|
17479
|
+
/**
|
|
17480
|
+
* Analyze — without compiling, and never throwing — which external references
|
|
17481
|
+
* the generated code for `expr` would have on `target`:
|
|
17482
|
+
*
|
|
17483
|
+
* - `freeSymbols`: identifiers the caller must supply at run time. These are
|
|
17484
|
+
* the free symbols *as codegen sees them*: symbols with no value in the
|
|
17485
|
+
* engine, after descending into the values of folded (assigned / constant)
|
|
17486
|
+
* symbols — so `a = b + 1` surfaces `b`, which `expr.unknowns` misses — and
|
|
17487
|
+
* after excluding bound variables (lambda parameters, indices of
|
|
17488
|
+
* `Sum`/`Product`/`Integrate`/`Loop`, `Block` locals). A `vars`-mapped
|
|
17489
|
+
* symbol is always included: the mapping makes it an external input even
|
|
17490
|
+
* when it also has an assigned value.
|
|
17491
|
+
*
|
|
17492
|
+
* - `unsupported`: operator heads with no operator/function mapping in the
|
|
17493
|
+
* target and not one of the structural forms above.
|
|
17494
|
+
*
|
|
17495
|
+
* Lets a caller validate that a compiled result is self-contained
|
|
17496
|
+
* (`freeSymbols` covered by its inputs, `unsupported` empty) declaratively,
|
|
17497
|
+
* instead of executing or GPU-compiling the code to discover a dangling
|
|
17498
|
+
* reference or an unlowerable operator.
|
|
17499
|
+
*/
|
|
17500
|
+
static analyzeReferences(expr, target, varsKeys) {
|
|
17501
|
+
const engine = expr.engine;
|
|
17502
|
+
const free = /* @__PURE__ */ new Set();
|
|
17503
|
+
const unsupported = /* @__PURE__ */ new Set();
|
|
17504
|
+
const foldedSeen = /* @__PURE__ */ new Set();
|
|
17505
|
+
const union = (a, more) => {
|
|
17506
|
+
const s = new Set(a);
|
|
17507
|
+
for (const m of more) s.add(m);
|
|
17508
|
+
return s;
|
|
17509
|
+
};
|
|
17510
|
+
const visit = (e, bound) => {
|
|
17511
|
+
if (isSymbol2(e)) {
|
|
17512
|
+
const s = e.symbol;
|
|
17513
|
+
if (bound.has(s)) return;
|
|
17514
|
+
if (target.operators?.(s) !== void 0) return;
|
|
17515
|
+
if (varsKeys?.has(s)) {
|
|
17516
|
+
free.add(s);
|
|
17517
|
+
return;
|
|
17518
|
+
}
|
|
17519
|
+
const value = engine._getSymbolValue(s);
|
|
17520
|
+
if (value !== void 0) {
|
|
17521
|
+
if (!foldedSeen.has(s)) {
|
|
17522
|
+
foldedSeen.add(s);
|
|
17523
|
+
visit(value, bound);
|
|
17524
|
+
}
|
|
17525
|
+
return;
|
|
17526
|
+
}
|
|
17527
|
+
free.add(s);
|
|
17528
|
+
return;
|
|
17529
|
+
}
|
|
17530
|
+
if (!isFunction2(e)) return;
|
|
17531
|
+
const h = e.operator;
|
|
17532
|
+
const ops = e.ops;
|
|
17533
|
+
if (h !== "Error" && !_BaseCompiler.STRUCTURAL_HEADS.has(h) && target.functions?.(h) === void 0 && target.operators?.(h) === void 0)
|
|
17534
|
+
unsupported.add(h);
|
|
17535
|
+
if (h === "Function") {
|
|
17536
|
+
const params = ops.slice(1).filter((p) => isSymbol2(p)).map((p) => p.symbol);
|
|
17537
|
+
visit(ops[0], params.length ? union(bound, params) : bound);
|
|
17538
|
+
return;
|
|
17539
|
+
}
|
|
17540
|
+
if (h === "Sum" || h === "Product" || h === "Integrate" || h === "Loop") {
|
|
17541
|
+
const indices = [];
|
|
17542
|
+
const limitExprs = [];
|
|
17543
|
+
for (const clause of ops.slice(1)) {
|
|
17544
|
+
if (isFunction2(clause)) {
|
|
17545
|
+
if (isSymbol2(clause.ops[0])) indices.push(clause.ops[0].symbol);
|
|
17546
|
+
for (const sub2 of clause.ops.slice(1)) limitExprs.push(sub2);
|
|
17547
|
+
} else {
|
|
17548
|
+
limitExprs.push(clause);
|
|
17549
|
+
}
|
|
17550
|
+
}
|
|
17551
|
+
visit(ops[0], indices.length ? union(bound, indices) : bound);
|
|
17552
|
+
for (const le of limitExprs) visit(le, bound);
|
|
17553
|
+
return;
|
|
17554
|
+
}
|
|
17555
|
+
if (h === "Block") {
|
|
17556
|
+
const locals = [];
|
|
17557
|
+
for (const stmt of ops)
|
|
17558
|
+
if (isFunction2(stmt, "Declare") && isSymbol2(stmt.ops[0]))
|
|
17559
|
+
locals.push(stmt.ops[0].symbol);
|
|
17560
|
+
const inner = locals.length ? union(bound, locals) : bound;
|
|
17561
|
+
for (const op of ops) visit(op, inner);
|
|
17562
|
+
return;
|
|
17563
|
+
}
|
|
17564
|
+
for (const op of ops) visit(op, bound);
|
|
17565
|
+
};
|
|
17566
|
+
visit(expr, /* @__PURE__ */ new Set());
|
|
17567
|
+
return { freeSymbols: [...free], unsupported: [...unsupported] };
|
|
17568
|
+
}
|
|
17569
|
+
/**
|
|
17570
|
+
* Attach `freeSymbols` / `unsupported` (from `analyzeReferences`) to a
|
|
17571
|
+
* compilation result, returning the same object. Used by the built-in
|
|
17572
|
+
* targets to make every result carry its declarative reference analysis.
|
|
17573
|
+
*/
|
|
17574
|
+
static withReferences(result, expr, target, varsKeys) {
|
|
17575
|
+
return Object.assign(
|
|
17576
|
+
result,
|
|
17577
|
+
_BaseCompiler.analyzeReferences(expr, target, varsKeys)
|
|
17578
|
+
);
|
|
17579
|
+
}
|
|
17401
17580
|
/**
|
|
17402
17581
|
* Generate a temporary variable name
|
|
17403
17582
|
*/
|
|
@@ -17545,11 +17724,16 @@ ${lines.join("\n")}`;
|
|
|
17545
17724
|
try {
|
|
17546
17725
|
if (options?.target) {
|
|
17547
17726
|
const code = BaseCompiler.compile(expr, options.target);
|
|
17548
|
-
return
|
|
17549
|
-
|
|
17550
|
-
|
|
17551
|
-
|
|
17552
|
-
|
|
17727
|
+
return BaseCompiler.withReferences(
|
|
17728
|
+
{
|
|
17729
|
+
target: options.target.language ?? "custom",
|
|
17730
|
+
success: true,
|
|
17731
|
+
code
|
|
17732
|
+
},
|
|
17733
|
+
expr,
|
|
17734
|
+
options.target,
|
|
17735
|
+
options.vars ? new Set(Object.keys(options.vars)) : void 0
|
|
17736
|
+
);
|
|
17553
17737
|
}
|
|
17554
17738
|
const targetName = options?.to ?? "javascript";
|
|
17555
17739
|
const languageTarget = expr.engine.getCompilationTarget(targetName);
|
|
@@ -17568,11 +17752,26 @@ ${lines.join("\n")}`;
|
|
|
17568
17752
|
});
|
|
17569
17753
|
} catch (e) {
|
|
17570
17754
|
if (options?.fallback ?? true) {
|
|
17755
|
+
const error = e.message;
|
|
17571
17756
|
console.warn(
|
|
17572
|
-
`Compilation fallback for "${expr.operator}" (target: ${options?.to ?? "javascript"}): ${
|
|
17757
|
+
`Compilation fallback for "${expr.operator}" (target: ${options?.to ?? "javascript"}): ${error}`
|
|
17573
17758
|
);
|
|
17574
17759
|
const ce = expr.engine;
|
|
17575
17760
|
const target = options?.to ?? "javascript";
|
|
17761
|
+
let refs = {
|
|
17762
|
+
freeSymbols: [],
|
|
17763
|
+
unsupported: []
|
|
17764
|
+
};
|
|
17765
|
+
try {
|
|
17766
|
+
const compileTarget = options?.target ?? expr.engine.getCompilationTarget(target)?.createTarget();
|
|
17767
|
+
if (compileTarget)
|
|
17768
|
+
refs = BaseCompiler.analyzeReferences(
|
|
17769
|
+
expr,
|
|
17770
|
+
compileTarget,
|
|
17771
|
+
options?.vars ? new Set(Object.keys(options.vars)) : void 0
|
|
17772
|
+
);
|
|
17773
|
+
} catch {
|
|
17774
|
+
}
|
|
17576
17775
|
if (isFunction2(expr, "Function")) {
|
|
17577
17776
|
const lambdaRun = ((...args) => ce.function("Apply", [expr, ...args.map((a) => ce.expr(a))]).evaluate().re);
|
|
17578
17777
|
return {
|
|
@@ -17580,7 +17779,9 @@ ${lines.join("\n")}`;
|
|
|
17580
17779
|
success: false,
|
|
17581
17780
|
code: "",
|
|
17582
17781
|
calling: "lambda",
|
|
17583
|
-
run: lambdaRun
|
|
17782
|
+
run: lambdaRun,
|
|
17783
|
+
error,
|
|
17784
|
+
...refs
|
|
17584
17785
|
};
|
|
17585
17786
|
}
|
|
17586
17787
|
const fallbackRun = ((vars) => {
|
|
@@ -17599,7 +17800,9 @@ ${lines.join("\n")}`;
|
|
|
17599
17800
|
success: false,
|
|
17600
17801
|
code: "",
|
|
17601
17802
|
calling: "expression",
|
|
17602
|
-
run: fallbackRun
|
|
17803
|
+
run: fallbackRun,
|
|
17804
|
+
error,
|
|
17805
|
+
...refs
|
|
17603
17806
|
};
|
|
17604
17807
|
}
|
|
17605
17808
|
throw e;
|
|
@@ -17608,6 +17811,10 @@ ${lines.join("\n")}`;
|
|
|
17608
17811
|
|
|
17609
17812
|
// src/compute-engine/compilation/constant-folding.ts
|
|
17610
17813
|
function formatFloat(n) {
|
|
17814
|
+
if (!Number.isFinite(n))
|
|
17815
|
+
throw new Error(
|
|
17816
|
+
`Cannot compile the non-finite value \`${n}\` to a GPU shader: GLSL/WGSL have no infinity or NaN literals.`
|
|
17817
|
+
);
|
|
17611
17818
|
const str = n.toString();
|
|
17612
17819
|
if (!str.includes(".") && !str.includes("e") && !str.includes("E")) {
|
|
17613
17820
|
return `${str}.0`;
|
|
@@ -21897,6 +22104,442 @@ ${lines.join("\n")}`;
|
|
|
21897
22104
|
function sinc(x) {
|
|
21898
22105
|
return x === 0 ? 1 : Math.sin(x) / x;
|
|
21899
22106
|
}
|
|
22107
|
+
function erfi(x) {
|
|
22108
|
+
if (Number.isNaN(x)) return NaN;
|
|
22109
|
+
if (x === 0) return 0;
|
|
22110
|
+
if (!Number.isFinite(x)) return x > 0 ? Infinity : -Infinity;
|
|
22111
|
+
const sign2 = x < 0 ? -1 : 1;
|
|
22112
|
+
const ax = Math.abs(x);
|
|
22113
|
+
const x2 = ax * ax;
|
|
22114
|
+
let term = ax;
|
|
22115
|
+
let sum = ax;
|
|
22116
|
+
for (let n = 1; n < 1e3; n++) {
|
|
22117
|
+
term *= x2 * (2 * n - 1) / (n * (2 * n + 1));
|
|
22118
|
+
sum += term;
|
|
22119
|
+
if (term < sum * 1e-18) break;
|
|
22120
|
+
}
|
|
22121
|
+
return sign2 * (2 / Math.sqrt(Math.PI)) * sum;
|
|
22122
|
+
}
|
|
22123
|
+
var EULER_GAMMA = 0.5772156649015329;
|
|
22124
|
+
function cisi(x) {
|
|
22125
|
+
const EPS = 1e-16;
|
|
22126
|
+
const TMIN = 2;
|
|
22127
|
+
const BIG = 1e30;
|
|
22128
|
+
const t = Math.abs(x);
|
|
22129
|
+
if (t === 0) return { si: 0, ci: -Infinity };
|
|
22130
|
+
if (!Number.isFinite(t))
|
|
22131
|
+
return { si: x > 0 ? Math.PI / 2 : -Math.PI / 2, ci: 0 };
|
|
22132
|
+
let si;
|
|
22133
|
+
let ci;
|
|
22134
|
+
if (t > TMIN) {
|
|
22135
|
+
let br = 1;
|
|
22136
|
+
const bi = t;
|
|
22137
|
+
let cr = BIG;
|
|
22138
|
+
let cim = 0;
|
|
22139
|
+
let denom = br * br + bi * bi;
|
|
22140
|
+
let dr = br / denom;
|
|
22141
|
+
let di = -bi / denom;
|
|
22142
|
+
let hr = dr;
|
|
22143
|
+
let hi = di;
|
|
22144
|
+
for (let i = 1; i < 100; i++) {
|
|
22145
|
+
const a = -i * i;
|
|
22146
|
+
br += 2;
|
|
22147
|
+
let tr = a * dr + br;
|
|
22148
|
+
let ti = a * di + bi;
|
|
22149
|
+
denom = tr * tr + ti * ti;
|
|
22150
|
+
dr = tr / denom;
|
|
22151
|
+
di = -ti / denom;
|
|
22152
|
+
denom = cr * cr + cim * cim;
|
|
22153
|
+
cr = br + a * cr / denom;
|
|
22154
|
+
cim = bi - a * cim / denom;
|
|
22155
|
+
const delr = cr * dr - cim * di;
|
|
22156
|
+
const deli = cr * di + cim * dr;
|
|
22157
|
+
tr = hr * delr - hi * deli;
|
|
22158
|
+
ti = hr * deli + hi * delr;
|
|
22159
|
+
hr = tr;
|
|
22160
|
+
hi = ti;
|
|
22161
|
+
if (Math.abs(delr - 1) + Math.abs(deli) <= EPS) break;
|
|
22162
|
+
}
|
|
22163
|
+
const ct = Math.cos(t);
|
|
22164
|
+
const st = Math.sin(t);
|
|
22165
|
+
const reH = ct * hr + st * hi;
|
|
22166
|
+
const imH = ct * hi - st * hr;
|
|
22167
|
+
ci = -reH;
|
|
22168
|
+
si = Math.PI / 2 + imH;
|
|
22169
|
+
} else {
|
|
22170
|
+
let sum = 0;
|
|
22171
|
+
let sums = 0;
|
|
22172
|
+
let sumc = 0;
|
|
22173
|
+
let sign2 = 1;
|
|
22174
|
+
let fact = 1;
|
|
22175
|
+
let odd = true;
|
|
22176
|
+
for (let k = 1; k <= 100; k++) {
|
|
22177
|
+
fact *= t / k;
|
|
22178
|
+
const term = fact / k;
|
|
22179
|
+
sum += sign2 * term;
|
|
22180
|
+
const err = term / Math.abs(sum);
|
|
22181
|
+
if (odd) {
|
|
22182
|
+
sign2 = -sign2;
|
|
22183
|
+
sums = sum;
|
|
22184
|
+
sum = sumc;
|
|
22185
|
+
} else {
|
|
22186
|
+
sumc = sum;
|
|
22187
|
+
sum = sums;
|
|
22188
|
+
}
|
|
22189
|
+
if (err < EPS) break;
|
|
22190
|
+
odd = !odd;
|
|
22191
|
+
}
|
|
22192
|
+
si = sums;
|
|
22193
|
+
ci = sumc + Math.log(t) + EULER_GAMMA;
|
|
22194
|
+
}
|
|
22195
|
+
if (x < 0) si = -si;
|
|
22196
|
+
return { si, ci };
|
|
22197
|
+
}
|
|
22198
|
+
function sinIntegral(x) {
|
|
22199
|
+
if (Number.isNaN(x)) return NaN;
|
|
22200
|
+
return cisi(x).si;
|
|
22201
|
+
}
|
|
22202
|
+
function cosIntegral(x) {
|
|
22203
|
+
if (Number.isNaN(x)) return NaN;
|
|
22204
|
+
return cisi(x).ci;
|
|
22205
|
+
}
|
|
22206
|
+
function expInt1(x) {
|
|
22207
|
+
const EPS = 1e-16;
|
|
22208
|
+
const MAXIT = 200;
|
|
22209
|
+
if (x <= 0) return NaN;
|
|
22210
|
+
if (x <= 1) {
|
|
22211
|
+
let sum = -Math.log(x) - EULER_GAMMA;
|
|
22212
|
+
let fact = 1;
|
|
22213
|
+
for (let n = 1; n <= MAXIT; n++) {
|
|
22214
|
+
fact *= -x / n;
|
|
22215
|
+
const del = -fact / n;
|
|
22216
|
+
sum += del;
|
|
22217
|
+
if (Math.abs(del) < Math.abs(sum) * EPS) break;
|
|
22218
|
+
}
|
|
22219
|
+
return sum;
|
|
22220
|
+
}
|
|
22221
|
+
const BIG = 1e30;
|
|
22222
|
+
let b = x + 1;
|
|
22223
|
+
let c = BIG;
|
|
22224
|
+
let d = 1 / b;
|
|
22225
|
+
let h = d;
|
|
22226
|
+
for (let i = 1; i <= MAXIT; i++) {
|
|
22227
|
+
const a = -i * i;
|
|
22228
|
+
b += 2;
|
|
22229
|
+
d = 1 / (a * d + b);
|
|
22230
|
+
c = b + a / c;
|
|
22231
|
+
const del = c * d;
|
|
22232
|
+
h *= del;
|
|
22233
|
+
if (Math.abs(del - 1) <= EPS) break;
|
|
22234
|
+
}
|
|
22235
|
+
return h * Math.exp(-x);
|
|
22236
|
+
}
|
|
22237
|
+
function expIntegralEi(x) {
|
|
22238
|
+
if (Number.isNaN(x)) return NaN;
|
|
22239
|
+
if (x === 0) return -Infinity;
|
|
22240
|
+
if (!Number.isFinite(x)) return x > 0 ? Infinity : 0;
|
|
22241
|
+
if (x < 0) return -expInt1(-x);
|
|
22242
|
+
const EPS = 1e-16;
|
|
22243
|
+
const MAXIT = 200;
|
|
22244
|
+
const SWITCH = -Math.log(EPS);
|
|
22245
|
+
if (x <= SWITCH) {
|
|
22246
|
+
let sum2 = 0;
|
|
22247
|
+
let fact = 1;
|
|
22248
|
+
for (let k = 1; k <= MAXIT; k++) {
|
|
22249
|
+
fact *= x / k;
|
|
22250
|
+
const term2 = fact / k;
|
|
22251
|
+
sum2 += term2;
|
|
22252
|
+
if (term2 < EPS * sum2) break;
|
|
22253
|
+
}
|
|
22254
|
+
return sum2 + Math.log(x) + EULER_GAMMA;
|
|
22255
|
+
}
|
|
22256
|
+
let sum = 0;
|
|
22257
|
+
let term = 1;
|
|
22258
|
+
for (let k = 1; k <= MAXIT; k++) {
|
|
22259
|
+
const prev = term;
|
|
22260
|
+
term *= k / x;
|
|
22261
|
+
if (term < EPS) break;
|
|
22262
|
+
if (term < prev) sum += term;
|
|
22263
|
+
else {
|
|
22264
|
+
sum -= prev;
|
|
22265
|
+
break;
|
|
22266
|
+
}
|
|
22267
|
+
}
|
|
22268
|
+
return Math.exp(x) * (1 + sum) / x;
|
|
22269
|
+
}
|
|
22270
|
+
function logIntegral(x) {
|
|
22271
|
+
if (Number.isNaN(x)) return NaN;
|
|
22272
|
+
if (x === 0) return 0;
|
|
22273
|
+
if (x === 1) return -Infinity;
|
|
22274
|
+
if (x < 0) return NaN;
|
|
22275
|
+
return expIntegralEi(Math.log(x));
|
|
22276
|
+
}
|
|
22277
|
+
function agm(a, b) {
|
|
22278
|
+
if (Number.isNaN(a) || Number.isNaN(b)) return NaN;
|
|
22279
|
+
if (a < 0 || b < 0) return NaN;
|
|
22280
|
+
if (a === 0 || b === 0) return 0;
|
|
22281
|
+
if (!isFinite(a) || !isFinite(b)) return Infinity;
|
|
22282
|
+
for (let i = 0; i < 64 && Math.abs(a - b) > 1e-17 * Math.abs(a); i++) {
|
|
22283
|
+
const an = 0.5 * (a + b);
|
|
22284
|
+
b = Math.sqrt(a * b);
|
|
22285
|
+
a = an;
|
|
22286
|
+
}
|
|
22287
|
+
return 0.5 * (a + b);
|
|
22288
|
+
}
|
|
22289
|
+
function ellipticK(m) {
|
|
22290
|
+
if (Number.isNaN(m)) return NaN;
|
|
22291
|
+
if (m === 1) return Infinity;
|
|
22292
|
+
if (m > 1) return NaN;
|
|
22293
|
+
return Math.PI / (2 * agm(1, Math.sqrt(1 - m)));
|
|
22294
|
+
}
|
|
22295
|
+
function ellipticE(m) {
|
|
22296
|
+
if (Number.isNaN(m)) return NaN;
|
|
22297
|
+
if (m === 1) return 1;
|
|
22298
|
+
if (m > 1) return NaN;
|
|
22299
|
+
let a = 1;
|
|
22300
|
+
let b = Math.sqrt(1 - m);
|
|
22301
|
+
let sum = 0.5 * m;
|
|
22302
|
+
let pow2 = 0.5;
|
|
22303
|
+
for (let i = 0; i < 64 && Math.abs(a - b) > 1e-17 * a; i++) {
|
|
22304
|
+
const c = 0.5 * (a - b);
|
|
22305
|
+
const an = 0.5 * (a + b);
|
|
22306
|
+
b = Math.sqrt(a * b);
|
|
22307
|
+
a = an;
|
|
22308
|
+
pow2 *= 2;
|
|
22309
|
+
sum += pow2 * c * c;
|
|
22310
|
+
}
|
|
22311
|
+
const K = Math.PI / (2 * a);
|
|
22312
|
+
return K * (1 - sum);
|
|
22313
|
+
}
|
|
22314
|
+
var CARLSON_TOL = 1e-24;
|
|
22315
|
+
function carlsonRC(x, y) {
|
|
22316
|
+
if (Number.isNaN(x) || Number.isNaN(y) || x < 0) return NaN;
|
|
22317
|
+
if (y === 0) return Infinity;
|
|
22318
|
+
if (x === 0) return Math.PI / (2 * Math.sqrt(y));
|
|
22319
|
+
if (y < 0) return Math.sqrt(x / (x - y)) * carlsonRC(x - y, -y);
|
|
22320
|
+
if (x === y) return 1 / Math.sqrt(x);
|
|
22321
|
+
const e = (y - x) / x;
|
|
22322
|
+
if (Math.abs(e) < 0.01) {
|
|
22323
|
+
let sum = 0;
|
|
22324
|
+
let term = 1;
|
|
22325
|
+
for (let k = 0; k < 10; k++) {
|
|
22326
|
+
sum += term / (2 * k + 1);
|
|
22327
|
+
term *= -e;
|
|
22328
|
+
}
|
|
22329
|
+
return sum / Math.sqrt(x);
|
|
22330
|
+
}
|
|
22331
|
+
const a = Math.sqrt(x / y);
|
|
22332
|
+
return x < y ? Math.acos(a) / Math.sqrt(y - x) : Math.acosh(a) / Math.sqrt(x - y);
|
|
22333
|
+
}
|
|
22334
|
+
function carlsonRF(x, y, z) {
|
|
22335
|
+
if (Number.isNaN(x) || Number.isNaN(y) || Number.isNaN(z)) return NaN;
|
|
22336
|
+
if (x < 0 || y < 0 || z < 0) return NaN;
|
|
22337
|
+
if ((x === 0 ? 1 : 0) + (y === 0 ? 1 : 0) + (z === 0 ? 1 : 0) > 1)
|
|
22338
|
+
return Infinity;
|
|
22339
|
+
if (y === z) return carlsonRC(x, y);
|
|
22340
|
+
if (x === z) return carlsonRC(y, x);
|
|
22341
|
+
if (x === y) return carlsonRC(z, x);
|
|
22342
|
+
const A0 = (x + y + z) / 3;
|
|
22343
|
+
const Q = Math.pow(3 * CARLSON_TOL, -1 / 6) * Math.max(Math.abs(A0 - x), Math.abs(A0 - y), Math.abs(A0 - z));
|
|
22344
|
+
let [xm, ym, zm] = [x, y, z];
|
|
22345
|
+
let A = A0;
|
|
22346
|
+
let pow4 = 1;
|
|
22347
|
+
for (let i = 0; i < 64 && pow4 * Q >= Math.abs(A); i++) {
|
|
22348
|
+
const sx = Math.sqrt(xm);
|
|
22349
|
+
const sy = Math.sqrt(ym);
|
|
22350
|
+
const sz = Math.sqrt(zm);
|
|
22351
|
+
const lm = sx * sy + sx * sz + sy * sz;
|
|
22352
|
+
A = (A + lm) / 4;
|
|
22353
|
+
xm = (xm + lm) / 4;
|
|
22354
|
+
ym = (ym + lm) / 4;
|
|
22355
|
+
zm = (zm + lm) / 4;
|
|
22356
|
+
pow4 /= 4;
|
|
22357
|
+
}
|
|
22358
|
+
const t = pow4 / A;
|
|
22359
|
+
const Xc = (A0 - x) * t;
|
|
22360
|
+
const Yc = (A0 - y) * t;
|
|
22361
|
+
const Zc = -Xc - Yc;
|
|
22362
|
+
const E2 = Xc * Yc - Zc * Zc;
|
|
22363
|
+
const E3 = Xc * Yc * Zc;
|
|
22364
|
+
return Math.pow(A, -0.5) * (9240 - 924 * E2 + 385 * E2 * E2 + 660 * E3 - 630 * E2 * E3) / 9240;
|
|
22365
|
+
}
|
|
22366
|
+
function carlsonRJ(x, y, z, p) {
|
|
22367
|
+
if (Number.isNaN(x) || Number.isNaN(y) || Number.isNaN(z) || Number.isNaN(p))
|
|
22368
|
+
return NaN;
|
|
22369
|
+
if (x < 0 || y < 0 || z < 0) return NaN;
|
|
22370
|
+
if (p === 0) return Infinity;
|
|
22371
|
+
if ((x === 0 ? 1 : 0) + (y === 0 ? 1 : 0) + (z === 0 ? 1 : 0) > 1)
|
|
22372
|
+
return Infinity;
|
|
22373
|
+
if (p < 0) {
|
|
22374
|
+
const [a, b, c] = [x, y, z].sort((u, v2) => u - v2);
|
|
22375
|
+
const q = -p;
|
|
22376
|
+
const pn = (c * (a + b + q) - a * b) / (c + q);
|
|
22377
|
+
let v = (pn - c) * carlsonRJ(a, b, c, pn);
|
|
22378
|
+
v -= 3 * carlsonRF(a, b, c);
|
|
22379
|
+
v += 3 * Math.sqrt(a * b * c / (a * b + pn * q)) * carlsonRC(a * b + pn * q, pn * q);
|
|
22380
|
+
return v / (c + q);
|
|
22381
|
+
}
|
|
22382
|
+
const A0 = (x + y + z + 2 * p) / 5;
|
|
22383
|
+
const delta = (p - x) * (p - y) * (p - z);
|
|
22384
|
+
const Q = Math.pow(0.25 * CARLSON_TOL, -1 / 6) * Math.max(
|
|
22385
|
+
Math.abs(A0 - x),
|
|
22386
|
+
Math.abs(A0 - y),
|
|
22387
|
+
Math.abs(A0 - z),
|
|
22388
|
+
Math.abs(A0 - p)
|
|
22389
|
+
);
|
|
22390
|
+
let [xm, ym, zm, pm] = [x, y, z, p];
|
|
22391
|
+
let A = A0;
|
|
22392
|
+
let pow4 = 1;
|
|
22393
|
+
let S = 0;
|
|
22394
|
+
for (let i = 0; i < 64; i++) {
|
|
22395
|
+
const sx = Math.sqrt(xm);
|
|
22396
|
+
const sy = Math.sqrt(ym);
|
|
22397
|
+
const sz = Math.sqrt(zm);
|
|
22398
|
+
const sp = Math.sqrt(pm);
|
|
22399
|
+
const lm = sx * sy + sx * sz + sy * sz;
|
|
22400
|
+
const A1 = (A + lm) / 4;
|
|
22401
|
+
xm = (xm + lm) / 4;
|
|
22402
|
+
ym = (ym + lm) / 4;
|
|
22403
|
+
zm = (zm + lm) / 4;
|
|
22404
|
+
pm = (pm + lm) / 4;
|
|
22405
|
+
const dm = (sp + sx) * (sp + sy) * (sp + sz);
|
|
22406
|
+
const em = delta * pow4 * pow4 * pow4 / (dm * dm);
|
|
22407
|
+
if (pow4 * Q < Math.abs(A)) break;
|
|
22408
|
+
S += carlsonRC(1, 1 + em) * pow4 / dm;
|
|
22409
|
+
pow4 /= 4;
|
|
22410
|
+
A = A1;
|
|
22411
|
+
}
|
|
22412
|
+
const t = pow4 / A;
|
|
22413
|
+
const X = (A0 - x) * t;
|
|
22414
|
+
const Y = (A0 - y) * t;
|
|
22415
|
+
const Z = (A0 - z) * t;
|
|
22416
|
+
const P = (-X - Y - Z) / 2;
|
|
22417
|
+
const E2 = X * Y + X * Z + Y * Z - 3 * P * P;
|
|
22418
|
+
const E3 = X * Y * Z + 2 * E2 * P + 4 * P * P * P;
|
|
22419
|
+
const E4 = (2 * X * Y * Z + E2 * P + 3 * P * P * P) * P;
|
|
22420
|
+
const E5 = X * Y * Z * P * P;
|
|
22421
|
+
const series = (24024 - 5148 * E2 + 2457 * E2 * E2 + 4004 * E3 - 4158 * E2 * E3 - 3276 * E4 + 2772 * E5) / 24024;
|
|
22422
|
+
return pow4 * Math.pow(A, -1.5) * series + 6 * S;
|
|
22423
|
+
}
|
|
22424
|
+
function carlsonRD(x, y, z) {
|
|
22425
|
+
return carlsonRJ(x, y, z, z);
|
|
22426
|
+
}
|
|
22427
|
+
function ellipticF(phi, m) {
|
|
22428
|
+
if (Number.isNaN(phi) || Number.isNaN(m)) return NaN;
|
|
22429
|
+
if (Math.abs(phi) > Math.PI / 2) {
|
|
22430
|
+
const k = Math.round(phi / Math.PI);
|
|
22431
|
+
const K = ellipticK(m);
|
|
22432
|
+
if (!Number.isFinite(K)) return NaN;
|
|
22433
|
+
return 2 * k * K + ellipticF(phi - k * Math.PI, m);
|
|
22434
|
+
}
|
|
22435
|
+
const s = Math.sin(phi);
|
|
22436
|
+
const y = 1 - m * s * s;
|
|
22437
|
+
if (y < 0) return NaN;
|
|
22438
|
+
const c = Math.cos(phi);
|
|
22439
|
+
return s * carlsonRF(c * c, y, 1);
|
|
22440
|
+
}
|
|
22441
|
+
function ellipticEIncomplete(phi, m) {
|
|
22442
|
+
if (Number.isNaN(phi) || Number.isNaN(m)) return NaN;
|
|
22443
|
+
if (Math.abs(phi) > Math.PI / 2) {
|
|
22444
|
+
const k = Math.round(phi / Math.PI);
|
|
22445
|
+
const E = ellipticE(m);
|
|
22446
|
+
if (!Number.isFinite(E)) return NaN;
|
|
22447
|
+
return 2 * k * E + ellipticEIncomplete(phi - k * Math.PI, m);
|
|
22448
|
+
}
|
|
22449
|
+
const s = Math.sin(phi);
|
|
22450
|
+
const y = 1 - m * s * s;
|
|
22451
|
+
if (y < 0) return NaN;
|
|
22452
|
+
const c = Math.cos(phi);
|
|
22453
|
+
const s3 = s * s * s;
|
|
22454
|
+
return s * carlsonRF(c * c, y, 1) - m / 3 * s3 * carlsonRD(c * c, y, 1);
|
|
22455
|
+
}
|
|
22456
|
+
function ellipticPiComplete(n, m) {
|
|
22457
|
+
if (Number.isNaN(n) || Number.isNaN(m)) return NaN;
|
|
22458
|
+
if (n === 1 || m === 1) return Infinity;
|
|
22459
|
+
if (m > 1) return NaN;
|
|
22460
|
+
return carlsonRF(0, 1 - m, 1) + n / 3 * carlsonRJ(0, 1 - m, 1, 1 - n);
|
|
22461
|
+
}
|
|
22462
|
+
function ellipticPiIncomplete(n, phi, m) {
|
|
22463
|
+
if (Number.isNaN(n) || Number.isNaN(phi) || Number.isNaN(m)) return NaN;
|
|
22464
|
+
if (Math.abs(phi) > Math.PI / 2) {
|
|
22465
|
+
const k = Math.round(phi / Math.PI);
|
|
22466
|
+
const P = ellipticPiComplete(n, m);
|
|
22467
|
+
if (!Number.isFinite(P)) return NaN;
|
|
22468
|
+
return 2 * k * P + ellipticPiIncomplete(n, phi - k * Math.PI, m);
|
|
22469
|
+
}
|
|
22470
|
+
const s = Math.sin(phi);
|
|
22471
|
+
const y = 1 - m * s * s;
|
|
22472
|
+
if (y < 0) return NaN;
|
|
22473
|
+
const c = Math.cos(phi);
|
|
22474
|
+
const s3 = s * s * s;
|
|
22475
|
+
const p = 1 - n * s * s;
|
|
22476
|
+
if (p === 0) return Infinity;
|
|
22477
|
+
return s * carlsonRF(c * c, y, 1) + n / 3 * s3 * carlsonRJ(c * c, y, 1, p);
|
|
22478
|
+
}
|
|
22479
|
+
function isNonPositiveInteger(x) {
|
|
22480
|
+
return Number.isInteger(x) && x <= 0;
|
|
22481
|
+
}
|
|
22482
|
+
function gauss2F1Series(a, b, c, z, maxTerms = 1e4) {
|
|
22483
|
+
let term = 1;
|
|
22484
|
+
let sum = 1;
|
|
22485
|
+
for (let n = 0; n < maxTerms; n++) {
|
|
22486
|
+
term *= (a + n) * (b + n) * z / ((c + n) * (n + 1));
|
|
22487
|
+
if (term === 0) return sum;
|
|
22488
|
+
sum += term;
|
|
22489
|
+
if (n > 2 && Math.abs(term) <= Number.EPSILON * Math.abs(sum)) return sum;
|
|
22490
|
+
}
|
|
22491
|
+
return sum;
|
|
22492
|
+
}
|
|
22493
|
+
function hypergeometric2F1(a, b, c, z) {
|
|
22494
|
+
if ([a, b, c, z].some(Number.isNaN)) return NaN;
|
|
22495
|
+
const aTerm = isNonPositiveInteger(a) ? -a : Infinity;
|
|
22496
|
+
const bTerm = isNonPositiveInteger(b) ? -b : Infinity;
|
|
22497
|
+
const nTerms = Math.min(aTerm, bTerm);
|
|
22498
|
+
if (isNonPositiveInteger(c)) {
|
|
22499
|
+
if (nTerms === Infinity || nTerms > -c) return NaN;
|
|
22500
|
+
}
|
|
22501
|
+
if (nTerms !== Infinity) return gauss2F1Series(a, b, c, z, nTerms + 1);
|
|
22502
|
+
if (z === 0) return 1;
|
|
22503
|
+
if (z === 1) {
|
|
22504
|
+
const s2 = c - a - b;
|
|
22505
|
+
if (s2 <= 0) return s2 === 0 ? Infinity : NaN;
|
|
22506
|
+
return gamma(c) * gamma(s2) / (gamma(c - a) * gamma(c - b));
|
|
22507
|
+
}
|
|
22508
|
+
if (z > 1) return NaN;
|
|
22509
|
+
if (z < 0) {
|
|
22510
|
+
return Math.pow(1 - z, -a) * hypergeometric2F1(a, c - b, c, z / (z - 1));
|
|
22511
|
+
}
|
|
22512
|
+
if (z <= 0.5) return gauss2F1Series(a, b, c, z);
|
|
22513
|
+
const s = c - a - b;
|
|
22514
|
+
if (Number.isInteger(s)) {
|
|
22515
|
+
if (z <= 0.95) return gauss2F1Series(a, b, c, z, 1e6);
|
|
22516
|
+
return NaN;
|
|
22517
|
+
}
|
|
22518
|
+
const t1 = gamma(c) * gamma(s) / (gamma(c - a) * gamma(c - b)) * gauss2F1Series(a, b, 1 - s, 1 - z);
|
|
22519
|
+
const t2 = gamma(c) * gamma(-s) / (gamma(a) * gamma(b)) * Math.pow(1 - z, s) * gauss2F1Series(c - a, c - b, 1 + s, 1 - z);
|
|
22520
|
+
return t1 + t2;
|
|
22521
|
+
}
|
|
22522
|
+
function kummer1F1Series(a, b, z, maxTerms = 2e4) {
|
|
22523
|
+
let term = 1;
|
|
22524
|
+
let sum = 1;
|
|
22525
|
+
for (let n = 0; n < maxTerms; n++) {
|
|
22526
|
+
term *= (a + n) * z / ((b + n) * (n + 1));
|
|
22527
|
+
if (term === 0) return sum;
|
|
22528
|
+
sum += term;
|
|
22529
|
+
if (n > 2 && Math.abs(term) <= Number.EPSILON * Math.abs(sum)) return sum;
|
|
22530
|
+
}
|
|
22531
|
+
return sum;
|
|
22532
|
+
}
|
|
22533
|
+
function hypergeometric1F1(a, b, z) {
|
|
22534
|
+
if ([a, b, z].some(Number.isNaN)) return NaN;
|
|
22535
|
+
const aTerm = isNonPositiveInteger(a) ? -a : Infinity;
|
|
22536
|
+
if (isNonPositiveInteger(b)) {
|
|
22537
|
+
if (aTerm === Infinity || aTerm > -b) return NaN;
|
|
22538
|
+
}
|
|
22539
|
+
if (aTerm !== Infinity) return kummer1F1Series(a, b, z, aTerm + 1);
|
|
22540
|
+
if (z < 0) return Math.exp(z) * hypergeometric1F1(b - a, b, -z);
|
|
22541
|
+
return kummer1F1Series(a, b, z);
|
|
22542
|
+
}
|
|
21900
22543
|
|
|
21901
22544
|
// src/compute-engine/boxed-expression/expand.ts
|
|
21902
22545
|
var binomials = [
|
|
@@ -22616,6 +23259,7 @@ ${lines.join("\n")}`;
|
|
|
22616
23259
|
Erf: "_SYS.erf",
|
|
22617
23260
|
Erfc: "_SYS.erfc",
|
|
22618
23261
|
ErfInv: "_SYS.erfInv",
|
|
23262
|
+
Erfi: "_SYS.erfi",
|
|
22619
23263
|
// Special functions
|
|
22620
23264
|
Beta: "_SYS.beta",
|
|
22621
23265
|
Digamma: "_SYS.digamma",
|
|
@@ -22631,6 +23275,30 @@ ${lines.join("\n")}`;
|
|
|
22631
23275
|
// Airy functions
|
|
22632
23276
|
AiryAi: "_SYS.airyAi",
|
|
22633
23277
|
AiryBi: "_SYS.airyBi",
|
|
23278
|
+
// Exponential / trigonometric / logarithmic integrals. These are the closed
|
|
23279
|
+
// forms the antiderivative engine emits (e.g. ∫sin x/x dx = SinIntegral(x)),
|
|
23280
|
+
// so an "evaluate then compile" pipeline must be able to lower them.
|
|
23281
|
+
SinIntegral: "_SYS.sinIntegral",
|
|
23282
|
+
CosIntegral: "_SYS.cosIntegral",
|
|
23283
|
+
ExpIntegralEi: "_SYS.expIntegralEi",
|
|
23284
|
+
LogIntegral: "_SYS.logIntegral",
|
|
23285
|
+
// Arithmetic-geometric mean and elliptic integrals (parameter convention
|
|
23286
|
+
// m = k², as in the library). `AGM`, `EllipticE`, and `EllipticPi` are
|
|
23287
|
+
// arity-overloaded — the handlers mirror the library's evaluate dispatch.
|
|
23288
|
+
AGM: (args, compile2) => args.length === 1 ? `_SYS.agm(1, ${compile2(args[0])})` : `_SYS.agm(${compile2(args[0])}, ${compile2(args[1])})`,
|
|
23289
|
+
EllipticK: "_SYS.ellipticK",
|
|
23290
|
+
EllipticE: (args, compile2) => args.length === 2 ? `_SYS.ellipticEIncomplete(${compile2(args[0])}, ${compile2(args[1])})` : `_SYS.ellipticE(${compile2(args[0])})`,
|
|
23291
|
+
EllipticF: (args, compile2) => `_SYS.ellipticF(${compile2(args[0])}, ${compile2(args[1])})`,
|
|
23292
|
+
EllipticPi: (args, compile2) => args.length === 3 ? `_SYS.ellipticPiIncomplete(${compile2(args[0])}, ${compile2(
|
|
23293
|
+
args[1]
|
|
23294
|
+
)}, ${compile2(args[2])})` : `_SYS.ellipticPiComplete(${compile2(args[0])}, ${compile2(args[1])})`,
|
|
23295
|
+
// Hypergeometric functions.
|
|
23296
|
+
Hypergeometric2F1: (args, compile2) => `_SYS.hypergeometric2F1(${compile2(args[0])}, ${compile2(args[1])}, ${compile2(
|
|
23297
|
+
args[2]
|
|
23298
|
+
)}, ${compile2(args[3])})`,
|
|
23299
|
+
Hypergeometric1F1: (args, compile2) => `_SYS.hypergeometric1F1(${compile2(args[0])}, ${compile2(args[1])}, ${compile2(
|
|
23300
|
+
args[2]
|
|
23301
|
+
)})`,
|
|
22634
23302
|
// Combinatorics
|
|
22635
23303
|
Mandelbrot: ([c, maxIter], compile2) => {
|
|
22636
23304
|
if (c === null || maxIter === null)
|
|
@@ -22643,6 +23311,8 @@ ${lines.join("\n")}`;
|
|
|
22643
23311
|
return `_SYS.julia(${compile2(z)}, ${compile2(c)}, ${compile2(maxIter)})`;
|
|
22644
23312
|
},
|
|
22645
23313
|
Binomial: (args, compile2) => `_SYS.binomial(${compile2(args[0])}, ${compile2(args[1])})`,
|
|
23314
|
+
// Choose(n, k) is the binomial coefficient — same runtime helper.
|
|
23315
|
+
Choose: (args, compile2) => `_SYS.binomial(${compile2(args[0])}, ${compile2(args[1])})`,
|
|
22646
23316
|
Fibonacci: "_SYS.fibonacci",
|
|
22647
23317
|
// Complex-specific functions
|
|
22648
23318
|
Real: (args, compile2) => {
|
|
@@ -23148,6 +23818,20 @@ ${lines.join("\n")}`;
|
|
|
23148
23818
|
sinc,
|
|
23149
23819
|
fresnelS,
|
|
23150
23820
|
fresnelC,
|
|
23821
|
+
sinIntegral,
|
|
23822
|
+
cosIntegral,
|
|
23823
|
+
expIntegralEi,
|
|
23824
|
+
logIntegral,
|
|
23825
|
+
erfi,
|
|
23826
|
+
agm,
|
|
23827
|
+
ellipticK,
|
|
23828
|
+
ellipticE,
|
|
23829
|
+
ellipticEIncomplete,
|
|
23830
|
+
ellipticF,
|
|
23831
|
+
ellipticPiComplete,
|
|
23832
|
+
ellipticPiIncomplete,
|
|
23833
|
+
hypergeometric2F1,
|
|
23834
|
+
hypergeometric1F1,
|
|
23151
23835
|
mandelbrot: (c, maxIter) => {
|
|
23152
23836
|
let zx = 0, zy = 0;
|
|
23153
23837
|
const cx = typeof c === "number" ? c : c.re;
|
|
@@ -23334,7 +24018,7 @@ ${lines.join("\n")}`;
|
|
|
23334
24018
|
functions: (id) => namedFunctions?.[id] ? namedFunctions[id] : JAVASCRIPT_FUNCTIONS[id],
|
|
23335
24019
|
var: (id) => {
|
|
23336
24020
|
if (vars && id in vars) return JSON.stringify(vars[id]);
|
|
23337
|
-
const
|
|
24021
|
+
const result2 = {
|
|
23338
24022
|
Pi: "Math.PI",
|
|
23339
24023
|
ExponentialE: "Math.E",
|
|
23340
24024
|
NaN: "Number.NaN",
|
|
@@ -23345,13 +24029,20 @@ ${lines.join("\n")}`;
|
|
|
23345
24029
|
CatalanConstant: "0.91596559417721901",
|
|
23346
24030
|
EulerGamma: "0.57721566490153286"
|
|
23347
24031
|
}[id];
|
|
23348
|
-
if (
|
|
24032
|
+
if (result2 !== void 0) return result2;
|
|
23349
24033
|
if (unknowns.includes(id)) return `_.${id}`;
|
|
23350
|
-
return void 0;
|
|
24034
|
+
if (expr.engine._getSymbolValue(id) !== void 0) return void 0;
|
|
24035
|
+
return `_.${id}`;
|
|
23351
24036
|
},
|
|
23352
24037
|
preamble: (preamble ?? "") + preambleImports
|
|
23353
24038
|
});
|
|
23354
|
-
|
|
24039
|
+
const result = compileToTarget(expr, target, realOnly);
|
|
24040
|
+
return BaseCompiler.withReferences(
|
|
24041
|
+
result,
|
|
24042
|
+
expr,
|
|
24043
|
+
target,
|
|
24044
|
+
vars ? new Set(Object.keys(vars)) : void 0
|
|
24045
|
+
);
|
|
23355
24046
|
}
|
|
23356
24047
|
};
|
|
23357
24048
|
function wrapRealOnly(result) {
|
|
@@ -25922,6 +26613,10 @@ fn _gpu_apca(lch_bg: vec3f, lch_fg: vec3f) -> f32 {
|
|
|
25922
26613
|
EulerGamma: "0.57721566490"
|
|
25923
26614
|
};
|
|
25924
26615
|
function formatGPUNumber(n) {
|
|
26616
|
+
if (!Number.isFinite(n))
|
|
26617
|
+
throw new Error(
|
|
26618
|
+
`Cannot compile the non-finite value \`${n}\` to a GPU shader: GLSL/WGSL have no infinity or NaN literals.`
|
|
26619
|
+
);
|
|
25925
26620
|
const str = n.toString();
|
|
25926
26621
|
if (!str.includes(".") && !str.includes("e") && !str.includes("E")) {
|
|
25927
26622
|
return `${str}.0`;
|
|
@@ -25949,7 +26644,7 @@ fn _gpu_apca(lch_bg: vec3f, lch_fg: vec3f) -> f32 {
|
|
|
25949
26644
|
var: (id) => {
|
|
25950
26645
|
if (id === "ImaginaryUnit") return `${v2}(0.0, 1.0)`;
|
|
25951
26646
|
if (id in constants) return constants[id];
|
|
25952
|
-
return
|
|
26647
|
+
return void 0;
|
|
25953
26648
|
},
|
|
25954
26649
|
string: (str) => JSON.stringify(str),
|
|
25955
26650
|
number: formatGPUNumber,
|
|
@@ -25988,7 +26683,7 @@ fn _gpu_apca(lch_bg: vec3f, lch_fg: vec3f) -> f32 {
|
|
|
25988
26683
|
if (vars && id in vars) return vars[id];
|
|
25989
26684
|
if (id === "ImaginaryUnit") return `${v2}(0.0, 1.0)`;
|
|
25990
26685
|
if (id in constants) return constants[id];
|
|
25991
|
-
return
|
|
26686
|
+
return void 0;
|
|
25992
26687
|
}
|
|
25993
26688
|
});
|
|
25994
26689
|
const code = BaseCompiler.compile(expr, target);
|
|
@@ -26028,7 +26723,12 @@ fn _gpu_apca(lch_bg: vec3f, lch_fg: vec3f) -> f32 {
|
|
|
26028
26723
|
preamble += this.languageId === "wgsl" ? GPU_COLOR_PREAMBLE_WGSL : GPU_COLOR_PREAMBLE_GLSL;
|
|
26029
26724
|
}
|
|
26030
26725
|
if (preamble) result.preamble = preamble;
|
|
26031
|
-
return
|
|
26726
|
+
return BaseCompiler.withReferences(
|
|
26727
|
+
result,
|
|
26728
|
+
expr,
|
|
26729
|
+
target,
|
|
26730
|
+
vars ? new Set(Object.keys(vars)) : void 0
|
|
26731
|
+
);
|
|
26032
26732
|
}
|
|
26033
26733
|
compileToSource(expr, _options = {}) {
|
|
26034
26734
|
const target = this.createTarget();
|
|
@@ -26061,6 +26761,8 @@ fn _gpu_apca(lch_bg: vec3f, lch_fg: vec3f) -> f32 {
|
|
|
26061
26761
|
Tuple: compileGLSLList
|
|
26062
26762
|
};
|
|
26063
26763
|
var GLSLTarget = class extends GPUShaderTarget {
|
|
26764
|
+
// Annotated `string` (not the literal `'glsl'`) so subclasses such as
|
|
26765
|
+
// `IntervalGLSLTarget` can override it while reusing the GLSL shader assembly.
|
|
26064
26766
|
languageId = "glsl";
|
|
26065
26767
|
getLanguageSpecificFunctions() {
|
|
26066
26768
|
return GLSL_FUNCTIONS;
|
|
@@ -26581,7 +27283,17 @@ ${workgroupAttr}fn main(${paramStr})${returnStr} {
|
|
|
26581
27283
|
*/
|
|
26582
27284
|
compile(expr, options = {}) {
|
|
26583
27285
|
const code = this.compileToSource(expr, options);
|
|
26584
|
-
|
|
27286
|
+
const result = {
|
|
27287
|
+
target: "python",
|
|
27288
|
+
success: true,
|
|
27289
|
+
code
|
|
27290
|
+
};
|
|
27291
|
+
return BaseCompiler.withReferences(
|
|
27292
|
+
result,
|
|
27293
|
+
expr,
|
|
27294
|
+
this.createTarget(),
|
|
27295
|
+
options.vars ? new Set(Object.keys(options.vars)) : void 0
|
|
27296
|
+
);
|
|
26585
27297
|
}
|
|
26586
27298
|
/**
|
|
26587
27299
|
* Compile an expression to Python source code
|
|
@@ -28438,11 +29150,18 @@ ${code}`;
|
|
|
28438
29150
|
};
|
|
28439
29151
|
if (id in constants) return constants[id];
|
|
28440
29152
|
if (unknowns.includes(id)) return `_.${id}`;
|
|
28441
|
-
return void 0;
|
|
29153
|
+
if (expr.engine._getSymbolValue(id) !== void 0) return void 0;
|
|
29154
|
+
return `_.${id}`;
|
|
28442
29155
|
},
|
|
28443
29156
|
preamble: (preamble ?? "") + preambleImports
|
|
28444
29157
|
});
|
|
28445
|
-
|
|
29158
|
+
const result = compileToIntervalTarget(expr, target);
|
|
29159
|
+
return BaseCompiler.withReferences(
|
|
29160
|
+
result,
|
|
29161
|
+
expr,
|
|
29162
|
+
target,
|
|
29163
|
+
vars ? new Set(Object.keys(vars)) : void 0
|
|
29164
|
+
);
|
|
28446
29165
|
}
|
|
28447
29166
|
};
|
|
28448
29167
|
function compileToIntervalTarget(expr, target) {
|
|
@@ -28466,8 +29185,534 @@ ${code}`;
|
|
|
28466
29185
|
};
|
|
28467
29186
|
}
|
|
28468
29187
|
|
|
29188
|
+
// src/compute-engine/compilation/interval-glsl-target.ts
|
|
29189
|
+
var IV_INF = "1e18";
|
|
29190
|
+
var INTERVAL_GLSL_PREAMBLE = `
|
|
29191
|
+
const float IV_INF = ${IV_INF};
|
|
29192
|
+
const vec2 IV_ENTIRE = vec2(-IV_INF, IV_INF);
|
|
29193
|
+
const vec2 IV_EMPTY = vec2(IV_INF, -IV_INF);
|
|
29194
|
+
|
|
29195
|
+
bool _iv_is_empty(vec2 a) { return a.x > a.y; }
|
|
29196
|
+
|
|
29197
|
+
// Clamp bounds to the finite sentinel range. Preserves IV_EMPTY (its components
|
|
29198
|
+
// already sit at the sentinels) and folds any overflowed intermediate back to
|
|
29199
|
+
// the sentinel (min(inf, IV_INF) = IV_INF), so a real \`inf\` never escapes an op.
|
|
29200
|
+
vec2 _iv_clamp(vec2 a) { return clamp(a, -IV_INF, IV_INF); }
|
|
29201
|
+
|
|
29202
|
+
// Exact empty propagation: force empty if any operand is empty.
|
|
29203
|
+
vec2 _iv_guard1(vec2 r, vec2 a) { return _iv_is_empty(a) ? IV_EMPTY : r; }
|
|
29204
|
+
vec2 _iv_guard2(vec2 r, vec2 a, vec2 b) {
|
|
29205
|
+
return (_iv_is_empty(a) || _iv_is_empty(b)) ? IV_EMPTY : r;
|
|
29206
|
+
}
|
|
29207
|
+
|
|
29208
|
+
vec2 _iv_negate(vec2 a) { return _iv_guard1(_iv_clamp(vec2(-a.y, -a.x)), a); }
|
|
29209
|
+
|
|
29210
|
+
vec2 _iv_add(vec2 a, vec2 b) {
|
|
29211
|
+
return _iv_guard2(_iv_clamp(vec2(a.x + b.x, a.y + b.y)), a, b);
|
|
29212
|
+
}
|
|
29213
|
+
|
|
29214
|
+
vec2 _iv_sub(vec2 a, vec2 b) {
|
|
29215
|
+
return _iv_guard2(_iv_clamp(vec2(a.x - b.y, a.y - b.x)), a, b);
|
|
29216
|
+
}
|
|
29217
|
+
|
|
29218
|
+
vec2 _iv_mul(vec2 a, vec2 b) {
|
|
29219
|
+
float p1 = a.x * b.x, p2 = a.x * b.y, p3 = a.y * b.x, p4 = a.y * b.y;
|
|
29220
|
+
vec2 r = vec2(min(min(p1, p2), min(p3, p4)), max(max(p1, p2), max(p3, p4)));
|
|
29221
|
+
return _iv_guard2(_iv_clamp(r), a, b);
|
|
29222
|
+
}
|
|
29223
|
+
|
|
29224
|
+
vec2 _iv_div(vec2 a, vec2 b) {
|
|
29225
|
+
// Denominator spanning 0 \u2192 entire (wide, never narrow): the CPU pass turns
|
|
29226
|
+
// the pole into a proper asymptote break.
|
|
29227
|
+
bool spansZero = (b.x <= 0.0 && b.y >= 0.0);
|
|
29228
|
+
float q1 = a.x / b.x, q2 = a.x / b.y, q3 = a.y / b.x, q4 = a.y / b.y;
|
|
29229
|
+
vec2 r = vec2(min(min(q1, q2), min(q3, q4)), max(max(q1, q2), max(q3, q4)));
|
|
29230
|
+
r = spansZero ? IV_ENTIRE : r;
|
|
29231
|
+
return _iv_guard2(_iv_clamp(r), a, b);
|
|
29232
|
+
}
|
|
29233
|
+
|
|
29234
|
+
vec2 _iv_square(vec2 a) {
|
|
29235
|
+
float lo2 = a.x * a.x, hi2 = a.y * a.y;
|
|
29236
|
+
// Straddles 0 \u21D2 min is 0; otherwise the smaller endpoint\xB2 is the min.
|
|
29237
|
+
float lo = (a.x <= 0.0 && a.y >= 0.0) ? 0.0 : min(lo2, hi2);
|
|
29238
|
+
return _iv_guard1(_iv_clamp(vec2(lo, max(lo2, hi2))), a);
|
|
29239
|
+
}
|
|
29240
|
+
|
|
29241
|
+
// Scalar integer power that is correct for negative bases (GLSL \`pow\` requires
|
|
29242
|
+
// a non-negative base): keep the sign for odd exponents, drop it for even.
|
|
29243
|
+
float _iv_powi_scalar(float x, float n) {
|
|
29244
|
+
float a = pow(abs(x), n);
|
|
29245
|
+
return (mod(n, 2.0) == 1.0 && x < 0.0) ? -a : a;
|
|
29246
|
+
}
|
|
29247
|
+
|
|
29248
|
+
vec2 _iv_powi(vec2 a, float n) {
|
|
29249
|
+
float pl = _iv_powi_scalar(a.x, n);
|
|
29250
|
+
float ph = _iv_powi_scalar(a.y, n);
|
|
29251
|
+
bool even = (mod(n, 2.0) == 0.0);
|
|
29252
|
+
bool straddle = (a.x <= 0.0 && a.y >= 0.0);
|
|
29253
|
+
float lo = even ? (straddle ? 0.0 : min(pl, ph)) : pl;
|
|
29254
|
+
float hi = even ? max(pl, ph) : ph;
|
|
29255
|
+
return _iv_guard1(_iv_clamp(vec2(lo, hi)), a);
|
|
29256
|
+
}
|
|
29257
|
+
|
|
29258
|
+
// \u2500\u2500 Phase 2: elementary functions \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
29259
|
+
|
|
29260
|
+
vec2 _iv_abs(vec2 a) {
|
|
29261
|
+
float al = abs(a.x), ah = abs(a.y);
|
|
29262
|
+
bool straddle = (a.x <= 0.0 && a.y >= 0.0);
|
|
29263
|
+
return _iv_guard1(_iv_clamp(vec2(straddle ? 0.0 : min(al, ah), max(al, ah))), a);
|
|
29264
|
+
}
|
|
29265
|
+
|
|
29266
|
+
// Domain x \u2265 0: fully-negative box \u2192 empty; a box straddling 0 clamps lo to 0.
|
|
29267
|
+
vec2 _iv_sqrt(vec2 a) {
|
|
29268
|
+
vec2 r = vec2(sqrt(max(a.x, 0.0)), sqrt(max(a.y, 0.0)));
|
|
29269
|
+
r = (a.y < 0.0) ? IV_EMPTY : r;
|
|
29270
|
+
return _iv_guard1(_iv_clamp(r), a);
|
|
29271
|
+
}
|
|
29272
|
+
|
|
29273
|
+
vec2 _iv_exp(vec2 a) {
|
|
29274
|
+
return _iv_guard1(_iv_clamp(vec2(exp(a.x), exp(a.y))), a);
|
|
29275
|
+
}
|
|
29276
|
+
|
|
29277
|
+
// Domain x > 0: fully-\u22640 box \u2192 empty; straddling box \u2192 lo clamped to \u2212IV_INF
|
|
29278
|
+
// (ln \u2192 \u2212\u221E as x \u2192 0\u207A, never a real \u2212inf).
|
|
29279
|
+
vec2 _iv_ln(vec2 a) {
|
|
29280
|
+
vec2 r = vec2(a.x > 0.0 ? log(a.x) : -IV_INF, log(a.y));
|
|
29281
|
+
r = (a.y <= 0.0) ? IV_EMPTY : r;
|
|
29282
|
+
return _iv_guard1(_iv_clamp(r), a);
|
|
29283
|
+
}
|
|
29284
|
+
|
|
29285
|
+
const float _IV_INV_LN10 = 0.43429448190325176;
|
|
29286
|
+
const float _IV_INV_LN2 = 1.4426950408889634;
|
|
29287
|
+
|
|
29288
|
+
vec2 _iv_log10(vec2 a) {
|
|
29289
|
+
vec2 r = vec2(a.x > 0.0 ? log(a.x) * _IV_INV_LN10 : -IV_INF, log(a.y) * _IV_INV_LN10);
|
|
29290
|
+
r = (a.y <= 0.0) ? IV_EMPTY : r;
|
|
29291
|
+
return _iv_guard1(_iv_clamp(r), a);
|
|
29292
|
+
}
|
|
29293
|
+
|
|
29294
|
+
vec2 _iv_log2(vec2 a) {
|
|
29295
|
+
vec2 r = vec2(a.x > 0.0 ? log(a.x) * _IV_INV_LN2 : -IV_INF, log(a.y) * _IV_INV_LN2);
|
|
29296
|
+
r = (a.y <= 0.0) ? IV_EMPTY : r;
|
|
29297
|
+
return _iv_guard1(_iv_clamp(r), a);
|
|
29298
|
+
}
|
|
29299
|
+
|
|
29300
|
+
// Non-integer power. Real only for base \u2265 0: fully-negative box \u2192 empty; a box
|
|
29301
|
+
// straddling 0 clamps the base low end to 0. \`p\` is a compile-time constant, so
|
|
29302
|
+
// the \`p >= 0\` test is a constant branch.
|
|
29303
|
+
vec2 _iv_powf(vec2 a, float p) {
|
|
29304
|
+
float lob = max(a.x, 0.0);
|
|
29305
|
+
float e0 = pow(lob, p), e1 = pow(a.y, p);
|
|
29306
|
+
vec2 r = (p >= 0.0) ? vec2(e0, e1) : vec2(e1, e0);
|
|
29307
|
+
r = (a.y < 0.0) ? IV_EMPTY : r;
|
|
29308
|
+
return _iv_guard1(_iv_clamp(r), a);
|
|
29309
|
+
}
|
|
29310
|
+
|
|
29311
|
+
// \u2500\u2500 Phase 3: trigonometric & inverse-trigonometric functions \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
29312
|
+
// Mirrors interval-js (interval/trigonometric.ts): exact endpoints with
|
|
29313
|
+
// extremum snapping (no outward epsilon). Per the Option-A contract, a tan pole
|
|
29314
|
+
// yields \`entire\` (interval-js returns \`singular\`; entire \u2287 singular and the
|
|
29315
|
+
// CPU classifies the asymptote).
|
|
29316
|
+
|
|
29317
|
+
const float _IV_PI = 3.141592653589793;
|
|
29318
|
+
const float _IV_TWO_PI = 6.283185307179586;
|
|
29319
|
+
const float _IV_HALF_PI = 1.5707963267948966;
|
|
29320
|
+
const float _IV_THREE_HALF_PI = 4.71238898038469;
|
|
29321
|
+
|
|
29322
|
+
// True if [a] contains an extremum of the family { ext + n\xB7period }.
|
|
29323
|
+
bool _iv_has_ext(vec2 a, float ext, float period) {
|
|
29324
|
+
float n = ceil((a.x - ext) / period);
|
|
29325
|
+
float cand = ext + n * period;
|
|
29326
|
+
return cand >= a.x - 1e-15 && cand <= a.y + 1e-15;
|
|
29327
|
+
}
|
|
29328
|
+
|
|
29329
|
+
vec2 _iv_sin(vec2 a) {
|
|
29330
|
+
vec2 r;
|
|
29331
|
+
if (a.y - a.x >= _IV_TWO_PI) r = vec2(-1.0, 1.0);
|
|
29332
|
+
else {
|
|
29333
|
+
float sl = sin(a.x), sh = sin(a.y);
|
|
29334
|
+
float lo = min(sl, sh), hi = max(sl, sh);
|
|
29335
|
+
if (_iv_has_ext(a, _IV_HALF_PI, _IV_TWO_PI)) hi = 1.0;
|
|
29336
|
+
if (_iv_has_ext(a, _IV_THREE_HALF_PI, _IV_TWO_PI)) lo = -1.0;
|
|
29337
|
+
r = vec2(lo, hi);
|
|
29338
|
+
}
|
|
29339
|
+
return _iv_guard1(_iv_clamp(r), a);
|
|
29340
|
+
}
|
|
29341
|
+
|
|
29342
|
+
vec2 _iv_cos(vec2 a) {
|
|
29343
|
+
vec2 r;
|
|
29344
|
+
if (a.y - a.x >= _IV_TWO_PI) r = vec2(-1.0, 1.0);
|
|
29345
|
+
else {
|
|
29346
|
+
float cl = cos(a.x), ch = cos(a.y);
|
|
29347
|
+
float lo = min(cl, ch), hi = max(cl, ch);
|
|
29348
|
+
if (_iv_has_ext(a, 0.0, _IV_TWO_PI)) hi = 1.0;
|
|
29349
|
+
if (_iv_has_ext(a, _IV_PI, _IV_TWO_PI)) lo = -1.0;
|
|
29350
|
+
r = vec2(lo, hi);
|
|
29351
|
+
}
|
|
29352
|
+
return _iv_guard1(_iv_clamp(r), a);
|
|
29353
|
+
}
|
|
29354
|
+
|
|
29355
|
+
vec2 _iv_tan(vec2 a) {
|
|
29356
|
+
// A pole in the interval \u2192 entire (cannot exclude).
|
|
29357
|
+
bool pole =
|
|
29358
|
+
(a.y - a.x >= _IV_PI) || _iv_has_ext(a, _IV_HALF_PI, _IV_PI);
|
|
29359
|
+
float tl = tan(a.x), th = tan(a.y);
|
|
29360
|
+
// Floating-point branch-cross sanity (large opposite-sign endpoints).
|
|
29361
|
+
bool crossed = (tl > 1e10 && th < -1e10) || (tl < -1e10 && th > 1e10);
|
|
29362
|
+
vec2 r = (pole || crossed) ? IV_ENTIRE : vec2(tl, th);
|
|
29363
|
+
return _iv_guard1(_iv_clamp(r), a);
|
|
29364
|
+
}
|
|
29365
|
+
|
|
29366
|
+
// asin: domain [\u22121, 1]. Fully outside \u2192 empty; straddling clamps to the valid
|
|
29367
|
+
// sub-range. Monotonic increasing.
|
|
29368
|
+
vec2 _iv_asin(vec2 a) {
|
|
29369
|
+
vec2 r = vec2(asin(max(a.x, -1.0)), asin(min(a.y, 1.0)));
|
|
29370
|
+
r = (a.x > 1.0 || a.y < -1.0) ? IV_EMPTY : r;
|
|
29371
|
+
return _iv_guard1(_iv_clamp(r), a);
|
|
29372
|
+
}
|
|
29373
|
+
|
|
29374
|
+
// acos: domain [\u22121, 1], monotonic decreasing (bounds swap).
|
|
29375
|
+
vec2 _iv_acos(vec2 a) {
|
|
29376
|
+
vec2 r = vec2(acos(min(a.y, 1.0)), acos(max(a.x, -1.0)));
|
|
29377
|
+
r = (a.x > 1.0 || a.y < -1.0) ? IV_EMPTY : r;
|
|
29378
|
+
return _iv_guard1(_iv_clamp(r), a);
|
|
29379
|
+
}
|
|
29380
|
+
|
|
29381
|
+
vec2 _iv_atan(vec2 a) {
|
|
29382
|
+
return _iv_guard1(_iv_clamp(vec2(atan(a.x), atan(a.y))), a);
|
|
29383
|
+
}
|
|
29384
|
+
|
|
29385
|
+
// \u2500\u2500 Discontinuous / step functions \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500
|
|
29386
|
+
// Bounded jump-discontinuity functions return the TIGHT value-range enclosure
|
|
29387
|
+
// (sound, and excludable when the range misses 0) rather than \`entire\` \u2014 only
|
|
29388
|
+
// genuine poles are entire. Per the Option-A division of labor, the CPU still
|
|
29389
|
+
// classifies the discontinuity on the (kept) live cells; the GPU only needs a
|
|
29390
|
+
// sound bound for the exclusion test. These functions are monotone, so the
|
|
29391
|
+
// enclosure is just [f(lo), f(hi)] unless noted.
|
|
29392
|
+
|
|
29393
|
+
vec2 _iv_floor(vec2 a) { return _iv_guard1(_iv_clamp(vec2(floor(a.x), floor(a.y))), a); }
|
|
29394
|
+
vec2 _iv_ceil(vec2 a) { return _iv_guard1(_iv_clamp(vec2(ceil(a.x), ceil(a.y))), a); }
|
|
29395
|
+
vec2 _iv_round(vec2 a) { return _iv_guard1(_iv_clamp(vec2(floor(a.x + 0.5), floor(a.y + 0.5))), a); }
|
|
29396
|
+
vec2 _iv_trunc(vec2 a) { return _iv_guard1(_iv_clamp(vec2(trunc(a.x), trunc(a.y))), a); }
|
|
29397
|
+
vec2 _iv_sign(vec2 a) { return _iv_guard1(vec2(sign(a.x), sign(a.y)), a); }
|
|
29398
|
+
|
|
29399
|
+
vec2 _iv_heaviside(vec2 a) {
|
|
29400
|
+
float hl = a.x < 0.0 ? 0.0 : (a.x > 0.0 ? 1.0 : 0.5);
|
|
29401
|
+
float hh = a.y < 0.0 ? 0.0 : (a.y > 0.0 ? 1.0 : 0.5);
|
|
29402
|
+
return _iv_guard1(vec2(hl, hh), a);
|
|
29403
|
+
}
|
|
29404
|
+
|
|
29405
|
+
// fract(x) = x \u2212 floor(x): continuous within an integer cell, sawtooth across
|
|
29406
|
+
// one (\u2192 full [0, 1] range).
|
|
29407
|
+
vec2 _iv_fract(vec2 a) {
|
|
29408
|
+
float fl = floor(a.x);
|
|
29409
|
+
vec2 r = (fl == floor(a.y)) ? vec2(a.x - fl, a.y - fl) : vec2(0.0, 1.0);
|
|
29410
|
+
return _iv_guard1(_iv_clamp(r), a);
|
|
29411
|
+
}
|
|
29412
|
+
|
|
29413
|
+
vec2 _iv_min(vec2 a, vec2 b) {
|
|
29414
|
+
return _iv_guard2(_iv_clamp(vec2(min(a.x, b.x), min(a.y, b.y))), a, b);
|
|
29415
|
+
}
|
|
29416
|
+
vec2 _iv_max(vec2 a, vec2 b) {
|
|
29417
|
+
return _iv_guard2(_iv_clamp(vec2(max(a.x, b.x), max(a.y, b.y))), a, b);
|
|
29418
|
+
}
|
|
29419
|
+
|
|
29420
|
+
// mod(x, y) = x \u2212 y\xB7floor(x/y). A modulus straddling 0 is a pole \u2192 entire. For
|
|
29421
|
+
// a constant (point) modulus the fast path is exact; otherwise compose (the
|
|
29422
|
+
// tight floor keeps it sound).
|
|
29423
|
+
vec2 _iv_mod(vec2 a, vec2 b) {
|
|
29424
|
+
if (b.x <= 0.0 && b.y >= 0.0) return _iv_guard2(IV_ENTIRE, a, b);
|
|
29425
|
+
if (b.x == b.y) {
|
|
29426
|
+
float p = abs(b.x);
|
|
29427
|
+
float flo = floor(a.x / p);
|
|
29428
|
+
vec2 r = (flo == floor(a.y / p)) ? vec2(a.x - p * flo, a.y - p * flo)
|
|
29429
|
+
: vec2(0.0, p);
|
|
29430
|
+
return _iv_guard2(_iv_clamp(r), a, b);
|
|
29431
|
+
}
|
|
29432
|
+
return _iv_sub(a, _iv_mul(b, _iv_floor(_iv_div(a, b))));
|
|
29433
|
+
}
|
|
29434
|
+
`;
|
|
29435
|
+
var INTERVAL_GLSL_FUNCTIONS = {
|
|
29436
|
+
Add: (args, compile2) => {
|
|
29437
|
+
if (args.length === 0) return "vec2(0.0, 0.0)";
|
|
29438
|
+
let r = compile2(args[0]);
|
|
29439
|
+
for (let i = 1; i < args.length; i++)
|
|
29440
|
+
r = `_iv_add(${r}, ${compile2(args[i])})`;
|
|
29441
|
+
return r;
|
|
29442
|
+
},
|
|
29443
|
+
Subtract: ([a, b], compile2) => {
|
|
29444
|
+
if (a === null || b === null) throw new Error("Subtract: missing argument");
|
|
29445
|
+
return `_iv_sub(${compile2(a)}, ${compile2(b)})`;
|
|
29446
|
+
},
|
|
29447
|
+
Multiply: (args, compile2) => {
|
|
29448
|
+
if (args.length === 0) return "vec2(1.0, 1.0)";
|
|
29449
|
+
let r = compile2(args[0]);
|
|
29450
|
+
for (let i = 1; i < args.length; i++)
|
|
29451
|
+
r = `_iv_mul(${r}, ${compile2(args[i])})`;
|
|
29452
|
+
return r;
|
|
29453
|
+
},
|
|
29454
|
+
Divide: ([a, b], compile2) => {
|
|
29455
|
+
if (a === null || b === null) throw new Error("Divide: missing argument");
|
|
29456
|
+
return `_iv_div(${compile2(a)}, ${compile2(b)})`;
|
|
29457
|
+
},
|
|
29458
|
+
Negate: ([a], compile2) => {
|
|
29459
|
+
if (a === null) throw new Error("Negate: no argument");
|
|
29460
|
+
return `_iv_negate(${compile2(a)})`;
|
|
29461
|
+
},
|
|
29462
|
+
Square: ([a], compile2) => {
|
|
29463
|
+
if (a === null) throw new Error("Square: no argument");
|
|
29464
|
+
return `_iv_square(${compile2(a)})`;
|
|
29465
|
+
},
|
|
29466
|
+
Sqrt: ([a], compile2) => {
|
|
29467
|
+
if (a === null) throw new Error("Sqrt: no argument");
|
|
29468
|
+
return `_iv_sqrt(${compile2(a)})`;
|
|
29469
|
+
},
|
|
29470
|
+
Abs: ([a], compile2) => {
|
|
29471
|
+
if (a === null) throw new Error("Abs: no argument");
|
|
29472
|
+
return `_iv_abs(${compile2(a)})`;
|
|
29473
|
+
},
|
|
29474
|
+
Exp: ([a], compile2) => {
|
|
29475
|
+
if (a === null) throw new Error("Exp: no argument");
|
|
29476
|
+
return `_iv_exp(${compile2(a)})`;
|
|
29477
|
+
},
|
|
29478
|
+
Ln: ([a], compile2) => {
|
|
29479
|
+
if (a === null) throw new Error("Ln: no argument");
|
|
29480
|
+
return `_iv_ln(${compile2(a)})`;
|
|
29481
|
+
},
|
|
29482
|
+
Log: (args, compile2) => {
|
|
29483
|
+
if (args.length === 1) return `_iv_log10(${compile2(args[0])})`;
|
|
29484
|
+
return `_iv_div(_iv_ln(${compile2(args[0])}), _iv_ln(${compile2(args[1])}))`;
|
|
29485
|
+
},
|
|
29486
|
+
Lb: ([a], compile2) => {
|
|
29487
|
+
if (a === null) throw new Error("Lb: no argument");
|
|
29488
|
+
return `_iv_log2(${compile2(a)})`;
|
|
29489
|
+
},
|
|
29490
|
+
Sin: ([a], compile2) => {
|
|
29491
|
+
if (a === null) throw new Error("Sin: no argument");
|
|
29492
|
+
return `_iv_sin(${compile2(a)})`;
|
|
29493
|
+
},
|
|
29494
|
+
Cos: ([a], compile2) => {
|
|
29495
|
+
if (a === null) throw new Error("Cos: no argument");
|
|
29496
|
+
return `_iv_cos(${compile2(a)})`;
|
|
29497
|
+
},
|
|
29498
|
+
Tan: ([a], compile2) => {
|
|
29499
|
+
if (a === null) throw new Error("Tan: no argument");
|
|
29500
|
+
return `_iv_tan(${compile2(a)})`;
|
|
29501
|
+
},
|
|
29502
|
+
Arcsin: ([a], compile2) => {
|
|
29503
|
+
if (a === null) throw new Error("Arcsin: no argument");
|
|
29504
|
+
return `_iv_asin(${compile2(a)})`;
|
|
29505
|
+
},
|
|
29506
|
+
Arccos: ([a], compile2) => {
|
|
29507
|
+
if (a === null) throw new Error("Arccos: no argument");
|
|
29508
|
+
return `_iv_acos(${compile2(a)})`;
|
|
29509
|
+
},
|
|
29510
|
+
Arctan: ([a], compile2) => {
|
|
29511
|
+
if (a === null) throw new Error("Arctan: no argument");
|
|
29512
|
+
return `_iv_atan(${compile2(a)})`;
|
|
29513
|
+
},
|
|
29514
|
+
Floor: ([a], compile2) => {
|
|
29515
|
+
if (a === null) throw new Error("Floor: no argument");
|
|
29516
|
+
return `_iv_floor(${compile2(a)})`;
|
|
29517
|
+
},
|
|
29518
|
+
Ceil: ([a], compile2) => {
|
|
29519
|
+
if (a === null) throw new Error("Ceil: no argument");
|
|
29520
|
+
return `_iv_ceil(${compile2(a)})`;
|
|
29521
|
+
},
|
|
29522
|
+
Round: ([a], compile2) => {
|
|
29523
|
+
if (a === null) throw new Error("Round: no argument");
|
|
29524
|
+
return `_iv_round(${compile2(a)})`;
|
|
29525
|
+
},
|
|
29526
|
+
Truncate: ([a], compile2) => {
|
|
29527
|
+
if (a === null) throw new Error("Truncate: no argument");
|
|
29528
|
+
return `_iv_trunc(${compile2(a)})`;
|
|
29529
|
+
},
|
|
29530
|
+
Fract: ([a], compile2) => {
|
|
29531
|
+
if (a === null) throw new Error("Fract: no argument");
|
|
29532
|
+
return `_iv_fract(${compile2(a)})`;
|
|
29533
|
+
},
|
|
29534
|
+
Sign: ([a], compile2) => {
|
|
29535
|
+
if (a === null) throw new Error("Sign: no argument");
|
|
29536
|
+
return `_iv_sign(${compile2(a)})`;
|
|
29537
|
+
},
|
|
29538
|
+
Heaviside: ([a], compile2) => {
|
|
29539
|
+
if (a === null) throw new Error("Heaviside: no argument");
|
|
29540
|
+
return `_iv_heaviside(${compile2(a)})`;
|
|
29541
|
+
},
|
|
29542
|
+
Mod: ([a, b], compile2) => {
|
|
29543
|
+
if (a === null || b === null) throw new Error("Mod: missing argument");
|
|
29544
|
+
return `_iv_mod(${compile2(a)}, ${compile2(b)})`;
|
|
29545
|
+
},
|
|
29546
|
+
Min: (args, compile2) => {
|
|
29547
|
+
if (args.length === 0) throw new Error("Min: no argument");
|
|
29548
|
+
let r = compile2(args[0]);
|
|
29549
|
+
for (let i = 1; i < args.length; i++)
|
|
29550
|
+
r = `_iv_min(${r}, ${compile2(args[i])})`;
|
|
29551
|
+
return r;
|
|
29552
|
+
},
|
|
29553
|
+
Max: (args, compile2) => {
|
|
29554
|
+
if (args.length === 0) throw new Error("Max: no argument");
|
|
29555
|
+
let r = compile2(args[0]);
|
|
29556
|
+
for (let i = 1; i < args.length; i++)
|
|
29557
|
+
r = `_iv_max(${r}, ${compile2(args[i])})`;
|
|
29558
|
+
return r;
|
|
29559
|
+
},
|
|
29560
|
+
Power: ([base, exp3], compile2) => {
|
|
29561
|
+
if (base === null || exp3 === null)
|
|
29562
|
+
throw new Error("Power: missing argument");
|
|
29563
|
+
if (isSymbol2(base, "ExponentialE")) return `_iv_exp(${compile2(exp3)})`;
|
|
29564
|
+
if (isNumber(exp3) && exp3.im === 0) {
|
|
29565
|
+
const v = exp3.re;
|
|
29566
|
+
if (v === 0.5) return `_iv_sqrt(${compile2(base)})`;
|
|
29567
|
+
if (v === 2) return `_iv_square(${compile2(base)})`;
|
|
29568
|
+
if (Number.isInteger(v) && v >= 0)
|
|
29569
|
+
return `_iv_powi(${compile2(base)}, ${formatGPUNumber(v)})`;
|
|
29570
|
+
if (!Number.isInteger(v) && v > 0)
|
|
29571
|
+
return `_iv_powf(${compile2(base)}, ${formatGPUNumber(v)})`;
|
|
29572
|
+
throw new Error(
|
|
29573
|
+
`interval-glsl: Power with exponent \`${exp3.toString()}\` is not yet supported`
|
|
29574
|
+
);
|
|
29575
|
+
}
|
|
29576
|
+
throw new Error(
|
|
29577
|
+
"interval-glsl: Power with a variable exponent is not yet supported"
|
|
29578
|
+
);
|
|
29579
|
+
}
|
|
29580
|
+
};
|
|
29581
|
+
var INTERVAL_GLSL_CONSTANTS = {
|
|
29582
|
+
Pi: "vec2(3.14159265359, 3.14159265359)",
|
|
29583
|
+
ExponentialE: "vec2(2.71828182846, 2.71828182846)",
|
|
29584
|
+
GoldenRatio: "vec2(1.61803398875, 1.61803398875)",
|
|
29585
|
+
CatalanConstant: "vec2(0.91596559417, 0.91596559417)",
|
|
29586
|
+
EulerGamma: "vec2(0.57721566490, 0.57721566490)"
|
|
29587
|
+
};
|
|
29588
|
+
var IntervalGLSLTarget = class extends GLSLTarget {
|
|
29589
|
+
languageId = "interval-glsl";
|
|
29590
|
+
getOperators() {
|
|
29591
|
+
return {};
|
|
29592
|
+
}
|
|
29593
|
+
getFunctions() {
|
|
29594
|
+
return INTERVAL_GLSL_FUNCTIONS;
|
|
29595
|
+
}
|
|
29596
|
+
getConstants() {
|
|
29597
|
+
return INTERVAL_GLSL_CONSTANTS;
|
|
29598
|
+
}
|
|
29599
|
+
createTarget(options = {}) {
|
|
29600
|
+
return super.createTarget({
|
|
29601
|
+
operators: () => void 0,
|
|
29602
|
+
functions: (id) => INTERVAL_GLSL_FUNCTIONS[id],
|
|
29603
|
+
number: (n) => `vec2(${formatGPUNumber(n)}, ${formatGPUNumber(n)})`,
|
|
29604
|
+
complex: () => {
|
|
29605
|
+
throw new Error("interval-glsl: complex values are not supported");
|
|
29606
|
+
},
|
|
29607
|
+
var: (id) => INTERVAL_GLSL_CONSTANTS[id],
|
|
29608
|
+
...options
|
|
29609
|
+
});
|
|
29610
|
+
}
|
|
29611
|
+
compile(expr, options = {}) {
|
|
29612
|
+
const { vars } = options;
|
|
29613
|
+
const target = this.createTarget({
|
|
29614
|
+
var: (id) => {
|
|
29615
|
+
if (vars && id in vars) return vars[id];
|
|
29616
|
+
if (id in INTERVAL_GLSL_CONSTANTS) return INTERVAL_GLSL_CONSTANTS[id];
|
|
29617
|
+
return void 0;
|
|
29618
|
+
}
|
|
29619
|
+
});
|
|
29620
|
+
const code = BaseCompiler.compile(expr, target);
|
|
29621
|
+
const result = {
|
|
29622
|
+
target: "interval-glsl",
|
|
29623
|
+
success: true,
|
|
29624
|
+
code
|
|
29625
|
+
};
|
|
29626
|
+
if (code.includes("_iv_")) result.preamble = INTERVAL_GLSL_PREAMBLE;
|
|
29627
|
+
return BaseCompiler.withReferences(
|
|
29628
|
+
result,
|
|
29629
|
+
expr,
|
|
29630
|
+
target,
|
|
29631
|
+
vars ? new Set(Object.keys(vars)) : void 0
|
|
29632
|
+
);
|
|
29633
|
+
}
|
|
29634
|
+
/**
|
|
29635
|
+
* Emit a complete, self-contained GLSL fragment shader implementing the
|
|
29636
|
+
* **interval exclusion oracle** for the implicit curve `f = 0` (Phase 4).
|
|
29637
|
+
*
|
|
29638
|
+
* The shader is structured so the core contract — the interval evaluator —
|
|
29639
|
+
* is cleanly separable from the render harness:
|
|
29640
|
+
*
|
|
29641
|
+
* - `vec2 _implicit(<vec2 per free variable>)` evaluates the interval of `f`
|
|
29642
|
+
* over a cell box (this is the part that matters; it is identical to
|
|
29643
|
+
* `compile(expr).code` wrapped in a function).
|
|
29644
|
+
* - `main()` is a **reference harness**: it derives each fragment's cell box
|
|
29645
|
+
* from `gl_FragCoord` and the viewport uniforms, evaluates `_implicit`, and
|
|
29646
|
+
* writes the exclusion result. The renderer is free to replace `main()` /
|
|
29647
|
+
* the uniforms with its own conventions and keep `_implicit`.
|
|
29648
|
+
*
|
|
29649
|
+
* The first free variable maps to `u_domainX`, the second to `u_domainY`
|
|
29650
|
+
* (≤ 2 free variables; a 2D implicit curve). The exclusion predicate is
|
|
29651
|
+
* `f.lo > 0 || f.hi < 0` — which also excludes the `empty` (domain-undefined)
|
|
29652
|
+
* interval, since its `lo` is the `+IV_INF` sentinel.
|
|
29653
|
+
*
|
|
29654
|
+
* @throws if the expression has more than two free variables, or cannot be
|
|
29655
|
+
* lowered (an unsupported head propagates from `BaseCompiler.compile`).
|
|
29656
|
+
*/
|
|
29657
|
+
compileExclusionShader(expr, options = {}) {
|
|
29658
|
+
const { version: version2 = "300 es", precision = "highp" } = options;
|
|
29659
|
+
const compiled = this.compile(expr);
|
|
29660
|
+
const vars = compiled.freeSymbols ?? [];
|
|
29661
|
+
if (vars.length > 2)
|
|
29662
|
+
throw new Error(
|
|
29663
|
+
`interval-glsl exclusion shader supports at most 2 free variables (got ${vars.length}: ${vars.join(", ")})`
|
|
29664
|
+
);
|
|
29665
|
+
const params = vars.map((v) => `vec2 ${v}`).join(", ");
|
|
29666
|
+
const [axisX, axisY] = vars;
|
|
29667
|
+
const main = ["void main() {"];
|
|
29668
|
+
main.push(" vec2 _cell = gl_FragCoord.xy / u_resolution;");
|
|
29669
|
+
main.push(" vec2 _step = 1.0 / u_resolution;");
|
|
29670
|
+
const callArgs = [];
|
|
29671
|
+
if (axisX !== void 0) {
|
|
29672
|
+
main.push(" float _xlo = mix(u_domainX.x, u_domainX.y, _cell.x);");
|
|
29673
|
+
main.push(
|
|
29674
|
+
" float _xhi = mix(u_domainX.x, u_domainX.y, _cell.x + _step.x);"
|
|
29675
|
+
);
|
|
29676
|
+
callArgs.push("vec2(_xlo, _xhi)");
|
|
29677
|
+
}
|
|
29678
|
+
if (axisY !== void 0) {
|
|
29679
|
+
main.push(" float _ylo = mix(u_domainY.x, u_domainY.y, _cell.y);");
|
|
29680
|
+
main.push(
|
|
29681
|
+
" float _yhi = mix(u_domainY.x, u_domainY.y, _cell.y + _step.y);"
|
|
29682
|
+
);
|
|
29683
|
+
callArgs.push("vec2(_ylo, _yhi)");
|
|
29684
|
+
}
|
|
29685
|
+
main.push(` vec2 _f = _implicit(${callArgs.join(", ")});`);
|
|
29686
|
+
main.push(" bool _excluded = (_f.x > 0.0 || _f.y < 0.0);");
|
|
29687
|
+
main.push(
|
|
29688
|
+
" fragColor = _excluded ? vec4(0.0, 0.0, 0.0, 1.0) : vec4(1.0);"
|
|
29689
|
+
);
|
|
29690
|
+
main.push("}");
|
|
29691
|
+
return [
|
|
29692
|
+
`#version ${version2}`,
|
|
29693
|
+
`precision ${precision} float;`,
|
|
29694
|
+
"",
|
|
29695
|
+
INTERVAL_GLSL_PREAMBLE.trim(),
|
|
29696
|
+
"",
|
|
29697
|
+
"uniform vec2 u_domainX; // [min, max] for the 1st free variable",
|
|
29698
|
+
"uniform vec2 u_domainY; // [min, max] for the 2nd free variable",
|
|
29699
|
+
"uniform vec2 u_resolution; // render target size, in pixels",
|
|
29700
|
+
"",
|
|
29701
|
+
"out vec4 fragColor;",
|
|
29702
|
+
"",
|
|
29703
|
+
"// Interval evaluation of the implicit field f over a cell box.",
|
|
29704
|
+
`vec2 _implicit(${params}) {`,
|
|
29705
|
+
` return ${compiled.code};`,
|
|
29706
|
+
"}",
|
|
29707
|
+
"",
|
|
29708
|
+
main.join("\n"),
|
|
29709
|
+
""
|
|
29710
|
+
].join("\n");
|
|
29711
|
+
}
|
|
29712
|
+
};
|
|
29713
|
+
|
|
28469
29714
|
// src/compile.ts
|
|
28470
|
-
var version = "0.
|
|
29715
|
+
var version = "0.61.0";
|
|
28471
29716
|
return __toCommonJS(compile_exports);
|
|
28472
29717
|
})();
|
|
28473
29718
|
/*! Bundled license information:
|