@lakutata/math 0.0.0-stage → 3.1.5

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 (1728) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +954 -2
  3. package/README.zh-CN.md +578 -0
  4. package/THIRD_PARTY_NOTICES.md +553 -0
  5. package/binding.gyp +89 -0
  6. package/dist/cjs/exceptions/MathArgumentException.d.ts +11 -0
  7. package/dist/cjs/exceptions/MathArgumentException.js +18 -0
  8. package/dist/cjs/exceptions/MathCancelledException.d.ts +10 -0
  9. package/dist/cjs/exceptions/MathCancelledException.js +17 -0
  10. package/dist/cjs/exceptions/MathDefinitionException.d.ts +11 -0
  11. package/dist/cjs/exceptions/MathDefinitionException.js +18 -0
  12. package/dist/cjs/exceptions/MathDivisionByZeroException.d.ts +10 -0
  13. package/dist/cjs/exceptions/MathDivisionByZeroException.js +17 -0
  14. package/dist/cjs/exceptions/MathDomainException.d.ts +11 -0
  15. package/dist/cjs/exceptions/MathDomainException.js +18 -0
  16. package/dist/cjs/exceptions/MathException.d.ts +19 -0
  17. package/dist/cjs/exceptions/MathException.js +22 -0
  18. package/dist/cjs/exceptions/MathNotSupportedException.d.ts +11 -0
  19. package/dist/cjs/exceptions/MathNotSupportedException.js +18 -0
  20. package/dist/cjs/exceptions/MathSyntaxException.d.ts +11 -0
  21. package/dist/cjs/exceptions/MathSyntaxException.js +18 -0
  22. package/dist/cjs/exceptions/MathTimeoutException.d.ts +10 -0
  23. package/dist/cjs/exceptions/MathTimeoutException.js +17 -0
  24. package/dist/cjs/exceptions/MathUnitException.d.ts +11 -0
  25. package/dist/cjs/exceptions/MathUnitException.js +18 -0
  26. package/dist/cjs/exceptions/MathUnknownFunctionException.d.ts +12 -0
  27. package/dist/cjs/exceptions/MathUnknownFunctionException.js +19 -0
  28. package/dist/cjs/exports/Math.d.ts +28 -0
  29. package/dist/cjs/exports/Math.js +84 -0
  30. package/dist/cjs/lib/Addon.d.ts +5 -0
  31. package/dist/cjs/lib/Addon.js +9 -0
  32. package/dist/cjs/lib/Context.d.ts +90 -0
  33. package/dist/cjs/lib/Context.js +134 -0
  34. package/dist/cjs/lib/Decimal.d.ts +276 -0
  35. package/dist/cjs/lib/Decimal.js +402 -0
  36. package/dist/cjs/lib/Defaults.d.ts +273 -0
  37. package/dist/cjs/lib/Defaults.js +308 -0
  38. package/dist/cjs/lib/Distribution.d.ts +177 -0
  39. package/dist/cjs/lib/Distribution.js +196 -0
  40. package/dist/cjs/lib/Expression.d.ts +791 -0
  41. package/dist/cjs/lib/Expression.js +991 -0
  42. package/dist/cjs/lib/ExpressionMatrix.d.ts +284 -0
  43. package/dist/cjs/lib/ExpressionMatrix.js +412 -0
  44. package/dist/cjs/lib/LinearAlgebra.d.ts +613 -0
  45. package/dist/cjs/lib/LinearAlgebra.js +712 -0
  46. package/dist/cjs/lib/MathScope.d.ts +268 -0
  47. package/dist/cjs/lib/MathScope.js +316 -0
  48. package/dist/cjs/lib/MathSet.d.ts +139 -0
  49. package/dist/cjs/lib/MathSet.js +376 -0
  50. package/dist/cjs/lib/Matrix.d.ts +212 -0
  51. package/dist/cjs/lib/Matrix.js +393 -0
  52. package/dist/cjs/lib/Native.d.ts +80 -0
  53. package/dist/cjs/lib/Native.js +61 -0
  54. package/dist/cjs/lib/NumberTheory.d.ts +356 -0
  55. package/dist/cjs/lib/NumberTheory.js +524 -0
  56. package/dist/cjs/lib/Numeric.d.ts +363 -0
  57. package/dist/cjs/lib/Numeric.js +243 -0
  58. package/dist/cjs/lib/Polynomials.d.ts +140 -0
  59. package/dist/cjs/lib/Polynomials.js +167 -0
  60. package/dist/cjs/lib/SparseMatrix.d.ts +125 -0
  61. package/dist/cjs/lib/SparseMatrix.js +341 -0
  62. package/dist/cjs/lib/Statistics.d.ts +366 -0
  63. package/dist/cjs/lib/Statistics.js +380 -0
  64. package/dist/cjs/lib/Unit.d.ts +342 -0
  65. package/dist/cjs/lib/Unit.js +1027 -0
  66. package/dist/cjs/lib/UnitTable.d.ts +39 -0
  67. package/dist/cjs/lib/UnitTable.js +634 -0
  68. package/dist/cjs/package.json +1 -0
  69. package/dist/esm/exceptions/MathArgumentException.js +14 -0
  70. package/dist/esm/exceptions/MathCancelledException.js +13 -0
  71. package/dist/esm/exceptions/MathDefinitionException.js +14 -0
  72. package/dist/esm/exceptions/MathDivisionByZeroException.js +13 -0
  73. package/dist/esm/exceptions/MathDomainException.js +14 -0
  74. package/dist/esm/exceptions/MathException.js +18 -0
  75. package/dist/esm/exceptions/MathNotSupportedException.js +14 -0
  76. package/dist/esm/exceptions/MathSyntaxException.js +14 -0
  77. package/dist/esm/exceptions/MathTimeoutException.js +13 -0
  78. package/dist/esm/exceptions/MathUnitException.js +14 -0
  79. package/dist/esm/exceptions/MathUnknownFunctionException.js +15 -0
  80. package/dist/esm/exports/Math.js +26 -0
  81. package/dist/esm/lib/Addon.js +10 -0
  82. package/dist/esm/lib/Context.js +128 -0
  83. package/dist/esm/lib/Decimal.js +397 -0
  84. package/dist/esm/lib/Defaults.js +290 -0
  85. package/dist/esm/lib/Distribution.js +191 -0
  86. package/dist/esm/lib/Expression.js +979 -0
  87. package/dist/esm/lib/ExpressionMatrix.js +407 -0
  88. package/dist/esm/lib/LinearAlgebra.js +708 -0
  89. package/dist/esm/lib/MathScope.js +311 -0
  90. package/dist/esm/lib/MathSet.js +370 -0
  91. package/dist/esm/lib/Matrix.js +382 -0
  92. package/dist/esm/lib/Native.js +56 -0
  93. package/dist/esm/lib/NumberTheory.js +520 -0
  94. package/dist/esm/lib/Numeric.js +239 -0
  95. package/dist/esm/lib/Polynomials.js +163 -0
  96. package/dist/esm/lib/SparseMatrix.js +332 -0
  97. package/dist/esm/lib/Statistics.js +376 -0
  98. package/dist/esm/lib/Unit.js +1018 -0
  99. package/dist/esm/lib/UnitTable.js +631 -0
  100. package/dist/types/exceptions/MathArgumentException.d.ts +11 -0
  101. package/dist/types/exceptions/MathCancelledException.d.ts +10 -0
  102. package/dist/types/exceptions/MathDefinitionException.d.ts +11 -0
  103. package/dist/types/exceptions/MathDivisionByZeroException.d.ts +10 -0
  104. package/dist/types/exceptions/MathDomainException.d.ts +11 -0
  105. package/dist/types/exceptions/MathException.d.ts +19 -0
  106. package/dist/types/exceptions/MathNotSupportedException.d.ts +11 -0
  107. package/dist/types/exceptions/MathSyntaxException.d.ts +11 -0
  108. package/dist/types/exceptions/MathTimeoutException.d.ts +10 -0
  109. package/dist/types/exceptions/MathUnitException.d.ts +11 -0
  110. package/dist/types/exceptions/MathUnknownFunctionException.d.ts +12 -0
  111. package/dist/types/exports/Math.d.ts +28 -0
  112. package/dist/types/lib/Addon.d.ts +5 -0
  113. package/dist/types/lib/Context.d.ts +90 -0
  114. package/dist/types/lib/Decimal.d.ts +276 -0
  115. package/dist/types/lib/Defaults.d.ts +273 -0
  116. package/dist/types/lib/Distribution.d.ts +177 -0
  117. package/dist/types/lib/Expression.d.ts +791 -0
  118. package/dist/types/lib/ExpressionMatrix.d.ts +284 -0
  119. package/dist/types/lib/LinearAlgebra.d.ts +613 -0
  120. package/dist/types/lib/MathScope.d.ts +268 -0
  121. package/dist/types/lib/MathSet.d.ts +139 -0
  122. package/dist/types/lib/Matrix.d.ts +212 -0
  123. package/dist/types/lib/Native.d.ts +80 -0
  124. package/dist/types/lib/NumberTheory.d.ts +356 -0
  125. package/dist/types/lib/Numeric.d.ts +363 -0
  126. package/dist/types/lib/Polynomials.d.ts +140 -0
  127. package/dist/types/lib/SparseMatrix.d.ts +125 -0
  128. package/dist/types/lib/Statistics.d.ts +366 -0
  129. package/dist/types/lib/Unit.d.ts +342 -0
  130. package/dist/types/lib/UnitTable.d.ts +39 -0
  131. package/native/addon.cpp +1374 -0
  132. package/native/async/Pool.cpp +133 -0
  133. package/native/async/Pool.h +59 -0
  134. package/native/config/boost_math_policy.h +26 -0
  135. package/native/config/mpdecimal/mpdecimal.h +809 -0
  136. package/native/config/symengine/symengine_config.h +44 -0
  137. package/native/config/symengine/symengine_export.h +19 -0
  138. package/native/core/Errors.cpp +77 -0
  139. package/native/core/Errors.h +72 -0
  140. package/native/core/Handle.cpp +109 -0
  141. package/native/core/Handle.h +72 -0
  142. package/native/core/Scope.cpp +122 -0
  143. package/native/core/Scope.h +36 -0
  144. package/native/functions/Functions.cpp +468 -0
  145. package/native/functions/Functions.h +115 -0
  146. package/native/functions/Gosper.cpp +429 -0
  147. package/native/functions/Gosper.h +20 -0
  148. package/native/functions/SpecialIntegrals.cpp +329 -0
  149. package/native/functions/SpecialIntegrals.h +53 -0
  150. package/native/functions/Summation.cpp +645 -0
  151. package/native/functions/Summation.h +42 -0
  152. package/native/integrals/Integrals.cpp +1428 -0
  153. package/native/integrals/Integrals.h +32 -0
  154. package/native/limits/Gruntz.cpp +1332 -0
  155. package/native/limits/Gruntz.h +24 -0
  156. package/native/linalg/Decompositions.cpp +159 -0
  157. package/native/linalg/Functions.cpp +199 -0
  158. package/native/linalg/Linalg.cpp +123 -0
  159. package/native/linalg/Linalg.h +67 -0
  160. package/native/linalg/LinalgSupport.h +69 -0
  161. package/native/linalg/Sparse.cpp +172 -0
  162. package/native/matrix/Matrices.cpp +766 -0
  163. package/native/matrix/Matrices.h +74 -0
  164. package/native/ntheory/NumberTheory.cpp +754 -0
  165. package/native/ntheory/NumberTheory.h +56 -0
  166. package/native/numeric/Compiled.cpp +93 -0
  167. package/native/numeric/Compiled.h +49 -0
  168. package/native/numeric/Integrate.cpp +718 -0
  169. package/native/numeric/Numeric.h +95 -0
  170. package/native/numeric/ODE.cpp +542 -0
  171. package/native/numeric/Roots.cpp +402 -0
  172. package/native/ops/Decimal.cpp +776 -0
  173. package/native/ops/Decimal.h +182 -0
  174. package/native/ops/DecimalComplex.cpp +738 -0
  175. package/native/ops/DecimalEvaluator.h +79 -0
  176. package/native/ops/DecimalFunctions.cpp +439 -0
  177. package/native/ops/DecimalOperations.cpp +236 -0
  178. package/native/ops/DecimalSpecial.cpp +1028 -0
  179. package/native/ops/DecimalSupport.h +109 -0
  180. package/native/ops/Operations.cpp +969 -0
  181. package/native/ops/Operations.h +120 -0
  182. package/native/ops/Piecewise.cpp +195 -0
  183. package/native/ops/Piecewise.h +40 -0
  184. package/native/parser/Parser.cpp +853 -0
  185. package/native/parser/Parser.h +56 -0
  186. package/native/poly/Convert.cpp +210 -0
  187. package/native/poly/Convert.h +40 -0
  188. package/native/poly/Dense.cpp +1008 -0
  189. package/native/poly/Dense.h +136 -0
  190. package/native/poly/Euclid.cpp +446 -0
  191. package/native/poly/Euclid.h +44 -0
  192. package/native/poly/Factor.cpp +919 -0
  193. package/native/poly/Factor.h +36 -0
  194. package/native/poly/Galois.cpp +439 -0
  195. package/native/poly/Galois.h +86 -0
  196. package/native/poly/Inequalities.cpp +227 -0
  197. package/native/poly/Inequalities.h +21 -0
  198. package/native/poly/Poly.cpp +338 -0
  199. package/native/poly/Poly.h +46 -0
  200. package/native/poly/Rational.cpp +403 -0
  201. package/native/poly/Rational.h +33 -0
  202. package/native/poly/RealRoots.cpp +136 -0
  203. package/native/poly/RealRoots.h +35 -0
  204. package/native/printer/Printer.cpp +973 -0
  205. package/native/printer/Printer.h +23 -0
  206. package/native/simplify/Simplify.cpp +921 -0
  207. package/native/simplify/Simplify.h +21 -0
  208. package/native/stats/Distributions.cpp +392 -0
  209. package/native/stats/Distributions.h +33 -0
  210. package/native/stats/Statistics.cpp +255 -0
  211. package/native/stats/Statistics.h +25 -0
  212. package/package.json +85 -4
  213. package/scripts/sources.mjs +35 -0
  214. package/vendor/PATCHES.md +169 -0
  215. package/vendor/boost/config/README.md +43 -0
  216. package/vendor/boost/config/include/boost/config/abi/borland_prefix.hpp +27 -0
  217. package/vendor/boost/config/include/boost/config/abi/borland_suffix.hpp +12 -0
  218. package/vendor/boost/config/include/boost/config/abi/msvc_prefix.hpp +22 -0
  219. package/vendor/boost/config/include/boost/config/abi/msvc_suffix.hpp +8 -0
  220. package/vendor/boost/config/include/boost/config/abi_prefix.hpp +25 -0
  221. package/vendor/boost/config/include/boost/config/abi_suffix.hpp +25 -0
  222. package/vendor/boost/config/include/boost/config/assert_cxx03.hpp +211 -0
  223. package/vendor/boost/config/include/boost/config/assert_cxx11.hpp +212 -0
  224. package/vendor/boost/config/include/boost/config/assert_cxx14.hpp +47 -0
  225. package/vendor/boost/config/include/boost/config/assert_cxx17.hpp +65 -0
  226. package/vendor/boost/config/include/boost/config/assert_cxx20.hpp +59 -0
  227. package/vendor/boost/config/include/boost/config/assert_cxx23.hpp +41 -0
  228. package/vendor/boost/config/include/boost/config/assert_cxx98.hpp +23 -0
  229. package/vendor/boost/config/include/boost/config/auto_link.hpp +530 -0
  230. package/vendor/boost/config/include/boost/config/compiler/borland.hpp +342 -0
  231. package/vendor/boost/config/include/boost/config/compiler/clang.hpp +370 -0
  232. package/vendor/boost/config/include/boost/config/compiler/clang_version.hpp +98 -0
  233. package/vendor/boost/config/include/boost/config/compiler/codegear.hpp +389 -0
  234. package/vendor/boost/config/include/boost/config/compiler/comeau.hpp +59 -0
  235. package/vendor/boost/config/include/boost/config/compiler/common_edg.hpp +185 -0
  236. package/vendor/boost/config/include/boost/config/compiler/compaq_cxx.hpp +19 -0
  237. package/vendor/boost/config/include/boost/config/compiler/cray.hpp +446 -0
  238. package/vendor/boost/config/include/boost/config/compiler/diab.hpp +26 -0
  239. package/vendor/boost/config/include/boost/config/compiler/digitalmars.hpp +146 -0
  240. package/vendor/boost/config/include/boost/config/compiler/gcc.hpp +386 -0
  241. package/vendor/boost/config/include/boost/config/compiler/gcc_xml.hpp +115 -0
  242. package/vendor/boost/config/include/boost/config/compiler/greenhills.hpp +28 -0
  243. package/vendor/boost/config/include/boost/config/compiler/hp_acc.hpp +153 -0
  244. package/vendor/boost/config/include/boost/config/compiler/intel.hpp +577 -0
  245. package/vendor/boost/config/include/boost/config/compiler/kai.hpp +33 -0
  246. package/vendor/boost/config/include/boost/config/compiler/metrowerks.hpp +201 -0
  247. package/vendor/boost/config/include/boost/config/compiler/mpw.hpp +143 -0
  248. package/vendor/boost/config/include/boost/config/compiler/nvcc.hpp +64 -0
  249. package/vendor/boost/config/include/boost/config/compiler/pathscale.hpp +141 -0
  250. package/vendor/boost/config/include/boost/config/compiler/pgi.hpp +23 -0
  251. package/vendor/boost/config/include/boost/config/compiler/sgi_mipspro.hpp +29 -0
  252. package/vendor/boost/config/include/boost/config/compiler/sunpro_cc.hpp +225 -0
  253. package/vendor/boost/config/include/boost/config/compiler/vacpp.hpp +189 -0
  254. package/vendor/boost/config/include/boost/config/compiler/visualc.hpp +400 -0
  255. package/vendor/boost/config/include/boost/config/compiler/xlcpp.hpp +303 -0
  256. package/vendor/boost/config/include/boost/config/compiler/xlcpp_zos.hpp +174 -0
  257. package/vendor/boost/config/include/boost/config/detail/cxx_composite.hpp +218 -0
  258. package/vendor/boost/config/include/boost/config/detail/posix_features.hpp +95 -0
  259. package/vendor/boost/config/include/boost/config/detail/select_compiler_config.hpp +157 -0
  260. package/vendor/boost/config/include/boost/config/detail/select_platform_config.hpp +147 -0
  261. package/vendor/boost/config/include/boost/config/detail/select_stdlib_config.hpp +121 -0
  262. package/vendor/boost/config/include/boost/config/detail/suffix.hpp +1334 -0
  263. package/vendor/boost/config/include/boost/config/header_deprecated.hpp +26 -0
  264. package/vendor/boost/config/include/boost/config/helper_macros.hpp +37 -0
  265. package/vendor/boost/config/include/boost/config/no_tr1/cmath.hpp +28 -0
  266. package/vendor/boost/config/include/boost/config/no_tr1/complex.hpp +28 -0
  267. package/vendor/boost/config/include/boost/config/no_tr1/functional.hpp +28 -0
  268. package/vendor/boost/config/include/boost/config/no_tr1/memory.hpp +28 -0
  269. package/vendor/boost/config/include/boost/config/no_tr1/utility.hpp +28 -0
  270. package/vendor/boost/config/include/boost/config/platform/aix.hpp +33 -0
  271. package/vendor/boost/config/include/boost/config/platform/amigaos.hpp +15 -0
  272. package/vendor/boost/config/include/boost/config/platform/beos.hpp +26 -0
  273. package/vendor/boost/config/include/boost/config/platform/bsd.hpp +83 -0
  274. package/vendor/boost/config/include/boost/config/platform/cloudabi.hpp +18 -0
  275. package/vendor/boost/config/include/boost/config/platform/cray.hpp +18 -0
  276. package/vendor/boost/config/include/boost/config/platform/cygwin.hpp +71 -0
  277. package/vendor/boost/config/include/boost/config/platform/haiku.hpp +31 -0
  278. package/vendor/boost/config/include/boost/config/platform/hpux.hpp +87 -0
  279. package/vendor/boost/config/include/boost/config/platform/irix.hpp +31 -0
  280. package/vendor/boost/config/include/boost/config/platform/linux.hpp +106 -0
  281. package/vendor/boost/config/include/boost/config/platform/macos.hpp +87 -0
  282. package/vendor/boost/config/include/boost/config/platform/qnxnto.hpp +31 -0
  283. package/vendor/boost/config/include/boost/config/platform/solaris.hpp +31 -0
  284. package/vendor/boost/config/include/boost/config/platform/symbian.hpp +97 -0
  285. package/vendor/boost/config/include/boost/config/platform/vms.hpp +25 -0
  286. package/vendor/boost/config/include/boost/config/platform/vxworks.hpp +422 -0
  287. package/vendor/boost/config/include/boost/config/platform/wasm.hpp +23 -0
  288. package/vendor/boost/config/include/boost/config/platform/win32.hpp +90 -0
  289. package/vendor/boost/config/include/boost/config/platform/zos.hpp +32 -0
  290. package/vendor/boost/config/include/boost/config/pragma_message.hpp +31 -0
  291. package/vendor/boost/config/include/boost/config/requires_threads.hpp +92 -0
  292. package/vendor/boost/config/include/boost/config/stdlib/dinkumware.hpp +324 -0
  293. package/vendor/boost/config/include/boost/config/stdlib/libcomo.hpp +93 -0
  294. package/vendor/boost/config/include/boost/config/stdlib/libcpp.hpp +185 -0
  295. package/vendor/boost/config/include/boost/config/stdlib/libstdcpp3.hpp +482 -0
  296. package/vendor/boost/config/include/boost/config/stdlib/modena.hpp +79 -0
  297. package/vendor/boost/config/include/boost/config/stdlib/msl.hpp +98 -0
  298. package/vendor/boost/config/include/boost/config/stdlib/roguewave.hpp +208 -0
  299. package/vendor/boost/config/include/boost/config/stdlib/sgi.hpp +168 -0
  300. package/vendor/boost/config/include/boost/config/stdlib/stlport.hpp +258 -0
  301. package/vendor/boost/config/include/boost/config/stdlib/vacpp.hpp +74 -0
  302. package/vendor/boost/config/include/boost/config/stdlib/xlcpp_zos.hpp +61 -0
  303. package/vendor/boost/config/include/boost/config/user.hpp +133 -0
  304. package/vendor/boost/config/include/boost/config/warning_disable.hpp +47 -0
  305. package/vendor/boost/config/include/boost/config/workaround.hpp +310 -0
  306. package/vendor/boost/config/include/boost/config.hpp +67 -0
  307. package/vendor/boost/config/include/boost/cstdint.hpp +556 -0
  308. package/vendor/boost/config/include/boost/cxx11_char_types.hpp +70 -0
  309. package/vendor/boost/config/include/boost/detail/workaround.hpp +10 -0
  310. package/vendor/boost/config/include/boost/limits.hpp +146 -0
  311. package/vendor/boost/config/include/boost/static_assert.hpp +179 -0
  312. package/vendor/boost/config/include/boost/version.hpp +32 -0
  313. package/vendor/boost/math/LICENSE +23 -0
  314. package/vendor/boost/math/README.md +184 -0
  315. package/vendor/boost/math/include/boost/cstdfloat.hpp +58 -0
  316. package/vendor/boost/math/include/boost/math/bindings/detail/big_digamma.hpp +297 -0
  317. package/vendor/boost/math/include/boost/math/bindings/detail/big_lanczos.hpp +777 -0
  318. package/vendor/boost/math/include/boost/math/bindings/mpfr.hpp +974 -0
  319. package/vendor/boost/math/include/boost/math/bindings/mpreal.hpp +921 -0
  320. package/vendor/boost/math/include/boost/math/bindings/rr.hpp +876 -0
  321. package/vendor/boost/math/include/boost/math/ccmath/abs.hpp +89 -0
  322. package/vendor/boost/math/include/boost/math/ccmath/ccmath.hpp +45 -0
  323. package/vendor/boost/math/include/boost/math/ccmath/ceil.hpp +78 -0
  324. package/vendor/boost/math/include/boost/math/ccmath/copysign.hpp +81 -0
  325. package/vendor/boost/math/include/boost/math/ccmath/detail/config.hpp +52 -0
  326. package/vendor/boost/math/include/boost/math/ccmath/detail/swap.hpp +21 -0
  327. package/vendor/boost/math/include/boost/math/ccmath/div.hpp +86 -0
  328. package/vendor/boost/math/include/boost/math/ccmath/fabs.hpp +41 -0
  329. package/vendor/boost/math/include/boost/math/ccmath/fdim.hpp +93 -0
  330. package/vendor/boost/math/include/boost/math/ccmath/floor.hpp +131 -0
  331. package/vendor/boost/math/include/boost/math/ccmath/fma.hpp +130 -0
  332. package/vendor/boost/math/include/boost/math/ccmath/fmax.hpp +89 -0
  333. package/vendor/boost/math/include/boost/math/ccmath/fmin.hpp +89 -0
  334. package/vendor/boost/math/include/boost/math/ccmath/fmod.hpp +114 -0
  335. package/vendor/boost/math/include/boost/math/ccmath/fpclassify.hpp +48 -0
  336. package/vendor/boost/math/include/boost/math/ccmath/frexp.hpp +101 -0
  337. package/vendor/boost/math/include/boost/math/ccmath/hypot.hpp +116 -0
  338. package/vendor/boost/math/include/boost/math/ccmath/ilogb.hpp +60 -0
  339. package/vendor/boost/math/include/boost/math/ccmath/isfinite.hpp +53 -0
  340. package/vendor/boost/math/include/boost/math/ccmath/isgreater.hpp +42 -0
  341. package/vendor/boost/math/include/boost/math/ccmath/isgreaterequal.hpp +42 -0
  342. package/vendor/boost/math/include/boost/math/ccmath/isinf.hpp +61 -0
  343. package/vendor/boost/math/include/boost/math/ccmath/isless.hpp +42 -0
  344. package/vendor/boost/math/include/boost/math/ccmath/islessequal.hpp +42 -0
  345. package/vendor/boost/math/include/boost/math/ccmath/isnan.hpp +42 -0
  346. package/vendor/boost/math/include/boost/math/ccmath/isnormal.hpp +47 -0
  347. package/vendor/boost/math/include/boost/math/ccmath/isunordered.hpp +35 -0
  348. package/vendor/boost/math/include/boost/math/ccmath/ldexp.hpp +81 -0
  349. package/vendor/boost/math/include/boost/math/ccmath/logb.hpp +86 -0
  350. package/vendor/boost/math/include/boost/math/ccmath/modf.hpp +79 -0
  351. package/vendor/boost/math/include/boost/math/ccmath/next.hpp +458 -0
  352. package/vendor/boost/math/include/boost/math/ccmath/remainder.hpp +106 -0
  353. package/vendor/boost/math/include/boost/math/ccmath/round.hpp +179 -0
  354. package/vendor/boost/math/include/boost/math/ccmath/scalbln.hpp +60 -0
  355. package/vendor/boost/math/include/boost/math/ccmath/scalbn.hpp +81 -0
  356. package/vendor/boost/math/include/boost/math/ccmath/signbit.hpp +218 -0
  357. package/vendor/boost/math/include/boost/math/ccmath/sqrt.hpp +80 -0
  358. package/vendor/boost/math/include/boost/math/ccmath/trunc.hpp +70 -0
  359. package/vendor/boost/math/include/boost/math/common_factor.hpp +23 -0
  360. package/vendor/boost/math/include/boost/math/common_factor_ct.hpp +34 -0
  361. package/vendor/boost/math/include/boost/math/common_factor_rt.hpp +30 -0
  362. package/vendor/boost/math/include/boost/math/complex/acos.hpp +245 -0
  363. package/vendor/boost/math/include/boost/math/complex/acosh.hpp +34 -0
  364. package/vendor/boost/math/include/boost/math/complex/asin.hpp +252 -0
  365. package/vendor/boost/math/include/boost/math/complex/asinh.hpp +32 -0
  366. package/vendor/boost/math/include/boost/math/complex/atan.hpp +36 -0
  367. package/vendor/boost/math/include/boost/math/complex/atanh.hpp +214 -0
  368. package/vendor/boost/math/include/boost/math/complex/details.hpp +68 -0
  369. package/vendor/boost/math/include/boost/math/complex/fabs.hpp +23 -0
  370. package/vendor/boost/math/include/boost/math/complex.hpp +32 -0
  371. package/vendor/boost/math/include/boost/math/concepts/distributions.hpp +497 -0
  372. package/vendor/boost/math/include/boost/math/concepts/real_concept.hpp +400 -0
  373. package/vendor/boost/math/include/boost/math/concepts/real_type_concept.hpp +119 -0
  374. package/vendor/boost/math/include/boost/math/concepts/std_real_concept.hpp +427 -0
  375. package/vendor/boost/math/include/boost/math/constants/calculate_constants.hpp +1117 -0
  376. package/vendor/boost/math/include/boost/math/constants/constants.hpp +360 -0
  377. package/vendor/boost/math/include/boost/math/constants/info.hpp +169 -0
  378. package/vendor/boost/math/include/boost/math/cstdfloat/cstdfloat_cmath.hpp +1012 -0
  379. package/vendor/boost/math/include/boost/math/cstdfloat/cstdfloat_complex.hpp +38 -0
  380. package/vendor/boost/math/include/boost/math/cstdfloat/cstdfloat_complex_std.hpp +813 -0
  381. package/vendor/boost/math/include/boost/math/cstdfloat/cstdfloat_iostream.hpp +822 -0
  382. package/vendor/boost/math/include/boost/math/cstdfloat/cstdfloat_limits.hpp +87 -0
  383. package/vendor/boost/math/include/boost/math/cstdfloat/cstdfloat_types.hpp +441 -0
  384. package/vendor/boost/math/include/boost/math/differentiation/autodiff.hpp +2061 -0
  385. package/vendor/boost/math/include/boost/math/differentiation/autodiff_cpp11.hpp +387 -0
  386. package/vendor/boost/math/include/boost/math/differentiation/autodiff_reverse.hpp +811 -0
  387. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_basic_operator_expressions.hpp +276 -0
  388. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_basic_ops_et.hpp +160 -0
  389. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_basic_ops_no_et.hpp +154 -0
  390. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_comparison_operator_overloads.hpp +167 -0
  391. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_erf_overloads.hpp +234 -0
  392. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_expression_template_base.hpp +258 -0
  393. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_helper_functions.hpp +18 -0
  394. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_memory_management.hpp +462 -0
  395. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_stl_et.hpp +275 -0
  396. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_stl_expressions.hpp +852 -0
  397. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_stl_no_et.hpp +266 -0
  398. package/vendor/boost/math/include/boost/math/differentiation/detail/reverse_mode_autodiff_utilities.hpp +51 -0
  399. package/vendor/boost/math/include/boost/math/differentiation/finite_difference.hpp +266 -0
  400. package/vendor/boost/math/include/boost/math/differentiation/lanczos_smoothing.hpp +591 -0
  401. package/vendor/boost/math/include/boost/math/distributions/arcsine.hpp +593 -0
  402. package/vendor/boost/math/include/boost/math/distributions/bernoulli.hpp +349 -0
  403. package/vendor/boost/math/include/boost/math/distributions/beta.hpp +584 -0
  404. package/vendor/boost/math/include/boost/math/distributions/binomial.hpp +729 -0
  405. package/vendor/boost/math/include/boost/math/distributions/cauchy.hpp +379 -0
  406. package/vendor/boost/math/include/boost/math/distributions/chi_squared.hpp +345 -0
  407. package/vendor/boost/math/include/boost/math/distributions/complement.hpp +198 -0
  408. package/vendor/boost/math/include/boost/math/distributions/detail/common_error_handling.hpp +228 -0
  409. package/vendor/boost/math/include/boost/math/distributions/detail/derived_accessors.hpp +190 -0
  410. package/vendor/boost/math/include/boost/math/distributions/detail/generic_mode.hpp +145 -0
  411. package/vendor/boost/math/include/boost/math/distributions/detail/generic_quantile.hpp +100 -0
  412. package/vendor/boost/math/include/boost/math/distributions/detail/hypergeometric_cdf.hpp +101 -0
  413. package/vendor/boost/math/include/boost/math/distributions/detail/hypergeometric_pdf.hpp +490 -0
  414. package/vendor/boost/math/include/boost/math/distributions/detail/hypergeometric_quantile.hpp +245 -0
  415. package/vendor/boost/math/include/boost/math/distributions/detail/inv_discrete_quantile.hpp +583 -0
  416. package/vendor/boost/math/include/boost/math/distributions/empirical_cumulative_distribution_function.hpp +73 -0
  417. package/vendor/boost/math/include/boost/math/distributions/exponential.hpp +352 -0
  418. package/vendor/boost/math/include/boost/math/distributions/extreme_value.hpp +388 -0
  419. package/vendor/boost/math/include/boost/math/distributions/find_location.hpp +141 -0
  420. package/vendor/boost/math/include/boost/math/distributions/find_scale.hpp +200 -0
  421. package/vendor/boost/math/include/boost/math/distributions/fisher_f.hpp +393 -0
  422. package/vendor/boost/math/include/boost/math/distributions/fwd.hpp +171 -0
  423. package/vendor/boost/math/include/boost/math/distributions/gamma.hpp +396 -0
  424. package/vendor/boost/math/include/boost/math/distributions/geometric.hpp +571 -0
  425. package/vendor/boost/math/include/boost/math/distributions/holtsmark.hpp +2518 -0
  426. package/vendor/boost/math/include/boost/math/distributions/hyperexponential.hpp +641 -0
  427. package/vendor/boost/math/include/boost/math/distributions/hypergeometric.hpp +313 -0
  428. package/vendor/boost/math/include/boost/math/distributions/inverse_chi_squared.hpp +398 -0
  429. package/vendor/boost/math/include/boost/math/distributions/inverse_gamma.hpp +504 -0
  430. package/vendor/boost/math/include/boost/math/distributions/inverse_gaussian.hpp +566 -0
  431. package/vendor/boost/math/include/boost/math/distributions/kolmogorov_smirnov.hpp +511 -0
  432. package/vendor/boost/math/include/boost/math/distributions/landau.hpp +4642 -0
  433. package/vendor/boost/math/include/boost/math/distributions/laplace.hpp +494 -0
  434. package/vendor/boost/math/include/boost/math/distributions/logistic.hpp +377 -0
  435. package/vendor/boost/math/include/boost/math/distributions/lognormal.hpp +361 -0
  436. package/vendor/boost/math/include/boost/math/distributions/mapairy.hpp +4220 -0
  437. package/vendor/boost/math/include/boost/math/distributions/negative_binomial.hpp +609 -0
  438. package/vendor/boost/math/include/boost/math/distributions/non_central_beta.hpp +981 -0
  439. package/vendor/boost/math/include/boost/math/distributions/non_central_chi_squared.hpp +998 -0
  440. package/vendor/boost/math/include/boost/math/distributions/non_central_f.hpp +712 -0
  441. package/vendor/boost/math/include/boost/math/distributions/non_central_t.hpp +1324 -0
  442. package/vendor/boost/math/include/boost/math/distributions/normal.hpp +368 -0
  443. package/vendor/boost/math/include/boost/math/distributions/pareto.hpp +508 -0
  444. package/vendor/boost/math/include/boost/math/distributions/poisson.hpp +563 -0
  445. package/vendor/boost/math/include/boost/math/distributions/rayleigh.hpp +381 -0
  446. package/vendor/boost/math/include/boost/math/distributions/saspoint5.hpp +2796 -0
  447. package/vendor/boost/math/include/boost/math/distributions/skew_normal.hpp +760 -0
  448. package/vendor/boost/math/include/boost/math/distributions/students_t.hpp +721 -0
  449. package/vendor/boost/math/include/boost/math/distributions/triangular.hpp +548 -0
  450. package/vendor/boost/math/include/boost/math/distributions/uniform.hpp +398 -0
  451. package/vendor/boost/math/include/boost/math/distributions/weibull.hpp +487 -0
  452. package/vendor/boost/math/include/boost/math/distributions.hpp +58 -0
  453. package/vendor/boost/math/include/boost/math/filters/daubechies.hpp +99 -0
  454. package/vendor/boost/math/include/boost/math/interpolators/barycentric_rational.hpp +99 -0
  455. package/vendor/boost/math/include/boost/math/interpolators/bezier_polynomial.hpp +60 -0
  456. package/vendor/boost/math/include/boost/math/interpolators/bilinear_uniform.hpp +54 -0
  457. package/vendor/boost/math/include/boost/math/interpolators/cardinal_cubic_b_spline.hpp +87 -0
  458. package/vendor/boost/math/include/boost/math/interpolators/cardinal_quadratic_b_spline.hpp +57 -0
  459. package/vendor/boost/math/include/boost/math/interpolators/cardinal_quintic_b_spline.hpp +62 -0
  460. package/vendor/boost/math/include/boost/math/interpolators/cardinal_trigonometric.hpp +58 -0
  461. package/vendor/boost/math/include/boost/math/interpolators/catmull_rom.hpp +310 -0
  462. package/vendor/boost/math/include/boost/math/interpolators/cubic_b_spline.hpp +90 -0
  463. package/vendor/boost/math/include/boost/math/interpolators/cubic_hermite.hpp +142 -0
  464. package/vendor/boost/math/include/boost/math/interpolators/detail/barycentric_rational_detail.hpp +215 -0
  465. package/vendor/boost/math/include/boost/math/interpolators/detail/bezier_polynomial_detail.hpp +167 -0
  466. package/vendor/boost/math/include/boost/math/interpolators/detail/bilinear_uniform_detail.hpp +137 -0
  467. package/vendor/boost/math/include/boost/math/interpolators/detail/cardinal_cubic_b_spline_detail.hpp +331 -0
  468. package/vendor/boost/math/include/boost/math/interpolators/detail/cardinal_quadratic_b_spline_detail.hpp +208 -0
  469. package/vendor/boost/math/include/boost/math/interpolators/detail/cardinal_quintic_b_spline_detail.hpp +241 -0
  470. package/vendor/boost/math/include/boost/math/interpolators/detail/cardinal_trigonometric_detail.hpp +684 -0
  471. package/vendor/boost/math/include/boost/math/interpolators/detail/cubic_b_spline_detail.hpp +330 -0
  472. package/vendor/boost/math/include/boost/math/interpolators/detail/cubic_hermite_detail.hpp +439 -0
  473. package/vendor/boost/math/include/boost/math/interpolators/detail/quintic_hermite_detail.hpp +586 -0
  474. package/vendor/boost/math/include/boost/math/interpolators/detail/septic_hermite_detail.hpp +653 -0
  475. package/vendor/boost/math/include/boost/math/interpolators/detail/vector_barycentric_rational_detail.hpp +196 -0
  476. package/vendor/boost/math/include/boost/math/interpolators/detail/whittaker_shannon_detail.hpp +128 -0
  477. package/vendor/boost/math/include/boost/math/interpolators/makima.hpp +178 -0
  478. package/vendor/boost/math/include/boost/math/interpolators/pchip.hpp +136 -0
  479. package/vendor/boost/math/include/boost/math/interpolators/quintic_hermite.hpp +143 -0
  480. package/vendor/boost/math/include/boost/math/interpolators/septic_hermite.hpp +147 -0
  481. package/vendor/boost/math/include/boost/math/interpolators/vector_barycentric_rational.hpp +82 -0
  482. package/vendor/boost/math/include/boost/math/interpolators/whittaker_shannon.hpp +47 -0
  483. package/vendor/boost/math/include/boost/math/octonion.hpp +4254 -0
  484. package/vendor/boost/math/include/boost/math/optimization/cma_es.hpp +392 -0
  485. package/vendor/boost/math/include/boost/math/optimization/detail/common.hpp +200 -0
  486. package/vendor/boost/math/include/boost/math/optimization/detail/differentiable_opt_utilties.hpp +157 -0
  487. package/vendor/boost/math/include/boost/math/optimization/detail/gradient_opt_base.hpp +92 -0
  488. package/vendor/boost/math/include/boost/math/optimization/detail/line_search_policies.hpp +206 -0
  489. package/vendor/boost/math/include/boost/math/optimization/detail/rdiff_optimization_policies.hpp +134 -0
  490. package/vendor/boost/math/include/boost/math/optimization/differential_evolution.hpp +236 -0
  491. package/vendor/boost/math/include/boost/math/optimization/gradient_descent.hpp +202 -0
  492. package/vendor/boost/math/include/boost/math/optimization/gradient_optimizers.hpp +18 -0
  493. package/vendor/boost/math/include/boost/math/optimization/jso.hpp +465 -0
  494. package/vendor/boost/math/include/boost/math/optimization/lbfgs.hpp +382 -0
  495. package/vendor/boost/math/include/boost/math/optimization/minimizer.hpp +336 -0
  496. package/vendor/boost/math/include/boost/math/optimization/nesterov.hpp +208 -0
  497. package/vendor/boost/math/include/boost/math/optimization/random_search.hpp +145 -0
  498. package/vendor/boost/math/include/boost/math/policies/error_handling.hpp +1062 -0
  499. package/vendor/boost/math/include/boost/math/policies/policy.hpp +1034 -0
  500. package/vendor/boost/math/include/boost/math/quadrature/detail/exp_sinh_detail.hpp +2002 -0
  501. package/vendor/boost/math/include/boost/math/quadrature/detail/ooura_fourier_integrals_detail.hpp +692 -0
  502. package/vendor/boost/math/include/boost/math/quadrature/detail/sinh_sinh_detail.hpp +1353 -0
  503. package/vendor/boost/math/include/boost/math/quadrature/detail/tanh_sinh_detail.hpp +879 -0
  504. package/vendor/boost/math/include/boost/math/quadrature/exp_sinh.hpp +180 -0
  505. package/vendor/boost/math/include/boost/math/quadrature/gauss.hpp +904 -0
  506. package/vendor/boost/math/include/boost/math/quadrature/gauss_kronrod.hpp +1317 -0
  507. package/vendor/boost/math/include/boost/math/quadrature/naive_monte_carlo.hpp +469 -0
  508. package/vendor/boost/math/include/boost/math/quadrature/ooura_fourier_integrals.hpp +68 -0
  509. package/vendor/boost/math/include/boost/math/quadrature/sinh_sinh.hpp +72 -0
  510. package/vendor/boost/math/include/boost/math/quadrature/tanh_sinh.hpp +289 -0
  511. package/vendor/boost/math/include/boost/math/quadrature/trapezoidal.hpp +125 -0
  512. package/vendor/boost/math/include/boost/math/quadrature/wavelet_transforms.hpp +47 -0
  513. package/vendor/boost/math/include/boost/math/quaternion.hpp +1190 -0
  514. package/vendor/boost/math/include/boost/math/special_functions/acosh.hpp +102 -0
  515. package/vendor/boost/math/include/boost/math/special_functions/airy.hpp +475 -0
  516. package/vendor/boost/math/include/boost/math/special_functions/asinh.hpp +110 -0
  517. package/vendor/boost/math/include/boost/math/special_functions/atanh.hpp +116 -0
  518. package/vendor/boost/math/include/boost/math/special_functions/bernoulli.hpp +149 -0
  519. package/vendor/boost/math/include/boost/math/special_functions/bessel.hpp +795 -0
  520. package/vendor/boost/math/include/boost/math/special_functions/bessel_iterators.hpp +187 -0
  521. package/vendor/boost/math/include/boost/math/special_functions/bessel_prime.hpp +343 -0
  522. package/vendor/boost/math/include/boost/math/special_functions/beta.hpp +1870 -0
  523. package/vendor/boost/math/include/boost/math/special_functions/binomial.hpp +87 -0
  524. package/vendor/boost/math/include/boost/math/special_functions/cardinal_b_spline.hpp +218 -0
  525. package/vendor/boost/math/include/boost/math/special_functions/cbrt.hpp +215 -0
  526. package/vendor/boost/math/include/boost/math/special_functions/chebyshev.hpp +314 -0
  527. package/vendor/boost/math/include/boost/math/special_functions/chebyshev_transform.hpp +237 -0
  528. package/vendor/boost/math/include/boost/math/special_functions/cos_pi.hpp +128 -0
  529. package/vendor/boost/math/include/boost/math/special_functions/daubechies_scaling.hpp +491 -0
  530. package/vendor/boost/math/include/boost/math/special_functions/daubechies_wavelet.hpp +266 -0
  531. package/vendor/boost/math/include/boost/math/special_functions/detail/airy_ai_bi_zero.hpp +222 -0
  532. package/vendor/boost/math/include/boost/math/special_functions/detail/bernoulli_details.hpp +629 -0
  533. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_derivatives_linear.hpp +107 -0
  534. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_i0.hpp +550 -0
  535. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_i1.hpp +556 -0
  536. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_ik.hpp +447 -0
  537. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_j0.hpp +192 -0
  538. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_j1.hpp +179 -0
  539. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_jn.hpp +127 -0
  540. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_jy.hpp +603 -0
  541. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_jy_asym.hpp +230 -0
  542. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_jy_derivatives_asym.hpp +141 -0
  543. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_jy_derivatives_series.hpp +219 -0
  544. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_jy_series.hpp +267 -0
  545. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_jy_zero.hpp +643 -0
  546. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_k0.hpp +485 -0
  547. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_k1.hpp +526 -0
  548. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_kn.hpp +91 -0
  549. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_y0.hpp +205 -0
  550. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_y1.hpp +183 -0
  551. package/vendor/boost/math/include/boost/math/special_functions/detail/bessel_yn.hpp +113 -0
  552. package/vendor/boost/math/include/boost/math/special_functions/detail/daubechies_scaling_integer_grid.hpp +244 -0
  553. package/vendor/boost/math/include/boost/math/special_functions/detail/erf_inv.hpp +559 -0
  554. package/vendor/boost/math/include/boost/math/special_functions/detail/fp_traits.hpp +562 -0
  555. package/vendor/boost/math/include/boost/math/special_functions/detail/gamma_inva.hpp +241 -0
  556. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_0F1_bessel.hpp +46 -0
  557. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_addition_theorems_on_z.hpp +293 -0
  558. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_bessel.hpp +768 -0
  559. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_by_ratios.hpp +678 -0
  560. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_cf.hpp +50 -0
  561. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_large_a.hpp +35 -0
  562. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_large_abz.hpp +492 -0
  563. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_negative_b_regions.hpp +521 -0
  564. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_recurrence.hpp +522 -0
  565. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_scaled_series.hpp +60 -0
  566. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_1F1_small_a_negative_b_by_ratio.hpp +70 -0
  567. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_asym.hpp +179 -0
  568. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_cf.hpp +228 -0
  569. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_pFq_checked_series.hpp +687 -0
  570. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_pade.hpp +131 -0
  571. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_rational.hpp +167 -0
  572. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_separated_series.hpp +50 -0
  573. package/vendor/boost/math/include/boost/math/special_functions/detail/hypergeometric_series.hpp +434 -0
  574. package/vendor/boost/math/include/boost/math/special_functions/detail/ibeta_inv_ab.hpp +331 -0
  575. package/vendor/boost/math/include/boost/math/special_functions/detail/ibeta_inverse.hpp +1122 -0
  576. package/vendor/boost/math/include/boost/math/special_functions/detail/iconv.hpp +43 -0
  577. package/vendor/boost/math/include/boost/math/special_functions/detail/igamma_inverse.hpp +587 -0
  578. package/vendor/boost/math/include/boost/math/special_functions/detail/igamma_large.hpp +823 -0
  579. package/vendor/boost/math/include/boost/math/special_functions/detail/lambert_w_lookup_table.ipp +162 -0
  580. package/vendor/boost/math/include/boost/math/special_functions/detail/lanczos_sse2.hpp +238 -0
  581. package/vendor/boost/math/include/boost/math/special_functions/detail/lgamma_small.hpp +569 -0
  582. package/vendor/boost/math/include/boost/math/special_functions/detail/polygamma.hpp +538 -0
  583. package/vendor/boost/math/include/boost/math/special_functions/detail/round_fwd.hpp +87 -0
  584. package/vendor/boost/math/include/boost/math/special_functions/detail/t_distribution_inv.hpp +567 -0
  585. package/vendor/boost/math/include/boost/math/special_functions/detail/unchecked_bernoulli.hpp +1305 -0
  586. package/vendor/boost/math/include/boost/math/special_functions/detail/unchecked_factorial.hpp +1727 -0
  587. package/vendor/boost/math/include/boost/math/special_functions/digamma.hpp +631 -0
  588. package/vendor/boost/math/include/boost/math/special_functions/ellint_1.hpp +815 -0
  589. package/vendor/boost/math/include/boost/math/special_functions/ellint_2.hpp +756 -0
  590. package/vendor/boost/math/include/boost/math/special_functions/ellint_3.hpp +374 -0
  591. package/vendor/boost/math/include/boost/math/special_functions/ellint_d.hpp +183 -0
  592. package/vendor/boost/math/include/boost/math/special_functions/ellint_rc.hpp +112 -0
  593. package/vendor/boost/math/include/boost/math/special_functions/ellint_rd.hpp +207 -0
  594. package/vendor/boost/math/include/boost/math/special_functions/ellint_rf.hpp +169 -0
  595. package/vendor/boost/math/include/boost/math/special_functions/ellint_rg.hpp +130 -0
  596. package/vendor/boost/math/include/boost/math/special_functions/ellint_rj.hpp +299 -0
  597. package/vendor/boost/math/include/boost/math/special_functions/erf.hpp +1334 -0
  598. package/vendor/boost/math/include/boost/math/special_functions/expint.hpp +1614 -0
  599. package/vendor/boost/math/include/boost/math/special_functions/expm1.hpp +416 -0
  600. package/vendor/boost/math/include/boost/math/special_functions/factorials.hpp +276 -0
  601. package/vendor/boost/math/include/boost/math/special_functions/fibonacci.hpp +92 -0
  602. package/vendor/boost/math/include/boost/math/special_functions/fourier_transform_daubechies.hpp +248 -0
  603. package/vendor/boost/math/include/boost/math/special_functions/fpclassify.hpp +797 -0
  604. package/vendor/boost/math/include/boost/math/special_functions/gamma.hpp +2628 -0
  605. package/vendor/boost/math/include/boost/math/special_functions/gegenbauer.hpp +84 -0
  606. package/vendor/boost/math/include/boost/math/special_functions/hankel.hpp +186 -0
  607. package/vendor/boost/math/include/boost/math/special_functions/hermite.hpp +79 -0
  608. package/vendor/boost/math/include/boost/math/special_functions/heuman_lambda.hpp +97 -0
  609. package/vendor/boost/math/include/boost/math/special_functions/hypergeometric_0F1.hpp +116 -0
  610. package/vendor/boost/math/include/boost/math/special_functions/hypergeometric_1F0.hpp +69 -0
  611. package/vendor/boost/math/include/boost/math/special_functions/hypergeometric_1F1.hpp +822 -0
  612. package/vendor/boost/math/include/boost/math/special_functions/hypergeometric_2F0.hpp +163 -0
  613. package/vendor/boost/math/include/boost/math/special_functions/hypergeometric_pFq.hpp +205 -0
  614. package/vendor/boost/math/include/boost/math/special_functions/hypot.hpp +148 -0
  615. package/vendor/boost/math/include/boost/math/special_functions/jacobi.hpp +69 -0
  616. package/vendor/boost/math/include/boost/math/special_functions/jacobi_elliptic.hpp +319 -0
  617. package/vendor/boost/math/include/boost/math/special_functions/jacobi_theta.hpp +802 -0
  618. package/vendor/boost/math/include/boost/math/special_functions/jacobi_zeta.hpp +83 -0
  619. package/vendor/boost/math/include/boost/math/special_functions/laguerre.hpp +139 -0
  620. package/vendor/boost/math/include/boost/math/special_functions/lambert_w.hpp +2171 -0
  621. package/vendor/boost/math/include/boost/math/special_functions/lanczos.hpp +2760 -0
  622. package/vendor/boost/math/include/boost/math/special_functions/legendre.hpp +380 -0
  623. package/vendor/boost/math/include/boost/math/special_functions/legendre_stieltjes.hpp +234 -0
  624. package/vendor/boost/math/include/boost/math/special_functions/log1p.hpp +417 -0
  625. package/vendor/boost/math/include/boost/math/special_functions/logaddexp.hpp +41 -0
  626. package/vendor/boost/math/include/boost/math/special_functions/logistic_sigmoid.hpp +46 -0
  627. package/vendor/boost/math/include/boost/math/special_functions/logit.hpp +56 -0
  628. package/vendor/boost/math/include/boost/math/special_functions/logsumexp.hpp +60 -0
  629. package/vendor/boost/math/include/boost/math/special_functions/math_fwd.hpp +1927 -0
  630. package/vendor/boost/math/include/boost/math/special_functions/modf.hpp +74 -0
  631. package/vendor/boost/math/include/boost/math/special_functions/next.hpp +886 -0
  632. package/vendor/boost/math/include/boost/math/special_functions/nonfinite_num_facets.hpp +588 -0
  633. package/vendor/boost/math/include/boost/math/special_functions/owens_t.hpp +1067 -0
  634. package/vendor/boost/math/include/boost/math/special_functions/polygamma.hpp +83 -0
  635. package/vendor/boost/math/include/boost/math/special_functions/pow.hpp +144 -0
  636. package/vendor/boost/math/include/boost/math/special_functions/powm1.hpp +101 -0
  637. package/vendor/boost/math/include/boost/math/special_functions/prime.hpp +2433 -0
  638. package/vendor/boost/math/include/boost/math/special_functions/relative_difference.hpp +134 -0
  639. package/vendor/boost/math/include/boost/math/special_functions/round.hpp +353 -0
  640. package/vendor/boost/math/include/boost/math/special_functions/rsqrt.hpp +52 -0
  641. package/vendor/boost/math/include/boost/math/special_functions/sign.hpp +241 -0
  642. package/vendor/boost/math/include/boost/math/special_functions/sin_pi.hpp +135 -0
  643. package/vendor/boost/math/include/boost/math/special_functions/sinc.hpp +123 -0
  644. package/vendor/boost/math/include/boost/math/special_functions/sinhc.hpp +142 -0
  645. package/vendor/boost/math/include/boost/math/special_functions/spherical_harmonic.hpp +205 -0
  646. package/vendor/boost/math/include/boost/math/special_functions/sqrt1pm1.hpp +49 -0
  647. package/vendor/boost/math/include/boost/math/special_functions/trigamma.hpp +448 -0
  648. package/vendor/boost/math/include/boost/math/special_functions/trunc.hpp +385 -0
  649. package/vendor/boost/math/include/boost/math/special_functions/ulp.hpp +102 -0
  650. package/vendor/boost/math/include/boost/math/special_functions/zeta.hpp +1081 -0
  651. package/vendor/boost/math/include/boost/math/special_functions.hpp +86 -0
  652. package/vendor/boost/math/include/boost/math/statistics/anderson_darling.hpp +112 -0
  653. package/vendor/boost/math/include/boost/math/statistics/bivariate_statistics.hpp +470 -0
  654. package/vendor/boost/math/include/boost/math/statistics/chatterjee_correlation.hpp +159 -0
  655. package/vendor/boost/math/include/boost/math/statistics/detail/rank.hpp +140 -0
  656. package/vendor/boost/math/include/boost/math/statistics/detail/single_pass.hpp +401 -0
  657. package/vendor/boost/math/include/boost/math/statistics/linear_regression.hpp +133 -0
  658. package/vendor/boost/math/include/boost/math/statistics/ljung_box.hpp +70 -0
  659. package/vendor/boost/math/include/boost/math/statistics/runs_test.hpp +121 -0
  660. package/vendor/boost/math/include/boost/math/statistics/signal_statistics.hpp +350 -0
  661. package/vendor/boost/math/include/boost/math/statistics/t_test.hpp +275 -0
  662. package/vendor/boost/math/include/boost/math/statistics/univariate_statistics.hpp +1184 -0
  663. package/vendor/boost/math/include/boost/math/statistics/z_test.hpp +161 -0
  664. package/vendor/boost/math/include/boost/math/tools/agm.hpp +47 -0
  665. package/vendor/boost/math/include/boost/math/tools/array.hpp +41 -0
  666. package/vendor/boost/math/include/boost/math/tools/assert.hpp +49 -0
  667. package/vendor/boost/math/include/boost/math/tools/atomic.hpp +50 -0
  668. package/vendor/boost/math/include/boost/math/tools/big_constant.hpp +110 -0
  669. package/vendor/boost/math/include/boost/math/tools/bivariate_statistics.hpp +96 -0
  670. package/vendor/boost/math/include/boost/math/tools/centered_continued_fraction.hpp +173 -0
  671. package/vendor/boost/math/include/boost/math/tools/cohen_acceleration.hpp +51 -0
  672. package/vendor/boost/math/include/boost/math/tools/color_maps.hpp +1943 -0
  673. package/vendor/boost/math/include/boost/math/tools/complex.hpp +115 -0
  674. package/vendor/boost/math/include/boost/math/tools/concepts.hpp +24 -0
  675. package/vendor/boost/math/include/boost/math/tools/condition_numbers.hpp +144 -0
  676. package/vendor/boost/math/include/boost/math/tools/config.hpp +856 -0
  677. package/vendor/boost/math/include/boost/math/tools/convert_from_string.hpp +85 -0
  678. package/vendor/boost/math/include/boost/math/tools/cstdint.hpp +107 -0
  679. package/vendor/boost/math/include/boost/math/tools/cubic_roots.hpp +198 -0
  680. package/vendor/boost/math/include/boost/math/tools/cxx03_warn.hpp +95 -0
  681. package/vendor/boost/math/include/boost/math/tools/detail/is_const_iterable.hpp +38 -0
  682. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_10.hpp +84 -0
  683. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_11.hpp +90 -0
  684. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_12.hpp +96 -0
  685. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_13.hpp +102 -0
  686. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_14.hpp +108 -0
  687. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_15.hpp +114 -0
  688. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_16.hpp +120 -0
  689. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_17.hpp +126 -0
  690. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_18.hpp +132 -0
  691. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_19.hpp +138 -0
  692. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_2.hpp +36 -0
  693. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_20.hpp +144 -0
  694. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_3.hpp +42 -0
  695. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_4.hpp +48 -0
  696. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_5.hpp +54 -0
  697. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_6.hpp +60 -0
  698. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_7.hpp +66 -0
  699. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_8.hpp +72 -0
  700. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner1_9.hpp +78 -0
  701. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_10.hpp +90 -0
  702. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_11.hpp +97 -0
  703. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_12.hpp +104 -0
  704. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_13.hpp +111 -0
  705. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_14.hpp +118 -0
  706. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_15.hpp +125 -0
  707. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_16.hpp +132 -0
  708. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_17.hpp +139 -0
  709. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_18.hpp +146 -0
  710. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_19.hpp +153 -0
  711. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_2.hpp +48 -0
  712. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_20.hpp +160 -0
  713. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_3.hpp +48 -0
  714. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_4.hpp +48 -0
  715. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_5.hpp +55 -0
  716. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_6.hpp +62 -0
  717. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_7.hpp +69 -0
  718. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_8.hpp +76 -0
  719. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner2_9.hpp +83 -0
  720. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_10.hpp +156 -0
  721. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_11.hpp +181 -0
  722. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_12.hpp +208 -0
  723. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_13.hpp +237 -0
  724. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_14.hpp +268 -0
  725. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_15.hpp +301 -0
  726. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_16.hpp +336 -0
  727. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_17.hpp +373 -0
  728. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_18.hpp +412 -0
  729. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_19.hpp +453 -0
  730. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_2.hpp +48 -0
  731. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_20.hpp +496 -0
  732. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_3.hpp +48 -0
  733. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_4.hpp +48 -0
  734. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_5.hpp +61 -0
  735. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_6.hpp +76 -0
  736. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_7.hpp +93 -0
  737. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_8.hpp +112 -0
  738. package/vendor/boost/math/include/boost/math/tools/detail/polynomial_horner3_9.hpp +133 -0
  739. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_10.hpp +138 -0
  740. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_11.hpp +150 -0
  741. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_12.hpp +162 -0
  742. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_13.hpp +174 -0
  743. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_14.hpp +186 -0
  744. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_15.hpp +198 -0
  745. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_16.hpp +210 -0
  746. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_17.hpp +222 -0
  747. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_18.hpp +234 -0
  748. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_19.hpp +246 -0
  749. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_2.hpp +42 -0
  750. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_20.hpp +258 -0
  751. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_3.hpp +54 -0
  752. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_4.hpp +66 -0
  753. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_5.hpp +78 -0
  754. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_6.hpp +90 -0
  755. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_7.hpp +102 -0
  756. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_8.hpp +114 -0
  757. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner1_9.hpp +126 -0
  758. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_10.hpp +144 -0
  759. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_11.hpp +160 -0
  760. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_12.hpp +176 -0
  761. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_13.hpp +192 -0
  762. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_14.hpp +208 -0
  763. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_15.hpp +224 -0
  764. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_16.hpp +240 -0
  765. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_17.hpp +256 -0
  766. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_18.hpp +272 -0
  767. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_19.hpp +288 -0
  768. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_2.hpp +48 -0
  769. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_20.hpp +304 -0
  770. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_3.hpp +48 -0
  771. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_4.hpp +48 -0
  772. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_5.hpp +64 -0
  773. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_6.hpp +80 -0
  774. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_7.hpp +96 -0
  775. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_8.hpp +112 -0
  776. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner2_9.hpp +128 -0
  777. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_10.hpp +396 -0
  778. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_11.hpp +482 -0
  779. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_12.hpp +576 -0
  780. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_13.hpp +678 -0
  781. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_14.hpp +788 -0
  782. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_15.hpp +906 -0
  783. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_16.hpp +1032 -0
  784. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_17.hpp +1166 -0
  785. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_18.hpp +1308 -0
  786. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_19.hpp +1458 -0
  787. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_2.hpp +48 -0
  788. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_20.hpp +1616 -0
  789. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_3.hpp +48 -0
  790. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_4.hpp +48 -0
  791. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_5.hpp +86 -0
  792. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_6.hpp +132 -0
  793. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_7.hpp +186 -0
  794. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_8.hpp +248 -0
  795. package/vendor/boost/math/include/boost/math/tools/detail/rational_horner3_9.hpp +318 -0
  796. package/vendor/boost/math/include/boost/math/tools/engel_expansion.hpp +124 -0
  797. package/vendor/boost/math/include/boost/math/tools/estrin.hpp +72 -0
  798. package/vendor/boost/math/include/boost/math/tools/fraction.hpp +354 -0
  799. package/vendor/boost/math/include/boost/math/tools/header_deprecated.hpp +27 -0
  800. package/vendor/boost/math/include/boost/math/tools/is_constant_evaluated.hpp +51 -0
  801. package/vendor/boost/math/include/boost/math/tools/is_detected.hpp +56 -0
  802. package/vendor/boost/math/include/boost/math/tools/is_standalone.hpp +18 -0
  803. package/vendor/boost/math/include/boost/math/tools/luroth_expansion.hpp +147 -0
  804. package/vendor/boost/math/include/boost/math/tools/minima.hpp +164 -0
  805. package/vendor/boost/math/include/boost/math/tools/mp.hpp +423 -0
  806. package/vendor/boost/math/include/boost/math/tools/norms.hpp +638 -0
  807. package/vendor/boost/math/include/boost/math/tools/nothrow.hpp +27 -0
  808. package/vendor/boost/math/include/boost/math/tools/numeric_limits.hpp +888 -0
  809. package/vendor/boost/math/include/boost/math/tools/numerical_differentiation.hpp +12 -0
  810. package/vendor/boost/math/include/boost/math/tools/polynomial.hpp +862 -0
  811. package/vendor/boost/math/include/boost/math/tools/polynomial_gcd.hpp +268 -0
  812. package/vendor/boost/math/include/boost/math/tools/precision.hpp +418 -0
  813. package/vendor/boost/math/include/boost/math/tools/promotion.hpp +135 -0
  814. package/vendor/boost/math/include/boost/math/tools/quartic_roots.hpp +157 -0
  815. package/vendor/boost/math/include/boost/math/tools/random_vector.hpp +101 -0
  816. package/vendor/boost/math/include/boost/math/tools/rational.hpp +346 -0
  817. package/vendor/boost/math/include/boost/math/tools/real_cast.hpp +31 -0
  818. package/vendor/boost/math/include/boost/math/tools/recurrence.hpp +330 -0
  819. package/vendor/boost/math/include/boost/math/tools/roots.hpp +1072 -0
  820. package/vendor/boost/math/include/boost/math/tools/series.hpp +221 -0
  821. package/vendor/boost/math/include/boost/math/tools/signal_statistics.hpp +353 -0
  822. package/vendor/boost/math/include/boost/math/tools/simple_continued_fraction.hpp +177 -0
  823. package/vendor/boost/math/include/boost/math/tools/stats.hpp +87 -0
  824. package/vendor/boost/math/include/boost/math/tools/test_value.hpp +143 -0
  825. package/vendor/boost/math/include/boost/math/tools/throw_exception.hpp +43 -0
  826. package/vendor/boost/math/include/boost/math/tools/toms748_solve.hpp +636 -0
  827. package/vendor/boost/math/include/boost/math/tools/traits.hpp +140 -0
  828. package/vendor/boost/math/include/boost/math/tools/tuple.hpp +88 -0
  829. package/vendor/boost/math/include/boost/math/tools/type_traits.hpp +489 -0
  830. package/vendor/boost/math/include/boost/math/tools/ulps_plot.hpp +598 -0
  831. package/vendor/boost/math/include/boost/math/tools/univariate_statistics.hpp +437 -0
  832. package/vendor/boost/math/include/boost/math/tools/user.hpp +105 -0
  833. package/vendor/boost/math/include/boost/math/tools/utility.hpp +69 -0
  834. package/vendor/boost/math/include/boost/math/tools/workaround.hpp +42 -0
  835. package/vendor/boost/math/include/boost/math/tr1.hpp +1121 -0
  836. package/vendor/boost/math/include/boost/math/tr1_c_macros.ipp +810 -0
  837. package/vendor/boost/math/include/boost/math_fwd.hpp +42 -0
  838. package/vendor/boost/multiprecision/LICENSE +23 -0
  839. package/vendor/boost/multiprecision/README.md +168 -0
  840. package/vendor/boost/multiprecision/include/boost/config/abi/borland_prefix.hpp +27 -0
  841. package/vendor/boost/multiprecision/include/boost/config/abi/borland_suffix.hpp +12 -0
  842. package/vendor/boost/multiprecision/include/boost/config/abi/msvc_prefix.hpp +22 -0
  843. package/vendor/boost/multiprecision/include/boost/config/abi/msvc_suffix.hpp +8 -0
  844. package/vendor/boost/multiprecision/include/boost/config/abi_prefix.hpp +25 -0
  845. package/vendor/boost/multiprecision/include/boost/config/abi_suffix.hpp +25 -0
  846. package/vendor/boost/multiprecision/include/boost/config/assert_cxx03.hpp +211 -0
  847. package/vendor/boost/multiprecision/include/boost/config/assert_cxx11.hpp +212 -0
  848. package/vendor/boost/multiprecision/include/boost/config/assert_cxx14.hpp +47 -0
  849. package/vendor/boost/multiprecision/include/boost/config/assert_cxx17.hpp +65 -0
  850. package/vendor/boost/multiprecision/include/boost/config/assert_cxx20.hpp +59 -0
  851. package/vendor/boost/multiprecision/include/boost/config/assert_cxx23.hpp +41 -0
  852. package/vendor/boost/multiprecision/include/boost/config/assert_cxx98.hpp +23 -0
  853. package/vendor/boost/multiprecision/include/boost/config/auto_link.hpp +530 -0
  854. package/vendor/boost/multiprecision/include/boost/config/compiler/borland.hpp +342 -0
  855. package/vendor/boost/multiprecision/include/boost/config/compiler/clang.hpp +370 -0
  856. package/vendor/boost/multiprecision/include/boost/config/compiler/clang_version.hpp +98 -0
  857. package/vendor/boost/multiprecision/include/boost/config/compiler/codegear.hpp +389 -0
  858. package/vendor/boost/multiprecision/include/boost/config/compiler/comeau.hpp +59 -0
  859. package/vendor/boost/multiprecision/include/boost/config/compiler/common_edg.hpp +185 -0
  860. package/vendor/boost/multiprecision/include/boost/config/compiler/compaq_cxx.hpp +19 -0
  861. package/vendor/boost/multiprecision/include/boost/config/compiler/cray.hpp +446 -0
  862. package/vendor/boost/multiprecision/include/boost/config/compiler/diab.hpp +26 -0
  863. package/vendor/boost/multiprecision/include/boost/config/compiler/digitalmars.hpp +146 -0
  864. package/vendor/boost/multiprecision/include/boost/config/compiler/gcc.hpp +386 -0
  865. package/vendor/boost/multiprecision/include/boost/config/compiler/gcc_xml.hpp +115 -0
  866. package/vendor/boost/multiprecision/include/boost/config/compiler/greenhills.hpp +28 -0
  867. package/vendor/boost/multiprecision/include/boost/config/compiler/hp_acc.hpp +153 -0
  868. package/vendor/boost/multiprecision/include/boost/config/compiler/intel.hpp +577 -0
  869. package/vendor/boost/multiprecision/include/boost/config/compiler/kai.hpp +33 -0
  870. package/vendor/boost/multiprecision/include/boost/config/compiler/metrowerks.hpp +201 -0
  871. package/vendor/boost/multiprecision/include/boost/config/compiler/mpw.hpp +143 -0
  872. package/vendor/boost/multiprecision/include/boost/config/compiler/nvcc.hpp +64 -0
  873. package/vendor/boost/multiprecision/include/boost/config/compiler/pathscale.hpp +141 -0
  874. package/vendor/boost/multiprecision/include/boost/config/compiler/pgi.hpp +23 -0
  875. package/vendor/boost/multiprecision/include/boost/config/compiler/sgi_mipspro.hpp +29 -0
  876. package/vendor/boost/multiprecision/include/boost/config/compiler/sunpro_cc.hpp +225 -0
  877. package/vendor/boost/multiprecision/include/boost/config/compiler/vacpp.hpp +189 -0
  878. package/vendor/boost/multiprecision/include/boost/config/compiler/visualc.hpp +400 -0
  879. package/vendor/boost/multiprecision/include/boost/config/compiler/xlcpp.hpp +303 -0
  880. package/vendor/boost/multiprecision/include/boost/config/compiler/xlcpp_zos.hpp +174 -0
  881. package/vendor/boost/multiprecision/include/boost/config/detail/cxx_composite.hpp +218 -0
  882. package/vendor/boost/multiprecision/include/boost/config/detail/posix_features.hpp +95 -0
  883. package/vendor/boost/multiprecision/include/boost/config/detail/select_compiler_config.hpp +157 -0
  884. package/vendor/boost/multiprecision/include/boost/config/detail/select_platform_config.hpp +147 -0
  885. package/vendor/boost/multiprecision/include/boost/config/detail/select_stdlib_config.hpp +121 -0
  886. package/vendor/boost/multiprecision/include/boost/config/detail/suffix.hpp +1334 -0
  887. package/vendor/boost/multiprecision/include/boost/config/header_deprecated.hpp +26 -0
  888. package/vendor/boost/multiprecision/include/boost/config/helper_macros.hpp +37 -0
  889. package/vendor/boost/multiprecision/include/boost/config/no_tr1/cmath.hpp +28 -0
  890. package/vendor/boost/multiprecision/include/boost/config/no_tr1/complex.hpp +28 -0
  891. package/vendor/boost/multiprecision/include/boost/config/no_tr1/functional.hpp +28 -0
  892. package/vendor/boost/multiprecision/include/boost/config/no_tr1/memory.hpp +28 -0
  893. package/vendor/boost/multiprecision/include/boost/config/no_tr1/utility.hpp +28 -0
  894. package/vendor/boost/multiprecision/include/boost/config/platform/aix.hpp +33 -0
  895. package/vendor/boost/multiprecision/include/boost/config/platform/amigaos.hpp +15 -0
  896. package/vendor/boost/multiprecision/include/boost/config/platform/beos.hpp +26 -0
  897. package/vendor/boost/multiprecision/include/boost/config/platform/bsd.hpp +83 -0
  898. package/vendor/boost/multiprecision/include/boost/config/platform/cloudabi.hpp +18 -0
  899. package/vendor/boost/multiprecision/include/boost/config/platform/cray.hpp +18 -0
  900. package/vendor/boost/multiprecision/include/boost/config/platform/cygwin.hpp +71 -0
  901. package/vendor/boost/multiprecision/include/boost/config/platform/haiku.hpp +31 -0
  902. package/vendor/boost/multiprecision/include/boost/config/platform/hpux.hpp +87 -0
  903. package/vendor/boost/multiprecision/include/boost/config/platform/irix.hpp +31 -0
  904. package/vendor/boost/multiprecision/include/boost/config/platform/linux.hpp +106 -0
  905. package/vendor/boost/multiprecision/include/boost/config/platform/macos.hpp +87 -0
  906. package/vendor/boost/multiprecision/include/boost/config/platform/qnxnto.hpp +31 -0
  907. package/vendor/boost/multiprecision/include/boost/config/platform/solaris.hpp +31 -0
  908. package/vendor/boost/multiprecision/include/boost/config/platform/symbian.hpp +97 -0
  909. package/vendor/boost/multiprecision/include/boost/config/platform/vms.hpp +25 -0
  910. package/vendor/boost/multiprecision/include/boost/config/platform/vxworks.hpp +422 -0
  911. package/vendor/boost/multiprecision/include/boost/config/platform/wasm.hpp +23 -0
  912. package/vendor/boost/multiprecision/include/boost/config/platform/win32.hpp +90 -0
  913. package/vendor/boost/multiprecision/include/boost/config/platform/zos.hpp +32 -0
  914. package/vendor/boost/multiprecision/include/boost/config/pragma_message.hpp +31 -0
  915. package/vendor/boost/multiprecision/include/boost/config/requires_threads.hpp +92 -0
  916. package/vendor/boost/multiprecision/include/boost/config/stdlib/dinkumware.hpp +324 -0
  917. package/vendor/boost/multiprecision/include/boost/config/stdlib/libcomo.hpp +93 -0
  918. package/vendor/boost/multiprecision/include/boost/config/stdlib/libcpp.hpp +185 -0
  919. package/vendor/boost/multiprecision/include/boost/config/stdlib/libstdcpp3.hpp +482 -0
  920. package/vendor/boost/multiprecision/include/boost/config/stdlib/modena.hpp +79 -0
  921. package/vendor/boost/multiprecision/include/boost/config/stdlib/msl.hpp +98 -0
  922. package/vendor/boost/multiprecision/include/boost/config/stdlib/roguewave.hpp +208 -0
  923. package/vendor/boost/multiprecision/include/boost/config/stdlib/sgi.hpp +168 -0
  924. package/vendor/boost/multiprecision/include/boost/config/stdlib/stlport.hpp +258 -0
  925. package/vendor/boost/multiprecision/include/boost/config/stdlib/vacpp.hpp +74 -0
  926. package/vendor/boost/multiprecision/include/boost/config/stdlib/xlcpp_zos.hpp +61 -0
  927. package/vendor/boost/multiprecision/include/boost/config/user.hpp +133 -0
  928. package/vendor/boost/multiprecision/include/boost/config/warning_disable.hpp +47 -0
  929. package/vendor/boost/multiprecision/include/boost/config/workaround.hpp +310 -0
  930. package/vendor/boost/multiprecision/include/boost/config.hpp +67 -0
  931. package/vendor/boost/multiprecision/include/boost/cstdint.hpp +556 -0
  932. package/vendor/boost/multiprecision/include/boost/cxx11_char_types.hpp +70 -0
  933. package/vendor/boost/multiprecision/include/boost/detail/workaround.hpp +10 -0
  934. package/vendor/boost/multiprecision/include/boost/limits.hpp +146 -0
  935. package/vendor/boost/multiprecision/include/boost/multiprecision/complex128.hpp +24 -0
  936. package/vendor/boost/multiprecision/include/boost/multiprecision/complex_adaptor.hpp +1049 -0
  937. package/vendor/boost/multiprecision/include/boost/multiprecision/concepts/mp_number_archetypes.hpp +257 -0
  938. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_bin_float/io.hpp +700 -0
  939. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_bin_float/transcendental.hpp +157 -0
  940. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_bin_float.hpp +2374 -0
  941. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_complex.hpp +12 -0
  942. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_dec_float.hpp +3807 -0
  943. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail.hpp +177 -0
  944. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath.hpp +25 -0
  945. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_fabs.hpp +27 -0
  946. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_floor.hpp +116 -0
  947. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_fma.hpp +65 -0
  948. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_fpclassify.hpp +52 -0
  949. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_frexp.hpp +93 -0
  950. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_isinf.hpp +24 -0
  951. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_isnan.hpp +21 -0
  952. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_ldexp.hpp +71 -0
  953. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_limits.hpp +218 -0
  954. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_log.hpp +172 -0
  955. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_ccmath_sqrt.hpp +57 -0
  956. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_df_qf/cpp_df_qf_detail_constants.hpp +80 -0
  957. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_double_fp.hpp +2690 -0
  958. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/add.hpp +368 -0
  959. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/add_unsigned.hpp +387 -0
  960. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/bitwise.hpp +896 -0
  961. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/checked.hpp +178 -0
  962. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/comparison.hpp +374 -0
  963. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/cpp_int_config.hpp +161 -0
  964. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/divide.hpp +703 -0
  965. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/import_export.hpp +248 -0
  966. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/intel_intrinsics.hpp +138 -0
  967. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/limits.hpp +292 -0
  968. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/literals.hpp +296 -0
  969. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/misc.hpp +1462 -0
  970. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/multiply.hpp +848 -0
  971. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/serialize.hpp +209 -0
  972. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int/value_pack.hpp +42 -0
  973. package/vendor/boost/multiprecision/include/boost/multiprecision/cpp_int.hpp +2360 -0
  974. package/vendor/boost/multiprecision/include/boost/multiprecision/debug_adaptor.hpp +760 -0
  975. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/assert.hpp +29 -0
  976. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/atomic.hpp +62 -0
  977. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/bitscan.hpp +317 -0
  978. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/check_cpp11_config.hpp +64 -0
  979. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/constexpr.hpp +88 -0
  980. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/default_ops.hpp +4077 -0
  981. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/digits.hpp +49 -0
  982. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/dynamic_array.hpp +44 -0
  983. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/empty_value.hpp +87 -0
  984. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/endian.hpp +35 -0
  985. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/et_ops.hpp +1831 -0
  986. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/float128_functions.hpp +95 -0
  987. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/float_string_cvt.hpp +333 -0
  988. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/fpclassify.hpp +101 -0
  989. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/functions/constants.hpp +289 -0
  990. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/functions/pow.hpp +941 -0
  991. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/functions/trig.hpp +1064 -0
  992. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/functions/trunc.hpp +82 -0
  993. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/generic_interconvert.hpp +687 -0
  994. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/hash.hpp +56 -0
  995. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/integer_ops.hpp +474 -0
  996. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/itos.hpp +39 -0
  997. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/min_max.hpp +106 -0
  998. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/no_et_ops.hpp +661 -0
  999. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/no_exceptions_support.hpp +55 -0
  1000. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/number_base.hpp +1656 -0
  1001. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/number_compare.hpp +848 -0
  1002. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/precision.hpp +313 -0
  1003. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/rebind.hpp +19 -0
  1004. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/standalone_config.hpp +165 -0
  1005. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/static_array.hpp +42 -0
  1006. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/string_helpers.hpp +48 -0
  1007. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/tables.hpp +80 -0
  1008. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/ublas_interop.hpp +75 -0
  1009. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/uniform_int_distribution.hpp +212 -0
  1010. package/vendor/boost/multiprecision/include/boost/multiprecision/detail/utype_helper.hpp +374 -0
  1011. package/vendor/boost/multiprecision/include/boost/multiprecision/eigen.hpp +248 -0
  1012. package/vendor/boost/multiprecision/include/boost/multiprecision/float128.hpp +960 -0
  1013. package/vendor/boost/multiprecision/include/boost/multiprecision/fwd.hpp +268 -0
  1014. package/vendor/boost/multiprecision/include/boost/multiprecision/gmp.hpp +4100 -0
  1015. package/vendor/boost/multiprecision/include/boost/multiprecision/integer.hpp +363 -0
  1016. package/vendor/boost/multiprecision/include/boost/multiprecision/logged_adaptor.hpp +834 -0
  1017. package/vendor/boost/multiprecision/include/boost/multiprecision/miller_rabin.hpp +221 -0
  1018. package/vendor/boost/multiprecision/include/boost/multiprecision/mpc.hpp +1721 -0
  1019. package/vendor/boost/multiprecision/include/boost/multiprecision/mpfi.hpp +2579 -0
  1020. package/vendor/boost/multiprecision/include/boost/multiprecision/mpfr.hpp +3668 -0
  1021. package/vendor/boost/multiprecision/include/boost/multiprecision/number.hpp +2491 -0
  1022. package/vendor/boost/multiprecision/include/boost/multiprecision/random.hpp +23 -0
  1023. package/vendor/boost/multiprecision/include/boost/multiprecision/rational_adaptor.hpp +1289 -0
  1024. package/vendor/boost/multiprecision/include/boost/multiprecision/tommath.hpp +1044 -0
  1025. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/explicit_conversion.hpp +67 -0
  1026. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/extract_exponent_type.hpp +28 -0
  1027. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/is_backend.hpp +91 -0
  1028. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/is_byte_container.hpp +51 -0
  1029. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/is_complex.hpp +22 -0
  1030. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/is_convertible_arithmetic.hpp +51 -0
  1031. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/is_restricted_conversion.hpp +47 -0
  1032. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/is_variable_precision.hpp +25 -0
  1033. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/max_digits10.hpp +79 -0
  1034. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/std_integer_traits.hpp +95 -0
  1035. package/vendor/boost/multiprecision/include/boost/multiprecision/traits/transcendental_reduction_type.hpp +21 -0
  1036. package/vendor/boost/multiprecision/include/boost/static_assert.hpp +179 -0
  1037. package/vendor/boost/multiprecision/include/boost/version.hpp +32 -0
  1038. package/vendor/eigen/COPYING.APACHE +203 -0
  1039. package/vendor/eigen/COPYING.BSD +26 -0
  1040. package/vendor/eigen/COPYING.MPL2 +373 -0
  1041. package/vendor/eigen/COPYING.README +6 -0
  1042. package/vendor/eigen/Eigen/AccelerateSupport +52 -0
  1043. package/vendor/eigen/Eigen/Cholesky +43 -0
  1044. package/vendor/eigen/Eigen/CholmodSupport +48 -0
  1045. package/vendor/eigen/Eigen/Core +451 -0
  1046. package/vendor/eigen/Eigen/Dense +7 -0
  1047. package/vendor/eigen/Eigen/Eigen +2 -0
  1048. package/vendor/eigen/Eigen/Eigenvalues +63 -0
  1049. package/vendor/eigen/Eigen/Geometry +59 -0
  1050. package/vendor/eigen/Eigen/Householder +31 -0
  1051. package/vendor/eigen/Eigen/IterativeLinearSolvers +52 -0
  1052. package/vendor/eigen/Eigen/Jacobi +33 -0
  1053. package/vendor/eigen/Eigen/KLUSupport +43 -0
  1054. package/vendor/eigen/Eigen/LU +46 -0
  1055. package/vendor/eigen/Eigen/MetisSupport +35 -0
  1056. package/vendor/eigen/Eigen/OrderingMethods +73 -0
  1057. package/vendor/eigen/Eigen/PaStiXSupport +51 -0
  1058. package/vendor/eigen/Eigen/PardisoSupport +38 -0
  1059. package/vendor/eigen/Eigen/QR +48 -0
  1060. package/vendor/eigen/Eigen/QtAlignedMalloc +32 -0
  1061. package/vendor/eigen/Eigen/SPQRSupport +41 -0
  1062. package/vendor/eigen/Eigen/SVD +56 -0
  1063. package/vendor/eigen/Eigen/Sparse +33 -0
  1064. package/vendor/eigen/Eigen/SparseCholesky +40 -0
  1065. package/vendor/eigen/Eigen/SparseCore +70 -0
  1066. package/vendor/eigen/Eigen/SparseLU +50 -0
  1067. package/vendor/eigen/Eigen/SparseQR +38 -0
  1068. package/vendor/eigen/Eigen/StdDeque +30 -0
  1069. package/vendor/eigen/Eigen/StdList +29 -0
  1070. package/vendor/eigen/Eigen/StdVector +30 -0
  1071. package/vendor/eigen/Eigen/SuperLUSupport +70 -0
  1072. package/vendor/eigen/Eigen/ThreadPool +80 -0
  1073. package/vendor/eigen/Eigen/UmfPackSupport +42 -0
  1074. package/vendor/eigen/Eigen/Version +14 -0
  1075. package/vendor/eigen/Eigen/src/AccelerateSupport/AccelerateSupport.h +423 -0
  1076. package/vendor/eigen/Eigen/src/AccelerateSupport/InternalHeaderCheck.h +3 -0
  1077. package/vendor/eigen/Eigen/src/Cholesky/InternalHeaderCheck.h +3 -0
  1078. package/vendor/eigen/Eigen/src/Cholesky/LDLT.h +649 -0
  1079. package/vendor/eigen/Eigen/src/Cholesky/LLT.h +514 -0
  1080. package/vendor/eigen/Eigen/src/Cholesky/LLT_LAPACKE.h +124 -0
  1081. package/vendor/eigen/Eigen/src/CholmodSupport/CholmodSupport.h +738 -0
  1082. package/vendor/eigen/Eigen/src/CholmodSupport/InternalHeaderCheck.h +3 -0
  1083. package/vendor/eigen/Eigen/src/Core/ArithmeticSequence.h +239 -0
  1084. package/vendor/eigen/Eigen/src/Core/Array.h +376 -0
  1085. package/vendor/eigen/Eigen/src/Core/ArrayBase.h +213 -0
  1086. package/vendor/eigen/Eigen/src/Core/ArrayWrapper.h +165 -0
  1087. package/vendor/eigen/Eigen/src/Core/Assign.h +80 -0
  1088. package/vendor/eigen/Eigen/src/Core/AssignEvaluator.h +1057 -0
  1089. package/vendor/eigen/Eigen/src/Core/Assign_MKL.h +183 -0
  1090. package/vendor/eigen/Eigen/src/Core/BandMatrix.h +338 -0
  1091. package/vendor/eigen/Eigen/src/Core/Block.h +429 -0
  1092. package/vendor/eigen/Eigen/src/Core/CommaInitializer.h +149 -0
  1093. package/vendor/eigen/Eigen/src/Core/ConditionEstimator.h +173 -0
  1094. package/vendor/eigen/Eigen/src/Core/CoreEvaluators.h +2018 -0
  1095. package/vendor/eigen/Eigen/src/Core/CoreIterators.h +141 -0
  1096. package/vendor/eigen/Eigen/src/Core/CwiseBinaryOp.h +166 -0
  1097. package/vendor/eigen/Eigen/src/Core/CwiseNullaryOp.h +975 -0
  1098. package/vendor/eigen/Eigen/src/Core/CwiseTernaryOp.h +171 -0
  1099. package/vendor/eigen/Eigen/src/Core/CwiseUnaryOp.h +91 -0
  1100. package/vendor/eigen/Eigen/src/Core/CwiseUnaryView.h +167 -0
  1101. package/vendor/eigen/Eigen/src/Core/DenseBase.h +673 -0
  1102. package/vendor/eigen/Eigen/src/Core/DenseCoeffsBase.h +568 -0
  1103. package/vendor/eigen/Eigen/src/Core/DenseStorage.h +573 -0
  1104. package/vendor/eigen/Eigen/src/Core/DeviceWrapper.h +153 -0
  1105. package/vendor/eigen/Eigen/src/Core/Diagonal.h +219 -0
  1106. package/vendor/eigen/Eigen/src/Core/DiagonalMatrix.h +420 -0
  1107. package/vendor/eigen/Eigen/src/Core/DiagonalProduct.h +30 -0
  1108. package/vendor/eigen/Eigen/src/Core/Dot.h +268 -0
  1109. package/vendor/eigen/Eigen/src/Core/EigenBase.h +149 -0
  1110. package/vendor/eigen/Eigen/src/Core/Fill.h +138 -0
  1111. package/vendor/eigen/Eigen/src/Core/FindCoeff.h +464 -0
  1112. package/vendor/eigen/Eigen/src/Core/ForceAlignedAccess.h +127 -0
  1113. package/vendor/eigen/Eigen/src/Core/Fuzzy.h +132 -0
  1114. package/vendor/eigen/Eigen/src/Core/GeneralProduct.h +519 -0
  1115. package/vendor/eigen/Eigen/src/Core/GenericPacketMath.h +1702 -0
  1116. package/vendor/eigen/Eigen/src/Core/GlobalFunctions.h +230 -0
  1117. package/vendor/eigen/Eigen/src/Core/IO.h +233 -0
  1118. package/vendor/eigen/Eigen/src/Core/IndexedView.h +321 -0
  1119. package/vendor/eigen/Eigen/src/Core/InnerProduct.h +260 -0
  1120. package/vendor/eigen/Eigen/src/Core/InternalHeaderCheck.h +3 -0
  1121. package/vendor/eigen/Eigen/src/Core/Inverse.h +108 -0
  1122. package/vendor/eigen/Eigen/src/Core/Map.h +153 -0
  1123. package/vendor/eigen/Eigen/src/Core/MapBase.h +283 -0
  1124. package/vendor/eigen/Eigen/src/Core/MathFunctions.h +2103 -0
  1125. package/vendor/eigen/Eigen/src/Core/MathFunctionsImpl.h +263 -0
  1126. package/vendor/eigen/Eigen/src/Core/Matrix.h +534 -0
  1127. package/vendor/eigen/Eigen/src/Core/MatrixBase.h +545 -0
  1128. package/vendor/eigen/Eigen/src/Core/NestByValue.h +91 -0
  1129. package/vendor/eigen/Eigen/src/Core/NoAlias.h +102 -0
  1130. package/vendor/eigen/Eigen/src/Core/NumTraits.h +335 -0
  1131. package/vendor/eigen/Eigen/src/Core/PartialReduxEvaluator.h +253 -0
  1132. package/vendor/eigen/Eigen/src/Core/PermutationMatrix.h +555 -0
  1133. package/vendor/eigen/Eigen/src/Core/PlainObjectBase.h +1014 -0
  1134. package/vendor/eigen/Eigen/src/Core/Product.h +307 -0
  1135. package/vendor/eigen/Eigen/src/Core/ProductEvaluators.h +1287 -0
  1136. package/vendor/eigen/Eigen/src/Core/Random.h +207 -0
  1137. package/vendor/eigen/Eigen/src/Core/RandomImpl.h +262 -0
  1138. package/vendor/eigen/Eigen/src/Core/RealView.h +250 -0
  1139. package/vendor/eigen/Eigen/src/Core/Redux.h +535 -0
  1140. package/vendor/eigen/Eigen/src/Core/Ref.h +383 -0
  1141. package/vendor/eigen/Eigen/src/Core/Replicate.h +130 -0
  1142. package/vendor/eigen/Eigen/src/Core/Reshaped.h +398 -0
  1143. package/vendor/eigen/Eigen/src/Core/ReturnByValue.h +111 -0
  1144. package/vendor/eigen/Eigen/src/Core/Reverse.h +202 -0
  1145. package/vendor/eigen/Eigen/src/Core/Select.h +92 -0
  1146. package/vendor/eigen/Eigen/src/Core/SelfAdjointView.h +329 -0
  1147. package/vendor/eigen/Eigen/src/Core/SelfCwiseBinaryOp.h +50 -0
  1148. package/vendor/eigen/Eigen/src/Core/SkewSymmetricMatrix3.h +382 -0
  1149. package/vendor/eigen/Eigen/src/Core/Solve.h +174 -0
  1150. package/vendor/eigen/Eigen/src/Core/SolveTriangular.h +237 -0
  1151. package/vendor/eigen/Eigen/src/Core/SolverBase.h +167 -0
  1152. package/vendor/eigen/Eigen/src/Core/StableNorm.h +217 -0
  1153. package/vendor/eigen/Eigen/src/Core/StlIterators.h +619 -0
  1154. package/vendor/eigen/Eigen/src/Core/Stride.h +114 -0
  1155. package/vendor/eigen/Eigen/src/Core/Swap.h +99 -0
  1156. package/vendor/eigen/Eigen/src/Core/Transpose.h +427 -0
  1157. package/vendor/eigen/Eigen/src/Core/Transpositions.h +323 -0
  1158. package/vendor/eigen/Eigen/src/Core/TriangularMatrix.h +900 -0
  1159. package/vendor/eigen/Eigen/src/Core/VectorBlock.h +83 -0
  1160. package/vendor/eigen/Eigen/src/Core/VectorwiseOp.h +733 -0
  1161. package/vendor/eigen/Eigen/src/Core/Visitor.h +537 -0
  1162. package/vendor/eigen/Eigen/src/Core/arch/AVX/Complex.h +565 -0
  1163. package/vendor/eigen/Eigen/src/Core/arch/AVX/MathFunctions.h +130 -0
  1164. package/vendor/eigen/Eigen/src/Core/arch/AVX/PacketMath.h +3081 -0
  1165. package/vendor/eigen/Eigen/src/Core/arch/AVX/Reductions.h +353 -0
  1166. package/vendor/eigen/Eigen/src/Core/arch/AVX/TypeCasting.h +308 -0
  1167. package/vendor/eigen/Eigen/src/Core/arch/AVX512/Complex.h +472 -0
  1168. package/vendor/eigen/Eigen/src/Core/arch/AVX512/GemmKernel.h +1245 -0
  1169. package/vendor/eigen/Eigen/src/Core/arch/AVX512/MathFunctions.h +141 -0
  1170. package/vendor/eigen/Eigen/src/Core/arch/AVX512/MathFunctionsFP16.h +75 -0
  1171. package/vendor/eigen/Eigen/src/Core/arch/AVX512/PacketMath.h +3146 -0
  1172. package/vendor/eigen/Eigen/src/Core/arch/AVX512/PacketMathFP16.h +1413 -0
  1173. package/vendor/eigen/Eigen/src/Core/arch/AVX512/Reductions.h +297 -0
  1174. package/vendor/eigen/Eigen/src/Core/arch/AVX512/TrsmKernel.h +1167 -0
  1175. package/vendor/eigen/Eigen/src/Core/arch/AVX512/TrsmUnrolls.inc +1219 -0
  1176. package/vendor/eigen/Eigen/src/Core/arch/AVX512/TypeCasting.h +277 -0
  1177. package/vendor/eigen/Eigen/src/Core/arch/AVX512/TypeCastingFP16.h +130 -0
  1178. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/Complex.h +653 -0
  1179. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/MathFunctions.h +81 -0
  1180. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProduct.h +3686 -0
  1181. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductCommon.h +205 -0
  1182. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMA.h +901 -0
  1183. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixProductMMAbfloat16.h +742 -0
  1184. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/MatrixVectorProduct.inc +2818 -0
  1185. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/PacketMath.h +3729 -0
  1186. package/vendor/eigen/Eigen/src/Core/arch/AltiVec/TypeCasting.h +153 -0
  1187. package/vendor/eigen/Eigen/src/Core/arch/Default/BFloat16.h +866 -0
  1188. package/vendor/eigen/Eigen/src/Core/arch/Default/ConjHelper.h +128 -0
  1189. package/vendor/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctions.h +2634 -0
  1190. package/vendor/eigen/Eigen/src/Core/arch/Default/GenericPacketMathFunctionsFwd.h +227 -0
  1191. package/vendor/eigen/Eigen/src/Core/arch/Default/Half.h +1091 -0
  1192. package/vendor/eigen/Eigen/src/Core/arch/Default/Settings.h +47 -0
  1193. package/vendor/eigen/Eigen/src/Core/arch/GPU/Complex.h +244 -0
  1194. package/vendor/eigen/Eigen/src/Core/arch/GPU/MathFunctions.h +104 -0
  1195. package/vendor/eigen/Eigen/src/Core/arch/GPU/PacketMath.h +1712 -0
  1196. package/vendor/eigen/Eigen/src/Core/arch/GPU/Tuple.h +268 -0
  1197. package/vendor/eigen/Eigen/src/Core/arch/GPU/TypeCasting.h +77 -0
  1198. package/vendor/eigen/Eigen/src/Core/arch/HIP/hcc/math_constants.h +23 -0
  1199. package/vendor/eigen/Eigen/src/Core/arch/HVX/PacketMath.h +1088 -0
  1200. package/vendor/eigen/Eigen/src/Core/arch/LSX/Complex.h +520 -0
  1201. package/vendor/eigen/Eigen/src/Core/arch/LSX/GeneralBlockPanelKernel.h +23 -0
  1202. package/vendor/eigen/Eigen/src/Core/arch/LSX/MathFunctions.h +43 -0
  1203. package/vendor/eigen/Eigen/src/Core/arch/LSX/PacketMath.h +2866 -0
  1204. package/vendor/eigen/Eigen/src/Core/arch/LSX/TypeCasting.h +526 -0
  1205. package/vendor/eigen/Eigen/src/Core/arch/MSA/Complex.h +620 -0
  1206. package/vendor/eigen/Eigen/src/Core/arch/MSA/MathFunctions.h +379 -0
  1207. package/vendor/eigen/Eigen/src/Core/arch/MSA/PacketMath.h +1237 -0
  1208. package/vendor/eigen/Eigen/src/Core/arch/NEON/Complex.h +732 -0
  1209. package/vendor/eigen/Eigen/src/Core/arch/NEON/GeneralBlockPanelKernel.h +243 -0
  1210. package/vendor/eigen/Eigen/src/Core/arch/NEON/MathFunctions.h +68 -0
  1211. package/vendor/eigen/Eigen/src/Core/arch/NEON/PacketMath.h +6096 -0
  1212. package/vendor/eigen/Eigen/src/Core/arch/NEON/TypeCasting.h +1642 -0
  1213. package/vendor/eigen/Eigen/src/Core/arch/NEON/UnaryFunctors.h +57 -0
  1214. package/vendor/eigen/Eigen/src/Core/arch/SSE/Complex.h +503 -0
  1215. package/vendor/eigen/Eigen/src/Core/arch/SSE/MathFunctions.h +88 -0
  1216. package/vendor/eigen/Eigen/src/Core/arch/SSE/PacketMath.h +2384 -0
  1217. package/vendor/eigen/Eigen/src/Core/arch/SSE/Reductions.h +324 -0
  1218. package/vendor/eigen/Eigen/src/Core/arch/SSE/TypeCasting.h +230 -0
  1219. package/vendor/eigen/Eigen/src/Core/arch/SVE/MathFunctions.h +48 -0
  1220. package/vendor/eigen/Eigen/src/Core/arch/SVE/PacketMath.h +674 -0
  1221. package/vendor/eigen/Eigen/src/Core/arch/SVE/TypeCasting.h +52 -0
  1222. package/vendor/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h +227 -0
  1223. package/vendor/eigen/Eigen/src/Core/arch/SYCL/MathFunctions.h +303 -0
  1224. package/vendor/eigen/Eigen/src/Core/arch/SYCL/PacketMath.h +576 -0
  1225. package/vendor/eigen/Eigen/src/Core/arch/SYCL/TypeCasting.h +83 -0
  1226. package/vendor/eigen/Eigen/src/Core/arch/ZVector/Complex.h +570 -0
  1227. package/vendor/eigen/Eigen/src/Core/arch/ZVector/MathFunctions.h +244 -0
  1228. package/vendor/eigen/Eigen/src/Core/arch/ZVector/PacketMath.h +1413 -0
  1229. package/vendor/eigen/Eigen/src/Core/functors/AssignmentFunctors.h +174 -0
  1230. package/vendor/eigen/Eigen/src/Core/functors/BinaryFunctors.h +747 -0
  1231. package/vendor/eigen/Eigen/src/Core/functors/NullaryFunctors.h +274 -0
  1232. package/vendor/eigen/Eigen/src/Core/functors/StlFunctors.h +149 -0
  1233. package/vendor/eigen/Eigen/src/Core/functors/TernaryFunctors.h +52 -0
  1234. package/vendor/eigen/Eigen/src/Core/functors/UnaryFunctors.h +1420 -0
  1235. package/vendor/eigen/Eigen/src/Core/products/GeneralBlockPanelKernel.h +3153 -0
  1236. package/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrix.h +459 -0
  1237. package/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular.h +330 -0
  1238. package/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrixTriangular_BLAS.h +148 -0
  1239. package/vendor/eigen/Eigen/src/Core/products/GeneralMatrixMatrix_BLAS.h +205 -0
  1240. package/vendor/eigen/Eigen/src/Core/products/GeneralMatrixVector.h +473 -0
  1241. package/vendor/eigen/Eigen/src/Core/products/GeneralMatrixVector_BLAS.h +139 -0
  1242. package/vendor/eigen/Eigen/src/Core/products/Parallelizer.h +282 -0
  1243. package/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +483 -0
  1244. package/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixMatrix_BLAS.h +277 -0
  1245. package/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixVector.h +253 -0
  1246. package/vendor/eigen/Eigen/src/Core/products/SelfadjointMatrixVector_BLAS.h +115 -0
  1247. package/vendor/eigen/Eigen/src/Core/products/SelfadjointProduct.h +133 -0
  1248. package/vendor/eigen/Eigen/src/Core/products/SelfadjointRank2Update.h +95 -0
  1249. package/vendor/eigen/Eigen/src/Core/products/TriangularMatrixMatrix.h +397 -0
  1250. package/vendor/eigen/Eigen/src/Core/products/TriangularMatrixMatrix_BLAS.h +325 -0
  1251. package/vendor/eigen/Eigen/src/Core/products/TriangularMatrixVector.h +347 -0
  1252. package/vendor/eigen/Eigen/src/Core/products/TriangularMatrixVector_BLAS.h +275 -0
  1253. package/vendor/eigen/Eigen/src/Core/products/TriangularSolverMatrix.h +388 -0
  1254. package/vendor/eigen/Eigen/src/Core/products/TriangularSolverMatrix_BLAS.h +166 -0
  1255. package/vendor/eigen/Eigen/src/Core/products/TriangularSolverVector.h +122 -0
  1256. package/vendor/eigen/Eigen/src/Core/util/Assert.h +158 -0
  1257. package/vendor/eigen/Eigen/src/Core/util/BlasUtil.h +622 -0
  1258. package/vendor/eigen/Eigen/src/Core/util/ConfigureVectorization.h +543 -0
  1259. package/vendor/eigen/Eigen/src/Core/util/Constants.h +598 -0
  1260. package/vendor/eigen/Eigen/src/Core/util/DisableStupidWarnings.h +146 -0
  1261. package/vendor/eigen/Eigen/src/Core/util/EmulateArray.h +270 -0
  1262. package/vendor/eigen/Eigen/src/Core/util/ForwardDeclarations.h +524 -0
  1263. package/vendor/eigen/Eigen/src/Core/util/GpuHipCudaDefines.inc +101 -0
  1264. package/vendor/eigen/Eigen/src/Core/util/GpuHipCudaUndefines.inc +45 -0
  1265. package/vendor/eigen/Eigen/src/Core/util/IndexedViewHelper.h +487 -0
  1266. package/vendor/eigen/Eigen/src/Core/util/IntegralConstant.h +279 -0
  1267. package/vendor/eigen/Eigen/src/Core/util/MKL_support.h +139 -0
  1268. package/vendor/eigen/Eigen/src/Core/util/Macros.h +1346 -0
  1269. package/vendor/eigen/Eigen/src/Core/util/MaxSizeVector.h +139 -0
  1270. package/vendor/eigen/Eigen/src/Core/util/Memory.h +1385 -0
  1271. package/vendor/eigen/Eigen/src/Core/util/Meta.h +760 -0
  1272. package/vendor/eigen/Eigen/src/Core/util/MoreMeta.h +638 -0
  1273. package/vendor/eigen/Eigen/src/Core/util/ReenableStupidWarnings.h +44 -0
  1274. package/vendor/eigen/Eigen/src/Core/util/ReshapedHelper.h +51 -0
  1275. package/vendor/eigen/Eigen/src/Core/util/Serializer.h +209 -0
  1276. package/vendor/eigen/Eigen/src/Core/util/StaticAssert.h +105 -0
  1277. package/vendor/eigen/Eigen/src/Core/util/SymbolicIndex.h +445 -0
  1278. package/vendor/eigen/Eigen/src/Core/util/XprHelper.h +1093 -0
  1279. package/vendor/eigen/Eigen/src/Eigenvalues/ComplexEigenSolver.h +315 -0
  1280. package/vendor/eigen/Eigen/src/Eigenvalues/ComplexSchur.h +442 -0
  1281. package/vendor/eigen/Eigen/src/Eigenvalues/ComplexSchur_LAPACKE.h +95 -0
  1282. package/vendor/eigen/Eigen/src/Eigenvalues/EigenSolver.h +579 -0
  1283. package/vendor/eigen/Eigen/src/Eigenvalues/GeneralizedEigenSolver.h +402 -0
  1284. package/vendor/eigen/Eigen/src/Eigenvalues/GeneralizedSelfAdjointEigenSolver.h +212 -0
  1285. package/vendor/eigen/Eigen/src/Eigenvalues/HessenbergDecomposition.h +356 -0
  1286. package/vendor/eigen/Eigen/src/Eigenvalues/InternalHeaderCheck.h +3 -0
  1287. package/vendor/eigen/Eigen/src/Eigenvalues/MatrixBaseEigenvalues.h +142 -0
  1288. package/vendor/eigen/Eigen/src/Eigenvalues/RealQZ.h +587 -0
  1289. package/vendor/eigen/Eigen/src/Eigenvalues/RealSchur.h +519 -0
  1290. package/vendor/eigen/Eigen/src/Eigenvalues/RealSchur_LAPACKE.h +83 -0
  1291. package/vendor/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver.h +850 -0
  1292. package/vendor/eigen/Eigen/src/Eigenvalues/SelfAdjointEigenSolver_LAPACKE.h +90 -0
  1293. package/vendor/eigen/Eigen/src/Eigenvalues/Tridiagonalization.h +529 -0
  1294. package/vendor/eigen/Eigen/src/Geometry/AlignedBox.h +485 -0
  1295. package/vendor/eigen/Eigen/src/Geometry/AngleAxis.h +245 -0
  1296. package/vendor/eigen/Eigen/src/Geometry/EulerAngles.h +203 -0
  1297. package/vendor/eigen/Eigen/src/Geometry/Homogeneous.h +453 -0
  1298. package/vendor/eigen/Eigen/src/Geometry/Hyperplane.h +273 -0
  1299. package/vendor/eigen/Eigen/src/Geometry/InternalHeaderCheck.h +3 -0
  1300. package/vendor/eigen/Eigen/src/Geometry/OrthoMethods.h +257 -0
  1301. package/vendor/eigen/Eigen/src/Geometry/ParametrizedLine.h +232 -0
  1302. package/vendor/eigen/Eigen/src/Geometry/Quaternion.h +930 -0
  1303. package/vendor/eigen/Eigen/src/Geometry/Rotation2D.h +201 -0
  1304. package/vendor/eigen/Eigen/src/Geometry/RotationBase.h +209 -0
  1305. package/vendor/eigen/Eigen/src/Geometry/Scaling.h +195 -0
  1306. package/vendor/eigen/Eigen/src/Geometry/Transform.h +1485 -0
  1307. package/vendor/eigen/Eigen/src/Geometry/Translation.h +204 -0
  1308. package/vendor/eigen/Eigen/src/Geometry/Umeyama.h +161 -0
  1309. package/vendor/eigen/Eigen/src/Geometry/arch/Geometry_SIMD.h +154 -0
  1310. package/vendor/eigen/Eigen/src/Householder/BlockHouseholder.h +115 -0
  1311. package/vendor/eigen/Eigen/src/Householder/Householder.h +154 -0
  1312. package/vendor/eigen/Eigen/src/Householder/HouseholderSequence.h +504 -0
  1313. package/vendor/eigen/Eigen/src/Householder/InternalHeaderCheck.h +3 -0
  1314. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/BasicPreconditioners.h +213 -0
  1315. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h +220 -0
  1316. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h +217 -0
  1317. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/IncompleteCholesky.h +402 -0
  1318. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/IncompleteLUT.h +449 -0
  1319. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/InternalHeaderCheck.h +3 -0
  1320. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h +395 -0
  1321. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/LeastSquareConjugateGradient.h +193 -0
  1322. package/vendor/eigen/Eigen/src/IterativeLinearSolvers/SolveWithGuess.h +111 -0
  1323. package/vendor/eigen/Eigen/src/Jacobi/InternalHeaderCheck.h +3 -0
  1324. package/vendor/eigen/Eigen/src/Jacobi/Jacobi.h +427 -0
  1325. package/vendor/eigen/Eigen/src/KLUSupport/InternalHeaderCheck.h +3 -0
  1326. package/vendor/eigen/Eigen/src/KLUSupport/KLUSupport.h +339 -0
  1327. package/vendor/eigen/Eigen/src/LU/Determinant.h +98 -0
  1328. package/vendor/eigen/Eigen/src/LU/FullPivLU.h +826 -0
  1329. package/vendor/eigen/Eigen/src/LU/InternalHeaderCheck.h +3 -0
  1330. package/vendor/eigen/Eigen/src/LU/InverseImpl.h +353 -0
  1331. package/vendor/eigen/Eigen/src/LU/PartialPivLU.h +586 -0
  1332. package/vendor/eigen/Eigen/src/LU/PartialPivLU_LAPACKE.h +97 -0
  1333. package/vendor/eigen/Eigen/src/LU/arch/InverseSize4.h +353 -0
  1334. package/vendor/eigen/Eigen/src/MetisSupport/InternalHeaderCheck.h +3 -0
  1335. package/vendor/eigen/Eigen/src/MetisSupport/MetisSupport.h +125 -0
  1336. package/vendor/eigen/Eigen/src/OrderingMethods/Amd.h +413 -0
  1337. package/vendor/eigen/Eigen/src/OrderingMethods/Eigen_Colamd.h +1690 -0
  1338. package/vendor/eigen/Eigen/src/OrderingMethods/InternalHeaderCheck.h +3 -0
  1339. package/vendor/eigen/Eigen/src/OrderingMethods/Ordering.h +146 -0
  1340. package/vendor/eigen/Eigen/src/PaStiXSupport/InternalHeaderCheck.h +3 -0
  1341. package/vendor/eigen/Eigen/src/PaStiXSupport/PaStiXSupport.h +632 -0
  1342. package/vendor/eigen/Eigen/src/PardisoSupport/InternalHeaderCheck.h +3 -0
  1343. package/vendor/eigen/Eigen/src/PardisoSupport/PardisoSupport.h +500 -0
  1344. package/vendor/eigen/Eigen/src/QR/ColPivHouseholderQR.h +674 -0
  1345. package/vendor/eigen/Eigen/src/QR/ColPivHouseholderQR_LAPACKE.h +161 -0
  1346. package/vendor/eigen/Eigen/src/QR/CompleteOrthogonalDecomposition.h +648 -0
  1347. package/vendor/eigen/Eigen/src/QR/FullPivHouseholderQR.h +733 -0
  1348. package/vendor/eigen/Eigen/src/QR/HouseholderQR.h +543 -0
  1349. package/vendor/eigen/Eigen/src/QR/HouseholderQR_LAPACKE.h +77 -0
  1350. package/vendor/eigen/Eigen/src/QR/InternalHeaderCheck.h +3 -0
  1351. package/vendor/eigen/Eigen/src/SPQRSupport/InternalHeaderCheck.h +3 -0
  1352. package/vendor/eigen/Eigen/src/SPQRSupport/SuiteSparseQRSupport.h +315 -0
  1353. package/vendor/eigen/Eigen/src/SVD/BDCSVD.h +1470 -0
  1354. package/vendor/eigen/Eigen/src/SVD/BDCSVD_LAPACKE.h +174 -0
  1355. package/vendor/eigen/Eigen/src/SVD/InternalHeaderCheck.h +3 -0
  1356. package/vendor/eigen/Eigen/src/SVD/JacobiSVD.h +846 -0
  1357. package/vendor/eigen/Eigen/src/SVD/JacobiSVD_LAPACKE.h +127 -0
  1358. package/vendor/eigen/Eigen/src/SVD/SVDBase.h +436 -0
  1359. package/vendor/eigen/Eigen/src/SVD/UpperBidiagonalization.h +379 -0
  1360. package/vendor/eigen/Eigen/src/SparseCholesky/InternalHeaderCheck.h +3 -0
  1361. package/vendor/eigen/Eigen/src/SparseCholesky/SimplicialCholesky.h +868 -0
  1362. package/vendor/eigen/Eigen/src/SparseCholesky/SimplicialCholesky_impl.h +388 -0
  1363. package/vendor/eigen/Eigen/src/SparseCore/AmbiVector.h +329 -0
  1364. package/vendor/eigen/Eigen/src/SparseCore/CompressedStorage.h +206 -0
  1365. package/vendor/eigen/Eigen/src/SparseCore/ConservativeSparseSparseProduct.h +308 -0
  1366. package/vendor/eigen/Eigen/src/SparseCore/InternalHeaderCheck.h +3 -0
  1367. package/vendor/eigen/Eigen/src/SparseCore/SparseAssign.h +279 -0
  1368. package/vendor/eigen/Eigen/src/SparseCore/SparseBlock.h +534 -0
  1369. package/vendor/eigen/Eigen/src/SparseCore/SparseColEtree.h +194 -0
  1370. package/vendor/eigen/Eigen/src/SparseCore/SparseCompressedBase.h +592 -0
  1371. package/vendor/eigen/Eigen/src/SparseCore/SparseCwiseBinaryOp.h +938 -0
  1372. package/vendor/eigen/Eigen/src/SparseCore/SparseCwiseUnaryOp.h +142 -0
  1373. package/vendor/eigen/Eigen/src/SparseCore/SparseDenseProduct.h +314 -0
  1374. package/vendor/eigen/Eigen/src/SparseCore/SparseDiagonalProduct.h +138 -0
  1375. package/vendor/eigen/Eigen/src/SparseCore/SparseDot.h +100 -0
  1376. package/vendor/eigen/Eigen/src/SparseCore/SparseFuzzy.h +31 -0
  1377. package/vendor/eigen/Eigen/src/SparseCore/SparseMap.h +295 -0
  1378. package/vendor/eigen/Eigen/src/SparseCore/SparseMatrix.h +1876 -0
  1379. package/vendor/eigen/Eigen/src/SparseCore/SparseMatrixBase.h +451 -0
  1380. package/vendor/eigen/Eigen/src/SparseCore/SparsePermutation.h +249 -0
  1381. package/vendor/eigen/Eigen/src/SparseCore/SparseProduct.h +178 -0
  1382. package/vendor/eigen/Eigen/src/SparseCore/SparseRedux.h +47 -0
  1383. package/vendor/eigen/Eigen/src/SparseCore/SparseRef.h +370 -0
  1384. package/vendor/eigen/Eigen/src/SparseCore/SparseSelfAdjointView.h +613 -0
  1385. package/vendor/eigen/Eigen/src/SparseCore/SparseSolverBase.h +115 -0
  1386. package/vendor/eigen/Eigen/src/SparseCore/SparseSparseProductWithPruning.h +184 -0
  1387. package/vendor/eigen/Eigen/src/SparseCore/SparseTranspose.h +83 -0
  1388. package/vendor/eigen/Eigen/src/SparseCore/SparseTriangularView.h +177 -0
  1389. package/vendor/eigen/Eigen/src/SparseCore/SparseUtil.h +209 -0
  1390. package/vendor/eigen/Eigen/src/SparseCore/SparseVector.h +532 -0
  1391. package/vendor/eigen/Eigen/src/SparseCore/SparseView.h +225 -0
  1392. package/vendor/eigen/Eigen/src/SparseCore/TriangularSolver.h +274 -0
  1393. package/vendor/eigen/Eigen/src/SparseLU/InternalHeaderCheck.h +3 -0
  1394. package/vendor/eigen/Eigen/src/SparseLU/SparseLU.h +969 -0
  1395. package/vendor/eigen/Eigen/src/SparseLU/SparseLUImpl.h +79 -0
  1396. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_Memory.h +210 -0
  1397. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_Structs.h +113 -0
  1398. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_SupernodalMatrix.h +319 -0
  1399. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_Utils.h +75 -0
  1400. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_column_bmod.h +177 -0
  1401. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_column_dfs.h +168 -0
  1402. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_copy_to_ucol.h +106 -0
  1403. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_heap_relax_snode.h +114 -0
  1404. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_kernel_bmod.h +133 -0
  1405. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_panel_bmod.h +215 -0
  1406. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_panel_dfs.h +235 -0
  1407. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_pivotL.h +136 -0
  1408. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_pruneL.h +130 -0
  1409. package/vendor/eigen/Eigen/src/SparseLU/SparseLU_relax_snode.h +81 -0
  1410. package/vendor/eigen/Eigen/src/SparseQR/InternalHeaderCheck.h +3 -0
  1411. package/vendor/eigen/Eigen/src/SparseQR/SparseQR.h +706 -0
  1412. package/vendor/eigen/Eigen/src/StlSupport/StdDeque.h +51 -0
  1413. package/vendor/eigen/Eigen/src/StlSupport/StdList.h +50 -0
  1414. package/vendor/eigen/Eigen/src/StlSupport/StdVector.h +51 -0
  1415. package/vendor/eigen/Eigen/src/StlSupport/details.h +82 -0
  1416. package/vendor/eigen/Eigen/src/SuperLUSupport/InternalHeaderCheck.h +3 -0
  1417. package/vendor/eigen/Eigen/src/SuperLUSupport/SuperLUSupport.h +929 -0
  1418. package/vendor/eigen/Eigen/src/ThreadPool/Barrier.h +70 -0
  1419. package/vendor/eigen/Eigen/src/ThreadPool/CoreThreadPoolDevice.h +336 -0
  1420. package/vendor/eigen/Eigen/src/ThreadPool/EventCount.h +241 -0
  1421. package/vendor/eigen/Eigen/src/ThreadPool/ForkJoin.h +140 -0
  1422. package/vendor/eigen/Eigen/src/ThreadPool/InternalHeaderCheck.h +4 -0
  1423. package/vendor/eigen/Eigen/src/ThreadPool/NonBlockingThreadPool.h +587 -0
  1424. package/vendor/eigen/Eigen/src/ThreadPool/RunQueue.h +230 -0
  1425. package/vendor/eigen/Eigen/src/ThreadPool/ThreadCancel.h +21 -0
  1426. package/vendor/eigen/Eigen/src/ThreadPool/ThreadEnvironment.h +43 -0
  1427. package/vendor/eigen/Eigen/src/ThreadPool/ThreadLocal.h +289 -0
  1428. package/vendor/eigen/Eigen/src/ThreadPool/ThreadPoolInterface.h +50 -0
  1429. package/vendor/eigen/Eigen/src/ThreadPool/ThreadYield.h +16 -0
  1430. package/vendor/eigen/Eigen/src/UmfPackSupport/InternalHeaderCheck.h +3 -0
  1431. package/vendor/eigen/Eigen/src/UmfPackSupport/UmfPackSupport.h +606 -0
  1432. package/vendor/eigen/Eigen/src/misc/Image.h +80 -0
  1433. package/vendor/eigen/Eigen/src/misc/InternalHeaderCheck.h +3 -0
  1434. package/vendor/eigen/Eigen/src/misc/Kernel.h +77 -0
  1435. package/vendor/eigen/Eigen/src/misc/RealSvd2x2.h +53 -0
  1436. package/vendor/eigen/Eigen/src/misc/blas.h +97 -0
  1437. package/vendor/eigen/Eigen/src/misc/lapacke.h +10085 -0
  1438. package/vendor/eigen/Eigen/src/misc/lapacke_helpers.h +163 -0
  1439. package/vendor/eigen/Eigen/src/misc/lapacke_mangling.h +16 -0
  1440. package/vendor/eigen/Eigen/src/plugins/ArrayCwiseBinaryOps.inc +344 -0
  1441. package/vendor/eigen/Eigen/src/plugins/ArrayCwiseUnaryOps.inc +544 -0
  1442. package/vendor/eigen/Eigen/src/plugins/BlockMethods.inc +1370 -0
  1443. package/vendor/eigen/Eigen/src/plugins/CommonCwiseBinaryOps.inc +116 -0
  1444. package/vendor/eigen/Eigen/src/plugins/CommonCwiseUnaryOps.inc +167 -0
  1445. package/vendor/eigen/Eigen/src/plugins/IndexedViewMethods.inc +192 -0
  1446. package/vendor/eigen/Eigen/src/plugins/InternalHeaderCheck.inc +3 -0
  1447. package/vendor/eigen/Eigen/src/plugins/MatrixCwiseBinaryOps.inc +331 -0
  1448. package/vendor/eigen/Eigen/src/plugins/MatrixCwiseUnaryOps.inc +118 -0
  1449. package/vendor/eigen/Eigen/src/plugins/ReshapedMethods.inc +133 -0
  1450. package/vendor/eigen/README.md +5 -0
  1451. package/vendor/mpdecimal/COPYRIGHT.txt +23 -0
  1452. package/vendor/mpdecimal/README.txt +53 -0
  1453. package/vendor/mpdecimal/libmpdec/.objs/README.txt +8 -0
  1454. package/vendor/mpdecimal/libmpdec/.objs/symbols32.exp +343 -0
  1455. package/vendor/mpdecimal/libmpdec/.objs/symbols64.exp +347 -0
  1456. package/vendor/mpdecimal/libmpdec/.pc/libmpdec.pc.in +11 -0
  1457. package/vendor/mpdecimal/libmpdec/.profile/train.sh +35 -0
  1458. package/vendor/mpdecimal/libmpdec/README.txt +84 -0
  1459. package/vendor/mpdecimal/libmpdec/basearith.c +649 -0
  1460. package/vendor/mpdecimal/libmpdec/basearith.h +217 -0
  1461. package/vendor/mpdecimal/libmpdec/bits.h +188 -0
  1462. package/vendor/mpdecimal/libmpdec/constants.c +129 -0
  1463. package/vendor/mpdecimal/libmpdec/constants.h +88 -0
  1464. package/vendor/mpdecimal/libmpdec/context.c +285 -0
  1465. package/vendor/mpdecimal/libmpdec/convolute.c +172 -0
  1466. package/vendor/mpdecimal/libmpdec/convolute.h +48 -0
  1467. package/vendor/mpdecimal/libmpdec/crt.c +178 -0
  1468. package/vendor/mpdecimal/libmpdec/crt.h +45 -0
  1469. package/vendor/mpdecimal/libmpdec/difradix2.c +171 -0
  1470. package/vendor/mpdecimal/libmpdec/difradix2.h +46 -0
  1471. package/vendor/mpdecimal/libmpdec/fnt.c +77 -0
  1472. package/vendor/mpdecimal/libmpdec/fnt.h +46 -0
  1473. package/vendor/mpdecimal/libmpdec/fourstep.c +242 -0
  1474. package/vendor/mpdecimal/libmpdec/fourstep.h +46 -0
  1475. package/vendor/mpdecimal/libmpdec/io.c +1610 -0
  1476. package/vendor/mpdecimal/libmpdec/io.h +61 -0
  1477. package/vendor/mpdecimal/libmpdec/mpalloc.c +347 -0
  1478. package/vendor/mpdecimal/libmpdec/mpalloc.h +53 -0
  1479. package/vendor/mpdecimal/libmpdec/mpdecimal.c +9155 -0
  1480. package/vendor/mpdecimal/libmpdec/mpdecimal.h.in +804 -0
  1481. package/vendor/mpdecimal/libmpdec/mpsignal.c +966 -0
  1482. package/vendor/mpdecimal/libmpdec/numbertheory.c +129 -0
  1483. package/vendor/mpdecimal/libmpdec/numbertheory.h +75 -0
  1484. package/vendor/mpdecimal/libmpdec/sixstep.c +212 -0
  1485. package/vendor/mpdecimal/libmpdec/sixstep.h +46 -0
  1486. package/vendor/mpdecimal/libmpdec/transpose.c +275 -0
  1487. package/vendor/mpdecimal/libmpdec/transpose.h +60 -0
  1488. package/vendor/mpdecimal/libmpdec/typearith.h +661 -0
  1489. package/vendor/mpdecimal/libmpdec/umodarith.h +645 -0
  1490. package/vendor/symengine/AUTHORS +101 -0
  1491. package/vendor/symengine/LICENSE +254 -0
  1492. package/vendor/symengine/README.md +199 -0
  1493. package/vendor/symengine/symengine/add.cpp +508 -0
  1494. package/vendor/symengine/symengine/add.h +187 -0
  1495. package/vendor/symengine/symengine/as_real_imag.cpp +289 -0
  1496. package/vendor/symengine/symengine/assumptions.cpp +202 -0
  1497. package/vendor/symengine/symengine/assumptions.h +47 -0
  1498. package/vendor/symengine/symengine/basic-inl.h +152 -0
  1499. package/vendor/symengine/symengine/basic-methods.inc +9 -0
  1500. package/vendor/symengine/symengine/basic.cpp +110 -0
  1501. package/vendor/symengine/symengine/basic.h +356 -0
  1502. package/vendor/symengine/symengine/complex.cpp +198 -0
  1503. package/vendor/symengine/symengine/complex.h +396 -0
  1504. package/vendor/symengine/symengine/complex_double.cpp +72 -0
  1505. package/vendor/symengine/symengine/complex_double.h +570 -0
  1506. package/vendor/symengine/symengine/complex_mpc.h +406 -0
  1507. package/vendor/symengine/symengine/constants.cpp +130 -0
  1508. package/vendor/symengine/symengine/constants.h +81 -0
  1509. package/vendor/symengine/symengine/cse.cpp +556 -0
  1510. package/vendor/symengine/symengine/cwrapper.h +949 -0
  1511. package/vendor/symengine/symengine/dense_matrix.cpp +2100 -0
  1512. package/vendor/symengine/symengine/derivative.cpp +841 -0
  1513. package/vendor/symengine/symengine/derivative.h +137 -0
  1514. package/vendor/symengine/symengine/dict.cpp +125 -0
  1515. package/vendor/symengine/symengine/dict.h +333 -0
  1516. package/vendor/symengine/symengine/diophantine.cpp +139 -0
  1517. package/vendor/symengine/symengine/diophantine.h +20 -0
  1518. package/vendor/symengine/symengine/eval.cpp +109 -0
  1519. package/vendor/symengine/symengine/eval.h +40 -0
  1520. package/vendor/symengine/symengine/eval_arb.h +31 -0
  1521. package/vendor/symengine/symengine/eval_double.cpp +959 -0
  1522. package/vendor/symengine/symengine/eval_double.h +28 -0
  1523. package/vendor/symengine/symengine/eval_mpc.h +29 -0
  1524. package/vendor/symengine/symengine/eval_mpfr.h +26 -0
  1525. package/vendor/symengine/symengine/expand.cpp +379 -0
  1526. package/vendor/symengine/symengine/expression.cpp +24 -0
  1527. package/vendor/symengine/symengine/expression.h +375 -0
  1528. package/vendor/symengine/symengine/fields.cpp +861 -0
  1529. package/vendor/symengine/symengine/fields.h +647 -0
  1530. package/vendor/symengine/symengine/finitediff.cpp +70 -0
  1531. package/vendor/symengine/symengine/finitediff.h +21 -0
  1532. package/vendor/symengine/symengine/flint_wrapper.h +1010 -0
  1533. package/vendor/symengine/symengine/functions.cpp +3913 -0
  1534. package/vendor/symengine/symengine/functions.h +1321 -0
  1535. package/vendor/symengine/symengine/infinity.cpp +537 -0
  1536. package/vendor/symengine/symengine/infinity.h +118 -0
  1537. package/vendor/symengine/symengine/integer.cpp +153 -0
  1538. package/vendor/symengine/symengine/integer.h +227 -0
  1539. package/vendor/symengine/symengine/interruption.cpp +9 -0
  1540. package/vendor/symengine/symengine/interruption.h +19 -0
  1541. package/vendor/symengine/symengine/lambda_double.h +918 -0
  1542. package/vendor/symengine/symengine/limits.h +35 -0
  1543. package/vendor/symengine/symengine/llvm_double.h +201 -0
  1544. package/vendor/symengine/symengine/logic.cpp +812 -0
  1545. package/vendor/symengine/symengine/logic.h +281 -0
  1546. package/vendor/symengine/symengine/matrices/conjugate_matrix.cpp +139 -0
  1547. package/vendor/symengine/symengine/matrices/conjugate_matrix.h +39 -0
  1548. package/vendor/symengine/symengine/matrices/diagonal_matrix.cpp +79 -0
  1549. package/vendor/symengine/symengine/matrices/diagonal_matrix.h +52 -0
  1550. package/vendor/symengine/symengine/matrices/hadamard_product.cpp +151 -0
  1551. package/vendor/symengine/symengine/matrices/hadamard_product.h +42 -0
  1552. package/vendor/symengine/symengine/matrices/identity_matrix.cpp +63 -0
  1553. package/vendor/symengine/symengine/matrices/identity_matrix.h +40 -0
  1554. package/vendor/symengine/symengine/matrices/immutable_dense_matrix.cpp +143 -0
  1555. package/vendor/symengine/symengine/matrices/immutable_dense_matrix.h +65 -0
  1556. package/vendor/symengine/symengine/matrices/is_diagonal.cpp +115 -0
  1557. package/vendor/symengine/symengine/matrices/is_lower.cpp +110 -0
  1558. package/vendor/symengine/symengine/matrices/is_real.cpp +78 -0
  1559. package/vendor/symengine/symengine/matrices/is_square.cpp +85 -0
  1560. package/vendor/symengine/symengine/matrices/is_symmetric.cpp +112 -0
  1561. package/vendor/symengine/symengine/matrices/is_toeplitz.cpp +104 -0
  1562. package/vendor/symengine/symengine/matrices/is_upper.cpp +108 -0
  1563. package/vendor/symengine/symengine/matrices/is_zero.cpp +81 -0
  1564. package/vendor/symengine/symengine/matrices/matrix_add.cpp +176 -0
  1565. package/vendor/symengine/symengine/matrices/matrix_add.h +42 -0
  1566. package/vendor/symengine/symengine/matrices/matrix_expr.h +19 -0
  1567. package/vendor/symengine/symengine/matrices/matrix_mul.cpp +258 -0
  1568. package/vendor/symengine/symengine/matrices/matrix_mul.h +55 -0
  1569. package/vendor/symengine/symengine/matrices/matrix_symbol.cpp +34 -0
  1570. package/vendor/symengine/symengine/matrices/matrix_symbol.h +41 -0
  1571. package/vendor/symengine/symengine/matrices/size.cpp +121 -0
  1572. package/vendor/symengine/symengine/matrices/size.h +15 -0
  1573. package/vendor/symengine/symengine/matrices/trace.cpp +112 -0
  1574. package/vendor/symengine/symengine/matrices/trace.h +31 -0
  1575. package/vendor/symengine/symengine/matrices/transpose.cpp +126 -0
  1576. package/vendor/symengine/symengine/matrices/transpose.h +39 -0
  1577. package/vendor/symengine/symengine/matrices/zero_matrix.cpp +94 -0
  1578. package/vendor/symengine/symengine/matrices/zero_matrix.h +47 -0
  1579. package/vendor/symengine/symengine/matrix.cpp +33 -0
  1580. package/vendor/symengine/symengine/matrix.h +675 -0
  1581. package/vendor/symengine/symengine/matrix_expressions.h +51 -0
  1582. package/vendor/symengine/symengine/monomials.cpp +33 -0
  1583. package/vendor/symengine/symengine/monomials.h +20 -0
  1584. package/vendor/symengine/symengine/mp_boost.cpp +635 -0
  1585. package/vendor/symengine/symengine/mp_class.h +1286 -0
  1586. package/vendor/symengine/symengine/mp_wrapper.h +510 -0
  1587. package/vendor/symengine/symengine/mul.cpp +629 -0
  1588. package/vendor/symengine/symengine/mul.h +146 -0
  1589. package/vendor/symengine/symengine/nan.cpp +234 -0
  1590. package/vendor/symengine/symengine/nan.h +82 -0
  1591. package/vendor/symengine/symengine/ntheory.cpp +1700 -0
  1592. package/vendor/symengine/symengine/ntheory.h +213 -0
  1593. package/vendor/symengine/symengine/ntheory_funcs.cpp +189 -0
  1594. package/vendor/symengine/symengine/ntheory_funcs.h +78 -0
  1595. package/vendor/symengine/symengine/number.cpp +36 -0
  1596. package/vendor/symengine/symengine/number.h +256 -0
  1597. package/vendor/symengine/symengine/numer_denom.cpp +149 -0
  1598. package/vendor/symengine/symengine/parser/parser.cpp +367 -0
  1599. package/vendor/symengine/symengine/parser/parser.h +56 -0
  1600. package/vendor/symengine/symengine/parser/parser.tab.cc +1495 -0
  1601. package/vendor/symengine/symengine/parser/parser.tab.hh +1410 -0
  1602. package/vendor/symengine/symengine/parser/parser_old.cpp +688 -0
  1603. package/vendor/symengine/symengine/parser/tokenizer.cpp +435 -0
  1604. package/vendor/symengine/symengine/parser/tokenizer.h +35 -0
  1605. package/vendor/symengine/symengine/parser.h +25 -0
  1606. package/vendor/symengine/symengine/polys/basic_conversions.cpp +178 -0
  1607. package/vendor/symengine/symengine/polys/basic_conversions.h +575 -0
  1608. package/vendor/symengine/symengine/polys/cancel.h +39 -0
  1609. package/vendor/symengine/symengine/polys/msymenginepoly.cpp +130 -0
  1610. package/vendor/symengine/symengine/polys/msymenginepoly.h +536 -0
  1611. package/vendor/symengine/symengine/polys/uexprpoly.cpp +90 -0
  1612. package/vendor/symengine/symengine/polys/uexprpoly.h +205 -0
  1613. package/vendor/symengine/symengine/polys/uintpoly.cpp +62 -0
  1614. package/vendor/symengine/symengine/polys/uintpoly.h +134 -0
  1615. package/vendor/symengine/symengine/polys/uintpoly_flint.h +228 -0
  1616. package/vendor/symengine/symengine/polys/uintpoly_piranha.h +373 -0
  1617. package/vendor/symengine/symengine/polys/upolybase.h +769 -0
  1618. package/vendor/symengine/symengine/polys/uratpoly.cpp +59 -0
  1619. package/vendor/symengine/symengine/polys/uratpoly.h +58 -0
  1620. package/vendor/symengine/symengine/polys/usymenginepoly.h +139 -0
  1621. package/vendor/symengine/symengine/pow.cpp +303 -0
  1622. package/vendor/symengine/symengine/pow.h +76 -0
  1623. package/vendor/symengine/symengine/prime_sieve.cpp +143 -0
  1624. package/vendor/symengine/symengine/prime_sieve.h +64 -0
  1625. package/vendor/symengine/symengine/printers/codegen.cpp +716 -0
  1626. package/vendor/symengine/symengine/printers/codegen.h +168 -0
  1627. package/vendor/symengine/symengine/printers/latex.cpp +630 -0
  1628. package/vendor/symengine/symengine/printers/latex.h +76 -0
  1629. package/vendor/symengine/symengine/printers/mathml.cpp +358 -0
  1630. package/vendor/symengine/symengine/printers/mathml.h +62 -0
  1631. package/vendor/symengine/symengine/printers/stringbox.cpp +276 -0
  1632. package/vendor/symengine/symengine/printers/stringbox.h +60 -0
  1633. package/vendor/symengine/symengine/printers/strprinter.cpp +1212 -0
  1634. package/vendor/symengine/symengine/printers/strprinter.h +217 -0
  1635. package/vendor/symengine/symengine/printers/unicode.cpp +730 -0
  1636. package/vendor/symengine/symengine/printers/unicode.h +84 -0
  1637. package/vendor/symengine/symengine/printers.h +46 -0
  1638. package/vendor/symengine/symengine/rational.cpp +365 -0
  1639. package/vendor/symengine/symengine/rational.h +341 -0
  1640. package/vendor/symengine/symengine/real_double.cpp +388 -0
  1641. package/vendor/symengine/symengine/real_double.h +492 -0
  1642. package/vendor/symengine/symengine/real_mpfr.h +379 -0
  1643. package/vendor/symengine/symengine/refine.cpp +213 -0
  1644. package/vendor/symengine/symengine/refine.h +43 -0
  1645. package/vendor/symengine/symengine/rewrite.cpp +235 -0
  1646. package/vendor/symengine/symengine/rings.cpp +107 -0
  1647. package/vendor/symengine/symengine/rings.h +24 -0
  1648. package/vendor/symengine/symengine/serialize-cereal.h +964 -0
  1649. package/vendor/symengine/symengine/series.cpp +85 -0
  1650. package/vendor/symengine/symengine/series.h +727 -0
  1651. package/vendor/symengine/symengine/series_flint.h +214 -0
  1652. package/vendor/symengine/symengine/series_generic.cpp +247 -0
  1653. package/vendor/symengine/symengine/series_generic.h +86 -0
  1654. package/vendor/symengine/symengine/series_piranha.h +95 -0
  1655. package/vendor/symengine/symengine/series_visitor.h +357 -0
  1656. package/vendor/symengine/symengine/set_funcs.cpp +296 -0
  1657. package/vendor/symengine/symengine/sets.cpp +1854 -0
  1658. package/vendor/symengine/symengine/sets.h +696 -0
  1659. package/vendor/symengine/symengine/simplify.cpp +62 -0
  1660. package/vendor/symengine/symengine/simplify.h +34 -0
  1661. package/vendor/symengine/symengine/solve.cpp +665 -0
  1662. package/vendor/symengine/symengine/solve.h +117 -0
  1663. package/vendor/symengine/symengine/sparse_matrix.cpp +776 -0
  1664. package/vendor/symengine/symengine/special_boost.cpp +85 -0
  1665. package/vendor/symengine/symengine/special_double.h +570 -0
  1666. package/vendor/symengine/symengine/subs.h +579 -0
  1667. package/vendor/symengine/symengine/symbol.cpp +88 -0
  1668. package/vendor/symengine/symengine/symbol.h +116 -0
  1669. package/vendor/symengine/symengine/symengine_assert.h +50 -0
  1670. package/vendor/symengine/symengine/symengine_casts.h +139 -0
  1671. package/vendor/symengine/symengine/symengine_exception.h +101 -0
  1672. package/vendor/symengine/symengine/symengine_rcp.cpp +21 -0
  1673. package/vendor/symengine/symengine/symengine_rcp.h +384 -0
  1674. package/vendor/symengine/symengine/test_visitors.cpp +1083 -0
  1675. package/vendor/symengine/symengine/test_visitors.h +466 -0
  1676. package/vendor/symengine/symengine/tribool.h +85 -0
  1677. package/vendor/symengine/symengine/tuple.cpp +47 -0
  1678. package/vendor/symengine/symengine/tuple.h +32 -0
  1679. package/vendor/symengine/symengine/type_codes.inc +139 -0
  1680. package/vendor/symengine/symengine/utilities/cereal/LICENSE +24 -0
  1681. package/vendor/symengine/symengine/utilities/cereal/include/cereal/access.hpp +351 -0
  1682. package/vendor/symengine/symengine/utilities/cereal/include/cereal/archives/adapters.hpp +163 -0
  1683. package/vendor/symengine/symengine/utilities/cereal/include/cereal/archives/binary.hpp +169 -0
  1684. package/vendor/symengine/symengine/utilities/cereal/include/cereal/archives/json.hpp +1024 -0
  1685. package/vendor/symengine/symengine/utilities/cereal/include/cereal/archives/portable_binary.hpp +334 -0
  1686. package/vendor/symengine/symengine/utilities/cereal/include/cereal/archives/xml.hpp +956 -0
  1687. package/vendor/symengine/symengine/utilities/cereal/include/cereal/cereal.hpp +1120 -0
  1688. package/vendor/symengine/symengine/utilities/cereal/include/cereal/details/helpers.hpp +422 -0
  1689. package/vendor/symengine/symengine/utilities/cereal/include/cereal/details/polymorphic_impl.hpp +825 -0
  1690. package/vendor/symengine/symengine/utilities/cereal/include/cereal/details/polymorphic_impl_fwd.hpp +65 -0
  1691. package/vendor/symengine/symengine/utilities/cereal/include/cereal/details/static_object.hpp +128 -0
  1692. package/vendor/symengine/symengine/utilities/cereal/include/cereal/details/traits.hpp +1411 -0
  1693. package/vendor/symengine/symengine/utilities/cereal/include/cereal/details/util.hpp +84 -0
  1694. package/vendor/symengine/symengine/utilities/cereal/include/cereal/macros.hpp +156 -0
  1695. package/vendor/symengine/symengine/utilities/cereal/include/cereal/specialize.hpp +139 -0
  1696. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/array.hpp +79 -0
  1697. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/atomic.hpp +55 -0
  1698. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/base_class.hpp +203 -0
  1699. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/bitset.hpp +176 -0
  1700. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/boost_variant.hpp +164 -0
  1701. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/chrono.hpp +72 -0
  1702. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/common.hpp +129 -0
  1703. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/complex.hpp +56 -0
  1704. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/concepts/pair_associative_container.hpp +73 -0
  1705. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/deque.hpp +62 -0
  1706. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/forward_list.hpp +68 -0
  1707. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/functional.hpp +43 -0
  1708. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/list.hpp +62 -0
  1709. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/map.hpp +36 -0
  1710. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/memory.hpp +425 -0
  1711. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/optional.hpp +65 -0
  1712. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/polymorphic.hpp +483 -0
  1713. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/queue.hpp +132 -0
  1714. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/set.hpp +103 -0
  1715. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/stack.hpp +76 -0
  1716. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/string.hpp +61 -0
  1717. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/tuple.hpp +123 -0
  1718. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/unordered_map.hpp +36 -0
  1719. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/unordered_set.hpp +99 -0
  1720. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/utility.hpp +47 -0
  1721. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/valarray.hpp +89 -0
  1722. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/variant.hpp +108 -0
  1723. package/vendor/symengine/symengine/utilities/cereal/include/cereal/types/vector.hpp +112 -0
  1724. package/vendor/symengine/symengine/utilities/cereal/include/cereal/version.hpp +52 -0
  1725. package/vendor/symengine/symengine/utilities/fast_float/include/fast_float/fast_float.h +3720 -0
  1726. package/vendor/symengine/symengine/utilities/stream_fmt.h +25 -0
  1727. package/vendor/symengine/symengine/visitor.cpp +348 -0
  1728. package/vendor/symengine/symengine/visitor.h +425 -0
