@cortex-js/compute-engine 0.35.2 → 0.35.3

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.
Files changed (177) hide show
  1. package/dist/compute-engine.esm.js +614 -29
  2. package/dist/compute-engine.min.esm.js +405 -52
  3. package/dist/compute-engine.min.umd.js +405 -52
  4. package/dist/compute-engine.umd.js +614 -29
  5. package/dist/math-json.esm.js +2 -2
  6. package/dist/math-json.min.esm.js +2 -2
  7. package/dist/math-json.min.umd.js +2 -2
  8. package/dist/math-json.umd.js +2 -2
  9. package/dist/types/common/ansi-codes.d.ts +1 -1
  10. package/dist/types/common/configuration-change.d.ts +1 -1
  11. package/dist/types/common/fuzzy-string-match.d.ts +1 -1
  12. package/dist/types/common/grapheme-splitter.d.ts +1 -1
  13. package/dist/types/common/interruptible.d.ts +1 -1
  14. package/dist/types/common/one-of.d.ts +1 -1
  15. package/dist/types/common/signals.d.ts +1 -1
  16. package/dist/types/common/type/ast-nodes.d.ts +1 -1
  17. package/dist/types/common/type/boxed-type.d.ts +1 -1
  18. package/dist/types/common/type/lexer.d.ts +1 -1
  19. package/dist/types/common/type/parse.d.ts +1 -1
  20. package/dist/types/common/type/parser.d.ts +1 -1
  21. package/dist/types/common/type/primitive.d.ts +1 -1
  22. package/dist/types/common/type/reduce.d.ts +1 -1
  23. package/dist/types/common/type/serialize.d.ts +1 -1
  24. package/dist/types/common/type/subtype.d.ts +1 -1
  25. package/dist/types/common/type/type-builder.d.ts +1 -1
  26. package/dist/types/common/type/types.d.ts +1 -1
  27. package/dist/types/common/type/utils.d.ts +1 -1
  28. package/dist/types/common/utils.d.ts +1 -1
  29. package/dist/types/compute-engine/assume.d.ts +1 -1
  30. package/dist/types/compute-engine/boxed-expression/abstract-boxed-expression.d.ts +1 -1
  31. package/dist/types/compute-engine/boxed-expression/apply.d.ts +1 -1
  32. package/dist/types/compute-engine/boxed-expression/arithmetic-add.d.ts +1 -1
  33. package/dist/types/compute-engine/boxed-expression/arithmetic-mul-div.d.ts +1 -1
  34. package/dist/types/compute-engine/boxed-expression/arithmetic-power.d.ts +1 -1
  35. package/dist/types/compute-engine/boxed-expression/ascii-math.d.ts +1 -1
  36. package/dist/types/compute-engine/boxed-expression/box.d.ts +1 -1
  37. package/dist/types/compute-engine/boxed-expression/boxed-dictionary.d.ts +1 -1
  38. package/dist/types/compute-engine/boxed-expression/boxed-function.d.ts +1 -1
  39. package/dist/types/compute-engine/boxed-expression/boxed-number.d.ts +1 -1
  40. package/dist/types/compute-engine/boxed-expression/boxed-operator-definition.d.ts +1 -1
  41. package/dist/types/compute-engine/boxed-expression/boxed-patterns.d.ts +1 -1
  42. package/dist/types/compute-engine/boxed-expression/boxed-string.d.ts +1 -1
  43. package/dist/types/compute-engine/boxed-expression/boxed-symbol.d.ts +1 -1
  44. package/dist/types/compute-engine/boxed-expression/boxed-tensor.d.ts +1 -1
  45. package/dist/types/compute-engine/boxed-expression/boxed-value-definition.d.ts +1 -1
  46. package/dist/types/compute-engine/boxed-expression/cache.d.ts +1 -1
  47. package/dist/types/compute-engine/boxed-expression/canonical-utils.d.ts +1 -1
  48. package/dist/types/compute-engine/boxed-expression/canonical.d.ts +1 -1
  49. package/dist/types/compute-engine/boxed-expression/compare.d.ts +1 -1
  50. package/dist/types/compute-engine/boxed-expression/expand.d.ts +1 -1
  51. package/dist/types/compute-engine/boxed-expression/expression-map.d.ts +1 -1
  52. package/dist/types/compute-engine/boxed-expression/factor.d.ts +1 -1
  53. package/dist/types/compute-engine/boxed-expression/flatten.d.ts +1 -1
  54. package/dist/types/compute-engine/boxed-expression/hold.d.ts +1 -1
  55. package/dist/types/compute-engine/boxed-expression/match.d.ts +1 -1
  56. package/dist/types/compute-engine/boxed-expression/negate.d.ts +1 -1
  57. package/dist/types/compute-engine/boxed-expression/numerics.d.ts +1 -1
  58. package/dist/types/compute-engine/boxed-expression/order.d.ts +1 -1
  59. package/dist/types/compute-engine/boxed-expression/polynomials.d.ts +1 -1
  60. package/dist/types/compute-engine/boxed-expression/product.d.ts +1 -1
  61. package/dist/types/compute-engine/boxed-expression/rules.d.ts +1 -1
  62. package/dist/types/compute-engine/boxed-expression/serialize.d.ts +1 -1
  63. package/dist/types/compute-engine/boxed-expression/sgn.d.ts +1 -1
  64. package/dist/types/compute-engine/boxed-expression/simplify.d.ts +1 -1
  65. package/dist/types/compute-engine/boxed-expression/solve-linear-system.d.ts +1 -1
  66. package/dist/types/compute-engine/boxed-expression/solve.d.ts +1 -1
  67. package/dist/types/compute-engine/boxed-expression/terms.d.ts +1 -1
  68. package/dist/types/compute-engine/boxed-expression/trigonometry.d.ts +1 -1
  69. package/dist/types/compute-engine/boxed-expression/utils.d.ts +1 -1
  70. package/dist/types/compute-engine/boxed-expression/validate.d.ts +1 -1
  71. package/dist/types/compute-engine/collection-utils.d.ts +1 -1
  72. package/dist/types/compute-engine/compilation/base-compiler.d.ts +1 -1
  73. package/dist/types/compute-engine/compilation/glsl-target.d.ts +1 -1
  74. package/dist/types/compute-engine/compilation/interval-glsl-target.d.ts +1 -1
  75. package/dist/types/compute-engine/compilation/interval-javascript-target.d.ts +11 -1
  76. package/dist/types/compute-engine/compilation/javascript-target.d.ts +1 -1
  77. package/dist/types/compute-engine/compilation/types.d.ts +1 -1
  78. package/dist/types/compute-engine/cost-function.d.ts +1 -1
  79. package/dist/types/compute-engine/function-utils.d.ts +1 -1
  80. package/dist/types/compute-engine/global-types.d.ts +1 -1
  81. package/dist/types/compute-engine/index.d.ts +1 -1
  82. package/dist/types/compute-engine/interval/arithmetic.d.ts +1 -1
  83. package/dist/types/compute-engine/interval/comparison.d.ts +1 -1
  84. package/dist/types/compute-engine/interval/elementary.d.ts +24 -5
  85. package/dist/types/compute-engine/interval/index.d.ts +15 -5
  86. package/dist/types/compute-engine/interval/trigonometric.d.ts +55 -1
  87. package/dist/types/compute-engine/interval/types.d.ts +1 -1
  88. package/dist/types/compute-engine/interval/util.d.ts +1 -1
  89. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-algebra.d.ts +1 -1
  90. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-arithmetic.d.ts +1 -1
  91. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-calculus.d.ts +1 -1
  92. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-complex.d.ts +1 -1
  93. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-core.d.ts +1 -1
  94. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-linear-algebra.d.ts +1 -1
  95. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-logic.d.ts +1 -1
  96. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-other.d.ts +1 -1
  97. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-relational-operators.d.ts +1 -1
  98. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-sets.d.ts +1 -1
  99. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-statistics.d.ts +1 -1
  100. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-symbols.d.ts +1 -1
  101. package/dist/types/compute-engine/latex-syntax/dictionary/definitions-trigonometry.d.ts +1 -1
  102. package/dist/types/compute-engine/latex-syntax/dictionary/definitions.d.ts +1 -1
  103. package/dist/types/compute-engine/latex-syntax/parse-symbol.d.ts +1 -1
  104. package/dist/types/compute-engine/latex-syntax/parse.d.ts +1 -1
  105. package/dist/types/compute-engine/latex-syntax/serialize-number.d.ts +1 -1
  106. package/dist/types/compute-engine/latex-syntax/serializer-style.d.ts +1 -1
  107. package/dist/types/compute-engine/latex-syntax/serializer.d.ts +1 -1
  108. package/dist/types/compute-engine/latex-syntax/tokenizer.d.ts +1 -1
  109. package/dist/types/compute-engine/latex-syntax/types.d.ts +1 -1
  110. package/dist/types/compute-engine/latex-syntax/utils.d.ts +1 -1
  111. package/dist/types/compute-engine/library/arithmetic.d.ts +1 -1
  112. package/dist/types/compute-engine/library/calculus.d.ts +1 -1
  113. package/dist/types/compute-engine/library/collections.d.ts +1 -1
  114. package/dist/types/compute-engine/library/combinatorics.d.ts +1 -1
  115. package/dist/types/compute-engine/library/complex.d.ts +1 -1
  116. package/dist/types/compute-engine/library/control-structures.d.ts +1 -1
  117. package/dist/types/compute-engine/library/core.d.ts +1 -1
  118. package/dist/types/compute-engine/library/invisible-operator.d.ts +1 -1
  119. package/dist/types/compute-engine/library/library.d.ts +1 -1
  120. package/dist/types/compute-engine/library/linear-algebra.d.ts +1 -1
  121. package/dist/types/compute-engine/library/logic-analysis.d.ts +1 -1
  122. package/dist/types/compute-engine/library/logic-utils.d.ts +1 -1
  123. package/dist/types/compute-engine/library/logic.d.ts +1 -1
  124. package/dist/types/compute-engine/library/number-theory.d.ts +1 -1
  125. package/dist/types/compute-engine/library/polynomials.d.ts +1 -1
  126. package/dist/types/compute-engine/library/random-expression.d.ts +1 -1
  127. package/dist/types/compute-engine/library/relational-operator.d.ts +1 -1
  128. package/dist/types/compute-engine/library/sets.d.ts +1 -1
  129. package/dist/types/compute-engine/library/statistics.d.ts +1 -1
  130. package/dist/types/compute-engine/library/trigonometry.d.ts +1 -1
  131. package/dist/types/compute-engine/library/utils.d.ts +1 -1
  132. package/dist/types/compute-engine/numeric-value/big-numeric-value.d.ts +1 -1
  133. package/dist/types/compute-engine/numeric-value/exact-numeric-value.d.ts +1 -1
  134. package/dist/types/compute-engine/numeric-value/machine-numeric-value.d.ts +1 -1
  135. package/dist/types/compute-engine/numeric-value/types.d.ts +1 -1
  136. package/dist/types/compute-engine/numerics/bigint.d.ts +1 -1
  137. package/dist/types/compute-engine/numerics/expression.d.ts +1 -1
  138. package/dist/types/compute-engine/numerics/interval.d.ts +1 -1
  139. package/dist/types/compute-engine/numerics/monte-carlo.d.ts +1 -1
  140. package/dist/types/compute-engine/numerics/numeric-bigint.d.ts +1 -1
  141. package/dist/types/compute-engine/numerics/numeric-bignum.d.ts +1 -1
  142. package/dist/types/compute-engine/numerics/numeric-complex.d.ts +1 -1
  143. package/dist/types/compute-engine/numerics/numeric.d.ts +1 -1
  144. package/dist/types/compute-engine/numerics/primes.d.ts +1 -1
  145. package/dist/types/compute-engine/numerics/rationals.d.ts +1 -1
  146. package/dist/types/compute-engine/numerics/richardson.d.ts +1 -1
  147. package/dist/types/compute-engine/numerics/special-functions.d.ts +1 -1
  148. package/dist/types/compute-engine/numerics/statistics.d.ts +1 -1
  149. package/dist/types/compute-engine/numerics/strings.d.ts +1 -1
  150. package/dist/types/compute-engine/numerics/types.d.ts +1 -1
  151. package/dist/types/compute-engine/oeis.d.ts +1 -1
  152. package/dist/types/compute-engine/sequence.d.ts +1 -1
  153. package/dist/types/compute-engine/symbolic/antiderivative.d.ts +1 -1
  154. package/dist/types/compute-engine/symbolic/derivative.d.ts +1 -1
  155. package/dist/types/compute-engine/symbolic/distribute.d.ts +1 -1
  156. package/dist/types/compute-engine/symbolic/fu-cost.d.ts +1 -1
  157. package/dist/types/compute-engine/symbolic/fu-transforms.d.ts +1 -1
  158. package/dist/types/compute-engine/symbolic/fu.d.ts +1 -1
  159. package/dist/types/compute-engine/symbolic/simplify-abs.d.ts +1 -1
  160. package/dist/types/compute-engine/symbolic/simplify-divide.d.ts +1 -1
  161. package/dist/types/compute-engine/symbolic/simplify-hyperbolic.d.ts +1 -1
  162. package/dist/types/compute-engine/symbolic/simplify-infinity.d.ts +1 -1
  163. package/dist/types/compute-engine/symbolic/simplify-log.d.ts +1 -1
  164. package/dist/types/compute-engine/symbolic/simplify-power.d.ts +1 -1
  165. package/dist/types/compute-engine/symbolic/simplify-product.d.ts +1 -1
  166. package/dist/types/compute-engine/symbolic/simplify-rules.d.ts +1 -1
  167. package/dist/types/compute-engine/symbolic/simplify-sum.d.ts +1 -1
  168. package/dist/types/compute-engine/symbolic/simplify-trig.d.ts +1 -1
  169. package/dist/types/compute-engine/tensor/tensor-fields.d.ts +1 -1
  170. package/dist/types/compute-engine/tensor/tensors.d.ts +1 -1
  171. package/dist/types/compute-engine/types.d.ts +1 -1
  172. package/dist/types/compute-engine.d.ts +1 -1
  173. package/dist/types/math-json/symbols.d.ts +1 -1
  174. package/dist/types/math-json/types.d.ts +1 -1
  175. package/dist/types/math-json/utils.d.ts +1 -1
  176. package/dist/types/math-json.d.ts +2 -2
  177. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /** Compute Engine 0.35.2 */