@@ -0,0 +1,1428 @@
1
+ //The integrals of expressions (see Integrals.h)
2
+ #include "Integrals.h"
3
+
4
+ #include <algorithm>
5
+ #include <atomic>
6
+ #include <functional>
7
+ #include <cmath>
8
+ #include <complex>
9
+ #include <map>
10
+ #include <optional>
11
+ #include <vector>
12
+
13
+ #include <symengine/add.h>
14
+ #include <symengine/constants.h>
15
+ #include <symengine/functions.h>
16
+ #include <symengine/infinity.h>
17
+ #include <symengine/integer.h>
18
+ #include <symengine/logic.h>
19
+ #include <symengine/mul.h>
20
+ #include <symengine/nan.h>
21
+ #include <symengine/polys/basic_conversions.h>
22
+ #include <symengine/polys/uexprpoly.h>
23
+ #include <symengine/pow.h>
24
+ #include <symengine/rational.h>
25
+ #include <symengine/subs.h>
26
+ #include <symengine/symbol.h>
27
+
28
+ #include "../async/Pool.h"
29
+ #include "../core/Errors.h"
30
+ #include "../functions/SpecialIntegrals.h"
31
+ #include "../limits/Gruntz.h"
32
+ #include "../numeric/Numeric.h"
33
+ #include "../ops/Operations.h"
34
+ #include "../ops/Piecewise.h"
35
+ #include "../parser/Parser.h"
36
+ #include "../poly/Poly.h"
37
+ #include "../poly/Rational.h"
38
+ #include "../printer/Printer.h"
39
+ #include "../simplify/Simplify.h"
40
+
41
+ namespace math {
42
+
43
+ using namespace SymEngine;
44
+
45
+ namespace {
46
+
47
+ using Variable = RCP<const Symbol>;
48
+
49
+ //The nesting of the rules at most (substitutions within parts within substitutions…)
50
+ constexpr unsigned LARGEST_DEPTH = 12;
51
+ //The candidates of a substitution tried at most
52
+ constexpr size_t LARGEST_CANDIDATES = 24;
53
+
54
+ MathError notFound(const std::string &why)
55
+ {
56
+ return MathError(ErrorCode::NotSupported, "The integral is not found: " + why);
57
+ }
58
+
59
+ //A variable of a substitution: a name no other has (the polynomials and the series know variables by their names)
60
+ Variable fresh(const std::string &name)
61
+ {
62
+ static std::atomic<size_t> count{0};
63
+ return symbol("@" + name + std::to_string(++count));
64
+ }
65
+
66
+ bool has(const Expr &e, const Variable &x)
67
+ {
68
+ return has_symbol(*e, *x);
69
+ }
70
+
71
+ //A name of the parser that no variable of an expression has (u1, u2…)
72
+ Variable plainName(const Expr &e)
73
+ {
74
+ const auto symbols = free_symbols(*e);
75
+ for (size_t i = 1;; i++) {
76
+ const Variable candidate = symbol("u" + std::to_string(i));
77
+ if (!symbols.count(candidate)) return candidate;
78
+ }
79
+ }
80
+
81
+ Expr replaced(const Expr &e, const Expr &from, const Expr &to)
82
+ {
83
+ map_basic_basic replacement;
84
+ replacement[from] = to;
85
+ return xreplace(e, replacement);
86
+ }
87
+
88
+ //The coefficients of a polynomial in x whose coefficients have no x, from the constant term up, or nothing (by the
89
+ //symbol: the variables of the substitutions have names no parser takes)
90
+ std::optional<std::vector<Expr>> polynomialIn(const Expr &e, const Variable &x)
91
+ {
92
+ try {
93
+ const RCP<const UExprPoly> polynomial = from_basic<UExprPoly>(expand(e), x);
94
+ std::vector<Expr> c;
95
+ for (const auto &[power, coefficient] : polynomial->get_poly().get_dict()) {
96
+ if (power < 0 || power > 200 || has(coefficient.get_basic(), x)) return std::nullopt;
97
+ if (static_cast<size_t>(power) >= c.size()) c.resize(static_cast<size_t>(power) + 1, zero);
98
+ c[static_cast<size_t>(power)] = coefficient.get_basic();
99
+ }
100
+ if (c.empty()) c.push_back(zero);
101
+ return c;
102
+ } catch (SymEngineException &) {
103
+ return std::nullopt;
104
+ }
105
+ }
106
+
107
+ //a x + b: (a, b), a not 0
108
+ std::optional<std::pair<Expr, Expr>> linearIn(const Expr &e, const Variable &x)
109
+ {
110
+ if (!has(e, x)) return std::nullopt;
111
+ const auto c = polynomialIn(e, x);
112
+ if (!c || c->size() != 2) return std::nullopt;
113
+ return std::make_pair((*c)[1], (*c)[0]);
114
+ }
115
+
116
+ //Whether an expression is a fraction of polynomials in x: x by sums, products and integer powers
117
+ bool rationalIn(const Expr &e, const Variable &x)
118
+ {
119
+ if (!has(e, x) || eq(*e, *x)) return true;
120
+ if (is_a<Add>(*e) || is_a<Mul>(*e)) {
121
+ for (const Expr &part : e->get_args()) {
122
+ if (!rationalIn(part, x)) return false;
123
+ }
124
+ return true;
125
+ }
126
+ if (is_a<Pow>(*e)) return is_a<Integer>(*down_cast<const Pow &>(*e).get_exp()) && rationalIn(down_cast<const Pow &>(*e).get_base(), x);
127
+ return false;
128
+ }
129
+
130
+ //The sign of a value without variables: 1, -1, 0, or 2 where it is not decided (parameters, complex values)
131
+ int signOf(const Expr &e)
132
+ {
133
+ if (!free_symbols(*e).empty()) return 2;
134
+ return compareOf(e, zero);
135
+ }
136
+
137
+ bool isExp(const Expr &e)
138
+ {
139
+ return is_a<Pow>(*e) && eq(*down_cast<const Pow &>(*e).get_base(), *E);
140
+ }
141
+
142
+ //An antiderivative checked by its derivative: equal to the integrand where both are real at several points (the
143
+ //other variables at fixed values); points where they are complex count only where they agree (a branch cut may differ)
144
+ bool verified(const Expr &F, const Expr &f, const Variable &x)
145
+ {
146
+ const Expr derivative = SymEngine::diff(F, x, true);
147
+ if (eq(*expand(sub(derivative, f)), *zero)) return true;
148
+ std::vector<Expr> others;
149
+ for (const auto &symbolFound : free_symbols(*add(F, f))) {
150
+ if (!eq(*symbolFound, *x)) others.push_back(symbolFound);
151
+ }
152
+ static const long points[][2] = {{37, 100}, {61, 100}, {-29, 100}, {17, 10}, {23, 10}, {-16, 10}, {39, 10}, {-31, 10}};
153
+ int agreeing = 0;
154
+ for (const auto &point : points) {
155
+ checkpoint();
156
+ map_basic_basic values;
157
+ values[x] = rational(point[0], point[1]);
158
+ for (size_t j = 0; j < others.size(); j++) values[others[j]] = rational(113 + 37 * static_cast<long>(j), 100);
159
+ std::complex<double> a, b;
160
+ try {
161
+ a = toComplex(subs(derivative, values));
162
+ b = toComplex(subs(f, values));
163
+ } catch (const MathError &error) {
164
+ if (error.code() == ErrorCode::Cancelled || error.code() == ErrorCode::Timeout) throw;
165
+ continue;
166
+ } catch (SymEngineException &) {
167
+ continue;
168
+ }
169
+ if (!std::isfinite(a.real()) || !std::isfinite(a.imag()) || !std::isfinite(b.real()) || !std::isfinite(b.imag())) continue;
170
+ const bool close = std::abs(a - b) <= 1e-8 * std::max(1.0, std::abs(b));
171
+ const bool real = std::abs(a.imag()) <= 1e-12 * std::max(1.0, std::abs(a)) && std::abs(b.imag()) <= 1e-12 * std::max(1.0, std::abs(b));
172
+ if (real && !close) return false;
173
+ if (close) agreeing++;
174
+ }
175
+ return agreeing >= 2;
176
+ }
177
+
178
+ //Whether two expressions of x are equal at several points (where both are finite)
179
+ bool verifiedAt(const Expr &a, const Expr &b, const Variable &x)
180
+ {
181
+ static const long points[][2] = {{37, 10}, {61, 10}, {29, 10}, {113, 10}};
182
+ int agreeing = 0;
183
+ for (const auto &point : points) {
184
+ map_basic_basic values;
185
+ values[x] = rational(point[0], point[1]);
186
+ for (const auto &other : free_symbols(*add(a, b))) {
187
+ if (!eq(*other, *x)) values[other] = rational(13, 10);
188
+ }
189
+ try {
190
+ const std::complex<double> va = toComplex(subs(a, values)), vb = toComplex(subs(b, values));
191
+ if (std::abs(va - vb) > 1e-9 * std::max(1.0, std::abs(vb))) return false;
192
+ agreeing++;
193
+ } catch (const MathError &error) {
194
+ if (error.code() == ErrorCode::Cancelled || error.code() == ErrorCode::Timeout) throw;
195
+ } catch (SymEngineException &) {
196
+ }
197
+ }
198
+ return agreeing >= 2;
199
+ }
200
+
201
+ class Integrator {
202
+ public:
203
+ explicit Integrator(const Variable &x, unsigned depth = 0) : x_(x), depth_(depth)
204
+ {
205
+ }
206
+
207
+ //An antiderivative of f in x, or nothing
208
+ std::optional<Expr> integral(const Expr &f)
209
+ {
210
+ checkpoint();
211
+ if (!has(f, x_)) return mul(f, x_);
212
+ if (depth_ >= LARGEST_DEPTH) return std::nullopt;
213
+ if (std::any_of(active_.begin(), active_.end(), [&f](const Expr &a) { return eq(*a, *f); })) return std::nullopt;
214
+ const auto cached = memo_.find(f);
215
+ if (cached != memo_.end()) return cached->second;
216
+ depth_++;
217
+ active_.push_back(f);
218
+ std::optional<Expr> result;
219
+ try {
220
+ result = attempt(f);
221
+ } catch (SymEngineException &) {
222
+ result = std::nullopt;
223
+ }
224
+ active_.pop_back();
225
+ depth_--;
226
+ memo_[f] = result;
227
+ return result;
228
+ }
229
+
230
+ private:
231
+ Variable x_;
232
+ unsigned depth_;
233
+ std::vector<Expr> active_;
234
+ std::map<Expr, std::optional<Expr>, RCPBasicKeyLess> memo_;
235
+
236
+ //The rules in order, each on its own: one that fails (an operation SymEngine does not do) leaves the others
237
+ std::optional<Expr> attempt(const Expr &f)
238
+ {
239
+ if (eq(*f, *x_)) return div(mul(x_, x_), integer(2));
240
+ using Rule = std::optional<Expr> (Integrator::*)(const Expr &);
241
+ std::vector<Rule> rules;
242
+ if (is_a<Add>(*f)) rules.push_back(&Integrator::termwise);
243
+ if (is_a<Mul>(*f)) rules.push_back(&Integrator::constantFactor);
244
+ if (rationalIn(f, x_)) rules.push_back(&Integrator::rational);
245
+ for (const Rule rule : {&Integrator::table, &Integrator::specialFunctions, &Integrator::substitution, &Integrator::trigonometric, &Integrator::exponentialTrigonometric, &Integrator::parts, &Integrator::rewritten}) rules.push_back(rule);
246
+ for (const Rule rule : rules) {
247
+ try {
248
+ if (auto found = (this->*rule)(f)) return found;
249
+ } catch (const MathError &error) {
250
+ if (error.code() == ErrorCode::Cancelled || error.code() == ErrorCode::Timeout) throw;
251
+ } catch (SymEngineException &) {
252
+ }
253
+ }
254
+ return std::nullopt;
255
+ }
256
+
257
+ std::optional<Expr> termwise(const Expr &f)
258
+ {
259
+ Expr sum = zero;
260
+ for (const Expr &term : f->get_args()) {
261
+ const auto found = integral(term);
262
+ if (!found) return std::nullopt;
263
+ sum = add(sum, *found);
264
+ }
265
+ return sum;
266
+ }
267
+
268
+ //c g: c times the integral of g, c the factors without x
269
+ std::optional<Expr> constantFactor(const Expr &f)
270
+ {
271
+ Expr constant = down_cast<const Mul &>(*f).get_coef(), rest = one;
272
+ for (const auto &[base, exponent] : down_cast<const Mul &>(*f).get_dict()) {
273
+ const Expr factor = pow(base, exponent);
274
+ if (has(factor, x_)) rest = mul(rest, factor);
275
+ else constant = mul(constant, factor);
276
+ }
277
+ if (eq(*constant, *one)) return std::nullopt;
278
+ const auto found = integral(rest);
279
+ if (!found) return std::nullopt;
280
+ return mul(constant, *found);
281
+ }
282
+
283
+ //A fraction of polynomials: its polynomial part, then its partial fractions: c/(a x + b)^k as a power or a
284
+ //logarithm, (B x + C)/q^k for an irreducible quadratic q by the reduction formula (a logarithm and an arctangent,
285
+ //an inverse hyperbolic tangent where the roots of q are real); a fraction over an irreducible factor of a higher
286
+ //degree only where its numerator is a multiple of the derivative of the factor
287
+ std::optional<Expr> rational(const Expr &f)
288
+ {
289
+ const Expr cancelled = cancelOf(togetherOf(f));
290
+ const auto [numerator, denominator] = fractionOf(cancelled);
291
+ if (!has(denominator, x_)) {
292
+ const auto c = polynomialIn(expand(cancelled), x_);
293
+ if (!c) return std::nullopt;
294
+ Expr sum = zero;
295
+ for (size_t k = 0; k < c->size(); k++) sum = add(sum, div(mul((*c)[k], pow(x_, integer(static_cast<long>(k + 1)))), integer(static_cast<long>(k + 1))));
296
+ return sum;
297
+ }
298
+ //(apart() takes a name of the parser: the variable of a substitution is named as one for it)
299
+ Expr parts;
300
+ try {
301
+ const Variable plain = plainName(cancelled);
302
+ parts = replaced(apartOf(replaced(cancelled, x_, plain), plain->get_name()), plain, x_);
303
+ } catch (const MathError &error) {
304
+ if (error.code() == ErrorCode::Cancelled || error.code() == ErrorCode::Timeout) throw;
305
+ return std::nullopt;
306
+ }
307
+ Expr sum = zero;
308
+ for (const Expr &term : is_a<Add>(*parts) ? parts->get_args() : vec_basic{parts}) {
309
+ const auto found = partialFraction(term);
310
+ if (!found) return std::nullopt;
311
+ sum = add(sum, *found);
312
+ }
313
+ return sum;
314
+ }
315
+
316
+ std::optional<Expr> partialFraction(const Expr &term)
317
+ {
318
+ const auto [numerator, denominator] = fractionOf(term);
319
+ if (!has(denominator, x_)) {
320
+ const auto c = polynomialIn(expand(term), x_);
321
+ if (!c) return std::nullopt;
322
+ Expr sum = zero;
323
+ for (size_t k = 0; k < c->size(); k++) sum = add(sum, div(mul((*c)[k], pow(x_, integer(static_cast<long>(k + 1)))), integer(static_cast<long>(k + 1))));
324
+ return sum;
325
+ }
326
+ const FactoredPolynomial factored = factorPolynomial(denominator);
327
+ Expr q;
328
+ long k = 0;
329
+ Expr scale = factored.coefficient;
330
+ for (const auto &[factor, multiplicity] : factored.factors) {
331
+ if (!has(factor, x_)) {
332
+ scale = mul(scale, pow(factor, integer(multiplicity)));
333
+ continue;
334
+ }
335
+ if (!q.is_null()) return std::nullopt;
336
+ q = factor;
337
+ k = multiplicity;
338
+ }
339
+ if (q.is_null()) return std::nullopt;
340
+ const Expr p = div(numerator, scale);
341
+ const auto qc = polynomialIn(q, x_);
342
+ const auto pc = polynomialIn(p, x_);
343
+ if (!qc || !pc) return std::nullopt;
344
+ if (qc->size() == 2) {
345
+ //p/(a x + b)^k, p without x
346
+ if (pc->size() > 1) return std::nullopt;
347
+ const Expr a = (*qc)[1];
348
+ if (k == 1) return div(mul(p, log(q)), a);
349
+ return div(mul(p, pow(q, integer(1 - k))), mul(integer(1 - k), a));
350
+ }
351
+ if (qc->size() == 3) return quadraticFraction(pc->size() > 1 ? (*pc)[1] : Expr(zero), (*pc)[0], *qc, q, k);
352
+ //p a multiple of q'
353
+ if (k == 1) {
354
+ const Expr derivative = SymEngine::diff(q, x_, true);
355
+ const Expr ratio = cancelOf(div(p, derivative));
356
+ if (!has(ratio, x_)) return mul(ratio, log(q));
357
+ }
358
+ return std::nullopt;
359
+ }
360
+
361
+ //(B x + C)/q^k, q = a x^2 + b x + c irreducible: B/(2a) q'/q^k + (C - B b/(2a))/q^k
362
+ std::optional<Expr> quadraticFraction(const Expr &B, const Expr &C, const std::vector<Expr> &qc, const Expr &q, long k)
363
+ {
364
+ const Expr a = qc[2], b = qc[1];
365
+ Expr result = zero;
366
+ if (!eq(*B, *zero)) {
367
+ const Expr factor = div(B, mul(integer(2), a));
368
+ result = add(result, mul(factor, k == 1 ? log(q) : div(pow(q, integer(1 - k)), integer(1 - k))));
369
+ }
370
+ const Expr rest = sub(C, div(mul(B, b), mul(integer(2), a)));
371
+ if (eq(*rest, *zero)) return result;
372
+ const auto j = reciprocalPower(qc, q, k);
373
+ if (!j) return std::nullopt;
374
+ return add(result, mul(rest, *j));
375
+ }
376
+
377
+ //The integral of 1/q^k: 2/sqrt(4ac - b^2) atan((2a x + b)/sqrt(4ac - b^2)) for k = 1 (for 4ac - b^2 < 0 a number,
378
+ //-2/sqrt(b^2 - 4ac) atanh((2a x + b)/sqrt(b^2 - 4ac))); for k > 1, J_k = (2a x + b)/((k - 1)(4ac - b^2) q^(k - 1)) +
379
+ //(2k - 3) 2a/((k - 1)(4ac - b^2)) J_(k - 1)
380
+ std::optional<Expr> reciprocalPower(const std::vector<Expr> &qc, const Expr &q, long k)
381
+ {
382
+ const Expr a = qc[2], b = qc[1], c = qc[0];
383
+ const Expr d = expand(sub(mul(integer(4), mul(a, c)), mul(b, b)));
384
+ if (eq(*d, *zero)) return std::nullopt;
385
+ const Expr line = add(mul(integer(2), mul(a, x_)), b);
386
+ if (k == 1) {
387
+ if (signOf(d) == -1) {
388
+ const Expr r = sqrt(neg(d));
389
+ return mul(div(integer(-2), r), atanh(div(line, r)));
390
+ }
391
+ const Expr r = sqrt(d);
392
+ return mul(div(integer(2), r), atan(div(line, r)));
393
+ }
394
+ const auto previous = reciprocalPower(qc, q, k - 1);
395
+ if (!previous) return std::nullopt;
396
+ const Expr kk = integer(k);
397
+ const Expr first = div(line, mul(mul(sub(kk, one), d), pow(q, integer(k - 1))));
398
+ const Expr second = mul(div(mul(sub(mul(integer(2), kk), integer(3)), mul(integer(2), a)), mul(sub(kk, one), d)), *previous);
399
+ return add(first, second);
400
+ }
401
+
402
+ //The table: powers and exponentials of a linear argument, the elementary functions of one, the squares of the
403
+ //functions whose derivatives they are, the square roots of quadratics and their reciprocals, e^(quadratic) by erf
404
+ std::optional<Expr> table(const Expr &f)
405
+ {
406
+ //P(x) q^(n/2)
407
+ if (is_a<Mul>(*f)) {
408
+ Expr polynomial = one, root;
409
+ for (const Expr &factor : factorsOf(f)) {
410
+ if (is_a<Pow>(*factor) && is_a<Rational>(*down_cast<const Pow &>(*factor).get_exp()) && root.is_null() && polynomialIn(down_cast<const Pow &>(*factor).get_base(), x_)) root = factor;
411
+ else if (polynomialIn(factor, x_)) polynomial = mul(polynomial, factor);
412
+ else return std::nullopt;
413
+ }
414
+ if (root.is_null()) return std::nullopt;
415
+ return polynomialOverRoot(polynomial, down_cast<const Pow &>(*root).get_base(), down_cast<const Pow &>(*root).get_exp());
416
+ }
417
+ if (is_a<Pow>(*f)) {
418
+ const Expr base = down_cast<const Pow &>(*f).get_base(), exponent = down_cast<const Pow &>(*f).get_exp();
419
+ if (!has(exponent, x_)) {
420
+ if (const auto line = linearIn(base, x_)) {
421
+ const Expr &a = line->first;
422
+ const Expr logarithm = div(log(base), a);
423
+ const Expr power = div(pow(base, add(exponent, one)), mul(add(exponent, one), a));
424
+ if (eq(*exponent, *minus_one)) return logarithm;
425
+ if (is_a_Number(*exponent)) return power;
426
+ //x^n of a parameter n: ln(x) where n = -1
427
+ return SymEngine::piecewise({{logarithm, relationOf("=", exponent, minus_one)}, {power, boolTrue}});
428
+ }
429
+ if (const auto found = quadraticRoot(base, exponent)) return found;
430
+ //sqrt(q)^n, n odd above 1 or below -1: q^((n - 1)/2) sqrt(q)… by the polynomial rule below
431
+ if (const auto found = polynomialOverRoot(one, base, exponent)) return found;
432
+ if (const auto found = functionPower(base, exponent)) return found;
433
+ }
434
+ if (!has(base, x_)) {
435
+ const auto line = linearIn(exponent, x_);
436
+ if (line) {
437
+ if (eq(*base, *E)) return div(f, line->first);
438
+ return div(f, mul(line->first, log(base)));
439
+ }
440
+ if (eq(*base, *E)) return gaussian(exponent);
441
+ }
442
+ return std::nullopt;
443
+ }
444
+ if (is_a_sub<OneArgFunction>(*f)) {
445
+ const Expr u = f->get_args()[0];
446
+ const auto line = linearIn(u, x_);
447
+ if (!line) return std::nullopt;
448
+ const Expr &a = line->first;
449
+ std::optional<Expr> F;
450
+ if (is_a<Sin>(*f)) F = neg(cos(u));
451
+ else if (is_a<Cos>(*f)) F = sin(u);
452
+ else if (is_a<Tan>(*f)) F = neg(log(cos(u)));
453
+ else if (is_a<Cot>(*f)) F = log(sin(u));
454
+ else if (is_a<Sec>(*f)) F = log(add(sec(u), tan(u)));
455
+ else if (is_a<Csc>(*f)) F = neg(log(add(csc(u), cot(u))));
456
+ else if (is_a<Sinh>(*f)) F = cosh(u);
457
+ else if (is_a<Cosh>(*f)) F = sinh(u);
458
+ else if (is_a<Tanh>(*f)) F = log(cosh(u));
459
+ else if (is_a<Coth>(*f)) F = log(sinh(u));
460
+ else if (is_a<Sech>(*f)) F = mul(integer(2), atan(tanh(div(u, integer(2)))));
461
+ else if (is_a<Csch>(*f)) F = log(tanh(div(u, integer(2))));
462
+ else if (is_a<Log>(*f)) F = sub(mul(u, log(u)), u);
463
+ else if (is_a<ATan>(*f)) F = sub(mul(u, atan(u)), div(log(add(mul(u, u), one)), integer(2)));
464
+ else if (is_a<ACot>(*f)) F = add(mul(u, acot(u)), div(log(add(mul(u, u), one)), integer(2)));
465
+ else if (is_a<ASin>(*f)) F = add(mul(u, asin(u)), sqrt(sub(one, mul(u, u))));
466
+ else if (is_a<ACos>(*f)) F = sub(mul(u, acos(u)), sqrt(sub(one, mul(u, u))));
467
+ else if (is_a<ASinh>(*f)) F = sub(mul(u, asinh(u)), sqrt(add(mul(u, u), one)));
468
+ else if (is_a<ACosh>(*f)) F = sub(mul(u, acosh(u)), mul(sqrt(sub(u, one)), sqrt(add(u, one))));
469
+ else if (is_a<ATanh>(*f)) F = add(mul(u, atanh(u)), div(log(sub(one, mul(u, u))), integer(2)));
470
+ else if (is_a<Erf>(*f)) F = add(mul(u, erf(u)), div(exp(neg(mul(u, u))), sqrt(pi)));
471
+ if (!F) return std::nullopt;
472
+ return div(*F, a);
473
+ }
474
+ return std::nullopt;
475
+ }
476
+
477
+ //The integrals the special functions are: g(u)/w of a linear u, w = u/k (sin, cos, sinh, cosh, exp: k Si(u)/a, Ci,
478
+ //Shi, Chi, Ei), 1/ln(u) (li(u)/a), sin(c x^2) and cos(c x^2) of a number c > 0 (sqrt(pi/(2c)) fresnelS(sqrt(2c/pi) x),
479
+ //fresnelC)
480
+ std::optional<Expr> specialFunctions(const Expr &f)
481
+ {
482
+ if (is_a<Pow>(*f) && eq(*down_cast<const Pow &>(*f).get_exp(), *minus_one) && is_a<Log>(*down_cast<const Pow &>(*f).get_base())) {
483
+ const Expr u = down_cast<const Pow &>(*f).get_base()->get_args()[0];
484
+ if (const auto line = linearIn(u, x_)) return div(liOf(u), line->first);
485
+ return std::nullopt;
486
+ }
487
+ if (is_a<Sin>(*f) || is_a<Cos>(*f)) {
488
+ const auto c = polynomialIn(f->get_args()[0], x_);
489
+ if (!c || c->size() != 3 || !eq(*(*c)[1], *zero) || !eq(*(*c)[0], *zero) || signOf((*c)[2]) != 1) return std::nullopt;
490
+ const Expr k = sqrt(div(mul(integer(2), (*c)[2]), pi));
491
+ return div(is_a<Sin>(*f) ? fresnelSOf(mul(k, x_)) : fresnelCOf(mul(k, x_)), k);
492
+ }
493
+ if (!is_a<Mul>(*f)) return std::nullopt;
494
+ Expr constant = one, function, denominator;
495
+ for (const Expr &factor : factorsOf(f)) {
496
+ if (!has(factor, x_)) {
497
+ constant = mul(constant, factor);
498
+ } else if (is_a<Pow>(*factor) && eq(*down_cast<const Pow &>(*factor).get_exp(), *minus_one) && denominator.is_null() && linearIn(down_cast<const Pow &>(*factor).get_base(), x_)) {
499
+ denominator = down_cast<const Pow &>(*factor).get_base();
500
+ } else if (function.is_null() && (is_a<Sin>(*factor) || is_a<Cos>(*factor) || is_a<Sinh>(*factor) || is_a<Cosh>(*factor) || isExp(factor))) {
501
+ function = factor;
502
+ } else {
503
+ return std::nullopt;
504
+ }
505
+ }
506
+ if (function.is_null() || denominator.is_null()) return std::nullopt;
507
+ const Expr u = isExp(function) ? down_cast<const Pow &>(*function).get_exp() : function->get_args()[0];
508
+ const auto line = linearIn(u, x_);
509
+ if (!line) return std::nullopt;
510
+ const Expr k = cancelOf(div(u, denominator));
511
+ if (has(k, x_)) return std::nullopt;
512
+ Expr F;
513
+ if (is_a<Sin>(*function)) F = siOf(u);
514
+ else if (is_a<Cos>(*function)) F = ciOf(u);
515
+ else if (is_a<Sinh>(*function)) F = shiOf(u);
516
+ else if (is_a<Cosh>(*function)) F = chiOf(u);
517
+ else F = eiOf(u);
518
+ return mul(constant, div(mul(k, F), line->first));
519
+ }
520
+
521
+ //g(u)^n of a linear u: sec^2, csc^2, sech^2, csch^2, tan^2, cot^2, the reciprocals of cos and sin and their squares
522
+ std::optional<Expr> functionPower(const Expr &g, const Expr &n)
523
+ {
524
+ if (!is_a_sub<OneArgFunction>(*g)) return std::nullopt;
525
+ const Expr u = g->get_args()[0];
526
+ const auto line = linearIn(u, x_);
527
+ if (!line) return std::nullopt;
528
+ const Expr &a = line->first;
529
+ std::optional<Expr> F;
530
+ if (eq(*n, *integer(2))) {
531
+ if (is_a<Sec>(*g)) F = tan(u);
532
+ else if (is_a<Csc>(*g)) F = neg(cot(u));
533
+ else if (is_a<Sech>(*g)) F = tanh(u);
534
+ else if (is_a<Csch>(*g)) F = neg(coth(u));
535
+ else if (is_a<Tan>(*g)) F = sub(tan(u), u);
536
+ else if (is_a<Cot>(*g)) F = sub(neg(cot(u)), u);
537
+ else if (is_a<Sin>(*g)) F = sub(div(u, integer(2)), div(sin(mul(integer(2), u)), integer(4)));
538
+ else if (is_a<Cos>(*g)) F = add(div(u, integer(2)), div(sin(mul(integer(2), u)), integer(4)));
539
+ else if (is_a<Tanh>(*g)) F = sub(u, tanh(u));
540
+ else if (is_a<Coth>(*g)) F = sub(u, coth(u));
541
+ } else if (eq(*n, *minus_one)) {
542
+ if (is_a<Cos>(*g)) F = log(add(sec(u), tan(u)));
543
+ else if (is_a<Sin>(*g)) F = neg(log(add(csc(u), cot(u))));
544
+ else if (is_a<Cosh>(*g)) F = mul(integer(2), atan(tanh(div(u, integer(2)))));
545
+ else if (is_a<Sinh>(*g)) F = log(tanh(div(u, integer(2))));
546
+ } else if (eq(*n, *integer(-2))) {
547
+ if (is_a<Cos>(*g)) F = tan(u);
548
+ else if (is_a<Sin>(*g)) F = neg(cot(u));
549
+ else if (is_a<Cosh>(*g)) F = tanh(u);
550
+ else if (is_a<Sinh>(*g)) F = neg(coth(u));
551
+ }
552
+ if (!F) return std::nullopt;
553
+ return div(*F, a);
554
+ }
555
+
556
+ //P(x) q^(n/2) for a polynomial P and a quadratic q, n odd: P divided by q (P = A q + B, B linear) gives A q^((n + 2)/2)
557
+ //+ B q^(n/2), and B q^(n/2) = b/(2a) q' q^(n/2) + (B - b/(2a) q') q^(n/2): a power of q, and a constant times q^(n/2),
558
+ //down to sqrt(q) and 1/sqrt(q) of the table (x^2/sqrt(x^2 + 1) is (x sqrt(x^2 + 1) - asinh(x))/2)
559
+ std::optional<Expr> polynomialOverRoot(const Expr &P, const Expr &q, const Expr &exponent)
560
+ {
561
+ if (!is_a<Rational>(*exponent) || get_den(down_cast<const Rational &>(*exponent).as_rational_class()) != 2) return std::nullopt;
562
+ const auto qc = polynomialIn(q, x_);
563
+ const auto pc = polynomialIn(P, x_);
564
+ if (!qc || qc->size() != 3 || !pc) return std::nullopt;
565
+ if (pc->size() == 1 && (eq(*exponent, *SymEngine::rational(1, 2)) || eq(*exponent, *SymEngine::rational(-1, 2)))) {
566
+ return quadraticRoot(q, exponent).has_value() ? std::optional<Expr>(mul(P, *quadraticRoot(q, exponent))) : std::nullopt;
567
+ }
568
+ if (depth_ > LARGEST_DEPTH - 2) return std::nullopt;
569
+ const Expr a = (*qc)[2];
570
+ //A power of q alone, m = n/2 >= 3/2: (2a x + b) q^m/(2a(2m + 1)) + m D/(2a(2m + 1)) times the integral of q^(m - 1),
571
+ //D = 4ac - b^2
572
+ if (pc->size() == 1) {
573
+ const integer_class n = get_num(down_cast<const Rational &>(*exponent).as_rational_class());
574
+ if (n < 3) return std::nullopt;
575
+ const auto lower = integral(pow(q, sub(exponent, one)));
576
+ if (!lower) return std::nullopt;
577
+ const Expr b = (*qc)[1], D = sub(mul(integer(4), mul(a, (*qc)[0])), mul(b, b));
578
+ const Expr denominator = mul(mul(integer(2), a), add(mul(integer(2), exponent), one));
579
+ return mul(P, add(div(mul(add(mul(integer(2), mul(a, x_)), b), pow(q, exponent)), denominator), mul(div(mul(exponent, D), denominator), *lower)));
580
+ }
581
+ const auto [A, B] = divideOf(P, q, x_->get_name());
582
+ Expr result = zero;
583
+ if (!eq(*A, *zero)) {
584
+ const auto found = integral(mul(A, pow(q, add(exponent, one))));
585
+ if (!found) return std::nullopt;
586
+ result = add(result, *found);
587
+ }
588
+ const auto bc = polynomialIn(B, x_);
589
+ if (!bc) return std::nullopt;
590
+ const Expr slope = bc->size() > 1 ? (*bc)[1] : Expr(zero);
591
+ const Expr factor = div(slope, mul(integer(2), a));
592
+ //b/(2a) q' q^(n/2): q^(n/2 + 1)/(n/2 + 1)
593
+ if (!eq(*factor, *zero)) result = add(result, mul(factor, div(pow(q, add(exponent, one)), add(exponent, one))));
594
+ const Expr rest = expand(sub(B, mul(factor, SymEngine::diff(q, x_, true))));
595
+ if (!eq(*rest, *zero)) {
596
+ const auto found = integral(mul(rest, pow(q, exponent)));
597
+ if (!found) return std::nullopt;
598
+ result = add(result, *found);
599
+ }
600
+ return result;
601
+ }
602
+
603
+ //(a x^2 + b x + c)^(±1/2), its coefficients numbers: with t = x + b/(2a) and k = c - b^2/(4a), a > 0: 1/sqrt(a t^2 + k)
604
+ //is asinh(sqrt(a) t/sqrt(k))/sqrt(a) (acosh(sqrt(a) t/sqrt(-k))/sqrt(a) for k < 0), sqrt(a t^2 + k) is t sqrt(…)/2
605
+ //+ k/(2 sqrt(a)) of the same; a < 0 and k > 0: asin(sqrt(-a) t/sqrt(k))/sqrt(-a), t sqrt(…)/2 + k/(2 sqrt(-a)) asin(…)
606
+ std::optional<Expr> quadraticRoot(const Expr &base, const Expr &exponent)
607
+ {
608
+ const bool reciprocal = eq(*exponent, *SymEngine::rational(-1, 2));
609
+ if (!reciprocal && !eq(*exponent, *SymEngine::rational(1, 2))) return std::nullopt;
610
+ const auto c = polynomialIn(base, x_);
611
+ if (!c || c->size() != 3) return std::nullopt;
612
+ const Expr a = (*c)[2];
613
+ const Expr t = add(x_, div((*c)[1], mul(integer(2), a)));
614
+ const Expr k = expand(sub((*c)[0], div(mul((*c)[1], (*c)[1]), mul(integer(4), a))));
615
+ const int sa = signOf(a), sk = signOf(k);
616
+ if (sa != 1 && sa != -1) return std::nullopt;
617
+ if (sk == 2 || sk == 0) return std::nullopt;
618
+ Expr inverse;
619
+ if (sa == 1) {
620
+ inverse = sk == 1 ? asinh(div(mul(sqrt(a), t), sqrt(k))) : acosh(div(mul(sqrt(a), t), sqrt(neg(k))));
621
+ } else {
622
+ if (sk != 1) return std::nullopt;
623
+ inverse = asin(div(mul(sqrt(neg(a)), t), sqrt(k)));
624
+ }
625
+ const Expr root = sqrt(sa == 1 ? a : neg(a));
626
+ if (reciprocal) return div(inverse, root);
627
+ return add(div(mul(t, sqrt(base)), integer(2)), div(mul(k, inverse), mul(integer(2), root)));
628
+ }
629
+
630
+ //e^(a x^2 + b x + c), a < 0 a number: e^(c - b^2/(4a)) sqrt(pi)/(2 sqrt(-a)) erf(sqrt(-a)(x + b/(2a)))
631
+ std::optional<Expr> gaussian(const Expr &exponent)
632
+ {
633
+ const auto c = polynomialIn(exponent, x_);
634
+ if (!c || c->size() != 3 || signOf((*c)[2]) != -1) return std::nullopt;
635
+ const Expr a = (*c)[2], b = (*c)[1];
636
+ const Expr root = sqrt(neg(a));
637
+ const Expr shift = expand(sub((*c)[0], div(mul(b, b), mul(integer(4), a))));
638
+ return mul(div(mul(exp(shift), sqrt(pi)), mul(integer(2), root)), erf(mul(root, add(x_, div(b, mul(integer(2), a))))));
639
+ }
640
+
641
+ //The parts an expression may be a function of: the arguments of its functions, the bases and the exponents of its
642
+ //powers, the expression of each (a sum, a power), not x nor linear in x
643
+ void candidatesOf(const Expr &e, std::vector<Expr> &found)
644
+ {
645
+ if (!has(e, x_) || eq(*e, *x_)) return;
646
+ const auto add = [&found, this](const Expr &candidate) {
647
+ if (!has(candidate, x_) || eq(*candidate, *x_) || linearIn(candidate, x_)) return;
648
+ if (std::none_of(found.begin(), found.end(), [&candidate](const Expr &c) { return eq(*c, *candidate); })) found.push_back(candidate);
649
+ };
650
+ if (is_a<Pow>(*e)) {
651
+ const Expr base = down_cast<const Pow &>(*e).get_base(), exponent = down_cast<const Pow &>(*e).get_exp();
652
+ add(base);
653
+ if (has(exponent, x_)) {
654
+ add(exponent);
655
+ add(e);
656
+ }
657
+ candidatesOf(base, found);
658
+ candidatesOf(exponent, found);
659
+ return;
660
+ }
661
+ if (is_a_sub<Function>(*e)) {
662
+ add(e);
663
+ for (const Expr &argument : e->get_args()) {
664
+ add(argument);
665
+ candidatesOf(argument, found);
666
+ }
667
+ return;
668
+ }
669
+ for (const Expr &part : e->get_args()) candidatesOf(part, found);
670
+ }
671
+
672
+ //u-substitution: f/u' a function of u alone, its integral in u written with u
673
+ std::optional<Expr> substitution(const Expr &f)
674
+ {
675
+ std::vector<Expr> candidates;
676
+ candidatesOf(f, candidates);
677
+ if (candidates.size() > LARGEST_CANDIDATES) candidates.resize(LARGEST_CANDIDATES);
678
+ for (const Expr &u : candidates) {
679
+ checkpoint();
680
+ const Expr derivative = SymEngine::diff(u, x_, true);
681
+ if (eq(*derivative, *zero)) continue;
682
+ Expr g = div(f, derivative);
683
+ const Variable U = fresh("u");
684
+ Expr inU = replaced(g, u, U);
685
+ if (has(inU, x_)) {
686
+ //Cancelled first (x/(x^2 + 1)^3 over 2x)
687
+ try {
688
+ g = cancelOf(g);
689
+ } catch (const MathError &error) {
690
+ if (error.code() == ErrorCode::Cancelled || error.code() == ErrorCode::Timeout) throw;
691
+ continue;
692
+ }
693
+ inU = replaced(g, u, U);
694
+ if (has(inU, x_)) continue;
695
+ }
696
+ Integrator inner(U, depth_ + 1);
697
+ const auto found = inner.integral(inU);
698
+ if (found) return replaced(*found, U, u);
699
+ }
700
+ return std::nullopt;
701
+ }
702
+
703
+ //The factors of a product, each to its power
704
+ std::vector<Expr> factorsOf(const Expr &f)
705
+ {
706
+ std::vector<Expr> factors;
707
+ if (is_a<Mul>(*f)) {
708
+ const Mul &product = down_cast<const Mul &>(*f);
709
+ if (!eq(*product.get_coef(), *one)) factors.push_back(product.get_coef());
710
+ for (const auto &[base, exponent] : product.get_dict()) factors.push_back(pow(base, exponent));
711
+ } else {
712
+ factors.push_back(f);
713
+ }
714
+ return factors;
715
+ }
716
+
717
+ //sin and cos of linear arguments: (argument, power of sin, power of cos) of one argument
718
+ struct SineCosine {
719
+ Expr argument;
720
+ long sine = 0, cosine = 0;
721
+ };
722
+
723
+ //The products of sines and cosines: of one angle, sin^m cos^n with an odd power by the substitution of the other
724
+ //function, even powers by the double angle; tan^n by tan^2 = sec^2 - 1; of two angles by the sums of angles
725
+ std::optional<Expr> trigonometric(const Expr &f)
726
+ {
727
+ Expr constant = one;
728
+ std::vector<std::pair<Expr, long>> functions;
729
+ for (const Expr &factor : factorsOf(f)) {
730
+ if (!has(factor, x_)) {
731
+ constant = mul(constant, factor);
732
+ continue;
733
+ }
734
+ Expr base = factor;
735
+ long power = 1;
736
+ if (is_a<Pow>(*factor) && is_a<Integer>(*down_cast<const Pow &>(*factor).get_exp())) {
737
+ base = down_cast<const Pow &>(*factor).get_base();
738
+ power = mp_get_si(down_cast<const Integer &>(*down_cast<const Pow &>(*factor).get_exp()).as_integer_class());
739
+ }
740
+ if (!(is_a<Sin>(*base) || is_a<Cos>(*base) || is_a<Tan>(*base) || is_a<Sec>(*base) || is_a<Csc>(*base) || is_a<Cot>(*base))) return std::nullopt;
741
+ if (!linearIn(base->get_args()[0], x_)) return std::nullopt;
742
+ functions.emplace_back(base, power);
743
+ }
744
+ if (functions.empty()) return std::nullopt;
745
+ //tan^n, n >= 3: tan^(n - 2) sec^2 - tan^(n - 2)
746
+ if (functions.size() == 1 && is_a<Tan>(*functions[0].first) && functions[0].second >= 3) {
747
+ const Expr t = functions[0].first, u = t->get_args()[0];
748
+ const auto first = integral(mul(pow(t, integer(functions[0].second - 2)), pow(sec(u), integer(2))));
749
+ const auto second = integral(pow(t, integer(functions[0].second - 2)));
750
+ if (!first || !second) return std::nullopt;
751
+ return mul(constant, sub(*first, *second));
752
+ }
753
+ //In sines and cosines, by argument
754
+ std::vector<SineCosine> angles;
755
+ for (const auto &[function, power] : functions) {
756
+ const Expr u = function->get_args()[0];
757
+ long s = 0, c = 0;
758
+ if (is_a<Sin>(*function)) s = power;
759
+ else if (is_a<Cos>(*function)) c = power;
760
+ else if (is_a<Tan>(*function)) s = power, c = -power;
761
+ else if (is_a<Cot>(*function)) s = -power, c = power;
762
+ else if (is_a<Sec>(*function)) c = -power;
763
+ else s = -power;
764
+ auto found = std::find_if(angles.begin(), angles.end(), [&u](const SineCosine &a) { return eq(*a.argument, *u); });
765
+ if (found == angles.end()) {
766
+ angles.push_back({u, s, c});
767
+ } else {
768
+ found->sine += s;
769
+ found->cosine += c;
770
+ }
771
+ }
772
+ if (angles.size() == 2 && std::all_of(angles.begin(), angles.end(), [](const SineCosine &a) { return a.sine + a.cosine == 1 && a.sine >= 0 && a.cosine >= 0; })) {
773
+ //sin A cos B = (sin(A + B) + sin(A - B))/2, sin A sin B = (cos(A - B) - cos(A + B))/2, cos A cos B = (cos(A - B) +
774
+ //cos(A + B))/2
775
+ const Expr A = angles[0].argument, B = angles[1].argument;
776
+ Expr sum;
777
+ if (angles[0].sine == 1 && angles[1].cosine == 1) sum = div(add(sin(add(A, B)), sin(sub(A, B))), integer(2));
778
+ else if (angles[0].cosine == 1 && angles[1].sine == 1) sum = div(add(sin(add(A, B)), sin(sub(B, A))), integer(2));
779
+ else if (angles[0].sine == 1) sum = div(sub(cos(sub(A, B)), cos(add(A, B))), integer(2));
780
+ else sum = div(add(cos(sub(A, B)), cos(add(A, B))), integer(2));
781
+ const auto found = integral(expand(sum));
782
+ if (!found) return std::nullopt;
783
+ return mul(constant, *found);
784
+ }
785
+ if (angles.size() != 1) return std::nullopt;
786
+ const Expr u = angles[0].argument;
787
+ const long m = angles[0].sine, n = angles[0].cosine;
788
+ const Expr a = linearIn(u, x_)->first;
789
+ const Variable U = fresh("u");
790
+ Expr inU;
791
+ if (m > 0 && m % 2 == 1) {
792
+ //sin^m cos^n = sin (1 - cos^2)^((m - 1)/2) cos^n: -1/a of the integral in U = cos
793
+ inU = neg(div(mul(pow(sub(one, mul(U, U)), integer((m - 1) / 2)), pow(U, integer(n))), a));
794
+ Integrator inner(U, depth_ + 1);
795
+ const auto found = inner.integral(expand(inU));
796
+ if (found) return mul(constant, replaced(*found, U, cos(u)));
797
+ }
798
+ if (n > 0 && n % 2 == 1) {
799
+ inU = div(mul(pow(U, integer(m)), pow(sub(one, mul(U, U)), integer((n - 1) / 2))), a);
800
+ Integrator inner(U, depth_ + 1);
801
+ const auto found = inner.integral(expand(inU));
802
+ if (found) return mul(constant, replaced(*found, U, sin(u)));
803
+ }
804
+ if (n < 0 && (-n - m) % 2 == 0 && -n - m >= 2 && m >= 0) {
805
+ //tan^m sec^(2j): (1/a) the integral of U^m (1 + U^2)^(j - 1) in U = tan
806
+ const long j = (-n - m) / 2;
807
+ inU = div(mul(pow(U, integer(m)), pow(add(one, mul(U, U)), integer(j - 1))), a);
808
+ Integrator inner(U, depth_ + 1);
809
+ const auto found = inner.integral(expand(inU));
810
+ if (found) return mul(constant, replaced(*found, U, tan(u)));
811
+ }
812
+ if (m >= 0 && n >= 0 && m % 2 == 0 && n % 2 == 0 && m + n >= 2) {
813
+ //sin^2 = (1 - cos(2u))/2, cos^2 = (1 + cos(2u))/2
814
+ const Expr twice = cos(mul(integer(2), u));
815
+ const Expr reduced = expand(mul(pow(div(sub(one, twice), integer(2)), integer(m / 2)), pow(div(add(one, twice), integer(2)), integer(n / 2))));
816
+ const auto found = integral(reduced);
817
+ if (found) return mul(constant, *found);
818
+ }
819
+ return std::nullopt;
820
+ }
821
+
822
+ //e^(a x + b) sin(c x + d) and with cos: e^(…)(a sin(…) - c cos(…))/(a^2 + c^2), e^(…)(a cos(…) + c sin(…))/(a^2 + c^2)
823
+ std::optional<Expr> exponentialTrigonometric(const Expr &f)
824
+ {
825
+ Expr constant = one, exponential, trigonometric;
826
+ for (const Expr &factor : factorsOf(f)) {
827
+ if (!has(factor, x_)) constant = mul(constant, factor);
828
+ else if (isExp(factor) && exponential.is_null()) exponential = factor;
829
+ else if ((is_a<Sin>(*factor) || is_a<Cos>(*factor)) && trigonometric.is_null()) trigonometric = factor;
830
+ else return std::nullopt;
831
+ }
832
+ if (exponential.is_null() || trigonometric.is_null()) return std::nullopt;
833
+ const auto e = linearIn(down_cast<const Pow &>(*exponential).get_exp(), x_);
834
+ const auto t = linearIn(trigonometric->get_args()[0], x_);
835
+ if (!e || !t) return std::nullopt;
836
+ const Expr a = e->first, c = t->first, u = trigonometric->get_args()[0];
837
+ const Expr norm = add(mul(a, a), mul(c, c));
838
+ const Expr inside = is_a<Sin>(*trigonometric) ? sub(mul(a, sin(u)), mul(c, cos(u))) : add(mul(a, cos(u)), mul(c, sin(u)));
839
+ return mul(constant, div(mul(exponential, inside), norm));
840
+ }
841
+
842
+ //The order of the factors taken as u in parts (LIATE): logarithms, inverse functions, algebraic, trigonometric,
843
+ //exponential; a larger number first
844
+ int priority(const Expr &factor)
845
+ {
846
+ Expr base = factor;
847
+ if (is_a<Pow>(*factor) && is_a<Integer>(*down_cast<const Pow &>(*factor).get_exp()) && down_cast<const Integer &>(*down_cast<const Pow &>(*factor).get_exp()).is_positive()) base = down_cast<const Pow &>(*factor).get_base();
848
+ if (is_a<Log>(*base)) return 5;
849
+ if (is_a<ATan>(*base) || is_a<ASin>(*base) || is_a<ACos>(*base) || is_a<ACot>(*base) || is_a<ASinh>(*base) || is_a<ACosh>(*base) || is_a<ATanh>(*base) || is_a<Erf>(*base)) return 4;
850
+ if (polynomialIn(factor, x_)) return 3;
851
+ if (is_a<Sin>(*base) || is_a<Cos>(*base) || is_a<Sinh>(*base) || is_a<Cosh>(*base)) return 2;
852
+ if (isExp(base)) return 1;
853
+ return 0;
854
+ }
855
+
856
+ //Integration by parts: u the factor first in LIATE, dv the rest: u v - the integral of v u'
857
+ std::optional<Expr> parts(const Expr &f)
858
+ {
859
+ std::vector<Expr> factors;
860
+ Expr constant = one;
861
+ for (const Expr &factor : factorsOf(f)) {
862
+ if (has(factor, x_)) factors.push_back(factor);
863
+ else constant = mul(constant, factor);
864
+ }
865
+ //A function alone (ln(x)^2, atan(x)^2…): u it, dv dx
866
+ if (factors.size() == 1) {
867
+ if (priority(factors[0]) < 4) return std::nullopt;
868
+ factors.push_back(one);
869
+ }
870
+ //u the factor first in LIATE, dv the product of the others (x e^x sin(x): u = x)
871
+ size_t chosen = 0;
872
+ for (size_t i = 1; i < factors.size(); i++) {
873
+ if (priority(factors[i]) > priority(factors[chosen])) chosen = i;
874
+ }
875
+ if (priority(factors[chosen]) == 0 || (factors.size() > 2 && priority(factors[chosen]) < 3)) return std::nullopt;
876
+ const Expr u = factors[chosen];
877
+ Expr dv = one;
878
+ for (size_t i = 0; i < factors.size(); i++) {
879
+ if (i != chosen) dv = mul(dv, factors[i]);
880
+ }
881
+ const auto v = integral(dv);
882
+ if (!v) return std::nullopt;
883
+ const auto rest = integral(expand(mul(*v, SymEngine::diff(u, x_, true))));
884
+ if (!rest) return std::nullopt;
885
+ return mul(constant, sub(mul(u, *v), *rest));
886
+ }
887
+
888
+ //Other forms: expanded; tan, cot, sec, csc as sines and cosines; the hyperbolic functions as exponentials; a
889
+ //function of e^(x/q) alone, the substitution u = e^(x/q) (dx = q du/u)
890
+ std::optional<Expr> rewritten(const Expr &f)
891
+ {
892
+ const Expr expanded = expand(f);
893
+ if (!eq(*expanded, *f)) {
894
+ if (const auto found = integral(expanded)) return found;
895
+ }
896
+ if (const auto found = exponentialSubstitution(f)) return found;
897
+ if (const auto found = hyperbolicAsExponentials(f)) return found;
898
+ if (const auto found = halfAngleTangent(f)) return found;
899
+ return std::nullopt;
900
+ }
901
+
902
+ //sinh, cosh, tanh… of linear arguments as exponentials (cosh(x)^2 is (e^(2x) + 2 + e^(-2x))/4)
903
+ std::optional<Expr> hyperbolicAsExponentials(const Expr &f)
904
+ {
905
+ map_basic_basic replacements;
906
+ std::function<void(const Expr &)> collect = [&](const Expr &e) {
907
+ if (is_a<Sinh>(*e) || is_a<Cosh>(*e) || is_a<Tanh>(*e) || is_a<Coth>(*e) || is_a<Sech>(*e) || is_a<Csch>(*e)) {
908
+ const Expr u = e->get_args()[0];
909
+ const Expr p = exp(u), m = exp(neg(u));
910
+ const Expr s = div(sub(p, m), integer(2)), c = div(add(p, m), integer(2));
911
+ if (is_a<Sinh>(*e)) replacements[e] = s;
912
+ else if (is_a<Cosh>(*e)) replacements[e] = c;
913
+ else if (is_a<Tanh>(*e)) replacements[e] = div(s, c);
914
+ else if (is_a<Coth>(*e)) replacements[e] = div(c, s);
915
+ else if (is_a<Sech>(*e)) replacements[e] = div(one, c);
916
+ else replacements[e] = div(one, s);
917
+ return;
918
+ }
919
+ for (const Expr &argument : e->get_args()) collect(argument);
920
+ };
921
+ collect(f);
922
+ if (replacements.empty()) return std::nullopt;
923
+ return integral(expand(xreplace(f, replacements)));
924
+ }
925
+
926
+ //A fraction of polynomials in sin(u) and cos(u) of one linear u: t = tan(u/2), sin = 2t/(1 + t^2), cos = (1 - t^2)/(1 +
927
+ //t^2), dx = 2/(a(1 + t^2)) dt (Weierstrass; the definite integrals split at the poles of tan(u/2))
928
+ std::optional<Expr> halfAngleTangent(const Expr &f)
929
+ {
930
+ Expr angle;
931
+ bool usable = true;
932
+ std::function<void(const Expr &)> collect = [&](const Expr &e) {
933
+ if (!usable || !has(e, x_)) return;
934
+ if (is_a<Sin>(*e) || is_a<Cos>(*e) || is_a<Tan>(*e) || is_a<Cot>(*e) || is_a<Sec>(*e) || is_a<Csc>(*e)) {
935
+ const Expr u = e->get_args()[0];
936
+ if (!linearIn(u, x_) || (!angle.is_null() && !eq(*angle, *u))) usable = false;
937
+ angle = u;
938
+ return;
939
+ }
940
+ if (is_a<Add>(*e) || is_a<Mul>(*e)) {
941
+ for (const Expr &part : e->get_args()) collect(part);
942
+ return;
943
+ }
944
+ if (is_a<Pow>(*e) && is_a<Integer>(*down_cast<const Pow &>(*e).get_exp())) {
945
+ collect(down_cast<const Pow &>(*e).get_base());
946
+ return;
947
+ }
948
+ usable = false;
949
+ };
950
+ collect(f);
951
+ if (!usable || angle.is_null()) return std::nullopt;
952
+ const Variable T = fresh("t");
953
+ const Expr square = add(one, mul(T, T));
954
+ const Expr s = div(mul(integer(2), T), square), c = div(sub(one, mul(T, T)), square);
955
+ map_basic_basic replacements;
956
+ replacements[sin(angle)] = s;
957
+ replacements[cos(angle)] = c;
958
+ replacements[tan(angle)] = div(s, c);
959
+ replacements[cot(angle)] = div(c, s);
960
+ replacements[sec(angle)] = div(one, c);
961
+ replacements[csc(angle)] = div(one, s);
962
+ const Expr a = linearIn(angle, x_)->first;
963
+ const Expr inT = cancelOf(togetherOf(div(mul(xreplace(f, replacements), integer(2)), mul(a, square))));
964
+ if (has(inT, x_) || !rationalIn(inT, T)) return std::nullopt;
965
+ Integrator inner(T, depth_ + 1);
966
+ const auto found = inner.integral(inT);
967
+ if (!found) return std::nullopt;
968
+ return replaced(*found, T, tan(div(angle, integer(2))));
969
+ }
970
+
971
+ std::optional<Expr> exponentialSubstitution(const Expr &f)
972
+ {
973
+ //The exponentials of the integrand: their exponents k x/q
974
+ std::vector<Expr> exponents;
975
+ std::function<bool(const Expr &)> collect = [&](const Expr &e) -> bool {
976
+ if (!has(e, x_)) return true;
977
+ if (eq(*e, *x_)) return false;
978
+ if (isExp(e)) {
979
+ const auto line = linearIn(down_cast<const Pow &>(*e).get_exp(), x_);
980
+ if (!line || !(is_a<Integer>(*line->first) || is_a<Rational>(*line->first))) return false;
981
+ exponents.push_back(down_cast<const Pow &>(*e).get_exp());
982
+ return true;
983
+ }
984
+ if (is_a<Add>(*e) || is_a<Mul>(*e)) {
985
+ for (const Expr &part : e->get_args()) {
986
+ if (!collect(part)) return false;
987
+ }
988
+ return true;
989
+ }
990
+ if (is_a<Pow>(*e) && is_a<Integer>(*down_cast<const Pow &>(*e).get_exp())) return collect(down_cast<const Pow &>(*e).get_base());
991
+ return false;
992
+ };
993
+ if (!collect(f) || exponents.empty()) return std::nullopt;
994
+ //The gcd of the coefficients of x: e^(g x) the new variable
995
+ integer_class numerator(0), denominator(1);
996
+ for (const Expr &exponent : exponents) {
997
+ const Expr k = linearIn(exponent, x_)->first;
998
+ const rational_class value = is_a<Integer>(*k) ? rational_class(down_cast<const Integer &>(*k).as_integer_class()) : down_cast<const Rational &>(*k).as_rational_class();
999
+ integer_class n, d;
1000
+ mp_gcd(n, numerator, get_num(value));
1001
+ mp_lcm(d, denominator, get_den(value));
1002
+ numerator = n;
1003
+ denominator = d;
1004
+ }
1005
+ if (numerator < 0) numerator = -numerator;
1006
+ const Expr g = Rational::from_mpq(rational_class(numerator, denominator));
1007
+ const Variable U = fresh("u");
1008
+ //e^(k x + b) = e^b U^(k/g)
1009
+ map_basic_basic replacements;
1010
+ std::function<Expr(const Expr &)> written = [&](const Expr &e) -> Expr {
1011
+ if (!has(e, x_)) return e;
1012
+ if (isExp(e)) {
1013
+ const auto line = linearIn(down_cast<const Pow &>(*e).get_exp(), x_);
1014
+ return mul(exp(line->second), pow(U, div(line->first, g)));
1015
+ }
1016
+ if (is_a<Add>(*e)) {
1017
+ Expr sum = zero;
1018
+ for (const Expr &part : e->get_args()) sum = add(sum, written(part));
1019
+ return sum;
1020
+ }
1021
+ if (is_a<Mul>(*e)) {
1022
+ Expr product = one;
1023
+ for (const Expr &part : e->get_args()) product = mul(product, written(part));
1024
+ return product;
1025
+ }
1026
+ return pow(written(down_cast<const Pow &>(*e).get_base()), down_cast<const Pow &>(*e).get_exp());
1027
+ };
1028
+ const Expr inU = div(written(f), mul(g, U));
1029
+ if (has(inU, x_) || !rationalIn(inU, U)) return std::nullopt;
1030
+ Integrator inner(U, depth_ + 1);
1031
+ const auto found = inner.integral(inU);
1032
+ if (!found) return std::nullopt;
1033
+ return replaced(*found, U, exp(mul(g, x_)));
1034
+ }
1035
+ };
1036
+
1037
+ constexpr double PI = 3.14159265358979323846;
1038
+
1039
+ //The jumps of an antiderivative inside (low, high), numbers: the poles of tan, cot, sec and csc of linear arguments in it
1040
+ //(tan(x/2) of the substitution of the half angle), exactly
1041
+ void jumpsOf(const Expr &F, const Variable &x, double low, double high, std::vector<Expr> &points)
1042
+ {
1043
+ if (is_a<Tan>(*F) || is_a<Cot>(*F) || is_a<Sec>(*F) || is_a<Csc>(*F)) {
1044
+ const Expr v = F->get_args()[0];
1045
+ const auto line = linearIn(v, x);
1046
+ if (line && free_symbols(*line->first).empty() && free_symbols(*line->second).empty()) {
1047
+ //v = a x + b at the poles: pi/2 + k pi (tan, sec), k pi (cot, csc)
1048
+ const Expr offset = is_a<Tan>(*F) || is_a<Sec>(*F) ? div(pi, integer(2)) : Expr(zero);
1049
+ const double a = toDouble(line->first), b = toDouble(line->second), o = toDouble(offset);
1050
+ const double first = (std::min(a * low, a * high) + b - o) / PI, last = (std::max(a * low, a * high) + b - o) / PI;
1051
+ if (std::isfinite(first) && std::isfinite(last) && last - first < 1000) {
1052
+ for (long k = static_cast<long>(std::floor(first)); k <= static_cast<long>(std::ceil(last)); k++) {
1053
+ const Expr point = div(sub(add(offset, mul(integer(k), pi)), line->second), line->first);
1054
+ const double value = toDouble(point);
1055
+ if (value > low && value < high && std::none_of(points.begin(), points.end(), [&point](const Expr &p) { return eq(*p, *point); })) points.push_back(point);
1056
+ }
1057
+ }
1058
+ }
1059
+ }
1060
+ for (const Expr &argument : F->get_args()) jumpsOf(argument, x, low, high, points);
1061
+ }
1062
+
1063
+ }
1064
+
1065
+ Expr antiderivativeOf(const Expr &given, const std::string &name)
1066
+ {
1067
+ if (!isName(name) || isBuiltin(name)) throw MathError(ErrorCode::Argument, name + " is not a variable");
1068
+ const Variable x = symbol(name);
1069
+ const Expr f = evaluatedOf(given);
1070
+ Integrator integrator(x);
1071
+ const std::optional<Expr> found = integrator.integral(f);
1072
+ if (!found) throw notFound("no rule of the package gives an antiderivative of " + toText(given) + " (numeric.integrate() computes definite integrals)");
1073
+ //Tidied where that is shorter, and checked
1074
+ Expr result = *found;
1075
+ try {
1076
+ const Expr tidy = simplifiedOf(result);
1077
+ if (verified(tidy, f, x)) return tidy;
1078
+ } catch (const MathError &error) {
1079
+ if (error.code() == ErrorCode::Cancelled || error.code() == ErrorCode::Timeout) throw;
1080
+ }
1081
+ if (!verified(result, f, x)) throw notFound("the antiderivative found for " + toText(given) + " is not checked by its derivative");
1082
+ return result;
1083
+ }
1084
+
1085
+ Expr definiteIntegralOf(const Expr &given, const std::string &name, const Expr &from, const Expr &to)
1086
+ {
1087
+ if (!isName(name) || isBuiltin(name)) throw MathError(ErrorCode::Argument, name + " is not a variable");
1088
+ const Variable x = symbol(name);
1089
+ if (has(from, x) || has(to, x)) throw MathError(ErrorCode::Argument, "The ends of an integral are not of its variable");
1090
+ for (const Expr &end : {from, to}) {
1091
+ if (is_a<NaN>(*end) || (is_a<Infty>(*end) && down_cast<const Infty &>(*end).is_unsigned_infinity())) throw MathError(ErrorCode::Argument, "The ends of an integral are numbers, inf or -inf");
1092
+ }
1093
+ if (eq(*from, *to)) return zero;
1094
+ const int order = compareOf(from, to);
1095
+ if (order == 1) return neg(definiteIntegralOf(given, name, to, from));
1096
+ const Expr f = evaluatedOf(given);
1097
+ const Expr F = antiderivativeOf(f, name);
1098
+ //Split at the poles of the integrand inside and at the jumps of the antiderivative (numbers ends only)
1099
+ std::vector<Expr> ends{from};
1100
+ const bool numbers = free_symbols(*from).empty() && free_symbols(*to).empty() && free_symbols(*f).size() <= 1;
1101
+ double low = 0, high = 0;
1102
+ if (numbers) {
1103
+ low = is_a<Infty>(*from) ? -INFINITY : toDouble(from);
1104
+ high = is_a<Infty>(*to) ? INFINITY : toDouble(to);
1105
+ std::vector<Expr> inside;
1106
+ for (const double pole : realPolesOf(f, name, std::isfinite(low) ? low : -1e300, std::isfinite(high) ? high : 1e300)) inside.push_back(numberFromDouble(pole));
1107
+ if (std::isfinite(low) && std::isfinite(high)) jumpsOf(F, x, low, high, inside);
1108
+ std::sort(inside.begin(), inside.end(), [](const Expr &a, const Expr &b) { return toDouble(a) < toDouble(b); });
1109
+ ends.insert(ends.end(), inside.begin(), inside.end());
1110
+ }
1111
+ ends.push_back(to);
1112
+ Expr total = zero;
1113
+ for (size_t i = 0; i + 1 < ends.size(); i++) {
1114
+ const Expr upper = limitOf(F, x, ends[i + 1], "-"), lower = limitOf(F, x, ends[i], "+");
1115
+ //(the pieces on both sides of a pole added: inf where both grow toward inf, no value where they go to infinities
1116
+ //of opposite signs, as 1/x on [-1, 1])
1117
+ total = add(total, sub(upper, lower));
1118
+ }
1119
+ //An infinity beside a finite part keeps the infinity (the i pi of ln(x) at negative ends: -inf - i pi for 1/x on
1120
+ //[-1, 0]); no value for nan or complexInfinity
1121
+ if (is_a<Add>(*total)) {
1122
+ const vec_basic parts = total->get_args();
1123
+ for (const Expr &part : parts) {
1124
+ if (is_a<Infty>(*part)) total = part;
1125
+ }
1126
+ for (const Expr &part : parts) {
1127
+ if (is_a<NaN>(*part)) total = part;
1128
+ }
1129
+ }
1130
+ if (is_a<NaN>(*total) || (is_a<Infty>(*total) && down_cast<const Infty &>(*total).is_unsigned_infinity())) {
1131
+ throw MathError(ErrorCode::Domain, "The integral of " + toText(given) + " from " + toText(from) + " to " + toText(to) + " has no value");
1132
+ }
1133
+ //A number checked by the numeric integral where that converges (a jump of the antiderivative not found)
1134
+ if (numbers && !is_a<Infty>(*total) && free_symbols(*total).empty()) {
1135
+ try {
1136
+ const IntegralResult numeric = integralOf(f, name, low, high, {}, 1e-10);
1137
+ const std::complex<double> exact = toComplex(total);
1138
+ if (numeric.converged && std::abs(exact.imag()) <= 1e-9 * std::max(1.0, std::abs(exact.real()))
1139
+ && std::abs(numeric.value - exact.real()) > 1e-6 * std::max(1.0, std::abs(numeric.value)) + 10 * numeric.error) {
1140
+ throw notFound("the antiderivative of " + toText(given) + " gives " + toText(total) + ", not the numeric value " + std::to_string(numeric.value) + " (a jump not found)");
1141
+ }
1142
+ } catch (const MathError &error) {
1143
+ if (error.code() != ErrorCode::Domain && error.code() != ErrorCode::Argument) throw;
1144
+ }
1145
+ }
1146
+ return is_a<Infty>(*total) ? total : simplifiedOf(total);
1147
+ }
1148
+
1149
+ namespace {
1150
+
1151
+ //The Laplace transform of f(t) at s (see Integrals.h), or nothing
1152
+ std::optional<Expr> laplace(const Expr &f, const Variable &t, const Expr &s)
1153
+ {
1154
+ checkpoint();
1155
+ if (!has(f, t)) return div(f, s);
1156
+ if (is_a<Add>(*f)) {
1157
+ Expr sum = zero;
1158
+ for (const Expr &term : f->get_args()) {
1159
+ const auto found = laplace(term, t, s);
1160
+ if (!found) return std::nullopt;
1161
+ sum = add(sum, *found);
1162
+ }
1163
+ return sum;
1164
+ }
1165
+ if (eq(*f, *t)) return div(one, mul(s, s));
1166
+ if (is_a<Mul>(*f)) {
1167
+ Expr constant = down_cast<const Mul &>(*f).get_coef(), exponential, power, rest = one;
1168
+ for (const auto &[base, exponent] : down_cast<const Mul &>(*f).get_dict()) {
1169
+ const Expr factor = pow(base, exponent);
1170
+ if (!has(factor, t)) constant = mul(constant, factor);
1171
+ else if (isExp(factor) && exponential.is_null() && linearIn(exponent, t)) exponential = factor;
1172
+ else if (eq(*base, *t) && is_a<Integer>(*exponent) && down_cast<const Integer &>(*exponent).is_positive() && power.is_null()) power = exponent;
1173
+ else rest = mul(rest, factor);
1174
+ }
1175
+ if (!eq(*constant, *one)) {
1176
+ const auto found = laplace(div(f, constant), t, s);
1177
+ if (!found) return std::nullopt;
1178
+ return mul(constant, *found);
1179
+ }
1180
+ //e^(a t + b) g(t): e^b G(s - a)
1181
+ if (!exponential.is_null() && has(rest, t)) {
1182
+ const auto line = linearIn(down_cast<const Pow &>(*exponential).get_exp(), t);
1183
+ const Variable shifted = fresh("s");
1184
+ const auto found = laplace(power.is_null() ? rest : mul(rest, pow(t, power)), t, shifted);
1185
+ if (!found) return std::nullopt;
1186
+ return mul(exp(line->second), replaced(*found, shifted, sub(s, line->first)));
1187
+ }
1188
+ //t^n g(t): (-1)^n the n-th derivative of G(s)
1189
+ if (!power.is_null() && has(rest, t)) {
1190
+ const Variable variable = fresh("s");
1191
+ const auto found = laplace(exponential.is_null() ? rest : mul(rest, exponential), t, variable);
1192
+ if (!found) return std::nullopt;
1193
+ const long n = mp_get_si(down_cast<const Integer &>(*power).as_integer_class());
1194
+ Expr derivative = *found;
1195
+ for (long i = 0; i < n; i++) derivative = SymEngine::diff(derivative, variable, true);
1196
+ return replaced(mul(integer(n % 2 == 0 ? 1 : -1), derivative), variable, s);
1197
+ }
1198
+ if (!exponential.is_null() && !power.is_null() && !has(rest, t)) {
1199
+ const auto line = linearIn(down_cast<const Pow &>(*exponential).get_exp(), t);
1200
+ const auto found = laplace(pow(t, power), t, sub(s, line->first));
1201
+ if (!found) return std::nullopt;
1202
+ return mul(exp(line->second), *found);
1203
+ }
1204
+ //Products of two sines or cosines: their sums of angles
1205
+ const vec_basic factors = f->get_args();
1206
+ if (factors.size() == 2 && std::all_of(factors.begin(), factors.end(), [](const Expr &g) { return is_a<Sin>(*g) || is_a<Cos>(*g); })) {
1207
+ const Expr A = factors[0]->get_args()[0], B = factors[1]->get_args()[0];
1208
+ Expr sum;
1209
+ if (is_a<Sin>(*factors[0]) && is_a<Cos>(*factors[1])) sum = div(add(sin(add(A, B)), sin(sub(A, B))), integer(2));
1210
+ else if (is_a<Cos>(*factors[0]) && is_a<Sin>(*factors[1])) sum = div(add(sin(add(A, B)), sin(sub(B, A))), integer(2));
1211
+ else if (is_a<Sin>(*factors[0])) sum = div(sub(cos(sub(A, B)), cos(add(A, B))), integer(2));
1212
+ else sum = div(add(cos(sub(A, B)), cos(add(A, B))), integer(2));
1213
+ return laplace(expand(sum), t, s);
1214
+ }
1215
+ return std::nullopt;
1216
+ }
1217
+ if (is_a<Pow>(*f)) {
1218
+ const Expr base = down_cast<const Pow &>(*f).get_base(), exponent = down_cast<const Pow &>(*f).get_exp();
1219
+ //t^n, n > -1: gamma(n + 1)/s^(n + 1)
1220
+ if (eq(*base, *t) && !has(exponent, t) && signOf(add(exponent, one)) == 1) return div(gamma(add(exponent, one)), pow(s, add(exponent, one)));
1221
+ if (eq(*base, *E)) {
1222
+ const auto line = linearIn(exponent, t);
1223
+ if (line) return div(exp(line->second), sub(s, line->first));
1224
+ }
1225
+ if (!has(base, t)) {
1226
+ const auto line = linearIn(exponent, t);
1227
+ if (line) return laplace(exp(mul(exponent, log(base))), t, s);
1228
+ }
1229
+ //sin^2, cos^2, sinh^2, cosh^2: by the double angle
1230
+ if (eq(*exponent, *integer(2)) && is_a_sub<OneArgFunction>(*base)) {
1231
+ const Expr u = base->get_args()[0], twice = mul(integer(2), u);
1232
+ if (is_a<Sin>(*base)) return laplace(sub(div(one, integer(2)), div(cos(twice), integer(2))), t, s);
1233
+ if (is_a<Cos>(*base)) return laplace(add(div(one, integer(2)), div(cos(twice), integer(2))), t, s);
1234
+ if (is_a<Sinh>(*base)) return laplace(sub(div(cosh(twice), integer(2)), div(one, integer(2))), t, s);
1235
+ if (is_a<Cosh>(*base)) return laplace(add(div(cosh(twice), integer(2)), div(one, integer(2))), t, s);
1236
+ }
1237
+ return std::nullopt;
1238
+ }
1239
+ if (is_a<Sin>(*f) || is_a<Cos>(*f) || is_a<Sinh>(*f) || is_a<Cosh>(*f)) {
1240
+ const auto line = linearIn(f->get_args()[0], t);
1241
+ if (!line) return std::nullopt;
1242
+ const Expr &b = line->first, &c = line->second;
1243
+ //sin(b t + c) = sin(b t) cos(c) + cos(b t) sin(c)…
1244
+ if (!eq(*c, *zero)) {
1245
+ const Expr u = mul(b, t);
1246
+ if (is_a<Sin>(*f)) return laplace(add(mul(sin(u), cos(c)), mul(cos(u), sin(c))), t, s);
1247
+ if (is_a<Cos>(*f)) return laplace(sub(mul(cos(u), cos(c)), mul(sin(u), sin(c))), t, s);
1248
+ if (is_a<Sinh>(*f)) return laplace(add(mul(sinh(u), cosh(c)), mul(cosh(u), sinh(c))), t, s);
1249
+ return laplace(add(mul(cosh(u), cosh(c)), mul(sinh(u), sinh(c))), t, s);
1250
+ }
1251
+ const Expr b2 = mul(b, b);
1252
+ if (is_a<Sin>(*f)) return div(b, add(mul(s, s), b2));
1253
+ if (is_a<Cos>(*f)) return div(s, add(mul(s, s), b2));
1254
+ if (is_a<Sinh>(*f)) return div(b, sub(mul(s, s), b2));
1255
+ return div(s, sub(mul(s, s), b2));
1256
+ }
1257
+ return std::nullopt;
1258
+ }
1259
+
1260
+ //The inverse Laplace transform of F(s) at t (see Integrals.h), or nothing
1261
+ std::optional<Expr> inverseLaplace(const Expr &F, const Variable &s, const Variable &t)
1262
+ {
1263
+ checkpoint();
1264
+ if (!has(F, s)) return std::nullopt;
1265
+ if (is_a<Add>(*F)) {
1266
+ Expr sum = zero;
1267
+ for (const Expr &term : F->get_args()) {
1268
+ const auto found = inverseLaplace(term, s, t);
1269
+ if (!found) return std::nullopt;
1270
+ sum = add(sum, *found);
1271
+ }
1272
+ return sum;
1273
+ }
1274
+ if (is_a<Mul>(*F)) {
1275
+ Expr constant = down_cast<const Mul &>(*F).get_coef(), shift, rest = one;
1276
+ for (const auto &[base, exponent] : down_cast<const Mul &>(*F).get_dict()) {
1277
+ const Expr factor = pow(base, exponent);
1278
+ if (!has(factor, s)) constant = mul(constant, factor);
1279
+ else if (isExp(factor) && shift.is_null() && linearIn(exponent, s)) shift = factor;
1280
+ else rest = mul(rest, factor);
1281
+ }
1282
+ if (!eq(*constant, *one)) {
1283
+ const auto found = inverseLaplace(div(F, constant), s, t);
1284
+ if (!found) return std::nullopt;
1285
+ return mul(constant, *found);
1286
+ }
1287
+ //e^(-c s + d) G(s): e^d g(t - c) from t = c, 0 before
1288
+ if (!shift.is_null()) {
1289
+ const auto line = linearIn(down_cast<const Pow &>(*shift).get_exp(), s);
1290
+ const Expr c = neg(line->first);
1291
+ if (signOf(c) != 1) return std::nullopt;
1292
+ const auto found = inverseLaplace(rest, s, t);
1293
+ if (!found) return std::nullopt;
1294
+ return SymEngine::piecewise({{zero, relationOf("<", t, c)}, {mul(exp(line->second), replaced(*found, t, sub(t, c))), boolTrue}});
1295
+ }
1296
+ }
1297
+ //(s - a)^(-v), v > 0: e^(a t) t^(v - 1)/gamma(v)
1298
+ if (is_a<Pow>(*F) && !has(down_cast<const Pow &>(*F).get_exp(), s) && !is_a<Integer>(*down_cast<const Pow &>(*F).get_exp())) {
1299
+ const Expr base = down_cast<const Pow &>(*F).get_base(), v = neg(down_cast<const Pow &>(*F).get_exp());
1300
+ const auto line = linearIn(base, s);
1301
+ if (!line || signOf(v) != 1) return std::nullopt;
1302
+ //(k s + m)^(-v) = k^(-v) (s + m/k)^(-v)
1303
+ const Expr a = neg(div(line->second, line->first));
1304
+ return mul(pow(line->first, neg(v)), div(mul(exp(mul(a, t)), pow(t, sub(v, one))), gamma(v)));
1305
+ }
1306
+ if (!rationalIn(F, s)) return std::nullopt;
1307
+ //A fraction of polynomials whose numerator has a lower degree: its partial fractions
1308
+ const Expr cancelled = cancelOf(togetherOf(F));
1309
+ const auto [numerator, denominator] = fractionOf(cancelled);
1310
+ const auto pn = polynomialIn(numerator, s), pd = polynomialIn(denominator, s);
1311
+ if (!pn || !pd || pn->size() >= pd->size()) return std::nullopt;
1312
+ const Variable plain = plainName(cancelled);
1313
+ const Expr parts = replaced(apartOf(replaced(cancelled, s, plain), plain->get_name()), plain, s);
1314
+ Expr sum = zero;
1315
+ for (const Expr &term : is_a<Add>(*parts) ? parts->get_args() : vec_basic{parts}) {
1316
+ const auto [n, d] = fractionOf(term);
1317
+ const FactoredPolynomial factored = factorPolynomial(d);
1318
+ Expr q, scale = factored.coefficient;
1319
+ long k = 0;
1320
+ for (const auto &[factor, multiplicity] : factored.factors) {
1321
+ if (!has(factor, s)) {
1322
+ scale = mul(scale, pow(factor, integer(multiplicity)));
1323
+ continue;
1324
+ }
1325
+ if (!q.is_null()) return std::nullopt;
1326
+ q = factor;
1327
+ k = multiplicity;
1328
+ }
1329
+ if (q.is_null()) return std::nullopt;
1330
+ const Expr p = div(n, scale);
1331
+ const auto qc = polynomialIn(q, s), pc = polynomialIn(p, s);
1332
+ if (!qc || !pc) return std::nullopt;
1333
+ if (qc->size() == 2) {
1334
+ //p/(alpha s + beta)^k: p alpha^(-k) t^(k - 1) e^(-beta t/alpha)/(k - 1)!
1335
+ if (pc->size() > 1) return std::nullopt;
1336
+ const Expr alpha = (*qc)[1], beta = (*qc)[0];
1337
+ Expr factorial = one;
1338
+ for (long j = 2; j < k; j++) factorial = mul(factorial, integer(j));
1339
+ sum = add(sum, div(mul(mul(p, pow(alpha, integer(-k))), mul(pow(t, integer(k - 1)), exp(neg(mul(div(beta, alpha), t))))), factorial));
1340
+ continue;
1341
+ }
1342
+ if (qc->size() != 3 || k > 32) return std::nullopt;
1343
+ //(B s + C)/(a s^2 + b s + c)^k: with u = s - alpha, (s - alpha)^2 + beta^2, alpha = -b/(2a), beta^2 = c/a - alpha^2,
1344
+ //e^(alpha t)(B' J(k) + (C' + B' alpha) I(k)), B' = B/a^k, C' = C/a^k, I(k) and J(k) the transforms of
1345
+ //1/(u^2 + beta^2)^k and u/(u^2 + beta^2)^k: I(1) = sin(beta t)/beta, J(1) = cos(beta t) (sinh and cosh for
1346
+ //beta^2 < 0), J(k + 1) = t I(k)/(2k) (of the derivative in u), I(k + 1) = ((2k - 1) I(k) - t J(k))/(2k beta^2)
1347
+ //(1/(u^2 + beta^2)^(k + 1) = (d/du (u/(u^2 + beta^2)^k) + (2k - 1)/(u^2 + beta^2)^k)/(2k beta^2))
1348
+ const Expr a = (*qc)[2], ak = pow(a, integer(k));
1349
+ const Expr B = div(pc->size() > 1 ? (*pc)[1] : Expr(zero), ak), C = div((*pc)[0], ak);
1350
+ const Expr alpha = neg(div((*qc)[1], mul(integer(2), a)));
1351
+ const Expr beta2 = expand(sub(div((*qc)[0], a), mul(alpha, alpha)));
1352
+ const int betaSign = signOf(beta2);
1353
+ if (betaSign == 0) return std::nullopt;
1354
+ Expr I, J;
1355
+ if (betaSign == -1) {
1356
+ const Expr gamma2 = sqrt(neg(beta2));
1357
+ I = div(sinh(mul(gamma2, t)), gamma2);
1358
+ J = cosh(mul(gamma2, t));
1359
+ } else {
1360
+ const Expr beta = sqrt(beta2);
1361
+ I = div(sin(mul(beta, t)), beta);
1362
+ J = cos(mul(beta, t));
1363
+ }
1364
+ for (long j = 1; j < k; j++) {
1365
+ const Expr next = div(sub(mul(integer(2 * j - 1), I), mul(t, J)), mul(integer(2 * j), beta2));
1366
+ J = div(mul(t, I), integer(2 * j));
1367
+ I = expand(next);
1368
+ }
1369
+ const Expr inner = add(mul(B, J), mul(add(C, mul(B, alpha)), I));
1370
+ sum = add(sum, mul(exp(mul(alpha, t)), inner));
1371
+ }
1372
+ return sum;
1373
+ }
1374
+
1375
+ }
1376
+
1377
+ Expr laplaceOf(const Expr &given, const std::string &tName, const std::string &sName)
1378
+ {
1379
+ for (const std::string &name : {tName, sName}) {
1380
+ if (!isName(name) || isBuiltin(name)) throw MathError(ErrorCode::Argument, name + " is not a variable");
1381
+ }
1382
+ if (tName == sName) throw MathError(ErrorCode::Argument, "The variables of a transform differ");
1383
+ const Variable t = symbol(tName), s = symbol(sName);
1384
+ const Expr f = evaluatedOf(given);
1385
+ if (has(f, s)) throw MathError(ErrorCode::Argument, "The expression of a Laplace transform has no " + sName + ": it is its variable");
1386
+ std::optional<Expr> found;
1387
+ try {
1388
+ found = laplace(f, t, s);
1389
+ } catch (SymEngineException &) {
1390
+ found = std::nullopt;
1391
+ }
1392
+ if (!found) throw MathError(ErrorCode::NotSupported, "The Laplace transform of " + toText(given) + " is not found");
1393
+ return simplifiedOf(*found);
1394
+ }
1395
+
1396
+ Expr inverseLaplaceOf(const Expr &given, const std::string &sName, const std::string &tName)
1397
+ {
1398
+ for (const std::string &name : {tName, sName}) {
1399
+ if (!isName(name) || isBuiltin(name)) throw MathError(ErrorCode::Argument, name + " is not a variable");
1400
+ }
1401
+ if (tName == sName) throw MathError(ErrorCode::Argument, "The variables of a transform differ");
1402
+ const Variable t = symbol(tName), s = symbol(sName);
1403
+ const Expr F = evaluatedOf(given);
1404
+ if (has(F, t)) throw MathError(ErrorCode::Argument, "The expression of an inverse Laplace transform has no " + tName + ": it is its variable");
1405
+ std::optional<Expr> found;
1406
+ try {
1407
+ found = inverseLaplace(F, s, t);
1408
+ } catch (SymEngineException &) {
1409
+ found = std::nullopt;
1410
+ } catch (const MathError &error) {
1411
+ if (error.code() == ErrorCode::Cancelled || error.code() == ErrorCode::Timeout) throw;
1412
+ found = std::nullopt;
1413
+ }
1414
+ if (!found) throw MathError(ErrorCode::NotSupported, "The inverse Laplace transform of " + toText(given) + " is not found");
1415
+ const Expr result = simplifiedOf(*found);
1416
+ //Checked by its transform where that is found (not for the shifts, which are piecewise)
1417
+ try {
1418
+ if (const auto back = laplace(result, t, s)) {
1419
+ if (!eq(*cancelOf(togetherOf(sub(*back, F))), *zero) && !verifiedAt(*back, F, s)) {
1420
+ throw MathError(ErrorCode::NotSupported, "The inverse Laplace transform found for " + toText(given) + " is not checked by its transform");
1421
+ }
1422
+ }
1423
+ } catch (SymEngineException &) {
1424
+ }
1425
+ return result;
1426
+ }
1427
+
1428
+ }