1
+ /** Compute Engine 0.35.3 */
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.ComputeEngine = {}));})(this, (function (exports) { 'use strict';
3
3
  var ComputeEngine = (() => {
4
4
  var __defProp = Object.defineProperty;
@@ -51499,6 +51499,13 @@ Error in definition of "${name}"`,
51499
51499
  },
51500
51500
  Exp: "Math.exp",
51501
51501
  Floor: "Math.floor",
51502
+ Fract: ([x], compile) => {
51503
+ if (x === null) throw new Error("Fract: no argument");
51504
+ return BaseCompiler.inlineExpression(
51505
+ "${x} - Math.floor(${x})",
51506
+ compile(x)
51507
+ );
51508
+ },
51502
51509
  Gamma: "_SYS.gamma",
51503
51510
  GCD: "_SYS.gcd",
51504
51511
  Integrate: (args, compile, target) => compileIntegrate(args, compile, target),
@@ -51932,6 +51939,87 @@ Error in definition of "${name}"`,
51932
51939
  Sqrt: "sqrt",
51933
51940
  Step: "step",
51934
51941
  Tan: "tan",
51942
+ // Reciprocal trigonometric functions (no GLSL built-ins)
51943
+ Cot: ([x], compile) => {
51944
+ if (x === null) throw new Error("Cot: no argument");
51945
+ const arg = compile(x);
51946
+ return `(cos(${arg}) / sin(${arg}))`;
51947
+ },
51948
+ Csc: ([x], compile) => {
51949
+ if (x === null) throw new Error("Csc: no argument");
51950
+ return `(1.0 / sin(${compile(x)}))`;
51951
+ },
51952
+ Sec: ([x], compile) => {
51953
+ if (x === null) throw new Error("Sec: no argument");
51954
+ return `(1.0 / cos(${compile(x)}))`;
51955
+ },
51956
+ // Inverse trigonometric (reciprocal)
51957
+ Arccot: ([x], compile) => {
51958
+ if (x === null) throw new Error("Arccot: no argument");
51959
+ return `atan(1.0 / (${compile(x)}))`;
51960
+ },
51961
+ Arccsc: ([x], compile) => {
51962
+ if (x === null) throw new Error("Arccsc: no argument");
51963
+ return `asin(1.0 / (${compile(x)}))`;
51964
+ },
51965
+ Arcsec: ([x], compile) => {
51966
+ if (x === null) throw new Error("Arcsec: no argument");
51967
+ return `acos(1.0 / (${compile(x)}))`;
51968
+ },
51969
+ // Hyperbolic functions (GLSL ES 3.0+ built-ins)
51970
+ Sinh: "sinh",
51971
+ Cosh: "cosh",
51972
+ Tanh: "tanh",
51973
+ // Reciprocal hyperbolic functions
51974
+ Coth: ([x], compile) => {
51975
+ if (x === null) throw new Error("Coth: no argument");
51976
+ const arg = compile(x);
51977
+ return `(cosh(${arg}) / sinh(${arg}))`;
51978
+ },
51979
+ Csch: ([x], compile) => {
51980
+ if (x === null) throw new Error("Csch: no argument");
51981
+ return `(1.0 / sinh(${compile(x)}))`;
51982
+ },
51983
+ Sech: ([x], compile) => {
51984
+ if (x === null) throw new Error("Sech: no argument");
51985
+ return `(1.0 / cosh(${compile(x)}))`;
51986
+ },
51987
+ // Inverse hyperbolic functions (GLSL ES 3.0+ built-ins)
51988
+ Arcosh: "acosh",
51989
+ Arsinh: "asinh",
51990
+ Artanh: "atanh",
51991
+ // Inverse hyperbolic (reciprocal)
51992
+ Arcoth: ([x], compile) => {
51993
+ if (x === null) throw new Error("Arcoth: no argument");
51994
+ return `atanh(1.0 / (${compile(x)}))`;
51995
+ },
51996
+ Arcsch: ([x], compile) => {
51997
+ if (x === null) throw new Error("Arcsch: no argument");
51998
+ return `asinh(1.0 / (${compile(x)}))`;
51999
+ },
52000
+ Arsech: ([x], compile) => {
52001
+ if (x === null) throw new Error("Arsech: no argument");
52002
+ return `acosh(1.0 / (${compile(x)}))`;
52003
+ },
52004
+ // Additional math functions
52005
+ Sgn: "sign",
52006
+ Lb: "log2",
52007
+ Log: (args, compile) => {
52008
+ if (args.length === 0) throw new Error("Log: no argument");
52009
+ if (args.length === 1) return `(log(${compile(args[0])}) / log(10.0))`;
52010
+ return `(log(${compile(args[0])}) / log(${compile(args[1])}))`;
52011
+ },
52012
+ Square: ([x], compile) => {
52013
+ if (x === null) throw new Error("Square: no argument");
52014
+ const arg = compile(x);
52015
+ return `(${arg} * ${arg})`;
52016
+ },
52017
+ Root: ([x, n], compile) => {
52018
+ if (x === null) throw new Error("Root: no argument");
52019
+ if (n === null || n === void 0) return `sqrt(${compile(x)})`;
52020
+ if (n?.re === 2) return `sqrt(${compile(x)})`;
52021
+ return `pow(${compile(x)}, 1.0 / ${compile(n)})`;
52022
+ },
51935
52023
  // Vector/Matrix operations
51936
52024
  Cross: "cross",
51937
52025
  Distance: "distance",
@@ -52478,19 +52566,39 @@ Error in definition of "${name}"`,
52478
52566
  const unwrapped = unwrapOrPropagate(x);
52479
52567
  if (!Array.isArray(unwrapped)) return unwrapped;
52480
52568
  const [xVal] = unwrapped;
52481
- return ok({ lo: Math.floor(xVal.lo), hi: Math.floor(xVal.hi) });
52569
+ const flo = Math.floor(xVal.lo);
52570
+ const fhi = Math.floor(xVal.hi);
52571
+ if (flo === fhi) return ok({ lo: flo, hi: fhi });
52572
+ return { kind: "singular", at: flo + 1 };
52482
52573
  }
52483
52574
  function ceil2(x) {
52484
52575
  const unwrapped = unwrapOrPropagate(x);
52485
52576
  if (!Array.isArray(unwrapped)) return unwrapped;
52486
52577
  const [xVal] = unwrapped;
52487
- return ok({ lo: Math.ceil(xVal.lo), hi: Math.ceil(xVal.hi) });
52578
+ const clo = Math.ceil(xVal.lo);
52579
+ const chi = Math.ceil(xVal.hi);
52580
+ if (clo === chi) return ok({ lo: clo, hi: chi });
52581
+ return { kind: "singular", at: clo };
52488
52582
  }
52489
52583
  function round2(x) {
52490
52584
  const unwrapped = unwrapOrPropagate(x);
52491
52585
  if (!Array.isArray(unwrapped)) return unwrapped;
52492
52586
  const [xVal] = unwrapped;
52493
- return ok({ lo: Math.round(xVal.lo), hi: Math.round(xVal.hi) });
52587
+ const rlo = Math.round(xVal.lo);
52588
+ const rhi = Math.round(xVal.hi);
52589
+ if (rlo === rhi) return ok({ lo: rlo, hi: rhi });
52590
+ return { kind: "singular", at: rlo + 0.5 };
52591
+ }
52592
+ function fract(x) {
52593
+ const unwrapped = unwrapOrPropagate(x);
52594
+ if (!Array.isArray(unwrapped)) return unwrapped;
52595
+ const [xVal] = unwrapped;
52596
+ const flo = Math.floor(xVal.lo);
52597
+ const fhi = Math.floor(xVal.hi);
52598
+ if (flo === fhi) {
52599
+ return ok({ lo: xVal.lo - flo, hi: xVal.hi - flo });
52600
+ }
52601
+ return { kind: "singular", at: flo + 1 };
52494
52602
  }
52495
52603
  function min2(a, b) {
52496
52604
  const unwrapped = unwrapOrPropagate(a, b);
@@ -52517,18 +52625,15 @@ Error in definition of "${name}"`,
52517
52625
  if (containsZero(bVal)) {
52518
52626
  return { kind: "singular" };
52519
52627
  }
52520
- const bAbs = Math.max(Math.abs(bVal.lo), Math.abs(bVal.hi));
52521
- const aWidth = aVal.hi - aVal.lo;
52522
- if (aWidth >= bAbs) {
52523
- return ok({ lo: 0, hi: bAbs });
52524
- }
52525
- const modLo = (aVal.lo % bAbs + bAbs) % bAbs;
52526
- const modHi = (aVal.hi % bAbs + bAbs) % bAbs;
52527
- if (modLo <= modHi) {
52528
- return ok({ lo: modLo, hi: modHi });
52529
- } else {
52530
- return ok({ lo: 0, hi: bAbs });
52628
+ const period = Math.abs(bVal.lo === bVal.hi ? bVal.lo : Math.max(Math.abs(bVal.lo), Math.abs(bVal.hi)));
52629
+ const flo = Math.floor(aVal.lo / period);
52630
+ const fhi = Math.floor(aVal.hi / period);
52631
+ if (flo !== fhi) {
52632
+ return { kind: "singular", at: (flo + 1) * period };
52531
52633
  }
52634
+ const modLo = aVal.lo - period * flo;
52635
+ const modHi = aVal.hi - period * flo;
52636
+ return ok({ lo: Math.min(modLo, modHi), hi: Math.max(modLo, modHi) });
52532
52637
  }
52533
52638
  function sign2(x) {
52534
52639
  const unwrapped = unwrapOrPropagate(x);
@@ -52537,9 +52642,7 @@ Error in definition of "${name}"`,
52537
52642
  if (xVal.lo > 0) return ok({ lo: 1, hi: 1 });
52538
52643
  if (xVal.hi < 0) return ok({ lo: -1, hi: -1 });
52539
52644
  if (xVal.lo === 0 && xVal.hi === 0) return ok({ lo: 0, hi: 0 });
52540
- if (xVal.lo < 0 && xVal.hi > 0) return ok({ lo: -1, hi: 1 });
52541
- if (xVal.lo === 0) return ok({ lo: 0, hi: 1 });
52542
- return ok({ lo: -1, hi: 0 });
52645
+ return { kind: "singular", at: 0 };
52543
52646
  }
52544
52647
 
52545
52648
  // src/compute-engine/interval/trigonometric.ts
@@ -52799,6 +52902,81 @@ Error in definition of "${name}"`,
52799
52902
  }
52800
52903
  return ok({ lo: Math.atanh(xVal.lo), hi: Math.atanh(xVal.hi) });
52801
52904
  }
52905
+ function acot(x) {
52906
+ const unwrapped = unwrapOrPropagate(x);
52907
+ if (!Array.isArray(unwrapped)) return unwrapped;
52908
+ const [xVal] = unwrapped;
52909
+ if (containsZero(xVal)) {
52910
+ return { kind: "singular", at: 0 };
52911
+ }
52912
+ return atan3(div3(ok({ lo: 1, hi: 1 }), ok(xVal)));
52913
+ }
52914
+ function acsc(x) {
52915
+ const unwrapped = unwrapOrPropagate(x);
52916
+ if (!Array.isArray(unwrapped)) return unwrapped;
52917
+ const [xVal] = unwrapped;
52918
+ if (containsZero(xVal)) {
52919
+ return { kind: "singular", at: 0 };
52920
+ }
52921
+ return asin2(div3(ok({ lo: 1, hi: 1 }), ok(xVal)));
52922
+ }
52923
+ function asec(x) {
52924
+ const unwrapped = unwrapOrPropagate(x);
52925
+ if (!Array.isArray(unwrapped)) return unwrapped;
52926
+ const [xVal] = unwrapped;
52927
+ if (containsZero(xVal)) {
52928
+ return { kind: "singular", at: 0 };
52929
+ }
52930
+ return acos2(div3(ok({ lo: 1, hi: 1 }), ok(xVal)));
52931
+ }
52932
+ function coth(x) {
52933
+ const unwrapped = unwrapOrPropagate(x);
52934
+ if (!Array.isArray(unwrapped)) return unwrapped;
52935
+ const [xVal] = unwrapped;
52936
+ if (containsZero(xVal)) {
52937
+ return { kind: "singular", at: 0 };
52938
+ }
52939
+ return div3(cosh3(xVal), sinh3(xVal));
52940
+ }
52941
+ function csch(x) {
52942
+ const unwrapped = unwrapOrPropagate(x);
52943
+ if (!Array.isArray(unwrapped)) return unwrapped;
52944
+ const [xVal] = unwrapped;
52945
+ if (containsZero(xVal)) {
52946
+ return { kind: "singular", at: 0 };
52947
+ }
52948
+ return div3(ok({ lo: 1, hi: 1 }), sinh3(xVal));
52949
+ }
52950
+ function sech(x) {
52951
+ return div3(ok({ lo: 1, hi: 1 }), cosh3(x));
52952
+ }
52953
+ function acoth(x) {
52954
+ const unwrapped = unwrapOrPropagate(x);
52955
+ if (!Array.isArray(unwrapped)) return unwrapped;
52956
+ const [xVal] = unwrapped;
52957
+ if (containsZero(xVal)) {
52958
+ return { kind: "singular", at: 0 };
52959
+ }
52960
+ return atanh2(div3(ok({ lo: 1, hi: 1 }), ok(xVal)));
52961
+ }
52962
+ function acsch(x) {
52963
+ const unwrapped = unwrapOrPropagate(x);
52964
+ if (!Array.isArray(unwrapped)) return unwrapped;
52965
+ const [xVal] = unwrapped;
52966
+ if (containsZero(xVal)) {
52967
+ return { kind: "singular", at: 0 };
52968
+ }
52969
+ return asinh2(div3(ok({ lo: 1, hi: 1 }), ok(xVal)));
52970
+ }
52971
+ function asech(x) {
52972
+ const unwrapped = unwrapOrPropagate(x);
52973
+ if (!Array.isArray(unwrapped)) return unwrapped;
52974
+ const [xVal] = unwrapped;
52975
+ if (containsZero(xVal)) {
52976
+ return { kind: "singular", at: 0 };
52977
+ }
52978
+ return acosh2(div3(ok({ lo: 1, hi: 1 }), ok(xVal)));
52979
+ }
52802
52980
 
52803
52981
  // src/compute-engine/interval/comparison.ts
52804
52982
  function less(a, b) {
@@ -52946,6 +53124,7 @@ Error in definition of "${name}"`,
52946
53124
  floor: floor2,
52947
53125
  ceil: ceil2,
52948
53126
  round: round2,
53127
+ fract,
52949
53128
  min: min2,
52950
53129
  max: max2,
52951
53130
  mod: mod2,
@@ -52967,6 +53146,15 @@ Error in definition of "${name}"`,
52967
53146
  asinh: asinh2,
52968
53147
  acosh: acosh2,
52969
53148
  atanh: atanh2,
53149
+ acot,
53150
+ acsc,
53151
+ asec,
53152
+ coth,
53153
+ csch,
53154
+ sech,
53155
+ acoth,
53156
+ acsch,
53157
+ asech,
52970
53158
  // Comparison
52971
53159
  less,
52972
53160
  lessEqual,
@@ -53111,17 +53299,28 @@ Error in definition of "${name}"`,
53111
53299
  Arcsin: (args, compile) => `_IA.asin(${compile(args[0])})`,
53112
53300
  Arccos: (args, compile) => `_IA.acos(${compile(args[0])})`,
53113
53301
  Arctan: (args, compile) => `_IA.atan(${compile(args[0])})`,
53302
+ Arccot: (args, compile) => `_IA.acot(${compile(args[0])})`,
53303
+ Arccsc: (args, compile) => `_IA.acsc(${compile(args[0])})`,
53304
+ Arcsec: (args, compile) => `_IA.asec(${compile(args[0])})`,
53114
53305
  // Hyperbolic functions
53115
53306
  Sinh: (args, compile) => `_IA.sinh(${compile(args[0])})`,
53116
53307
  Cosh: (args, compile) => `_IA.cosh(${compile(args[0])})`,
53117
53308
  Tanh: (args, compile) => `_IA.tanh(${compile(args[0])})`,
53309
+ Coth: (args, compile) => `_IA.coth(${compile(args[0])})`,
53310
+ Csch: (args, compile) => `_IA.csch(${compile(args[0])})`,
53311
+ Sech: (args, compile) => `_IA.sech(${compile(args[0])})`,
53118
53312
  Arsinh: (args, compile) => `_IA.asinh(${compile(args[0])})`,
53119
53313
  Arcosh: (args, compile) => `_IA.acosh(${compile(args[0])})`,
53120
53314
  Artanh: (args, compile) => `_IA.atanh(${compile(args[0])})`,
53315
+ Arcoth: (args, compile) => `_IA.acoth(${compile(args[0])})`,
53316
+ Arcsch: (args, compile) => `_IA.acsch(${compile(args[0])})`,
53317
+ Arsech: (args, compile) => `_IA.asech(${compile(args[0])})`,
53121
53318
  // Inverse trig (alternative names)
53122
53319
  Asin: (args, compile) => `_IA.asin(${compile(args[0])})`,
53123
53320
  Acos: (args, compile) => `_IA.acos(${compile(args[0])})`,
53124
53321
  Atan: (args, compile) => `_IA.atan(${compile(args[0])})`,
53322
+ // Elementary
53323
+ Fract: (args, compile) => `_IA.fract(${compile(args[0])})`,
53125
53324
  // Mod
53126
53325
  Mod: (args, compile) => `_IA.mod(${compile(args[0])}, ${compile(args[1])})`,
53127
53326
  // Conditionals
@@ -53444,24 +53643,94 @@ IntervalResult ia_abs(vec2 x) {
53444
53643
  return ia_ok(vec2(0.0, max(-x.x, x.y)));
53445
53644
  }
53446
53645
 
53447
- // Sign function
53646
+ // Sign function - has jump discontinuity at 0
53448
53647
  IntervalResult ia_sign(vec2 x) {
53449
53648
  if (x.x > 0.0) return ia_ok(vec2(1.0, 1.0));
53450
53649
  if (x.y < 0.0) return ia_ok(vec2(-1.0, -1.0));
53451
53650
  if (x.x == 0.0 && x.y == 0.0) return ia_ok(vec2(0.0, 0.0));
53452
- if (x.x < 0.0 && x.y > 0.0) return ia_ok(vec2(-1.0, 1.0));
53453
- if (x.x == 0.0) return ia_ok(vec2(0.0, 1.0));
53454
- return ia_ok(vec2(-1.0, 0.0));
53651
+ // Interval spans 0 - discontinuity
53652
+ return ia_singular(0.0);
53455
53653
  }
53456
53654
 
53457
- // Floor
53655
+ // Floor - has jump discontinuities at every integer
53458
53656
  IntervalResult ia_floor(vec2 x) {
53459
- return ia_ok(vec2(floor(x.x), floor(x.y)));
53657
+ float flo = floor(x.x);
53658
+ float fhi = floor(x.y);
53659
+ if (flo == fhi) {
53660
+ return ia_ok(vec2(flo, fhi));
53661
+ }
53662
+ // Interval spans an integer boundary - discontinuity at first integer > x.x
53663
+ return ia_singular(flo + 1.0);
53460
53664
  }
53461
53665
 
53462
- // Ceiling
53666
+ // Ceiling - has jump discontinuities at every integer
53463
53667
  IntervalResult ia_ceil(vec2 x) {
53464
- return ia_ok(vec2(ceil(x.x), ceil(x.y)));
53668
+ float clo = ceil(x.x);
53669
+ float chi = ceil(x.y);
53670
+ if (clo == chi) {
53671
+ return ia_ok(vec2(clo, chi));
53672
+ }
53673
+ // Interval spans an integer boundary - discontinuity at ceil(x.x)
53674
+ return ia_singular(clo);
53675
+ }
53676
+
53677
+ // Round - has jump discontinuities at every half-integer
53678
+ // Note: GLSL round() uses IEEE 754 round-half-to-even, while JS Math.round
53679
+ // uses round-half-up. They differ only AT half-integers; discontinuity
53680
+ // detection is safe because intervals spanning half-integers return singular.
53681
+ IntervalResult ia_round(vec2 x) {
53682
+ float rlo = round(x.x);
53683
+ float rhi = round(x.y);
53684
+ if (rlo == rhi) {
53685
+ return ia_ok(vec2(rlo, rhi));
53686
+ }
53687
+ // Interval spans a half-integer boundary - discontinuity
53688
+ return ia_singular(rlo + 0.5);
53689
+ }
53690
+
53691
+ // Fract - sawtooth discontinuities at every integer
53692
+ // fract(x) = x - floor(x), jumps from ~1 back to 0 at each integer
53693
+ IntervalResult ia_fract(vec2 x) {
53694
+ float flo = floor(x.x);
53695
+ float fhi = floor(x.y);
53696
+ if (flo == fhi) {
53697
+ // No integer crossing - fract is continuous (linear) on this interval
53698
+ return ia_ok(vec2(fract(x.x) - IA_EPS, fract(x.y) + IA_EPS));
53699
+ }
53700
+ // Interval spans an integer - sawtooth discontinuity
53701
+ return ia_singular(flo + 1.0);
53702
+ }
53703
+
53704
+ // Mod - periodic discontinuities at multiples of the modulus
53705
+ // mod(x, y) = x - y * floor(x / y)
53706
+ IntervalResult ia_mod(vec2 x, vec2 y) {
53707
+ // y contains zero - undefined
53708
+ if (y.x <= 0.0 && y.y >= 0.0) {
53709
+ return ia_singular(0.0);
53710
+ }
53711
+
53712
+ // Constant modulus (point interval) - common case
53713
+ if (y.x == y.y) {
53714
+ float period = abs(y.x);
53715
+ float flo = floor(x.x / period);
53716
+ float fhi = floor(x.y / period);
53717
+ if (flo == fhi) {
53718
+ // No discontinuity - mod is continuous (linear) on this interval
53719
+ float mlo = x.x - period * flo;
53720
+ float mhi = x.y - period * flo;
53721
+ return ia_ok(vec2(min(mlo, mhi) - IA_EPS, max(mlo, mhi) + IA_EPS));
53722
+ }
53723
+ // Discontinuity at first multiple of period in the interval
53724
+ return ia_singular((flo + 1.0) * period);
53725
+ }
53726
+
53727
+ // General case: compose from existing operations
53728
+ // Discontinuity detection comes from ia_floor
53729
+ IntervalResult q = ia_div(x, y);
53730
+ if (ia_is_error(q.status)) return q;
53731
+ IntervalResult fq = ia_floor(q.value);
53732
+ if (ia_is_error(fq.status)) return fq;
53733
+ return ia_sub(x, ia_mul_raw(y, fq.value));
53465
53734
  }
53466
53735
 
53467
53736
  // Min of two intervals
@@ -53750,6 +54019,32 @@ IntervalResult ia_ceil(IntervalResult x) {
53750
54019
  return ia_ceil(x.value);
53751
54020
  }
53752
54021
 
54022
+ IntervalResult ia_round(IntervalResult x) {
54023
+ if (ia_is_error(x.status)) return x;
54024
+ return ia_round(x.value);
54025
+ }
54026
+
54027
+ IntervalResult ia_fract(IntervalResult x) {
54028
+ if (ia_is_error(x.status)) return x;
54029
+ return ia_fract(x.value);
54030
+ }
54031
+
54032
+ IntervalResult ia_mod(IntervalResult a, IntervalResult b) {
54033
+ if (ia_is_error(a.status)) return a;
54034
+ if (ia_is_error(b.status)) return b;
54035
+ return ia_mod(a.value, b.value);
54036
+ }
54037
+
54038
+ IntervalResult ia_mod(IntervalResult a, vec2 b) {
54039
+ if (ia_is_error(a.status)) return a;
54040
+ return ia_mod(a.value, b);
54041
+ }
54042
+
54043
+ IntervalResult ia_mod(vec2 a, IntervalResult b) {
54044
+ if (ia_is_error(b.status)) return b;
54045
+ return ia_mod(a, b.value);
54046
+ }
54047
+
53753
54048
  IntervalResult ia_min(IntervalResult a, IntervalResult b) {
53754
54049
  if (ia_is_error(a.status)) return a;
53755
54050
  if (ia_is_error(b.status)) return b;
@@ -53831,6 +54126,263 @@ IntervalResult ia_tanh(IntervalResult x) {
53831
54126
  if (ia_is_error(x.status)) return x;
53832
54127
  return ia_tanh(x.value);
53833
54128
  }
54129
+
54130
+ // Cotangent (derived from cos/sin)
54131
+ IntervalResult ia_cot(vec2 x) {
54132
+ return ia_div(ia_cos(x), ia_sin(x));
54133
+ }
54134
+
54135
+ IntervalResult ia_cot(IntervalResult x) {
54136
+ if (ia_is_error(x.status)) return x;
54137
+ return ia_cot(x.value);
54138
+ }
54139
+
54140
+ // Cosecant (derived from 1/sin)
54141
+ IntervalResult ia_csc(vec2 x) {
54142
+ return ia_div(ia_ok(vec2(1.0, 1.0)), ia_sin(x));
54143
+ }
54144
+
54145
+ IntervalResult ia_csc(IntervalResult x) {
54146
+ if (ia_is_error(x.status)) return x;
54147
+ return ia_csc(x.value);
54148
+ }
54149
+
54150
+ // Secant (derived from 1/cos)
54151
+ IntervalResult ia_sec(vec2 x) {
54152
+ return ia_div(ia_ok(vec2(1.0, 1.0)), ia_cos(x));
54153
+ }
54154
+
54155
+ IntervalResult ia_sec(IntervalResult x) {
54156
+ if (ia_is_error(x.status)) return x;
54157
+ return ia_sec(x.value);
54158
+ }
54159
+
54160
+ // Inverse cotangent
54161
+ IntervalResult ia_acot(vec2 x) {
54162
+ return ia_atan(ia_div(ia_ok(vec2(1.0, 1.0)), ia_ok(x)));
54163
+ }
54164
+
54165
+ IntervalResult ia_acot(IntervalResult x) {
54166
+ if (ia_is_error(x.status)) return x;
54167
+ return ia_acot(x.value);
54168
+ }
54169
+
54170
+ // Inverse cosecant
54171
+ IntervalResult ia_acsc(vec2 x) {
54172
+ return ia_asin(ia_div(ia_ok(vec2(1.0, 1.0)), ia_ok(x)));
54173
+ }
54174
+
54175
+ IntervalResult ia_acsc(IntervalResult x) {
54176
+ if (ia_is_error(x.status)) return x;
54177
+ return ia_acsc(x.value);
54178
+ }
54179
+
54180
+ // Inverse secant
54181
+ IntervalResult ia_asec(vec2 x) {
54182
+ return ia_acos(ia_div(ia_ok(vec2(1.0, 1.0)), ia_ok(x)));
54183
+ }
54184
+
54185
+ IntervalResult ia_asec(IntervalResult x) {
54186
+ if (ia_is_error(x.status)) return x;
54187
+ return ia_asec(x.value);
54188
+ }
54189
+
54190
+ // Hyperbolic cotangent
54191
+ IntervalResult ia_coth(vec2 x) {
54192
+ return ia_div(ia_cosh(x), ia_sinh(x));
54193
+ }
54194
+
54195
+ IntervalResult ia_coth(IntervalResult x) {
54196
+ if (ia_is_error(x.status)) return x;
54197
+ return ia_coth(x.value);
54198
+ }
54199
+
54200
+ // Hyperbolic cosecant
54201
+ IntervalResult ia_csch(vec2 x) {
54202
+ return ia_div(ia_ok(vec2(1.0, 1.0)), ia_sinh(x));
54203
+ }
54204
+
54205
+ IntervalResult ia_csch(IntervalResult x) {
54206
+ if (ia_is_error(x.status)) return x;
54207
+ return ia_csch(x.value);
54208
+ }
54209
+
54210
+ // Hyperbolic secant
54211
+ IntervalResult ia_sech(vec2 x) {
54212
+ return ia_div(ia_ok(vec2(1.0, 1.0)), ia_cosh(x));
54213
+ }
54214
+
54215
+ IntervalResult ia_sech(IntervalResult x) {
54216
+ if (ia_is_error(x.status)) return x;
54217
+ return ia_sech(x.value);
54218
+ }
54219
+
54220
+ // Inverse hyperbolic sine
54221
+ IntervalResult ia_asinh(vec2 x) {
54222
+ return ia_ok(vec2(asinh(x.x) - IA_EPS, asinh(x.y) + IA_EPS));
54223
+ }
54224
+
54225
+ IntervalResult ia_asinh(IntervalResult x) {
54226
+ if (ia_is_error(x.status)) return x;
54227
+ return ia_asinh(x.value);
54228
+ }
54229
+
54230
+ // Inverse hyperbolic cosine
54231
+ IntervalResult ia_acosh(vec2 x) {
54232
+ if (x.y < 1.0) {
54233
+ return ia_empty();
54234
+ }
54235
+ if (x.x >= 1.0) {
54236
+ return ia_ok(vec2(acosh(x.x) - IA_EPS, acosh(x.y) + IA_EPS));
54237
+ }
54238
+ return ia_partial(vec2(0.0, acosh(x.y) + IA_EPS), IA_PARTIAL_LO);
54239
+ }
54240
+
54241
+ IntervalResult ia_acosh(IntervalResult x) {
54242
+ if (ia_is_error(x.status)) return x;
54243
+ return ia_acosh(x.value);
54244
+ }
54245
+
54246
+ // Inverse hyperbolic tangent
54247
+ IntervalResult ia_atanh(vec2 x) {
54248
+ if (x.x >= 1.0 || x.y <= -1.0) {
54249
+ return ia_empty();
54250
+ }
54251
+ vec2 clipped = vec2(max(x.x, -1.0 + IA_EPS), min(x.y, 1.0 - IA_EPS));
54252
+ if (x.x < -1.0 || x.y > 1.0) {
54253
+ float clip = (x.x < -1.0 && x.y > 1.0) ? IA_PARTIAL_BOTH :
54254
+ (x.x < -1.0) ? IA_PARTIAL_LO : IA_PARTIAL_HI;
54255
+ return ia_partial(vec2(atanh(clipped.x) - IA_EPS, atanh(clipped.y) + IA_EPS), clip);
54256
+ }
54257
+ return ia_ok(vec2(atanh(x.x) - IA_EPS, atanh(x.y) + IA_EPS));
54258
+ }
54259
+
54260
+ IntervalResult ia_atanh(IntervalResult x) {
54261
+ if (ia_is_error(x.status)) return x;
54262
+ return ia_atanh(x.value);
54263
+ }
54264
+
54265
+ // Inverse hyperbolic cotangent
54266
+ IntervalResult ia_acoth(vec2 x) {
54267
+ return ia_atanh(ia_div(ia_ok(vec2(1.0, 1.0)), ia_ok(x)));
54268
+ }
54269
+
54270
+ IntervalResult ia_acoth(IntervalResult x) {
54271
+ if (ia_is_error(x.status)) return x;
54272
+ return ia_acoth(x.value);
54273
+ }
54274
+
54275
+ // Inverse hyperbolic cosecant
54276
+ IntervalResult ia_acsch(vec2 x) {
54277
+ return ia_asinh(ia_div(ia_ok(vec2(1.0, 1.0)), ia_ok(x)));
54278
+ }
54279
+
54280
+ IntervalResult ia_acsch(IntervalResult x) {
54281
+ if (ia_is_error(x.status)) return x;
54282
+ return ia_acsch(x.value);
54283
+ }
54284
+
54285
+ // Inverse hyperbolic secant
54286
+ IntervalResult ia_asech(vec2 x) {
54287
+ return ia_acosh(ia_div(ia_ok(vec2(1.0, 1.0)), ia_ok(x)));
54288
+ }
54289
+
54290
+ IntervalResult ia_asech(IntervalResult x) {
54291
+ if (ia_is_error(x.status)) return x;
54292
+ return ia_asech(x.value);
54293
+ }
54294
+
54295
+ // Boolean interval comparisons
54296
+ // Returns 1.0 = true, 0.0 = false, 0.5 = maybe
54297
+ const float IA_TRUE = 1.0;
54298
+ const float IA_FALSE = 0.0;
54299
+ const float IA_MAYBE = 0.5;
54300
+
54301
+ float ia_less(vec2 a, vec2 b) {
54302
+ if (a.y < b.x) return IA_TRUE;
54303
+ if (a.x >= b.y) return IA_FALSE;
54304
+ return IA_MAYBE;
54305
+ }
54306
+
54307
+ float ia_lessEqual(vec2 a, vec2 b) {
54308
+ if (a.y <= b.x) return IA_TRUE;
54309
+ if (a.x > b.y) return IA_FALSE;
54310
+ return IA_MAYBE;
54311
+ }
54312
+
54313
+ float ia_greater(vec2 a, vec2 b) {
54314
+ if (a.x > b.y) return IA_TRUE;
54315
+ if (a.y <= b.x) return IA_FALSE;
54316
+ return IA_MAYBE;
54317
+ }
54318
+
54319
+ float ia_greaterEqual(vec2 a, vec2 b) {
54320
+ if (a.x >= b.y) return IA_TRUE;
54321
+ if (a.y < b.x) return IA_FALSE;
54322
+ return IA_MAYBE;
54323
+ }
54324
+
54325
+ float ia_equal(vec2 a, vec2 b) {
54326
+ if (a.x == a.y && b.x == b.y && a.x == b.x) return IA_TRUE;
54327
+ if (a.y < b.x || b.y < a.x) return IA_FALSE;
54328
+ return IA_MAYBE;
54329
+ }
54330
+
54331
+ float ia_notEqual(vec2 a, vec2 b) {
54332
+ float eq = ia_equal(a, b);
54333
+ if (eq == IA_TRUE) return IA_FALSE;
54334
+ if (eq == IA_FALSE) return IA_TRUE;
54335
+ return IA_MAYBE;
54336
+ }
54337
+
54338
+ float ia_and(float a, float b) {
54339
+ if (a == IA_FALSE || b == IA_FALSE) return IA_FALSE;
54340
+ if (a == IA_TRUE && b == IA_TRUE) return IA_TRUE;
54341
+ return IA_MAYBE;
54342
+ }
54343
+
54344
+ float ia_or(float a, float b) {
54345
+ if (a == IA_TRUE || b == IA_TRUE) return IA_TRUE;
54346
+ if (a == IA_FALSE && b == IA_FALSE) return IA_FALSE;
54347
+ return IA_MAYBE;
54348
+ }
54349
+
54350
+ float ia_not(float a) {
54351
+ if (a == IA_TRUE) return IA_FALSE;
54352
+ if (a == IA_FALSE) return IA_TRUE;
54353
+ return IA_MAYBE;
54354
+ }
54355
+
54356
+ // IntervalResult overloads for comparisons
54357
+ float ia_less(IntervalResult a, IntervalResult b) {
54358
+ if (ia_is_error(a.status) || ia_is_error(b.status)) return IA_MAYBE;
54359
+ return ia_less(a.value, b.value);
54360
+ }
54361
+
54362
+ float ia_lessEqual(IntervalResult a, IntervalResult b) {
54363
+ if (ia_is_error(a.status) || ia_is_error(b.status)) return IA_MAYBE;
54364
+ return ia_lessEqual(a.value, b.value);
54365
+ }
54366
+
54367
+ float ia_greater(IntervalResult a, IntervalResult b) {
54368
+ if (ia_is_error(a.status) || ia_is_error(b.status)) return IA_MAYBE;
54369
+ return ia_greater(a.value, b.value);
54370
+ }
54371
+
54372
+ float ia_greaterEqual(IntervalResult a, IntervalResult b) {
54373
+ if (ia_is_error(a.status) || ia_is_error(b.status)) return IA_MAYBE;
54374
+ return ia_greaterEqual(a.value, b.value);
54375
+ }
54376
+
54377
+ float ia_equal(IntervalResult a, IntervalResult b) {
54378
+ if (ia_is_error(a.status) || ia_is_error(b.status)) return IA_MAYBE;
54379
+ return ia_equal(a.value, b.value);
54380
+ }
54381
+
54382
+ float ia_notEqual(IntervalResult a, IntervalResult b) {
54383
+ if (ia_is_error(a.status) || ia_is_error(b.status)) return IA_MAYBE;
54384
+ return ia_notEqual(a.value, b.value);
54385
+ }
53834
54386
  `;
53835
54387
  var INTERVAL_GLSL_OPERATORS = {
53836
54388
  Add: ["ia_add", 20],
@@ -53882,7 +54434,9 @@ IntervalResult ia_tanh(IntervalResult x) {
53882
54434
  Ceiling: (args, compile) => `ia_ceil(${compile(args[0])})`,
53883
54435
  Exp: (args, compile) => `ia_exp(${compile(args[0])})`,
53884
54436
  Floor: (args, compile) => `ia_floor(${compile(args[0])})`,
54437
+ Fract: (args, compile) => `ia_fract(${compile(args[0])})`,
53885
54438
  Ln: (args, compile) => `ia_ln(${compile(args[0])})`,
54439
+ Mod: (args, compile) => `ia_mod(${compile(args[0])}, ${compile(args[1])})`,
53886
54440
  Max: (args, compile) => {
53887
54441
  if (args.length === 0) return "ia_point(-1e38)";
53888
54442
  if (args.length === 1) return compile(args[0]);
@@ -53915,6 +54469,7 @@ IntervalResult ia_tanh(IntervalResult x) {
53915
54469
  }
53916
54470
  throw new Error("Interval GLSL does not support variable exponents");
53917
54471
  },
54472
+ Round: (args, compile) => `ia_round(${compile(args[0])})`,
53918
54473
  Sgn: (args, compile) => `ia_sign(${compile(args[0])})`,
53919
54474
  Sqrt: (args, compile) => `ia_sqrt(${compile(args[0])})`,
53920
54475
  Square: (args, compile) => `ia_square(${compile(args[0])})`,
@@ -53925,10 +54480,40 @@ IntervalResult ia_tanh(IntervalResult x) {
53925
54480
  Arcsin: (args, compile) => `ia_asin(${compile(args[0])})`,
53926
54481
  Arccos: (args, compile) => `ia_acos(${compile(args[0])})`,
53927
54482
  Arctan: (args, compile) => `ia_atan(${compile(args[0])})`,
54483
+ // Reciprocal trigonometric functions
54484
+ Cot: (args, compile) => `ia_cot(${compile(args[0])})`,
54485
+ Csc: (args, compile) => `ia_csc(${compile(args[0])})`,
54486
+ Sec: (args, compile) => `ia_sec(${compile(args[0])})`,
54487
+ // Inverse trigonometric (reciprocal)
54488
+ Arccot: (args, compile) => `ia_acot(${compile(args[0])})`,
54489
+ Arccsc: (args, compile) => `ia_acsc(${compile(args[0])})`,
54490
+ Arcsec: (args, compile) => `ia_asec(${compile(args[0])})`,
53928
54491
  // Hyperbolic functions
53929
54492
  Sinh: (args, compile) => `ia_sinh(${compile(args[0])})`,
53930
54493
  Cosh: (args, compile) => `ia_cosh(${compile(args[0])})`,
53931
- Tanh: (args, compile) => `ia_tanh(${compile(args[0])})`
54494
+ Tanh: (args, compile) => `ia_tanh(${compile(args[0])})`,
54495
+ // Reciprocal hyperbolic functions
54496
+ Coth: (args, compile) => `ia_coth(${compile(args[0])})`,
54497
+ Csch: (args, compile) => `ia_csch(${compile(args[0])})`,
54498
+ Sech: (args, compile) => `ia_sech(${compile(args[0])})`,
54499
+ // Inverse hyperbolic functions
54500
+ Arsinh: (args, compile) => `ia_asinh(${compile(args[0])})`,
54501
+ Arcosh: (args, compile) => `ia_acosh(${compile(args[0])})`,
54502
+ Artanh: (args, compile) => `ia_atanh(${compile(args[0])})`,
54503
+ // Inverse hyperbolic (reciprocal)
54504
+ Arcoth: (args, compile) => `ia_acoth(${compile(args[0])})`,
54505
+ Arcsch: (args, compile) => `ia_acsch(${compile(args[0])})`,
54506
+ Arsech: (args, compile) => `ia_asech(${compile(args[0])})`,
54507
+ // Comparison and logic (return float: 1.0=true, 0.0=false, 0.5=maybe)
54508
+ Equal: (args, compile) => `ia_equal(${compile(args[0])}, ${compile(args[1])})`,
54509
+ NotEqual: (args, compile) => `ia_notEqual(${compile(args[0])}, ${compile(args[1])})`,
54510
+ Less: (args, compile) => `ia_less(${compile(args[0])}, ${compile(args[1])})`,
54511
+ LessEqual: (args, compile) => `ia_lessEqual(${compile(args[0])}, ${compile(args[1])})`,
54512
+ Greater: (args, compile) => `ia_greater(${compile(args[0])}, ${compile(args[1])})`,
54513
+ GreaterEqual: (args, compile) => `ia_greaterEqual(${compile(args[0])}, ${compile(args[1])})`,
54514
+ And: (args, compile) => `ia_and(${compile(args[0])}, ${compile(args[1])})`,
54515
+ Or: (args, compile) => `ia_or(${compile(args[0])}, ${compile(args[1])})`,
54516
+ Not: (args, compile) => `ia_not(${compile(args[0])})`
53932
54517
  };
53933
54518
  var IntervalGLSLTarget = class {
53934
54519
  getOperators() {
@@ -55826,10 +56411,10 @@ IntervalResult ${functionName}(${params}) {
55826
56411
  // src/compute-engine.ts
55827
56412
  init_types6();
55828
56413
  init_base_compiler();
55829
- var version = "0.35.2";
56414
+ var version = "0.35.3";
55830
56415
  globalThis[Symbol.for("io.cortexjs.compute-engine")] = {
55831
56416
  ComputeEngine: ComputeEngine.prototype.constructor,
55832
- version: "0.35.2"
56417
+ version: "0.35.3"
55833
56418
  };
55834
56419
  return __toCommonJS(compute_engine_exports);
55835
56420
  })();