diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 0000000..8629e76 --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,41 @@ +name: Build and Deploy + +on: + push: + branches: ["master"] + + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Node.js environment + uses: actions/setup-node@v4.0.2 + - name: Install dependencies + run: npm install + - name: Build Pages + run: npm run build + - name: Setup Pages + uses: actions/configure-pages@v5 + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: 'docs' + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index ec2589d..06b094e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ node_modules vite.config.js.timestamp-* vite.config.ts.timestamp-* src/lib/generated/* -.idea \ No newline at end of file +.idea +/docs \ No newline at end of file diff --git a/docs/.nojekyll b/docs/.nojekyll deleted file mode 100644 index e69de29..0000000 diff --git a/docs/CNAME b/docs/CNAME deleted file mode 100644 index 326f20a..0000000 --- a/docs/CNAME +++ /dev/null @@ -1 +0,0 @@ -cavenightingale.moe \ No newline at end of file diff --git a/docs/_app/immutable/assets/0.f71657b6.css b/docs/_app/immutable/assets/0.f71657b6.css deleted file mode 100644 index 3dc1327..0000000 --- a/docs/_app/immutable/assets/0.f71657b6.css +++ /dev/null @@ -1 +0,0 @@ -#topbar.svelte-arx3nc{position:fixed;top:0;left:0;width:100%;height:2.4em;background-color:#65a1ee;display:flex;align-items:center;-webkit-user-drag:none;z-index:1000;border:0 solid #a37a877f;border-bottom-width:2px}#topbar-title.svelte-arx3nc{font-size:large;padding-left:1em}#back-button.svelte-arx3nc{height:1.2em;padding-left:1em;-webkit-user-select:none;user-select:none}#back-button.empty.svelte-arx3nc{opacity:0}*{outline:none}#klpbg.svelte-arx3nc{background:url(https://api.klpbbs.com/api/img/acg/) no-repeat;background-size:cover;width:100%;height:100%;position:fixed;left:0;top:0;filter:brightness(.75);z-index:-100}#klpbg.hide.svelte-arx3nc{display:none}@media print{#topbar.svelte-arx3nc,#klpbg.svelte-arx3nc{display:none}} diff --git a/docs/_app/immutable/assets/10.eec39ab6.css b/docs/_app/immutable/assets/10.eec39ab6.css deleted file mode 100644 index 158edb1..0000000 --- a/docs/_app/immutable/assets/10.eec39ab6.css +++ /dev/null @@ -1 +0,0 @@ -.inner.svelte-js2387{line-height:1em} diff --git a/docs/_app/immutable/assets/2.f82bd3d8.css b/docs/_app/immutable/assets/2.f82bd3d8.css deleted file mode 100644 index 837380e..0000000 --- a/docs/_app/immutable/assets/2.f82bd3d8.css +++ /dev/null @@ -1 +0,0 @@ -div.svelte-1dilkma{padding-left:.8em;padding-right:.8em;padding-top:2.4em;color:#fff}@media screen and (min-width: 1200px){div.svelte-1dilkma{padding-top:2.4em;border-radius:10px;width:1200px;margin:auto;position:absolute;top:0;left:0;right:0;bottom:0;word-wrap:break-word}} diff --git a/docs/_app/immutable/assets/8.0f129be8.css b/docs/_app/immutable/assets/8.0f129be8.css deleted file mode 100644 index 838ce64..0000000 --- a/docs/_app/immutable/assets/8.0f129be8.css +++ /dev/null @@ -1 +0,0 @@ -#container.svelte-17zegvx{width:1200px;height:1200px;margin:auto}@media (max-width: 1200px){#container.svelte-17zegvx{width:100%;height:100%}}#canvas.svelte-17zegvx{width:100%;height:100%;border:1px red solid}#error-message.svelte-17zegvx{color:red;text-align:center;font-size:2em}#input-message.svelte-17zegvx{color:green;margin-left:1em;font-size:1em}#message.svelte-17zegvx{color:green;text-align:center;font-size:2em}#input.svelte-17zegvx{resize:vertical;width:100%;height:10em;margin-bottom:1em}button.svelte-17zegvx{border-width:1px;border-radius:.3em;border-color:#8f8f8f;border-style:solid;height:2em;width:5em;font-weight:500;font-size:20px;color:#000;padding:0;margin:0;background-color:#0000}button.disabled.svelte-17zegvx{color:#8f8f8f} diff --git a/docs/_app/immutable/assets/State.085f50e3.css b/docs/_app/immutable/assets/State.085f50e3.css deleted file mode 100644 index 5307e2d..0000000 --- a/docs/_app/immutable/assets/State.085f50e3.css +++ /dev/null @@ -1 +0,0 @@ -i.svelte-16vvohq{padding-right:1em}div.svelte-16vvohq{position:relative}span.child.svelte-16vvohq>p:first-child{display:inline}.qed.svelte-16vvohq{font-size:1.5em;position:absolute;right:0;bottom:0}strong.svelte-jww2m9{padding-right:1em}span.svelte-jww2m9>p:first-child{display:inline} diff --git a/docs/_app/immutable/assets/_layout.92c21e3b.css b/docs/_app/immutable/assets/_layout.92c21e3b.css deleted file mode 100644 index 4208dc7..0000000 --- a/docs/_app/immutable/assets/_layout.92c21e3b.css +++ /dev/null @@ -1 +0,0 @@ -#topbar.svelte-arx3nc{position:fixed;top:0;left:0;width:100%;height:2.4em;background-color:#65a1ee;display:flex;align-items:center;-webkit-user-drag:none;z-index:1000;border:0 solid #a37a877f;border-bottom-width:2px}#topbar-title.svelte-arx3nc{font-size:large;padding-left:1em}#back-button.svelte-arx3nc{height:1.2em;padding-left:1em;user-select:none}#back-button.empty.svelte-arx3nc{opacity:0}*{outline:none}#klpbg.svelte-arx3nc{background:url(https://api.klpbbs.com/api/img/acg/) no-repeat;background-size:cover;width:100%;height:100%;position:fixed;left:0;top:0;filter:brightness(.75);z-index:-100}#klpbg.hide.svelte-arx3nc{display:none}@media print{#topbar.svelte-arx3nc,#klpbg.svelte-arx3nc{display:none}} diff --git a/docs/_app/immutable/assets/_page.0f129be8.css b/docs/_app/immutable/assets/_page.0f129be8.css deleted file mode 100644 index 838ce64..0000000 --- a/docs/_app/immutable/assets/_page.0f129be8.css +++ /dev/null @@ -1 +0,0 @@ -#container.svelte-17zegvx{width:1200px;height:1200px;margin:auto}@media (max-width: 1200px){#container.svelte-17zegvx{width:100%;height:100%}}#canvas.svelte-17zegvx{width:100%;height:100%;border:1px red solid}#error-message.svelte-17zegvx{color:red;text-align:center;font-size:2em}#input-message.svelte-17zegvx{color:green;margin-left:1em;font-size:1em}#message.svelte-17zegvx{color:green;text-align:center;font-size:2em}#input.svelte-17zegvx{resize:vertical;width:100%;height:10em;margin-bottom:1em}button.svelte-17zegvx{border-width:1px;border-radius:.3em;border-color:#8f8f8f;border-style:solid;height:2em;width:5em;font-weight:500;font-size:20px;color:#000;padding:0;margin:0;background-color:#0000}button.disabled.svelte-17zegvx{color:#8f8f8f} diff --git a/docs/_app/immutable/assets/_page.da741f68.css b/docs/_app/immutable/assets/_page.da741f68.css deleted file mode 100644 index 8dfdfcd..0000000 --- a/docs/_app/immutable/assets/_page.da741f68.css +++ /dev/null @@ -1 +0,0 @@ -div.svelte-1dilkma{padding-left:.8em;padding-right:.8em;padding-top:2.4em;color:#fff}@media screen and (min-width: 1200px){div.svelte-1dilkma{padding-top:2.4em;border-radius:10px;width:1200px;margin:auto;position:absolute;inset:0;word-wrap:break-word}} diff --git a/docs/_app/immutable/assets/_page.eec39ab6.css b/docs/_app/immutable/assets/_page.eec39ab6.css deleted file mode 100644 index 158edb1..0000000 --- a/docs/_app/immutable/assets/_page.eec39ab6.css +++ /dev/null @@ -1 +0,0 @@ -.inner.svelte-js2387{line-height:1em} diff --git a/docs/_app/immutable/assets/layout.4edc64fc.css b/docs/_app/immutable/assets/layout.4edc64fc.css deleted file mode 100644 index 2c408b9..0000000 --- a/docs/_app/immutable/assets/layout.4edc64fc.css +++ /dev/null @@ -1 +0,0 @@ -.expand.svelte-10uxbo6.svelte-10uxbo6{width:1em;height:1em;display:inline-block}a.svelte-10uxbo6.svelte-10uxbo6{color:#000;padding-left:1em}.root.svelte-10uxbo6.svelte-10uxbo6{padding:.5em 0 .5em 1em}.self.svelte-10uxbo6.svelte-10uxbo6{align-items:center;display:flex}.expandable.svelte-10uxbo6.svelte-10uxbo6{background-image:url(../../../assets/icon/subtree.svg);background-repeat:no-repeat;background-size:contain}.expanded.svelte-10uxbo6.svelte-10uxbo6{rotate:90deg}.active.svelte-10uxbo6.svelte-10uxbo6{font-weight:700}.active.svelte-10uxbo6>a.svelte-10uxbo6{color:#bb3989}.md-main.svelte-1n2wyel{padding-left:2.4em;padding-right:2.4em;padding-top:2.4em;margin-bottom:10em;background-color:#fff}.sidebar.svelte-1n2wyel{display:none;background-color:#f5f5f5}@media screen and (min-width: 1200px){.md-main.svelte-1n2wyel{padding-top:2.4em;border-radius:10px;width:calc(100% - 400px - 4.6em);margin:auto;position:absolute;top:0;right:0;bottom:0;word-wrap:break-word}.sidebar.svelte-1n2wyel{padding-top:2.7em;display:block;position:fixed;top:0;left:0;bottom:0;width:398px;border-right-style:dotted;border-right-width:2px;border-right-color:#a5a5a5;overflow-y:auto}}@media screen and (max-width: 1199px){.sidebar.svelte-1n2wyel{padding-top:1.2em;padding-bottom:1.2em;display:block;width:100%;border-top-style:solid;border-top-width:2px;border-right-color:#a5a5a5;overflow-y:auto}} diff --git a/docs/_app/immutable/assets/layout.4fe6528c.css b/docs/_app/immutable/assets/layout.4fe6528c.css deleted file mode 100644 index 275550e..0000000 --- a/docs/_app/immutable/assets/layout.4fe6528c.css +++ /dev/null @@ -1 +0,0 @@ -.expand.svelte-10uxbo6.svelte-10uxbo6{width:1em;height:1em;display:inline-block}a.svelte-10uxbo6.svelte-10uxbo6{color:#000;padding-left:1em}.root.svelte-10uxbo6.svelte-10uxbo6{padding:.5em 0 .5em 1em}.self.svelte-10uxbo6.svelte-10uxbo6{align-items:center;display:flex}.expandable.svelte-10uxbo6.svelte-10uxbo6{background-image:url(/assets/icon/subtree.svg);background-repeat:no-repeat;background-size:contain}.expanded.svelte-10uxbo6.svelte-10uxbo6{rotate:90deg}.active.svelte-10uxbo6.svelte-10uxbo6{font-weight:700}.active.svelte-10uxbo6>a.svelte-10uxbo6{color:#bb3989}.md-main.svelte-1n2wyel{padding-left:2.4em;padding-right:2.4em;padding-top:2.4em;margin-bottom:10em;background-color:#fff}.sidebar.svelte-1n2wyel{display:none;background-color:#f5f5f5}@media screen and (min-width: 1200px){.md-main.svelte-1n2wyel{padding-top:2.4em;border-radius:10px;width:calc(100% - 400px - 4.6em);margin:auto;position:absolute;top:0;right:0;bottom:0;word-wrap:break-word}.sidebar.svelte-1n2wyel{padding-top:2.7em;display:block;position:fixed;top:0;left:0;bottom:0;width:398px;border-right-style:dotted;border-right-width:2px;border-right-color:#a5a5a5;overflow-y:auto}}@media screen and (max-width: 1199px){.sidebar.svelte-1n2wyel{padding-top:1.2em;padding-bottom:1.2em;display:block;width:100%;border-top-style:solid;border-top-width:2px;border-right-color:#a5a5a5;overflow-y:auto}} diff --git a/docs/_app/immutable/chunks/Algor.c1ca40d5.js b/docs/_app/immutable/chunks/Algor.c1ca40d5.js deleted file mode 100644 index 94ea6c1..0000000 --- a/docs/_app/immutable/chunks/Algor.c1ca40d5.js +++ /dev/null @@ -1,269 +0,0 @@ -var ba=Object.defineProperty;var ya=(r,e,t)=>e in r?ba(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var Ue=(r,e,t)=>(ya(r,typeof e!="symbol"?e+"":e,t),t);import{S as xa,i as wa,s as ka,I as Sa,k as Ma,V as za,l as Lt,m as Ot,h as $e,n as Ft,b as Aa,E as Ta,K as Ba,L as Da,M as Ca,g as Na,d as qa}from"./index.488f1ee5.js";class u0{constructor(e,t,a){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=a}static range(e,t){return t?!e||!e.loc||!t.loc||e.loc.lexer!==t.loc.lexer?null:new u0(e.loc.lexer,e.loc.start,t.loc.end):e&&e.loc}}class f0{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new f0(t,u0.range(this,e))}}class M{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var a="KaTeX parse error: "+e,n,s,o=t&&t.loc;if(o&&o.start<=o.end){var h=o.lexer.input;n=o.start,s=o.end,n===h.length?a+=" at end of input: ":a+=" at position "+(n+1)+": ";var m=h.slice(n,s).replace(/[^]/g,"$&̲"),p;n>15?p="…"+h.slice(n-15,n):p=h.slice(0,n);var v;s+15":">","<":"<",'"':""","'":"'"},Oa=/[&><"']/g;function Fa(r){return String(r).replace(Oa,e=>La[e])}var xr=function r(e){return e.type==="ordgroup"||e.type==="color"?e.body.length===1?r(e.body[0]):e:e.type==="font"?r(e.body):e},Pa=function(e){var t=xr(e);return t.type==="mathord"||t.type==="textord"||t.type==="atom"},Va=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e},Ga=function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},q={contains:Ea,deflt:Ra,escape:Fa,hyphenate:Ha,getBaseElem:xr,isCharacterBox:Pa,protocolFromUrl:Ga},ze={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format "},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color ",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:r=>"#"+r},macros:{type:"object",cli:"-m, --macro ",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(r,e)=>(e.push(r),e)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:r=>Math.max(0,r),cli:"--min-rule-thickness ",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:r=>Math.max(0,r),cli:"-s, --max-size ",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:r=>Math.max(0,r),cli:"-e, --max-expand ",cliProcessor:r=>r==="Infinity"?1/0:parseInt(r)},globalGroup:{type:"boolean",cli:!1}};function Ua(r){if(r.default)return r.default;var e=r.type,t=Array.isArray(e)?e[0]:e;if(typeof t!="string")return t.enum[0];switch(t){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class ft{constructor(e){this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(var t in ze)if(ze.hasOwnProperty(t)){var a=ze[t];this[t]=e[t]!==void 0?a.processor?a.processor(e[t]):e[t]:Ua(a)}}reportNonstrict(e,t,a){var n=this.strict;if(typeof n=="function"&&(n=n(e,t,a)),!(!n||n==="ignore")){if(n===!0||n==="error")throw new M("LaTeX-incompatible input and strict mode is set to 'error': "+(t+" ["+e+"]"),a);n==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+n+"': "+t+" ["+e+"]"))}}useStrictBehavior(e,t,a){var n=this.strict;if(typeof n=="function")try{n=n(e,t,a)}catch{n="error"}return!n||n==="ignore"?!1:n===!0||n==="error"?!0:n==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(t+" ["+e+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+n+"': "+t+" ["+e+"]")),!1)}isTrusted(e){if(e.url&&!e.protocol){var t=q.protocolFromUrl(e.url);if(t==null)return!1;e.protocol=t}var a=typeof this.trust=="function"?this.trust(e):this.trust;return!!a}}class H0{constructor(e,t,a){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=a}sup(){return y0[$a[this.id]]}sub(){return y0[Xa[this.id]]}fracNum(){return y0[Ya[this.id]]}fracDen(){return y0[Wa[this.id]]}cramp(){return y0[ja[this.id]]}text(){return y0[Za[this.id]]}isTight(){return this.size>=2}}var pt=0,Te=1,_0=2,T0=3,le=4,d0=5,ee=6,n0=7,y0=[new H0(pt,0,!1),new H0(Te,0,!0),new H0(_0,1,!1),new H0(T0,1,!0),new H0(le,2,!1),new H0(d0,2,!0),new H0(ee,3,!1),new H0(n0,3,!0)],$a=[le,d0,le,d0,ee,n0,ee,n0],Xa=[d0,d0,d0,d0,n0,n0,n0,n0],Ya=[_0,T0,le,d0,ee,n0,ee,n0],Wa=[T0,T0,d0,d0,n0,n0,n0,n0],ja=[Te,Te,T0,T0,d0,d0,n0,n0],Za=[pt,Te,_0,T0,_0,T0,_0,T0],R={DISPLAY:y0[pt],TEXT:y0[_0],SCRIPT:y0[le],SCRIPTSCRIPT:y0[ee]},it=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function Ka(r){for(var e=0;e=n[0]&&r<=n[1])return t.name}return null}var Ae=[];it.forEach(r=>r.blocks.forEach(e=>Ae.push(...e)));function wr(r){for(var e=0;e=Ae[e]&&r<=Ae[e+1])return!0;return!1}var Q0=80,Ja=function(e,t){return"M95,"+(622+e+t)+` -c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14 -c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54 -c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10 -s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429 -c69,-144,104.5,-217.7,106.5,-221 -l`+e/2.075+" -"+e+` -c5.3,-9.3,12,-14,20,-14 -H400000v`+(40+e)+`H845.2724 -s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7 -c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z -M`+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},Qa=function(e,t){return"M263,"+(601+e+t)+`c0.7,0,18,39.7,52,119 -c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120 -c340,-704.7,510.7,-1060.3,512,-1067 -l`+e/2.084+" -"+e+` -c4.7,-7.3,11,-11,19,-11 -H40000v`+(40+e)+`H1012.3 -s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232 -c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1 -s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26 -c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z -M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},_a=function(e,t){return"M983 "+(10+e+t)+` -l`+e/3.13+" -"+e+` -c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+` -H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7 -s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744 -c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30 -c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722 -c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5 -c53.7,-170.3,84.5,-266.8,92.5,-289.5z -M`+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"},e1=function(e,t){return"M424,"+(2398+e+t)+` -c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514 -c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20 -s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121 -s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081 -l`+e/4.223+" -"+e+`c4,-6.7,10,-10,18,-10 H400000 -v`+(40+e)+`H1014.6 -s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185 -c-2,6,-10,9,-24,9 -c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+" "+t+` -h400000v`+(40+e)+"h-400000z"},t1=function(e,t){return"M473,"+(2713+e+t)+` -c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+" -"+e+` -c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7 -s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9 -c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200 -c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26 -s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104, -606zM`+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"},r1=function(e){var t=e/2;return"M400000 "+e+" H0 L"+t+" 0 l65 45 L145 "+(e-80)+" H400000z"},a1=function(e,t,a){var n=a-54-t-e;return"M702 "+(e+t)+"H400000"+(40+e)+` -H742v`+n+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1 -h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170 -c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667 -219 661 l218 661zM702 `+t+"H400000v"+(40+e)+"H742z"},n1=function(e,t,a){t=1e3*t;var n="";switch(e){case"sqrtMain":n=Ja(t,Q0);break;case"sqrtSize1":n=Qa(t,Q0);break;case"sqrtSize2":n=_a(t,Q0);break;case"sqrtSize3":n=e1(t,Q0);break;case"sqrtSize4":n=t1(t,Q0);break;case"sqrtTall":n=a1(t,Q0,a)}return n},i1=function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z"+("M367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z");case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z";case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257z"+("M478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z");default:return""}},Pt={doubleleftarrow:`M262 157 -l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3 - 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28 - 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5 -c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5 - 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87 --86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7 --2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z -m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l --10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5 - 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88 --33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68 --17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18 --13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782 -c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3 --107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120 - 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8 --5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247 -c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208 - 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3 - 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202 - l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117 --45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7 - 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13 - 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688 - 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7 --331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80 -H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0 - 435 0h399565z`,leftgroupunder:`M400000 262 -H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219 - 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3 --3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5 --18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7 --196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5 - 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3 --4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7 --10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z -m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333 - 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5 - 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667 --152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12 - 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7 --2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0 -v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5 --83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3 --68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21 - 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:`M40 281 V428 H0 V94 H40 V241 H400000 v40z -M40 281 V428 H0 V94 H40 V241 H400000 v40z`,leftmapsto:`M40 281 V448H0V74H40V241H400000v40z -M40 281 V448H0V74H40V241H400000v40z`,leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23 --.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8 -c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3 - 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:`M0 50 h400000 v40H0z m0 194h40000v40H0z -M0 50 h400000 v40H0z m0 194h40000v40H0z`,midbrace:`M200428 334 -c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14 --53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7 - 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11 - 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214 -c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14 - 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3 - 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0 --5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6 --320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z -m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8 -60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8 --451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z -m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2 -c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6 --480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z -m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0 -85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8 --707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z -m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1 -c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128 --16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 - 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 - 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85 --40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 --12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 - 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l --6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5 -s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1 -c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3 - 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237 --174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0 - 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18 - 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3 --3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2 --10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 - 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11 --18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7 - 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z -m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8 - 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5 --7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95 --27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8 - 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 - 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3 --64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z -m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3 - 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0 --13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21 - 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z -M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23 - 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32 --52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142 --167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40 - 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69 --70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3 --40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19 --37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101 - 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167 -c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3 - 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42 - 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333 --19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70 - 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7 --2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0 - 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0 - 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128 --68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418 --8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9 - 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114 -c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751 - 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457 --11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0 - 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697 - 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696 - -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345 --11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409 - 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9 - 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409 - -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5 -3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11 -10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63 --1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1 --7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59 -H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359 -c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22 -c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10 --11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1, --5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10, --11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202 -c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5 -c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130 -s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47 -121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6 -s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11 -c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z -M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32 --27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0 -13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39 --84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5 --119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5 --12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67 -151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 -c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17 -c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21 -c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40 -c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z -M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0 -c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, --231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 -c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11 -c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9, -1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7, --152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z -M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0 -c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199, --231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6 -c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z -M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},s1=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v1759 h347 v-84 -H403z M403 1759 V0 H319 V1759 v`+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v1759 H0 v84 H347z -M347 1759 V0 H263 V1759 v`+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z -M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15 -c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15 -c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+` v1715 h263 v84 H319z -MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+` v1799 H0 v-84 H319z -MM319 602 V0 H403 V602 v`+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+` v602 h84z -M403 1759 V0 H319 V1759 v`+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+` v602 h84z -M347 1759 V0 h-84 V1759 v`+t+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1 -c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349, --36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210, -949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9 -c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5, --544.7,-112.5,-882c-2,-104,-3,-167,-3,-189 -l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3, --210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3, -63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5 -c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+` -c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664 -c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11 -c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17 -c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558 -l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7, --470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};class ue{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return q.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;tt.toText();return this.children.map(e).join("")}}var x0={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},ve={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Vt={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function l1(r,e){x0[r]=e}function vt(r,e,t){if(!x0[e])throw new Error("Font metrics not found for font: "+e+".");var a=r.charCodeAt(0),n=x0[e][a];if(!n&&r[0]in Vt&&(a=Vt[r[0]].charCodeAt(0),n=x0[e][a]),!n&&t==="text"&&wr(a)&&(n=x0[e][77]),n)return{depth:n[0],height:n[1],italic:n[2],skew:n[3],width:n[4]}}var Xe={};function o1(r){var e;if(r>=5?e=0:r>=3?e=1:e=2,!Xe[e]){var t=Xe[e]={cssEmPerMu:ve.quad[e]/18};for(var a in ve)ve.hasOwnProperty(a)&&(t[a]=ve[a][e])}return Xe[e]}var u1=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Gt=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Ut=function(e,t){return t.size<2?e:u1[e-1][t.size-1]};class A0{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||A0.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Gt[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var a in e)e.hasOwnProperty(a)&&(t[a]=e[a]);return new A0(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Ut(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Gt[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=Ut(A0.BASESIZE,e);return this.size===t&&this.textSize===A0.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==A0.BASESIZE?["sizing","reset-size"+this.size,"size"+A0.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=o1(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}A0.BASESIZE=6;var st={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},h1={ex:!0,em:!0,mu:!0},kr=function(e){return typeof e!="string"&&(e=e.unit),e in st||e in h1||e==="ex"},K=function(e,t){var a;if(e.unit in st)a=st[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit==="mu")a=t.fontMetrics().cssEmPerMu;else{var n;if(t.style.isTight()?n=t.havingStyle(t.style.text()):n=t,e.unit==="ex")a=n.fontMetrics().xHeight;else if(e.unit==="em")a=n.fontMetrics().quad;else throw new M("Invalid unit: '"+e.unit+"'");n!==t&&(a*=n.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*a,t.maxSize)},A=function(e){return+e.toFixed(4)+"em"},F0=function(e){return e.filter(t=>t).join(" ")},Sr=function(e,t,a){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},t){t.style.isTight()&&this.classes.push("mtight");var n=t.getColor();n&&(this.style.color=n)}},Mr=function(e){var t=document.createElement(e);t.className=F0(this.classes);for(var a in this.style)this.style.hasOwnProperty(a)&&(t.style[a]=this.style[a]);for(var n in this.attributes)this.attributes.hasOwnProperty(n)&&t.setAttribute(n,this.attributes[n]);for(var s=0;s",t};class he{constructor(e,t,a,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Sr.call(this,e,a,n),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return q.contains(this.classes,e)}toNode(){return Mr.call(this,"span")}toMarkup(){return zr.call(this,"span")}}class gt{constructor(e,t,a,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,Sr.call(this,t,n),this.children=a||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return q.contains(this.classes,e)}toNode(){return Mr.call(this,"a")}toMarkup(){return zr.call(this,"a")}}class m1{constructor(e,t,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=a}hasClass(e){return q.contains(this.classes,e)}toNode(){var e=document.createElement("img");e.src=this.src,e.alt=this.alt,e.className="mord";for(var t in this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e=''+q.escape(this.alt)+'0&&(t=document.createElement("span"),t.style.marginRight=A(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=F0(this.classes));for(var a in this.style)this.style.hasOwnProperty(a)&&(t=t||document.createElement("span"),t.style[a]=this.style[a]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="0&&(a+="margin-right:"+this.italic+"em;");for(var n in this.style)this.style.hasOwnProperty(n)&&(a+=q.hyphenate(n)+":"+this.style[n]+";");a&&(e=!0,t+=' style="'+q.escape(a)+'"');var s=q.escape(this.text);return e?(t+=">",t+=s,t+="",t):s}}class D0{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"svg");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&t.setAttribute(a,this.attributes[a]);for(var n=0;n':''}}class lt{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e="http://www.w3.org/2000/svg",t=document.createElementNS(e,"line");for(var a in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,a)&&t.setAttribute(a,this.attributes[a]);return t}toMarkup(){var e=" but got "+String(r)+".")}var f1={bin:1,close:1,inner:1,open:1,punct:1,rel:1},p1={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Y={math:{},text:{}};function i(r,e,t,a,n,s){Y[r][n]={font:e,group:t,replace:a},s&&a&&(Y[r][a]=Y[r][n])}var l="math",k="text",u="main",d="ams",W="accent-token",D="bin",i0="close",te="inner",E="mathord",_="op-token",h0="open",qe="punct",f="rel",q0="spacing",g="textord";i(l,u,f,"≡","\\equiv",!0);i(l,u,f,"≺","\\prec",!0);i(l,u,f,"≻","\\succ",!0);i(l,u,f,"∼","\\sim",!0);i(l,u,f,"⊥","\\perp");i(l,u,f,"⪯","\\preceq",!0);i(l,u,f,"⪰","\\succeq",!0);i(l,u,f,"≃","\\simeq",!0);i(l,u,f,"∣","\\mid",!0);i(l,u,f,"≪","\\ll",!0);i(l,u,f,"≫","\\gg",!0);i(l,u,f,"≍","\\asymp",!0);i(l,u,f,"∥","\\parallel");i(l,u,f,"⋈","\\bowtie",!0);i(l,u,f,"⌣","\\smile",!0);i(l,u,f,"⊑","\\sqsubseteq",!0);i(l,u,f,"⊒","\\sqsupseteq",!0);i(l,u,f,"≐","\\doteq",!0);i(l,u,f,"⌢","\\frown",!0);i(l,u,f,"∋","\\ni",!0);i(l,u,f,"∝","\\propto",!0);i(l,u,f,"⊢","\\vdash",!0);i(l,u,f,"⊣","\\dashv",!0);i(l,u,f,"∋","\\owns");i(l,u,qe,".","\\ldotp");i(l,u,qe,"⋅","\\cdotp");i(l,u,g,"#","\\#");i(k,u,g,"#","\\#");i(l,u,g,"&","\\&");i(k,u,g,"&","\\&");i(l,u,g,"ℵ","\\aleph",!0);i(l,u,g,"∀","\\forall",!0);i(l,u,g,"ℏ","\\hbar",!0);i(l,u,g,"∃","\\exists",!0);i(l,u,g,"∇","\\nabla",!0);i(l,u,g,"♭","\\flat",!0);i(l,u,g,"ℓ","\\ell",!0);i(l,u,g,"♮","\\natural",!0);i(l,u,g,"♣","\\clubsuit",!0);i(l,u,g,"℘","\\wp",!0);i(l,u,g,"♯","\\sharp",!0);i(l,u,g,"♢","\\diamondsuit",!0);i(l,u,g,"ℜ","\\Re",!0);i(l,u,g,"♡","\\heartsuit",!0);i(l,u,g,"ℑ","\\Im",!0);i(l,u,g,"♠","\\spadesuit",!0);i(l,u,g,"§","\\S",!0);i(k,u,g,"§","\\S");i(l,u,g,"¶","\\P",!0);i(k,u,g,"¶","\\P");i(l,u,g,"†","\\dag");i(k,u,g,"†","\\dag");i(k,u,g,"†","\\textdagger");i(l,u,g,"‡","\\ddag");i(k,u,g,"‡","\\ddag");i(k,u,g,"‡","\\textdaggerdbl");i(l,u,i0,"⎱","\\rmoustache",!0);i(l,u,h0,"⎰","\\lmoustache",!0);i(l,u,i0,"⟯","\\rgroup",!0);i(l,u,h0,"⟮","\\lgroup",!0);i(l,u,D,"∓","\\mp",!0);i(l,u,D,"⊖","\\ominus",!0);i(l,u,D,"⊎","\\uplus",!0);i(l,u,D,"⊓","\\sqcap",!0);i(l,u,D,"∗","\\ast");i(l,u,D,"⊔","\\sqcup",!0);i(l,u,D,"◯","\\bigcirc",!0);i(l,u,D,"∙","\\bullet",!0);i(l,u,D,"‡","\\ddagger");i(l,u,D,"≀","\\wr",!0);i(l,u,D,"⨿","\\amalg");i(l,u,D,"&","\\And");i(l,u,f,"⟵","\\longleftarrow",!0);i(l,u,f,"⇐","\\Leftarrow",!0);i(l,u,f,"⟸","\\Longleftarrow",!0);i(l,u,f,"⟶","\\longrightarrow",!0);i(l,u,f,"⇒","\\Rightarrow",!0);i(l,u,f,"⟹","\\Longrightarrow",!0);i(l,u,f,"↔","\\leftrightarrow",!0);i(l,u,f,"⟷","\\longleftrightarrow",!0);i(l,u,f,"⇔","\\Leftrightarrow",!0);i(l,u,f,"⟺","\\Longleftrightarrow",!0);i(l,u,f,"↦","\\mapsto",!0);i(l,u,f,"⟼","\\longmapsto",!0);i(l,u,f,"↗","\\nearrow",!0);i(l,u,f,"↩","\\hookleftarrow",!0);i(l,u,f,"↪","\\hookrightarrow",!0);i(l,u,f,"↘","\\searrow",!0);i(l,u,f,"↼","\\leftharpoonup",!0);i(l,u,f,"⇀","\\rightharpoonup",!0);i(l,u,f,"↙","\\swarrow",!0);i(l,u,f,"↽","\\leftharpoondown",!0);i(l,u,f,"⇁","\\rightharpoondown",!0);i(l,u,f,"↖","\\nwarrow",!0);i(l,u,f,"⇌","\\rightleftharpoons",!0);i(l,d,f,"≮","\\nless",!0);i(l,d,f,"","\\@nleqslant");i(l,d,f,"","\\@nleqq");i(l,d,f,"⪇","\\lneq",!0);i(l,d,f,"≨","\\lneqq",!0);i(l,d,f,"","\\@lvertneqq");i(l,d,f,"⋦","\\lnsim",!0);i(l,d,f,"⪉","\\lnapprox",!0);i(l,d,f,"⊀","\\nprec",!0);i(l,d,f,"⋠","\\npreceq",!0);i(l,d,f,"⋨","\\precnsim",!0);i(l,d,f,"⪹","\\precnapprox",!0);i(l,d,f,"≁","\\nsim",!0);i(l,d,f,"","\\@nshortmid");i(l,d,f,"∤","\\nmid",!0);i(l,d,f,"⊬","\\nvdash",!0);i(l,d,f,"⊭","\\nvDash",!0);i(l,d,f,"⋪","\\ntriangleleft");i(l,d,f,"⋬","\\ntrianglelefteq",!0);i(l,d,f,"⊊","\\subsetneq",!0);i(l,d,f,"","\\@varsubsetneq");i(l,d,f,"⫋","\\subsetneqq",!0);i(l,d,f,"","\\@varsubsetneqq");i(l,d,f,"≯","\\ngtr",!0);i(l,d,f,"","\\@ngeqslant");i(l,d,f,"","\\@ngeqq");i(l,d,f,"⪈","\\gneq",!0);i(l,d,f,"≩","\\gneqq",!0);i(l,d,f,"","\\@gvertneqq");i(l,d,f,"⋧","\\gnsim",!0);i(l,d,f,"⪊","\\gnapprox",!0);i(l,d,f,"⊁","\\nsucc",!0);i(l,d,f,"⋡","\\nsucceq",!0);i(l,d,f,"⋩","\\succnsim",!0);i(l,d,f,"⪺","\\succnapprox",!0);i(l,d,f,"≆","\\ncong",!0);i(l,d,f,"","\\@nshortparallel");i(l,d,f,"∦","\\nparallel",!0);i(l,d,f,"⊯","\\nVDash",!0);i(l,d,f,"⋫","\\ntriangleright");i(l,d,f,"⋭","\\ntrianglerighteq",!0);i(l,d,f,"","\\@nsupseteqq");i(l,d,f,"⊋","\\supsetneq",!0);i(l,d,f,"","\\@varsupsetneq");i(l,d,f,"⫌","\\supsetneqq",!0);i(l,d,f,"","\\@varsupsetneqq");i(l,d,f,"⊮","\\nVdash",!0);i(l,d,f,"⪵","\\precneqq",!0);i(l,d,f,"⪶","\\succneqq",!0);i(l,d,f,"","\\@nsubseteqq");i(l,d,D,"⊴","\\unlhd");i(l,d,D,"⊵","\\unrhd");i(l,d,f,"↚","\\nleftarrow",!0);i(l,d,f,"↛","\\nrightarrow",!0);i(l,d,f,"⇍","\\nLeftarrow",!0);i(l,d,f,"⇏","\\nRightarrow",!0);i(l,d,f,"↮","\\nleftrightarrow",!0);i(l,d,f,"⇎","\\nLeftrightarrow",!0);i(l,d,f,"△","\\vartriangle");i(l,d,g,"ℏ","\\hslash");i(l,d,g,"▽","\\triangledown");i(l,d,g,"◊","\\lozenge");i(l,d,g,"Ⓢ","\\circledS");i(l,d,g,"®","\\circledR");i(k,d,g,"®","\\circledR");i(l,d,g,"∡","\\measuredangle",!0);i(l,d,g,"∄","\\nexists");i(l,d,g,"℧","\\mho");i(l,d,g,"Ⅎ","\\Finv",!0);i(l,d,g,"⅁","\\Game",!0);i(l,d,g,"‵","\\backprime");i(l,d,g,"▲","\\blacktriangle");i(l,d,g,"▼","\\blacktriangledown");i(l,d,g,"■","\\blacksquare");i(l,d,g,"⧫","\\blacklozenge");i(l,d,g,"★","\\bigstar");i(l,d,g,"∢","\\sphericalangle",!0);i(l,d,g,"∁","\\complement",!0);i(l,d,g,"ð","\\eth",!0);i(k,u,g,"ð","ð");i(l,d,g,"╱","\\diagup");i(l,d,g,"╲","\\diagdown");i(l,d,g,"□","\\square");i(l,d,g,"□","\\Box");i(l,d,g,"◊","\\Diamond");i(l,d,g,"¥","\\yen",!0);i(k,d,g,"¥","\\yen",!0);i(l,d,g,"✓","\\checkmark",!0);i(k,d,g,"✓","\\checkmark");i(l,d,g,"ℶ","\\beth",!0);i(l,d,g,"ℸ","\\daleth",!0);i(l,d,g,"ℷ","\\gimel",!0);i(l,d,g,"ϝ","\\digamma",!0);i(l,d,g,"ϰ","\\varkappa");i(l,d,h0,"┌","\\@ulcorner",!0);i(l,d,i0,"┐","\\@urcorner",!0);i(l,d,h0,"└","\\@llcorner",!0);i(l,d,i0,"┘","\\@lrcorner",!0);i(l,d,f,"≦","\\leqq",!0);i(l,d,f,"⩽","\\leqslant",!0);i(l,d,f,"⪕","\\eqslantless",!0);i(l,d,f,"≲","\\lesssim",!0);i(l,d,f,"⪅","\\lessapprox",!0);i(l,d,f,"≊","\\approxeq",!0);i(l,d,D,"⋖","\\lessdot");i(l,d,f,"⋘","\\lll",!0);i(l,d,f,"≶","\\lessgtr",!0);i(l,d,f,"⋚","\\lesseqgtr",!0);i(l,d,f,"⪋","\\lesseqqgtr",!0);i(l,d,f,"≑","\\doteqdot");i(l,d,f,"≓","\\risingdotseq",!0);i(l,d,f,"≒","\\fallingdotseq",!0);i(l,d,f,"∽","\\backsim",!0);i(l,d,f,"⋍","\\backsimeq",!0);i(l,d,f,"⫅","\\subseteqq",!0);i(l,d,f,"⋐","\\Subset",!0);i(l,d,f,"⊏","\\sqsubset",!0);i(l,d,f,"≼","\\preccurlyeq",!0);i(l,d,f,"⋞","\\curlyeqprec",!0);i(l,d,f,"≾","\\precsim",!0);i(l,d,f,"⪷","\\precapprox",!0);i(l,d,f,"⊲","\\vartriangleleft");i(l,d,f,"⊴","\\trianglelefteq");i(l,d,f,"⊨","\\vDash",!0);i(l,d,f,"⊪","\\Vvdash",!0);i(l,d,f,"⌣","\\smallsmile");i(l,d,f,"⌢","\\smallfrown");i(l,d,f,"≏","\\bumpeq",!0);i(l,d,f,"≎","\\Bumpeq",!0);i(l,d,f,"≧","\\geqq",!0);i(l,d,f,"⩾","\\geqslant",!0);i(l,d,f,"⪖","\\eqslantgtr",!0);i(l,d,f,"≳","\\gtrsim",!0);i(l,d,f,"⪆","\\gtrapprox",!0);i(l,d,D,"⋗","\\gtrdot");i(l,d,f,"⋙","\\ggg",!0);i(l,d,f,"≷","\\gtrless",!0);i(l,d,f,"⋛","\\gtreqless",!0);i(l,d,f,"⪌","\\gtreqqless",!0);i(l,d,f,"≖","\\eqcirc",!0);i(l,d,f,"≗","\\circeq",!0);i(l,d,f,"≜","\\triangleq",!0);i(l,d,f,"∼","\\thicksim");i(l,d,f,"≈","\\thickapprox");i(l,d,f,"⫆","\\supseteqq",!0);i(l,d,f,"⋑","\\Supset",!0);i(l,d,f,"⊐","\\sqsupset",!0);i(l,d,f,"≽","\\succcurlyeq",!0);i(l,d,f,"⋟","\\curlyeqsucc",!0);i(l,d,f,"≿","\\succsim",!0);i(l,d,f,"⪸","\\succapprox",!0);i(l,d,f,"⊳","\\vartriangleright");i(l,d,f,"⊵","\\trianglerighteq");i(l,d,f,"⊩","\\Vdash",!0);i(l,d,f,"∣","\\shortmid");i(l,d,f,"∥","\\shortparallel");i(l,d,f,"≬","\\between",!0);i(l,d,f,"⋔","\\pitchfork",!0);i(l,d,f,"∝","\\varpropto");i(l,d,f,"◀","\\blacktriangleleft");i(l,d,f,"∴","\\therefore",!0);i(l,d,f,"∍","\\backepsilon");i(l,d,f,"▶","\\blacktriangleright");i(l,d,f,"∵","\\because",!0);i(l,d,f,"⋘","\\llless");i(l,d,f,"⋙","\\gggtr");i(l,d,D,"⊲","\\lhd");i(l,d,D,"⊳","\\rhd");i(l,d,f,"≂","\\eqsim",!0);i(l,u,f,"⋈","\\Join");i(l,d,f,"≑","\\Doteq",!0);i(l,d,D,"∔","\\dotplus",!0);i(l,d,D,"∖","\\smallsetminus");i(l,d,D,"⋒","\\Cap",!0);i(l,d,D,"⋓","\\Cup",!0);i(l,d,D,"⩞","\\doublebarwedge",!0);i(l,d,D,"⊟","\\boxminus",!0);i(l,d,D,"⊞","\\boxplus",!0);i(l,d,D,"⋇","\\divideontimes",!0);i(l,d,D,"⋉","\\ltimes",!0);i(l,d,D,"⋊","\\rtimes",!0);i(l,d,D,"⋋","\\leftthreetimes",!0);i(l,d,D,"⋌","\\rightthreetimes",!0);i(l,d,D,"⋏","\\curlywedge",!0);i(l,d,D,"⋎","\\curlyvee",!0);i(l,d,D,"⊝","\\circleddash",!0);i(l,d,D,"⊛","\\circledast",!0);i(l,d,D,"⋅","\\centerdot");i(l,d,D,"⊺","\\intercal",!0);i(l,d,D,"⋒","\\doublecap");i(l,d,D,"⋓","\\doublecup");i(l,d,D,"⊠","\\boxtimes",!0);i(l,d,f,"⇢","\\dashrightarrow",!0);i(l,d,f,"⇠","\\dashleftarrow",!0);i(l,d,f,"⇇","\\leftleftarrows",!0);i(l,d,f,"⇆","\\leftrightarrows",!0);i(l,d,f,"⇚","\\Lleftarrow",!0);i(l,d,f,"↞","\\twoheadleftarrow",!0);i(l,d,f,"↢","\\leftarrowtail",!0);i(l,d,f,"↫","\\looparrowleft",!0);i(l,d,f,"⇋","\\leftrightharpoons",!0);i(l,d,f,"↶","\\curvearrowleft",!0);i(l,d,f,"↺","\\circlearrowleft",!0);i(l,d,f,"↰","\\Lsh",!0);i(l,d,f,"⇈","\\upuparrows",!0);i(l,d,f,"↿","\\upharpoonleft",!0);i(l,d,f,"⇃","\\downharpoonleft",!0);i(l,u,f,"⊶","\\origof",!0);i(l,u,f,"⊷","\\imageof",!0);i(l,d,f,"⊸","\\multimap",!0);i(l,d,f,"↭","\\leftrightsquigarrow",!0);i(l,d,f,"⇉","\\rightrightarrows",!0);i(l,d,f,"⇄","\\rightleftarrows",!0);i(l,d,f,"↠","\\twoheadrightarrow",!0);i(l,d,f,"↣","\\rightarrowtail",!0);i(l,d,f,"↬","\\looparrowright",!0);i(l,d,f,"↷","\\curvearrowright",!0);i(l,d,f,"↻","\\circlearrowright",!0);i(l,d,f,"↱","\\Rsh",!0);i(l,d,f,"⇊","\\downdownarrows",!0);i(l,d,f,"↾","\\upharpoonright",!0);i(l,d,f,"⇂","\\downharpoonright",!0);i(l,d,f,"⇝","\\rightsquigarrow",!0);i(l,d,f,"⇝","\\leadsto");i(l,d,f,"⇛","\\Rrightarrow",!0);i(l,d,f,"↾","\\restriction");i(l,u,g,"‘","`");i(l,u,g,"$","\\$");i(k,u,g,"$","\\$");i(k,u,g,"$","\\textdollar");i(l,u,g,"%","\\%");i(k,u,g,"%","\\%");i(l,u,g,"_","\\_");i(k,u,g,"_","\\_");i(k,u,g,"_","\\textunderscore");i(l,u,g,"∠","\\angle",!0);i(l,u,g,"∞","\\infty",!0);i(l,u,g,"′","\\prime");i(l,u,g,"△","\\triangle");i(l,u,g,"Γ","\\Gamma",!0);i(l,u,g,"Δ","\\Delta",!0);i(l,u,g,"Θ","\\Theta",!0);i(l,u,g,"Λ","\\Lambda",!0);i(l,u,g,"Ξ","\\Xi",!0);i(l,u,g,"Π","\\Pi",!0);i(l,u,g,"Σ","\\Sigma",!0);i(l,u,g,"Υ","\\Upsilon",!0);i(l,u,g,"Φ","\\Phi",!0);i(l,u,g,"Ψ","\\Psi",!0);i(l,u,g,"Ω","\\Omega",!0);i(l,u,g,"A","Α");i(l,u,g,"B","Β");i(l,u,g,"E","Ε");i(l,u,g,"Z","Ζ");i(l,u,g,"H","Η");i(l,u,g,"I","Ι");i(l,u,g,"K","Κ");i(l,u,g,"M","Μ");i(l,u,g,"N","Ν");i(l,u,g,"O","Ο");i(l,u,g,"P","Ρ");i(l,u,g,"T","Τ");i(l,u,g,"X","Χ");i(l,u,g,"¬","\\neg",!0);i(l,u,g,"¬","\\lnot");i(l,u,g,"⊤","\\top");i(l,u,g,"⊥","\\bot");i(l,u,g,"∅","\\emptyset");i(l,d,g,"∅","\\varnothing");i(l,u,E,"α","\\alpha",!0);i(l,u,E,"β","\\beta",!0);i(l,u,E,"γ","\\gamma",!0);i(l,u,E,"δ","\\delta",!0);i(l,u,E,"ϵ","\\epsilon",!0);i(l,u,E,"ζ","\\zeta",!0);i(l,u,E,"η","\\eta",!0);i(l,u,E,"θ","\\theta",!0);i(l,u,E,"ι","\\iota",!0);i(l,u,E,"κ","\\kappa",!0);i(l,u,E,"λ","\\lambda",!0);i(l,u,E,"μ","\\mu",!0);i(l,u,E,"ν","\\nu",!0);i(l,u,E,"ξ","\\xi",!0);i(l,u,E,"ο","\\omicron",!0);i(l,u,E,"π","\\pi",!0);i(l,u,E,"ρ","\\rho",!0);i(l,u,E,"σ","\\sigma",!0);i(l,u,E,"τ","\\tau",!0);i(l,u,E,"υ","\\upsilon",!0);i(l,u,E,"ϕ","\\phi",!0);i(l,u,E,"χ","\\chi",!0);i(l,u,E,"ψ","\\psi",!0);i(l,u,E,"ω","\\omega",!0);i(l,u,E,"ε","\\varepsilon",!0);i(l,u,E,"ϑ","\\vartheta",!0);i(l,u,E,"ϖ","\\varpi",!0);i(l,u,E,"ϱ","\\varrho",!0);i(l,u,E,"ς","\\varsigma",!0);i(l,u,E,"φ","\\varphi",!0);i(l,u,D,"∗","*",!0);i(l,u,D,"+","+");i(l,u,D,"−","-",!0);i(l,u,D,"⋅","\\cdot",!0);i(l,u,D,"∘","\\circ",!0);i(l,u,D,"÷","\\div",!0);i(l,u,D,"±","\\pm",!0);i(l,u,D,"×","\\times",!0);i(l,u,D,"∩","\\cap",!0);i(l,u,D,"∪","\\cup",!0);i(l,u,D,"∖","\\setminus",!0);i(l,u,D,"∧","\\land");i(l,u,D,"∨","\\lor");i(l,u,D,"∧","\\wedge",!0);i(l,u,D,"∨","\\vee",!0);i(l,u,g,"√","\\surd");i(l,u,h0,"⟨","\\langle",!0);i(l,u,h0,"∣","\\lvert");i(l,u,h0,"∥","\\lVert");i(l,u,i0,"?","?");i(l,u,i0,"!","!");i(l,u,i0,"⟩","\\rangle",!0);i(l,u,i0,"∣","\\rvert");i(l,u,i0,"∥","\\rVert");i(l,u,f,"=","=");i(l,u,f,":",":");i(l,u,f,"≈","\\approx",!0);i(l,u,f,"≅","\\cong",!0);i(l,u,f,"≥","\\ge");i(l,u,f,"≥","\\geq",!0);i(l,u,f,"←","\\gets");i(l,u,f,">","\\gt",!0);i(l,u,f,"∈","\\in",!0);i(l,u,f,"","\\@not");i(l,u,f,"⊂","\\subset",!0);i(l,u,f,"⊃","\\supset",!0);i(l,u,f,"⊆","\\subseteq",!0);i(l,u,f,"⊇","\\supseteq",!0);i(l,d,f,"⊈","\\nsubseteq",!0);i(l,d,f,"⊉","\\nsupseteq",!0);i(l,u,f,"⊨","\\models");i(l,u,f,"←","\\leftarrow",!0);i(l,u,f,"≤","\\le");i(l,u,f,"≤","\\leq",!0);i(l,u,f,"<","\\lt",!0);i(l,u,f,"→","\\rightarrow",!0);i(l,u,f,"→","\\to");i(l,d,f,"≱","\\ngeq",!0);i(l,d,f,"≰","\\nleq",!0);i(l,u,q0," ","\\ ");i(l,u,q0," ","\\space");i(l,u,q0," ","\\nobreakspace");i(k,u,q0," ","\\ ");i(k,u,q0," "," ");i(k,u,q0," ","\\space");i(k,u,q0," ","\\nobreakspace");i(l,u,q0,null,"\\nobreak");i(l,u,q0,null,"\\allowbreak");i(l,u,qe,",",",");i(l,u,qe,";",";");i(l,d,D,"⊼","\\barwedge",!0);i(l,d,D,"⊻","\\veebar",!0);i(l,u,D,"⊙","\\odot",!0);i(l,u,D,"⊕","\\oplus",!0);i(l,u,D,"⊗","\\otimes",!0);i(l,u,g,"∂","\\partial",!0);i(l,u,D,"⊘","\\oslash",!0);i(l,d,D,"⊚","\\circledcirc",!0);i(l,d,D,"⊡","\\boxdot",!0);i(l,u,D,"△","\\bigtriangleup");i(l,u,D,"▽","\\bigtriangledown");i(l,u,D,"†","\\dagger");i(l,u,D,"⋄","\\diamond");i(l,u,D,"⋆","\\star");i(l,u,D,"◃","\\triangleleft");i(l,u,D,"▹","\\triangleright");i(l,u,h0,"{","\\{");i(k,u,g,"{","\\{");i(k,u,g,"{","\\textbraceleft");i(l,u,i0,"}","\\}");i(k,u,g,"}","\\}");i(k,u,g,"}","\\textbraceright");i(l,u,h0,"{","\\lbrace");i(l,u,i0,"}","\\rbrace");i(l,u,h0,"[","\\lbrack",!0);i(k,u,g,"[","\\lbrack",!0);i(l,u,i0,"]","\\rbrack",!0);i(k,u,g,"]","\\rbrack",!0);i(l,u,h0,"(","\\lparen",!0);i(l,u,i0,")","\\rparen",!0);i(k,u,g,"<","\\textless",!0);i(k,u,g,">","\\textgreater",!0);i(l,u,h0,"⌊","\\lfloor",!0);i(l,u,i0,"⌋","\\rfloor",!0);i(l,u,h0,"⌈","\\lceil",!0);i(l,u,i0,"⌉","\\rceil",!0);i(l,u,g,"\\","\\backslash");i(l,u,g,"∣","|");i(l,u,g,"∣","\\vert");i(k,u,g,"|","\\textbar",!0);i(l,u,g,"∥","\\|");i(l,u,g,"∥","\\Vert");i(k,u,g,"∥","\\textbardbl");i(k,u,g,"~","\\textasciitilde");i(k,u,g,"\\","\\textbackslash");i(k,u,g,"^","\\textasciicircum");i(l,u,f,"↑","\\uparrow",!0);i(l,u,f,"⇑","\\Uparrow",!0);i(l,u,f,"↓","\\downarrow",!0);i(l,u,f,"⇓","\\Downarrow",!0);i(l,u,f,"↕","\\updownarrow",!0);i(l,u,f,"⇕","\\Updownarrow",!0);i(l,u,_,"∐","\\coprod");i(l,u,_,"⋁","\\bigvee");i(l,u,_,"⋀","\\bigwedge");i(l,u,_,"⨄","\\biguplus");i(l,u,_,"⋂","\\bigcap");i(l,u,_,"⋃","\\bigcup");i(l,u,_,"∫","\\int");i(l,u,_,"∫","\\intop");i(l,u,_,"∬","\\iint");i(l,u,_,"∭","\\iiint");i(l,u,_,"∏","\\prod");i(l,u,_,"∑","\\sum");i(l,u,_,"⨂","\\bigotimes");i(l,u,_,"⨁","\\bigoplus");i(l,u,_,"⨀","\\bigodot");i(l,u,_,"∮","\\oint");i(l,u,_,"∯","\\oiint");i(l,u,_,"∰","\\oiiint");i(l,u,_,"⨆","\\bigsqcup");i(l,u,_,"∫","\\smallint");i(k,u,te,"…","\\textellipsis");i(l,u,te,"…","\\mathellipsis");i(k,u,te,"…","\\ldots",!0);i(l,u,te,"…","\\ldots",!0);i(l,u,te,"⋯","\\@cdots",!0);i(l,u,te,"⋱","\\ddots",!0);i(l,u,g,"⋮","\\varvdots");i(l,u,W,"ˊ","\\acute");i(l,u,W,"ˋ","\\grave");i(l,u,W,"¨","\\ddot");i(l,u,W,"~","\\tilde");i(l,u,W,"ˉ","\\bar");i(l,u,W,"˘","\\breve");i(l,u,W,"ˇ","\\check");i(l,u,W,"^","\\hat");i(l,u,W,"⃗","\\vec");i(l,u,W,"˙","\\dot");i(l,u,W,"˚","\\mathring");i(l,u,E,"","\\@imath");i(l,u,E,"","\\@jmath");i(l,u,g,"ı","ı");i(l,u,g,"ȷ","ȷ");i(k,u,g,"ı","\\i",!0);i(k,u,g,"ȷ","\\j",!0);i(k,u,g,"ß","\\ss",!0);i(k,u,g,"æ","\\ae",!0);i(k,u,g,"œ","\\oe",!0);i(k,u,g,"ø","\\o",!0);i(k,u,g,"Æ","\\AE",!0);i(k,u,g,"Œ","\\OE",!0);i(k,u,g,"Ø","\\O",!0);i(k,u,W,"ˊ","\\'");i(k,u,W,"ˋ","\\`");i(k,u,W,"ˆ","\\^");i(k,u,W,"˜","\\~");i(k,u,W,"ˉ","\\=");i(k,u,W,"˘","\\u");i(k,u,W,"˙","\\.");i(k,u,W,"¸","\\c");i(k,u,W,"˚","\\r");i(k,u,W,"ˇ","\\v");i(k,u,W,"¨",'\\"');i(k,u,W,"˝","\\H");i(k,u,W,"◯","\\textcircled");var Ar={"--":!0,"---":!0,"``":!0,"''":!0};i(k,u,g,"–","--",!0);i(k,u,g,"–","\\textendash");i(k,u,g,"—","---",!0);i(k,u,g,"—","\\textemdash");i(k,u,g,"‘","`",!0);i(k,u,g,"‘","\\textquoteleft");i(k,u,g,"’","'",!0);i(k,u,g,"’","\\textquoteright");i(k,u,g,"“","``",!0);i(k,u,g,"“","\\textquotedblleft");i(k,u,g,"”","''",!0);i(k,u,g,"”","\\textquotedblright");i(l,u,g,"°","\\degree",!0);i(k,u,g,"°","\\degree");i(k,u,g,"°","\\textdegree",!0);i(l,u,g,"£","\\pounds");i(l,u,g,"£","\\mathsterling",!0);i(k,u,g,"£","\\pounds");i(k,u,g,"£","\\textsterling",!0);i(l,d,g,"✠","\\maltese");i(k,d,g,"✠","\\maltese");var Xt='0123456789/@."';for(var Ye=0;Ye0)return b0(s,p,n,t,o.concat(v));if(m){var b,w;if(m==="boldsymbol"){var x=b1(s,n,t,o,a);b=x.fontName,w=[x.fontClass]}else h?(b=Dr[m].fontName,w=[m]):(b=xe(m,t.fontWeight,t.fontShape),w=[m,t.fontWeight,t.fontShape]);if(Ee(s,b,n).metrics)return b0(s,b,n,t,o.concat(w));if(Ar.hasOwnProperty(s)&&b.slice(0,10)==="Typewriter"){for(var z=[],T=0;T{if(F0(r.classes)!==F0(e.classes)||r.skew!==e.skew||r.maxFontSize!==e.maxFontSize)return!1;if(r.classes.length===1){var t=r.classes[0];if(t==="mbin"||t==="mord")return!1}for(var a in r.style)if(r.style.hasOwnProperty(a)&&r.style[a]!==e.style[a])return!1;for(var n in e.style)if(e.style.hasOwnProperty(n)&&r.style[n]!==e.style[n])return!1;return!0},w1=r=>{for(var e=0;et&&(t=o.height),o.depth>a&&(a=o.depth),o.maxFontSize>n&&(n=o.maxFontSize)}e.height=t,e.depth=a,e.maxFontSize=n},l0=function(e,t,a,n){var s=new he(e,t,a,n);return bt(s),s},Tr=(r,e,t,a)=>new he(r,e,t,a),k1=function(e,t,a){var n=l0([e],[],t);return n.height=Math.max(a||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),n.style.borderBottomWidth=A(n.height),n.maxFontSize=1,n},S1=function(e,t,a,n){var s=new gt(e,t,a,n);return bt(s),s},Br=function(e){var t=new ue(e);return bt(t),t},M1=function(e,t){return e instanceof ue?l0([],[e],t):e},z1=function(e){if(e.positionType==="individualShift"){for(var t=e.children,a=[t[0]],n=-t[0].shift-t[0].elem.depth,s=n,o=1;o{var t=l0(["mspace"],[],e),a=K(r,e);return t.style.marginRight=A(a),t},xe=function(e,t,a){var n="";switch(e){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=e}var s;return t==="textbf"&&a==="textit"?s="BoldItalic":t==="textbf"?s="Bold":t==="textit"?s="Italic":s="Regular",n+"-"+s},Dr={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Cr={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},B1=function(e,t){var[a,n,s]=Cr[e],o=new P0(a),h=new D0([o],{width:A(n),height:A(s),style:"width:"+A(n),viewBox:"0 0 "+1e3*n+" "+1e3*s,preserveAspectRatio:"xMinYMin"}),m=Tr(["overlay"],[h],t);return m.height=s,m.style.height=A(s),m.style.width=A(n),m},y={fontMap:Dr,makeSymbol:b0,mathsym:g1,makeSpan:l0,makeSvgSpan:Tr,makeLineSpan:k1,makeAnchor:S1,makeFragment:Br,wrapFragment:M1,makeVList:A1,makeOrd:y1,makeGlue:T1,staticSvg:B1,svgData:Cr,tryCombineChars:w1},Z={number:3,unit:"mu"},X0={number:4,unit:"mu"},z0={number:5,unit:"mu"},D1={mord:{mop:Z,mbin:X0,mrel:z0,minner:Z},mop:{mord:Z,mop:Z,mrel:z0,minner:Z},mbin:{mord:X0,mop:X0,mopen:X0,minner:X0},mrel:{mord:z0,mop:z0,mopen:z0,minner:z0},mopen:{},mclose:{mop:Z,mbin:X0,mrel:z0,minner:Z},mpunct:{mord:Z,mop:Z,mrel:z0,mopen:Z,mclose:Z,mpunct:Z,minner:Z},minner:{mord:Z,mop:Z,mbin:X0,mrel:z0,mopen:Z,mpunct:Z,minner:Z}},C1={mord:{mop:Z},mop:{mord:Z,mop:Z},mbin:{},mrel:{},mopen:{},mclose:{mop:Z},mpunct:{},minner:{mop:Z}},Nr={},De={},Ce={};function B(r){for(var{type:e,names:t,props:a,handler:n,htmlBuilder:s,mathmlBuilder:o}=r,h={type:e,numArgs:a.numArgs,argTypes:a.argTypes,allowedInArgument:!!a.allowedInArgument,allowedInText:!!a.allowedInText,allowedInMath:a.allowedInMath===void 0?!0:a.allowedInMath,numOptionalArgs:a.numOptionalArgs||0,infix:!!a.infix,primitive:!!a.primitive,handler:n},m=0;m{var C=T.classes[0],N=z.classes[0];C==="mbin"&&q.contains(q1,N)?T.classes[0]="mord":N==="mbin"&&q.contains(N1,C)&&(z.classes[0]="mord")},{node:b},w,x),Kt(s,(z,T)=>{var C=ut(T),N=ut(z),H=C&&N?z.hasClass("mtight")?C1[C][N]:D1[C][N]:null;if(H)return y.makeGlue(H,p)},{node:b},w,x),s},Kt=function r(e,t,a,n,s){n&&e.push(n);for(var o=0;ow=>{e.splice(b+1,0,w),o++})(o)}n&&e.pop()},qr=function(e){return e instanceof ue||e instanceof gt||e instanceof he&&e.hasClass("enclosing")?e:null},I1=function r(e,t){var a=qr(e);if(a){var n=a.children;if(n.length){if(t==="right")return r(n[n.length-1],"right");if(t==="left")return r(n[0],"left")}}return e},ut=function(e,t){return e?(t&&(e=I1(e,t)),R1[e.classes[0]]||null):null},oe=function(e,t){var a=["nulldelimiter"].concat(e.baseSizingClasses());return C0(t.concat(a))},P=function(e,t,a){if(!e)return C0();if(De[e.type]){var n=De[e.type](e,t);if(a&&t.size!==a.size){n=C0(t.sizingClasses(a),[n],t);var s=t.sizeMultiplier/a.sizeMultiplier;n.height*=s,n.depth*=s}return n}else throw new M("Got group of unknown type: '"+e.type+"'")};function we(r,e){var t=C0(["base"],r,e),a=C0(["strut"]);return a.style.height=A(t.height+t.depth),t.depth&&(a.style.verticalAlign=A(-t.depth)),t.children.unshift(a),t}function ht(r,e){var t=null;r.length===1&&r[0].type==="tag"&&(t=r[0].tag,r=r[0].body);var a=t0(r,e,"root"),n;a.length===2&&a[1].hasClass("tag")&&(n=a.pop());for(var s=[],o=[],h=0;h0&&(s.push(we(o,e)),o=[]),s.push(a[h]));o.length>0&&s.push(we(o,e));var p;t?(p=we(t0(t,e,!0)),p.classes=["tag"],s.push(p)):n&&s.push(n);var v=C0(["katex-html"],s);if(v.setAttribute("aria-hidden","true"),p){var b=p.children[0];b.style.height=A(v.height+v.depth),v.depth&&(b.style.verticalAlign=A(-v.depth))}return v}function Er(r){return new ue(r)}class c0{constructor(e,t,a){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=a||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=F0(this.classes));for(var a=0;a0&&(e+=' class ="'+q.escape(F0(this.classes))+'"'),e+=">";for(var a=0;a",e}toText(){return this.children.map(e=>e.toText()).join("")}}class ie{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return q.escape(this.toText())}toText(){return this.text}}class H1{constructor(e){this.width=void 0,this.character=void 0,this.width=e,e>=.05555&&e<=.05556?this.character=" ":e>=.1666&&e<=.1667?this.character=" ":e>=.2222&&e<=.2223?this.character=" ":e>=.2777&&e<=.2778?this.character="  ":e>=-.05556&&e<=-.05555?this.character=" ⁣":e>=-.1667&&e<=-.1666?this.character=" ⁣":e>=-.2223&&e<=-.2222?this.character=" ⁣":e>=-.2778&&e<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",A(this.width)),e}toMarkup(){return this.character?""+this.character+"":''}toText(){return this.character?this.character:" "}}var S={MathNode:c0,TextNode:ie,SpaceNode:H1,newDocumentFragment:Er},v0=function(e,t,a){return Y[t][e]&&Y[t][e].replace&&e.charCodeAt(0)!==55349&&!(Ar.hasOwnProperty(e)&&a&&(a.fontFamily&&a.fontFamily.slice(4,6)==="tt"||a.font&&a.font.slice(4,6)==="tt"))&&(e=Y[t][e].replace),new S.TextNode(e)},yt=function(e){return e.length===1?e[0]:new S.MathNode("mrow",e)},xt=function(e,t){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold";var a=t.font;if(!a||a==="mathnormal")return null;var n=e.mode;if(a==="mathit")return"italic";if(a==="boldsymbol")return e.type==="textord"?"bold":"bold-italic";if(a==="mathbf")return"bold";if(a==="mathbb")return"double-struck";if(a==="mathfrak")return"fraktur";if(a==="mathscr"||a==="mathcal")return"script";if(a==="mathsf")return"sans-serif";if(a==="mathtt")return"monospace";var s=e.text;if(q.contains(["\\imath","\\jmath"],s))return null;Y[n][s]&&Y[n][s].replace&&(s=Y[n][s].replace);var o=y.fontMap[a].fontName;return vt(s,o,n)?y.fontMap[a].variant:null},o0=function(e,t,a){if(e.length===1){var n=X(e[0],t);return a&&n instanceof c0&&n.type==="mo"&&(n.setAttribute("lspace","0em"),n.setAttribute("rspace","0em")),[n]}for(var s=[],o,h=0;h0&&(b.text=b.text.slice(0,1)+"̸"+b.text.slice(1),s.pop())}}}s.push(m),o=m}return s},V0=function(e,t,a){return yt(o0(e,t,a))},X=function(e,t){if(!e)return new S.MathNode("mrow");if(Ce[e.type]){var a=Ce[e.type](e,t);return a}else throw new M("Got group of unknown type: '"+e.type+"'")};function Jt(r,e,t,a,n){var s=o0(r,t),o;s.length===1&&s[0]instanceof c0&&q.contains(["mrow","mtable"],s[0].type)?o=s[0]:o=new S.MathNode("mrow",s);var h=new S.MathNode("annotation",[new S.TextNode(e)]);h.setAttribute("encoding","application/x-tex");var m=new S.MathNode("semantics",[o,h]),p=new S.MathNode("math",[m]);p.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),a&&p.setAttribute("display","block");var v=n?"katex":"katex-mathml";return y.makeSpan([v],[p])}var Rr=function(e){return new A0({style:e.displayMode?R.DISPLAY:R.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},Ir=function(e,t){if(t.displayMode){var a=["katex-display"];t.leqno&&a.push("leqno"),t.fleqn&&a.push("fleqn"),e=y.makeSpan(a,[e])}return e},L1=function(e,t,a){var n=Rr(a),s;if(a.output==="mathml")return Jt(e,t,n,a.displayMode,!0);if(a.output==="html"){var o=ht(e,n);s=y.makeSpan(["katex"],[o])}else{var h=Jt(e,t,n,a.displayMode,!1),m=ht(e,n);s=y.makeSpan(["katex"],[h,m])}return Ir(s,a)},O1=function(e,t,a){var n=Rr(a),s=ht(e,n),o=y.makeSpan(["katex"],[s]);return Ir(o,a)},F1={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},P1=function(e){var t=new S.MathNode("mo",[new S.TextNode(F1[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},V1={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},G1=function(e){return e.type==="ordgroup"?e.body.length:1},U1=function(e,t){function a(){var h=4e5,m=e.label.slice(1);if(q.contains(["widehat","widecheck","widetilde","utilde"],m)){var p=e,v=G1(p.base),b,w,x;if(v>5)m==="widehat"||m==="widecheck"?(b=420,h=2364,x=.42,w=m+"4"):(b=312,h=2340,x=.34,w="tilde4");else{var z=[1,1,2,2,3,3][v];m==="widehat"||m==="widecheck"?(h=[0,1062,2364,2364,2364][z],b=[0,239,300,360,420][z],x=[0,.24,.3,.3,.36,.42][z],w=m+z):(h=[0,600,1033,2339,2340][z],b=[0,260,286,306,312][z],x=[0,.26,.286,.3,.306,.34][z],w="tilde"+z)}var T=new P0(w),C=new D0([T],{width:"100%",height:A(x),viewBox:"0 0 "+h+" "+b,preserveAspectRatio:"none"});return{span:y.makeSvgSpan([],[C],t),minWidth:0,height:x}}else{var N=[],H=V1[m],[L,G,F]=H,U=F/1e3,V=L.length,j,$;if(V===1){var M0=H[3];j=["hide-tail"],$=[M0]}else if(V===2)j=["halfarrow-left","halfarrow-right"],$=["xMinYMin","xMaxYMin"];else if(V===3)j=["brace-left","brace-center","brace-right"],$=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support - `+V+" children.");for(var r0=0;r00&&(n.style.minWidth=A(s)),n},$1=function(e,t,a,n,s){var o,h=e.height+e.depth+a+n;if(/fbox|color|angl/.test(t)){if(o=y.makeSpan(["stretchy",t],[],s),t==="fbox"){var m=s.color&&s.getColor();m&&(o.style.borderColor=m)}}else{var p=[];/^[bx]cancel$/.test(t)&&p.push(new lt({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&p.push(new lt({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var v=new D0(p,{width:"100%",height:A(h)});o=y.makeSvgSpan([],[v],s)}return o.height=h,o.style.height=A(h),o},N0={encloseSpan:$1,mathMLnode:P1,svgSpan:U1};function O(r,e){if(!r||r.type!==e)throw new Error("Expected node of type "+e+", but got "+(r?"node of type "+r.type:String(r)));return r}function wt(r){var e=Re(r);if(!e)throw new Error("Expected node of symbol group type, but got "+(r?"node of type "+r.type:String(r)));return e}function Re(r){return r&&(r.type==="atom"||p1.hasOwnProperty(r.type))?r:null}var kt=(r,e)=>{var t,a,n;r&&r.type==="supsub"?(a=O(r.base,"accent"),t=a.base,r.base=t,n=d1(P(r,e)),r.base=a):(a=O(r,"accent"),t=a.base);var s=P(t,e.havingCrampedStyle()),o=a.isShifty&&q.isCharacterBox(t),h=0;if(o){var m=q.getBaseElem(t),p=P(m,e.havingCrampedStyle());h=$t(p).skew}var v=a.label==="\\c",b=v?s.height+s.depth:Math.min(s.height,e.fontMetrics().xHeight),w;if(a.isStretchy)w=N0.svgSpan(a,e),w=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:w,wrapperClasses:["svg-align"],wrapperStyle:h>0?{width:"calc(100% - "+A(2*h)+")",marginLeft:A(2*h)}:void 0}]},e);else{var x,z;a.label==="\\vec"?(x=y.staticSvg("vec",e),z=y.svgData.vec[1]):(x=y.makeOrd({mode:a.mode,text:a.label},e,"textord"),x=$t(x),x.italic=0,z=x.width,v&&(b+=x.depth)),w=y.makeSpan(["accent-body"],[x]);var T=a.label==="\\textcircled";T&&(w.classes.push("accent-full"),b=s.height);var C=h;T||(C-=z/2),w.style.left=A(C),a.label==="\\textcircled"&&(w.style.top=".2em"),w=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-b},{type:"elem",elem:w}]},e)}var N=y.makeSpan(["mord","accent"],[w],e);return n?(n.children[0]=N,n.height=Math.max(N.height,n.height),n.classes[0]="mord",n):N},Hr=(r,e)=>{var t=r.isStretchy?N0.mathMLnode(r.label):new S.MathNode("mo",[v0(r.label,r.mode)]),a=new S.MathNode("mover",[X(r.base,e),t]);return a.setAttribute("accent","true"),a},X1=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(r=>"\\"+r).join("|"));B({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(r,e)=>{var t=Ne(e[0]),a=!X1.test(r.funcName),n=!a||r.funcName==="\\widehat"||r.funcName==="\\widetilde"||r.funcName==="\\widecheck";return{type:"accent",mode:r.parser.mode,label:r.funcName,isStretchy:a,isShifty:n,base:t}},htmlBuilder:kt,mathmlBuilder:Hr});B({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(r,e)=>{var t=e[0],a=r.parser.mode;return a==="math"&&(r.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+r.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:r.funcName,isStretchy:!1,isShifty:!0,base:t}},htmlBuilder:kt,mathmlBuilder:Hr});B({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0];return{type:"accentUnder",mode:t.mode,label:a,base:n}},htmlBuilder:(r,e)=>{var t=P(r.base,e),a=N0.svgSpan(r,e),n=r.label==="\\utilde"?.12:0,s=y.makeVList({positionType:"top",positionData:t.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:n},{type:"elem",elem:t}]},e);return y.makeSpan(["mord","accentunder"],[s],e)},mathmlBuilder:(r,e)=>{var t=N0.mathMLnode(r.label),a=new S.MathNode("munder",[X(r.base,e),t]);return a.setAttribute("accentunder","true"),a}});var ke=r=>{var e=new S.MathNode("mpadded",r?[r]:[]);return e.setAttribute("width","+0.6em"),e.setAttribute("lspace","0.3em"),e};B({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:a,funcName:n}=r;return{type:"xArrow",mode:a.mode,label:n,body:e[0],below:t[0]}},htmlBuilder(r,e){var t=e.style,a=e.havingStyle(t.sup()),n=y.wrapFragment(P(r.body,a,e),e),s=r.label.slice(0,2)==="\\x"?"x":"cd";n.classes.push(s+"-arrow-pad");var o;r.below&&(a=e.havingStyle(t.sub()),o=y.wrapFragment(P(r.below,a,e),e),o.classes.push(s+"-arrow-pad"));var h=N0.svgSpan(r,e),m=-e.fontMetrics().axisHeight+.5*h.height,p=-e.fontMetrics().axisHeight-.5*h.height-.111;(n.depth>.25||r.label==="\\xleftequilibrium")&&(p-=n.depth);var v;if(o){var b=-e.fontMetrics().axisHeight+o.height+.5*h.height+.111;v=y.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:p},{type:"elem",elem:h,shift:m},{type:"elem",elem:o,shift:b}]},e)}else v=y.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:p},{type:"elem",elem:h,shift:m}]},e);return v.children[0].children[0].children[1].classes.push("svg-align"),y.makeSpan(["mrel","x-arrow"],[v],e)},mathmlBuilder(r,e){var t=N0.mathMLnode(r.label);t.setAttribute("minsize",r.label.charAt(0)==="x"?"1.75em":"3.0em");var a;if(r.body){var n=ke(X(r.body,e));if(r.below){var s=ke(X(r.below,e));a=new S.MathNode("munderover",[t,s,n])}else a=new S.MathNode("mover",[t,n])}else if(r.below){var o=ke(X(r.below,e));a=new S.MathNode("munder",[t,o])}else a=ke(),a=new S.MathNode("mover",[t,a]);return a}});var Y1=y.makeSpan;function Lr(r,e){var t=t0(r.body,e,!0);return Y1([r.mclass],t,e)}function Or(r,e){var t,a=o0(r.body,e);return r.mclass==="minner"?t=new S.MathNode("mpadded",a):r.mclass==="mord"?r.isCharacterBox?(t=a[0],t.type="mi"):t=new S.MathNode("mi",a):(r.isCharacterBox?(t=a[0],t.type="mo"):t=new S.MathNode("mo",a),r.mclass==="mbin"?(t.attributes.lspace="0.22em",t.attributes.rspace="0.22em"):r.mclass==="mpunct"?(t.attributes.lspace="0em",t.attributes.rspace="0.17em"):r.mclass==="mopen"||r.mclass==="mclose"?(t.attributes.lspace="0em",t.attributes.rspace="0em"):r.mclass==="minner"&&(t.attributes.lspace="0.0556em",t.attributes.width="+0.1111em")),t}B({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(r,e){var{parser:t,funcName:a}=r,n=e[0];return{type:"mclass",mode:t.mode,mclass:"m"+a.slice(5),body:Q(n),isCharacterBox:q.isCharacterBox(n)}},htmlBuilder:Lr,mathmlBuilder:Or});var Ie=r=>{var e=r.type==="ordgroup"&&r.body.length?r.body[0]:r;return e.type==="atom"&&(e.family==="bin"||e.family==="rel")?"m"+e.family:"mord"};B({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(r,e){var{parser:t}=r;return{type:"mclass",mode:t.mode,mclass:Ie(e[0]),body:Q(e[1]),isCharacterBox:q.isCharacterBox(e[1])}}});B({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(r,e){var{parser:t,funcName:a}=r,n=e[1],s=e[0],o;a!=="\\stackrel"?o=Ie(n):o="mrel";var h={type:"op",mode:n.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:a!=="\\stackrel",body:Q(n)},m={type:"supsub",mode:s.mode,base:h,sup:a==="\\underset"?null:s,sub:a==="\\underset"?s:null};return{type:"mclass",mode:t.mode,mclass:o,body:[m],isCharacterBox:q.isCharacterBox(m)}},htmlBuilder:Lr,mathmlBuilder:Or});B({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"pmb",mode:t.mode,mclass:Ie(e[0]),body:Q(e[0])}},htmlBuilder(r,e){var t=t0(r.body,e,!0),a=y.makeSpan([r.mclass],t,e);return a.style.textShadow="0.02em 0.01em 0.04px",a},mathmlBuilder(r,e){var t=o0(r.body,e),a=new S.MathNode("mstyle",t);return a.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),a}});var W1={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Qt=()=>({type:"styling",body:[],mode:"math",style:"display"}),_t=r=>r.type==="textord"&&r.text==="@",j1=(r,e)=>(r.type==="mathord"||r.type==="atom")&&r.text===e;function Z1(r,e,t){var a=W1[r];switch(a){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return t.callFunction(a,[e[0]],[e[1]]);case"\\uparrow":case"\\downarrow":{var n=t.callFunction("\\\\cdleft",[e[0]],[]),s={type:"atom",text:a,mode:"math",family:"rel"},o=t.callFunction("\\Big",[s],[]),h=t.callFunction("\\\\cdright",[e[1]],[]),m={type:"ordgroup",mode:"math",body:[n,o,h]};return t.callFunction("\\\\cdparent",[m],[])}case"\\\\cdlongequal":return t.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var p={type:"textord",text:"\\Vert",mode:"math"};return t.callFunction("\\Big",[p],[])}default:return{type:"textord",text:" ",mode:"math"}}}function K1(r){var e=[];for(r.gullet.beginGroup(),r.gullet.macros.set("\\cr","\\\\\\relax"),r.gullet.beginGroup();;){e.push(r.parseExpression(!1,"\\\\")),r.gullet.endGroup(),r.gullet.beginGroup();var t=r.fetch().text;if(t==="&"||t==="\\\\")r.consume();else if(t==="\\end"){e[e.length-1].length===0&&e.pop();break}else throw new M("Expected \\\\ or \\cr or \\end",r.nextToken)}for(var a=[],n=[a],s=0;s-1))if("<>AV".indexOf(p)>-1)for(var b=0;b<2;b++){for(var w=!0,x=m+1;xAV=|." after @',o[m]);var z=Z1(p,v,r),T={type:"styling",body:[z],mode:"math",style:"display"};a.push(T),h=Qt()}s%2===0?a.push(h):a.shift(),a=[],n.push(a)}r.gullet.endGroup(),r.gullet.endGroup();var C=new Array(n[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:n,arraystretch:1,addJot:!0,rowGaps:[null],cols:C,colSeparationType:"CD",hLinesBeforeRow:new Array(n.length+1).fill([])}}B({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:a}=r;return{type:"cdlabel",mode:t.mode,side:a.slice(4),label:e[0]}},htmlBuilder(r,e){var t=e.havingStyle(e.style.sup()),a=y.wrapFragment(P(r.label,t,e),e);return a.classes.push("cd-label-"+r.side),a.style.bottom=A(.8-a.depth),a.height=0,a.depth=0,a},mathmlBuilder(r,e){var t=new S.MathNode("mrow",[X(r.label,e)]);return t=new S.MathNode("mpadded",[t]),t.setAttribute("width","0"),r.side==="left"&&t.setAttribute("lspace","-1width"),t.setAttribute("voffset","0.7em"),t=new S.MathNode("mstyle",[t]),t.setAttribute("displaystyle","false"),t.setAttribute("scriptlevel","1"),t}});B({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(r,e){var{parser:t}=r;return{type:"cdlabelparent",mode:t.mode,fragment:e[0]}},htmlBuilder(r,e){var t=y.wrapFragment(P(r.fragment,e),e);return t.classes.push("cd-vert-arrow"),t},mathmlBuilder(r,e){return new S.MathNode("mrow",[X(r.fragment,e)])}});B({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(r,e){for(var{parser:t}=r,a=O(e[0],"ordgroup"),n=a.body,s="",o=0;o=1114111)throw new M("\\@char with invalid code point "+s);return m<=65535?p=String.fromCharCode(m):(m-=65536,p=String.fromCharCode((m>>10)+55296,(m&1023)+56320)),{type:"textord",mode:t.mode,text:p}}});var Fr=(r,e)=>{var t=t0(r.body,e.withColor(r.color),!1);return y.makeFragment(t)},Pr=(r,e)=>{var t=o0(r.body,e.withColor(r.color)),a=new S.MathNode("mstyle",t);return a.setAttribute("mathcolor",r.color),a};B({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(r,e){var{parser:t}=r,a=O(e[0],"color-token").color,n=e[1];return{type:"color",mode:t.mode,color:a,body:Q(n)}},htmlBuilder:Fr,mathmlBuilder:Pr});B({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(r,e){var{parser:t,breakOnTokenText:a}=r,n=O(e[0],"color-token").color;t.gullet.macros.set("\\current@color",n);var s=t.parseExpression(!0,a);return{type:"color",mode:t.mode,color:n,body:s}},htmlBuilder:Fr,mathmlBuilder:Pr});B({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(r,e,t){var{parser:a}=r,n=a.gullet.future().text==="["?a.parseSizeGroup(!0):null,s=!a.settings.displayMode||!a.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:a.mode,newLine:s,size:n&&O(n,"size").value}},htmlBuilder(r,e){var t=y.makeSpan(["mspace"],[],e);return r.newLine&&(t.classes.push("newline"),r.size&&(t.style.marginTop=A(K(r.size,e)))),t},mathmlBuilder(r,e){var t=new S.MathNode("mspace");return r.newLine&&(t.setAttribute("linebreak","newline"),r.size&&t.setAttribute("height",A(K(r.size,e)))),t}});var mt={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Vr=r=>{var e=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(e))throw new M("Expected a control sequence",r);return e},J1=r=>{var e=r.gullet.popToken();return e.text==="="&&(e=r.gullet.popToken(),e.text===" "&&(e=r.gullet.popToken())),e},Gr=(r,e,t,a)=>{var n=r.gullet.macros.get(t.text);n==null&&(t.noexpand=!0,n={tokens:[t],numArgs:0,unexpandable:!r.gullet.isExpandable(t.text)}),r.gullet.macros.set(e,n,a)};B({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e,funcName:t}=r;e.consumeSpaces();var a=e.fetch();if(mt[a.text])return(t==="\\global"||t==="\\\\globallong")&&(a.text=mt[a.text]),O(e.parseFunction(),"internal");throw new M("Invalid token after macro prefix",a)}});B({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,a=e.gullet.popToken(),n=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(n))throw new M("Expected a control sequence",a);for(var s=0,o,h=[[]];e.gullet.future().text!=="{";)if(a=e.gullet.popToken(),a.text==="#"){if(e.gullet.future().text==="{"){o=e.gullet.future(),h[s].push("{");break}if(a=e.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new M('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==s+1)throw new M('Argument number "'+a.text+'" out of order');s++,h.push([])}else{if(a.text==="EOF")throw new M("Expected a macro definition");h[s].push(a.text)}var{tokens:m}=e.gullet.consumeArg();return o&&m.unshift(o),(t==="\\edef"||t==="\\xdef")&&(m=e.gullet.expandTokens(m),m.reverse()),e.gullet.macros.set(n,{tokens:m,numArgs:s,delimiters:h},t===mt[t]),{type:"internal",mode:e.mode}}});B({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,a=Vr(e.gullet.popToken());e.gullet.consumeSpaces();var n=J1(e);return Gr(e,a,n,t==="\\\\globallet"),{type:"internal",mode:e.mode}}});B({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r){var{parser:e,funcName:t}=r,a=Vr(e.gullet.popToken()),n=e.gullet.popToken(),s=e.gullet.popToken();return Gr(e,a,s,t==="\\\\globalfuture"),e.gullet.pushToken(s),e.gullet.pushToken(n),{type:"internal",mode:e.mode}}});var ne=function(e,t,a){var n=Y.math[e]&&Y.math[e].replace,s=vt(n||e,t,a);if(!s)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return s},St=function(e,t,a,n){var s=a.havingBaseStyle(t),o=y.makeSpan(n.concat(s.sizingClasses(a)),[e],a),h=s.sizeMultiplier/a.sizeMultiplier;return o.height*=h,o.depth*=h,o.maxFontSize=s.sizeMultiplier,o},Ur=function(e,t,a){var n=t.havingBaseStyle(a),s=(1-t.sizeMultiplier/n.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=A(s),e.height-=s,e.depth+=s},Q1=function(e,t,a,n,s,o){var h=y.makeSymbol(e,"Main-Regular",s,n),m=St(h,t,n,o);return a&&Ur(m,n,t),m},_1=function(e,t,a,n){return y.makeSymbol(e,"Size"+t+"-Regular",a,n)},$r=function(e,t,a,n,s,o){var h=_1(e,t,s,n),m=St(y.makeSpan(["delimsizing","size"+t],[h],n),R.TEXT,n,o);return a&&Ur(m,n,R.TEXT),m},Ke=function(e,t,a){var n;t==="Size1-Regular"?n="delim-size1":n="delim-size4";var s=y.makeSpan(["delimsizinginner",n],[y.makeSpan([],[y.makeSymbol(e,t,a)])]);return{type:"elem",elem:s}},Je=function(e,t,a){var n=x0["Size4-Regular"][e.charCodeAt(0)]?x0["Size4-Regular"][e.charCodeAt(0)][4]:x0["Size1-Regular"][e.charCodeAt(0)][4],s=new P0("inner",i1(e,Math.round(1e3*t))),o=new D0([s],{width:A(n),height:A(t),style:"width:"+A(n),viewBox:"0 0 "+1e3*n+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),h=y.makeSvgSpan([],[o],a);return h.height=t,h.style.height=A(t),h.style.width=A(n),{type:"elem",elem:h}},ct=.008,Se={type:"kern",size:-1*ct},e4=["|","\\lvert","\\rvert","\\vert"],t4=["\\|","\\lVert","\\rVert","\\Vert"],Xr=function(e,t,a,n,s,o){var h,m,p,v,b="",w=0;h=p=v=e,m=null;var x="Size1-Regular";e==="\\uparrow"?p=v="⏐":e==="\\Uparrow"?p=v="‖":e==="\\downarrow"?h=p="⏐":e==="\\Downarrow"?h=p="‖":e==="\\updownarrow"?(h="\\uparrow",p="⏐",v="\\downarrow"):e==="\\Updownarrow"?(h="\\Uparrow",p="‖",v="\\Downarrow"):q.contains(e4,e)?(p="∣",b="vert",w=333):q.contains(t4,e)?(p="∥",b="doublevert",w=556):e==="["||e==="\\lbrack"?(h="⎡",p="⎢",v="⎣",x="Size4-Regular",b="lbrack",w=667):e==="]"||e==="\\rbrack"?(h="⎤",p="⎥",v="⎦",x="Size4-Regular",b="rbrack",w=667):e==="\\lfloor"||e==="⌊"?(p=h="⎢",v="⎣",x="Size4-Regular",b="lfloor",w=667):e==="\\lceil"||e==="⌈"?(h="⎡",p=v="⎢",x="Size4-Regular",b="lceil",w=667):e==="\\rfloor"||e==="⌋"?(p=h="⎥",v="⎦",x="Size4-Regular",b="rfloor",w=667):e==="\\rceil"||e==="⌉"?(h="⎤",p=v="⎥",x="Size4-Regular",b="rceil",w=667):e==="("||e==="\\lparen"?(h="⎛",p="⎜",v="⎝",x="Size4-Regular",b="lparen",w=875):e===")"||e==="\\rparen"?(h="⎞",p="⎟",v="⎠",x="Size4-Regular",b="rparen",w=875):e==="\\{"||e==="\\lbrace"?(h="⎧",m="⎨",v="⎩",p="⎪",x="Size4-Regular"):e==="\\}"||e==="\\rbrace"?(h="⎫",m="⎬",v="⎭",p="⎪",x="Size4-Regular"):e==="\\lgroup"||e==="⟮"?(h="⎧",v="⎩",p="⎪",x="Size4-Regular"):e==="\\rgroup"||e==="⟯"?(h="⎫",v="⎭",p="⎪",x="Size4-Regular"):e==="\\lmoustache"||e==="⎰"?(h="⎧",v="⎭",p="⎪",x="Size4-Regular"):(e==="\\rmoustache"||e==="⎱")&&(h="⎫",v="⎩",p="⎪",x="Size4-Regular");var z=ne(h,x,s),T=z.height+z.depth,C=ne(p,x,s),N=C.height+C.depth,H=ne(v,x,s),L=H.height+H.depth,G=0,F=1;if(m!==null){var U=ne(m,x,s);G=U.height+U.depth,F=2}var V=T+L+G,j=Math.max(0,Math.ceil((t-V)/(F*N))),$=V+j*F*N,M0=n.fontMetrics().axisHeight;a&&(M0*=n.sizeMultiplier);var r0=$/2-M0,e0=[];if(b.length>0){var U0=$-T-L,s0=Math.round($*1e3),g0=s1(b,Math.round(U0*1e3)),E0=new P0(b,g0),W0=(w/1e3).toFixed(3)+"em",j0=(s0/1e3).toFixed(3)+"em",Fe=new D0([E0],{width:W0,height:j0,viewBox:"0 0 "+w+" "+s0}),R0=y.makeSvgSpan([],[Fe],n);R0.height=s0/1e3,R0.style.width=W0,R0.style.height=j0,e0.push({type:"elem",elem:R0})}else{if(e0.push(Ke(v,x,s)),e0.push(Se),m===null){var I0=$-T-L+2*ct;e0.push(Je(p,I0,n))}else{var m0=($-T-L-G)/2+2*ct;e0.push(Je(p,m0,n)),e0.push(Se),e0.push(Ke(m,x,s)),e0.push(Se),e0.push(Je(p,m0,n))}e0.push(Se),e0.push(Ke(h,x,s))}var ae=n.havingBaseStyle(R.TEXT),Pe=y.makeVList({positionType:"bottom",positionData:r0,children:e0},ae);return St(y.makeSpan(["delimsizing","mult"],[Pe],ae),R.TEXT,n,o)},Qe=80,_e=.08,et=function(e,t,a,n,s){var o=n1(e,n,a),h=new P0(e,o),m=new D0([h],{width:"400em",height:A(t),viewBox:"0 0 400000 "+a,preserveAspectRatio:"xMinYMin slice"});return y.makeSvgSpan(["hide-tail"],[m],s)},r4=function(e,t){var a=t.havingBaseSizing(),n=Zr("\\surd",e*a.sizeMultiplier,jr,a),s=a.sizeMultiplier,o=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),h,m=0,p=0,v=0,b;return n.type==="small"?(v=1e3+1e3*o+Qe,e<1?s=1:e<1.4&&(s=.7),m=(1+o+_e)/s,p=(1+o)/s,h=et("sqrtMain",m,v,o,t),h.style.minWidth="0.853em",b=.833/s):n.type==="large"?(v=(1e3+Qe)*se[n.size],p=(se[n.size]+o)/s,m=(se[n.size]+o+_e)/s,h=et("sqrtSize"+n.size,m,v,o,t),h.style.minWidth="1.02em",b=1/s):(m=e+o+_e,p=e+o,v=Math.floor(1e3*e+o)+Qe,h=et("sqrtTall",m,v,o,t),h.style.minWidth="0.742em",b=1.056),h.height=p,h.style.height=A(m),{span:h,advanceWidth:b,ruleWidth:(t.fontMetrics().sqrtRuleThickness+o)*s}},Yr=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],a4=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],Wr=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],se=[0,1.2,1.8,2.4,3],n4=function(e,t,a,n,s){if(e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle"),q.contains(Yr,e)||q.contains(Wr,e))return $r(e,t,!1,a,n,s);if(q.contains(a4,e))return Xr(e,se[t],!1,a,n,s);throw new M("Illegal delimiter: '"+e+"'")},i4=[{type:"small",style:R.SCRIPTSCRIPT},{type:"small",style:R.SCRIPT},{type:"small",style:R.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],s4=[{type:"small",style:R.SCRIPTSCRIPT},{type:"small",style:R.SCRIPT},{type:"small",style:R.TEXT},{type:"stack"}],jr=[{type:"small",style:R.SCRIPTSCRIPT},{type:"small",style:R.SCRIPT},{type:"small",style:R.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],l4=function(e){if(e.type==="small")return"Main-Regular";if(e.type==="large")return"Size"+e.size+"-Regular";if(e.type==="stack")return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},Zr=function(e,t,a,n){for(var s=Math.min(2,3-n.style.size),o=s;ot)return a[o]}return a[a.length-1]},Kr=function(e,t,a,n,s,o){e==="<"||e==="\\lt"||e==="⟨"?e="\\langle":(e===">"||e==="\\gt"||e==="⟩")&&(e="\\rangle");var h;q.contains(Wr,e)?h=i4:q.contains(Yr,e)?h=jr:h=s4;var m=Zr(e,t,h,n);return m.type==="small"?Q1(e,m.style,a,n,s,o):m.type==="large"?$r(e,m.size,a,n,s,o):Xr(e,t,a,n,s,o)},o4=function(e,t,a,n,s,o){var h=n.fontMetrics().axisHeight*n.sizeMultiplier,m=901,p=5/n.fontMetrics().ptPerEm,v=Math.max(t-h,a+h),b=Math.max(v/500*m,2*v-p);return Kr(e,b,!0,n,s,o)},B0={sqrtImage:r4,sizedDelim:n4,sizeToMaxHeight:se,customSizedDelim:Kr,leftRightDelim:o4},er={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},u4=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function He(r,e){var t=Re(r);if(t&&q.contains(u4,t.text))return t;throw t?new M("Invalid delimiter '"+t.text+"' after '"+e.funcName+"'",r):new M("Invalid delimiter type '"+r.type+"'",r)}B({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(r,e)=>{var t=He(e[0],r);return{type:"delimsizing",mode:r.parser.mode,size:er[r.funcName].size,mclass:er[r.funcName].mclass,delim:t.text}},htmlBuilder:(r,e)=>r.delim==="."?y.makeSpan([r.mclass]):B0.sizedDelim(r.delim,r.size,e,r.mode,[r.mclass]),mathmlBuilder:r=>{var e=[];r.delim!=="."&&e.push(v0(r.delim,r.mode));var t=new S.MathNode("mo",e);r.mclass==="mopen"||r.mclass==="mclose"?t.setAttribute("fence","true"):t.setAttribute("fence","false"),t.setAttribute("stretchy","true");var a=A(B0.sizeToMaxHeight[r.size]);return t.setAttribute("minsize",a),t.setAttribute("maxsize",a),t}});function tr(r){if(!r.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}B({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=r.parser.gullet.macros.get("\\current@color");if(t&&typeof t!="string")throw new M("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:r.parser.mode,delim:He(e[0],r).text,color:t}}});B({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=He(e[0],r),a=r.parser;++a.leftrightDepth;var n=a.parseExpression(!1);--a.leftrightDepth,a.expect("\\right",!1);var s=O(a.parseFunction(),"leftright-right");return{type:"leftright",mode:a.mode,body:n,left:t.text,right:s.delim,rightColor:s.color}},htmlBuilder:(r,e)=>{tr(r);for(var t=t0(r.body,e,!0,["mopen","mclose"]),a=0,n=0,s=!1,o=0;o{tr(r);var t=o0(r.body,e);if(r.left!=="."){var a=new S.MathNode("mo",[v0(r.left,r.mode)]);a.setAttribute("fence","true"),t.unshift(a)}if(r.right!=="."){var n=new S.MathNode("mo",[v0(r.right,r.mode)]);n.setAttribute("fence","true"),r.rightColor&&n.setAttribute("mathcolor",r.rightColor),t.push(n)}return yt(t)}});B({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var t=He(e[0],r);if(!r.parser.leftrightDepth)throw new M("\\middle without preceding \\left",t);return{type:"middle",mode:r.parser.mode,delim:t.text}},htmlBuilder:(r,e)=>{var t;if(r.delim===".")t=oe(e,[]);else{t=B0.sizedDelim(r.delim,1,e,r.mode,[]);var a={delim:r.delim,options:e};t.isMiddle=a}return t},mathmlBuilder:(r,e)=>{var t=r.delim==="\\vert"||r.delim==="|"?v0("|","text"):v0(r.delim,r.mode),a=new S.MathNode("mo",[t]);return a.setAttribute("fence","true"),a.setAttribute("lspace","0.05em"),a.setAttribute("rspace","0.05em"),a}});var Mt=(r,e)=>{var t=y.wrapFragment(P(r.body,e),e),a=r.label.slice(1),n=e.sizeMultiplier,s,o=0,h=q.isCharacterBox(r.body);if(a==="sout")s=y.makeSpan(["stretchy","sout"]),s.height=e.fontMetrics().defaultRuleThickness/n,o=-.5*e.fontMetrics().xHeight;else if(a==="phase"){var m=K({number:.6,unit:"pt"},e),p=K({number:.35,unit:"ex"},e),v=e.havingBaseSizing();n=n/v.sizeMultiplier;var b=t.height+t.depth+m+p;t.style.paddingLeft=A(b/2+m);var w=Math.floor(1e3*b*n),x=r1(w),z=new D0([new P0("phase",x)],{width:"400em",height:A(w/1e3),viewBox:"0 0 400000 "+w,preserveAspectRatio:"xMinYMin slice"});s=y.makeSvgSpan(["hide-tail"],[z],e),s.style.height=A(b),o=t.depth+m+p}else{/cancel/.test(a)?h||t.classes.push("cancel-pad"):a==="angl"?t.classes.push("anglpad"):t.classes.push("boxpad");var T=0,C=0,N=0;/box/.test(a)?(N=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness),T=e.fontMetrics().fboxsep+(a==="colorbox"?0:N),C=T):a==="angl"?(N=Math.max(e.fontMetrics().defaultRuleThickness,e.minRuleThickness),T=4*N,C=Math.max(0,.25-t.depth)):(T=h?.2:0,C=T),s=N0.encloseSpan(t,a,T,C,e),/fbox|boxed|fcolorbox/.test(a)?(s.style.borderStyle="solid",s.style.borderWidth=A(N)):a==="angl"&&N!==.049&&(s.style.borderTopWidth=A(N),s.style.borderRightWidth=A(N)),o=t.depth+C,r.backgroundColor&&(s.style.backgroundColor=r.backgroundColor,r.borderColor&&(s.style.borderColor=r.borderColor))}var H;if(r.backgroundColor)H=y.makeVList({positionType:"individualShift",children:[{type:"elem",elem:s,shift:o},{type:"elem",elem:t,shift:0}]},e);else{var L=/cancel|phase/.test(a)?["svg-align"]:[];H=y.makeVList({positionType:"individualShift",children:[{type:"elem",elem:t,shift:0},{type:"elem",elem:s,shift:o,wrapperClasses:L}]},e)}return/cancel/.test(a)&&(H.height=t.height,H.depth=t.depth),/cancel/.test(a)&&!h?y.makeSpan(["mord","cancel-lap"],[H],e):y.makeSpan(["mord"],[H],e)},zt=(r,e)=>{var t=0,a=new S.MathNode(r.label.indexOf("colorbox")>-1?"mpadded":"menclose",[X(r.body,e)]);switch(r.label){case"\\cancel":a.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":a.setAttribute("notation","downdiagonalstrike");break;case"\\phase":a.setAttribute("notation","phasorangle");break;case"\\sout":a.setAttribute("notation","horizontalstrike");break;case"\\fbox":a.setAttribute("notation","box");break;case"\\angl":a.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(t=e.fontMetrics().fboxsep*e.fontMetrics().ptPerEm,a.setAttribute("width","+"+2*t+"pt"),a.setAttribute("height","+"+2*t+"pt"),a.setAttribute("lspace",t+"pt"),a.setAttribute("voffset",t+"pt"),r.label==="\\fcolorbox"){var n=Math.max(e.fontMetrics().fboxrule,e.minRuleThickness);a.setAttribute("style","border: "+n+"em solid "+String(r.borderColor))}break;case"\\xcancel":a.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return r.backgroundColor&&a.setAttribute("mathbackground",r.backgroundColor),a};B({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(r,e,t){var{parser:a,funcName:n}=r,s=O(e[0],"color-token").color,o=e[1];return{type:"enclose",mode:a.mode,label:n,backgroundColor:s,body:o}},htmlBuilder:Mt,mathmlBuilder:zt});B({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","text"]},handler(r,e,t){var{parser:a,funcName:n}=r,s=O(e[0],"color-token").color,o=O(e[1],"color-token").color,h=e[2];return{type:"enclose",mode:a.mode,label:n,backgroundColor:o,borderColor:s,body:h}},htmlBuilder:Mt,mathmlBuilder:zt});B({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\fbox",body:e[0]}}});B({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:a}=r,n=e[0];return{type:"enclose",mode:t.mode,label:a,body:n}},htmlBuilder:Mt,mathmlBuilder:zt});B({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"enclose",mode:t.mode,label:"\\angl",body:e[0]}}});var Jr={};function w0(r){for(var{type:e,names:t,props:a,handler:n,htmlBuilder:s,mathmlBuilder:o}=r,h={type:e,numArgs:a.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:n},m=0;m{var e=r.parser.settings;if(!e.displayMode)throw new M("{"+r.envName+"} can be used only in display mode.")};function At(r){if(r.indexOf("ed")===-1)return r.indexOf("*")===-1}function G0(r,e,t){var{hskipBeforeAndAfter:a,addJot:n,cols:s,arraystretch:o,colSeparationType:h,autoTag:m,singleRow:p,emptySingleRow:v,maxNumCols:b,leqno:w}=e;if(r.gullet.beginGroup(),p||r.gullet.macros.set("\\cr","\\\\\\relax"),!o){var x=r.gullet.expandMacroAsText("\\arraystretch");if(x==null)o=1;else if(o=parseFloat(x),!o||o<0)throw new M("Invalid \\arraystretch: "+x)}r.gullet.beginGroup();var z=[],T=[z],C=[],N=[],H=m!=null?[]:void 0;function L(){m&&r.gullet.macros.set("\\@eqnsw","1",!0)}function G(){H&&(r.gullet.macros.get("\\df@tag")?(H.push(r.subparse([new f0("\\df@tag")])),r.gullet.macros.set("\\df@tag",void 0,!0)):H.push(!!m&&r.gullet.macros.get("\\@eqnsw")==="1"))}for(L(),N.push(rr(r));;){var F=r.parseExpression(!1,p?"\\end":"\\\\");r.gullet.endGroup(),r.gullet.beginGroup(),F={type:"ordgroup",mode:r.mode,body:F},t&&(F={type:"styling",mode:r.mode,style:t,body:[F]}),z.push(F);var U=r.fetch().text;if(U==="&"){if(b&&z.length===b){if(p||h)throw new M("Too many tab characters: &",r.nextToken);r.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}r.consume()}else if(U==="\\end"){G(),z.length===1&&F.type==="styling"&&F.body[0].body.length===0&&(T.length>1||!v)&&T.pop(),N.length0&&(L+=.25),p.push({pos:L,isDashed:fe[pe]})}for(G(o[0]),a=0;a0&&(r0+=H,Vfe))for(a=0;a=h)){var K0=void 0;(n>0||e.hskipBeforeAndAfter)&&(K0=q.deflt(m0.pregap,w),K0!==0&&(g0=y.makeSpan(["arraycolsep"],[]),g0.style.width=A(K0),s0.push(g0)));var J0=[];for(a=0;a0){for(var va=y.makeLineSpan("hline",t,v),ga=y.makeLineSpan("hdashline",t,v),Ve=[{type:"elem",elem:m,shift:0}];p.length>0;){var It=p.pop(),Ht=It.pos-e0;It.isDashed?Ve.push({type:"elem",elem:ga,shift:Ht}):Ve.push({type:"elem",elem:va,shift:Ht})}m=y.makeVList({positionType:"individualShift",children:Ve},t)}if(W0.length===0)return y.makeSpan(["mord"],[m],t);var Ge=y.makeVList({positionType:"individualShift",children:W0},t);return Ge=y.makeSpan(["tag"],[Ge],t),y.makeFragment([m,Ge])},h4={c:"center ",l:"left ",r:"right "},S0=function(e,t){for(var a=[],n=new S.MathNode("mtd",[],["mtr-glue"]),s=new S.MathNode("mtd",[],["mml-eqn-num"]),o=0;o0){var z=e.cols,T="",C=!1,N=0,H=z.length;z[0].type==="separator"&&(w+="top ",N=1),z[z.length-1].type==="separator"&&(w+="bottom ",H-=1);for(var L=N;L0?"left ":"",w+=j[j.length-1].length>0?"right ":"";for(var $=1;$-1?"alignat":"align",s=e.envName==="split",o=G0(e.parser,{cols:a,addJot:!0,autoTag:s?void 0:At(e.envName),emptySingleRow:!0,colSeparationType:n,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display"),h,m=0,p={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&t[0].type==="ordgroup"){for(var v="",b=0;b0&&x&&(C=1),a[z]={type:"align",align:T,pregap:C,postgap:0}}return o.colSeparationType=x?"align":"alignat",o};w0({type:"array",names:["array","darray"],props:{numArgs:1},handler(r,e){var t=Re(e[0]),a=t?[e[0]]:O(e[0],"ordgroup").body,n=a.map(function(o){var h=wt(o),m=h.text;if("lcr".indexOf(m)!==-1)return{type:"align",align:m};if(m==="|")return{type:"separator",separator:"|"};if(m===":")return{type:"separator",separator:":"};throw new M("Unknown column alignment: "+m,o)}),s={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return G0(r.parser,s,Tt(r.envName))},htmlBuilder:k0,mathmlBuilder:S0});w0({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(r){var e={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[r.envName.replace("*","")],t="c",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:t}]};if(r.envName.charAt(r.envName.length-1)==="*"){var n=r.parser;if(n.consumeSpaces(),n.fetch().text==="["){if(n.consume(),n.consumeSpaces(),t=n.fetch().text,"lcr".indexOf(t)===-1)throw new M("Expected l or c or r",n.nextToken);n.consume(),n.consumeSpaces(),n.expect("]"),n.consume(),a.cols=[{type:"align",align:t}]}}var s=G0(r.parser,a,Tt(r.envName)),o=Math.max(0,...s.body.map(h=>h.length));return s.cols=new Array(o).fill({type:"align",align:t}),e?{type:"leftright",mode:r.mode,body:[s],left:e[0],right:e[1],rightColor:void 0}:s},htmlBuilder:k0,mathmlBuilder:S0});w0({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(r){var e={arraystretch:.5},t=G0(r.parser,e,"script");return t.colSeparationType="small",t},htmlBuilder:k0,mathmlBuilder:S0});w0({type:"array",names:["subarray"],props:{numArgs:1},handler(r,e){var t=Re(e[0]),a=t?[e[0]]:O(e[0],"ordgroup").body,n=a.map(function(o){var h=wt(o),m=h.text;if("lc".indexOf(m)!==-1)return{type:"align",align:m};throw new M("Unknown column alignment: "+m,o)});if(n.length>1)throw new M("{subarray} can contain only one column");var s={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if(s=G0(r.parser,s,"script"),s.body.length>0&&s.body[0].length>1)throw new M("{subarray} can contain only one column");return s},htmlBuilder:k0,mathmlBuilder:S0});w0({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(r){var e={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},t=G0(r.parser,e,Tt(r.envName));return{type:"leftright",mode:r.mode,body:[t],left:r.envName.indexOf("r")>-1?".":"\\{",right:r.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:k0,mathmlBuilder:S0});w0({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:_r,htmlBuilder:k0,mathmlBuilder:S0});w0({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(r){q.contains(["gather","gather*"],r.envName)&&Le(r);var e={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:At(r.envName),emptySingleRow:!0,leqno:r.parser.settings.leqno};return G0(r.parser,e,"display")},htmlBuilder:k0,mathmlBuilder:S0});w0({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:_r,htmlBuilder:k0,mathmlBuilder:S0});w0({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(r){Le(r);var e={autoTag:At(r.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:r.parser.settings.leqno};return G0(r.parser,e,"display")},htmlBuilder:k0,mathmlBuilder:S0});w0({type:"array",names:["CD"],props:{numArgs:0},handler(r){return Le(r),K1(r.parser)},htmlBuilder:k0,mathmlBuilder:S0});c("\\nonumber","\\gdef\\@eqnsw{0}");c("\\notag","\\nonumber");B({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(r,e){throw new M(r.funcName+" valid only within array environment")}});var ar=Jr;B({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(r,e){var{parser:t,funcName:a}=r,n=e[0];if(n.type!=="ordgroup")throw new M("Invalid environment name",n);for(var s="",o=0;o{var t=r.font,a=e.withFont(t);return P(r.body,a)},ta=(r,e)=>{var t=r.font,a=e.withFont(t);return X(r.body,a)},nr={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};B({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=Ne(e[0]),s=a;return s in nr&&(s=nr[s]),{type:"font",mode:t.mode,font:s.slice(1),body:n}},htmlBuilder:ea,mathmlBuilder:ta});B({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(r,e)=>{var{parser:t}=r,a=e[0],n=q.isCharacterBox(a);return{type:"mclass",mode:t.mode,mclass:Ie(a),body:[{type:"font",mode:t.mode,font:"boldsymbol",body:a}],isCharacterBox:n}}});B({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:a,breakOnTokenText:n}=r,{mode:s}=t,o=t.parseExpression(!0,n),h="math"+a.slice(1);return{type:"font",mode:s,font:h,body:{type:"ordgroup",mode:t.mode,body:o}}},htmlBuilder:ea,mathmlBuilder:ta});var ra=(r,e)=>{var t=e;return r==="display"?t=t.id>=R.SCRIPT.id?t.text():R.DISPLAY:r==="text"&&t.size===R.DISPLAY.size?t=R.TEXT:r==="script"?t=R.SCRIPT:r==="scriptscript"&&(t=R.SCRIPTSCRIPT),t},Bt=(r,e)=>{var t=ra(r.size,e.style),a=t.fracNum(),n=t.fracDen(),s;s=e.havingStyle(a);var o=P(r.numer,s,e);if(r.continued){var h=8.5/e.fontMetrics().ptPerEm,m=3.5/e.fontMetrics().ptPerEm;o.height=o.height0?z=3*w:z=7*w,T=e.fontMetrics().denom1):(b>0?(x=e.fontMetrics().num2,z=w):(x=e.fontMetrics().num3,z=3*w),T=e.fontMetrics().denom2);var C;if(v){var H=e.fontMetrics().axisHeight;x-o.depth-(H+.5*b){var t=new S.MathNode("mfrac",[X(r.numer,e),X(r.denom,e)]);if(!r.hasBarLine)t.setAttribute("linethickness","0px");else if(r.barSize){var a=K(r.barSize,e);t.setAttribute("linethickness",A(a))}var n=ra(r.size,e.style);if(n.size!==e.style.size){t=new S.MathNode("mstyle",[t]);var s=n.size===R.DISPLAY.size?"true":"false";t.setAttribute("displaystyle",s),t.setAttribute("scriptlevel","0")}if(r.leftDelim!=null||r.rightDelim!=null){var o=[];if(r.leftDelim!=null){var h=new S.MathNode("mo",[new S.TextNode(r.leftDelim.replace("\\",""))]);h.setAttribute("fence","true"),o.push(h)}if(o.push(t),r.rightDelim!=null){var m=new S.MathNode("mo",[new S.TextNode(r.rightDelim.replace("\\",""))]);m.setAttribute("fence","true"),o.push(m)}return yt(o)}return t};B({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0],s=e[1],o,h=null,m=null,p="auto";switch(a){case"\\dfrac":case"\\frac":case"\\tfrac":o=!0;break;case"\\\\atopfrac":o=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":o=!1,h="(",m=")";break;case"\\\\bracefrac":o=!1,h="\\{",m="\\}";break;case"\\\\brackfrac":o=!1,h="[",m="]";break;default:throw new Error("Unrecognized genfrac command")}switch(a){case"\\dfrac":case"\\dbinom":p="display";break;case"\\tfrac":case"\\tbinom":p="text";break}return{type:"genfrac",mode:t.mode,continued:!1,numer:n,denom:s,hasBarLine:o,leftDelim:h,rightDelim:m,size:p,barSize:null}},htmlBuilder:Bt,mathmlBuilder:Dt});B({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0],s=e[1];return{type:"genfrac",mode:t.mode,continued:!0,numer:n,denom:s,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}});B({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(r){var{parser:e,funcName:t,token:a}=r,n;switch(t){case"\\over":n="\\frac";break;case"\\choose":n="\\binom";break;case"\\atop":n="\\\\atopfrac";break;case"\\brace":n="\\\\bracefrac";break;case"\\brack":n="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:e.mode,replaceWith:n,token:a}}});var ir=["display","text","script","scriptscript"],sr=function(e){var t=null;return e.length>0&&(t=e,t=t==="."?null:t),t};B({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(r,e){var{parser:t}=r,a=e[4],n=e[5],s=Ne(e[0]),o=s.type==="atom"&&s.family==="open"?sr(s.text):null,h=Ne(e[1]),m=h.type==="atom"&&h.family==="close"?sr(h.text):null,p=O(e[2],"size"),v,b=null;p.isBlank?v=!0:(b=p.value,v=b.number>0);var w="auto",x=e[3];if(x.type==="ordgroup"){if(x.body.length>0){var z=O(x.body[0],"textord");w=ir[Number(z.text)]}}else x=O(x,"textord"),w=ir[Number(x.text)];return{type:"genfrac",mode:t.mode,numer:a,denom:n,continued:!1,hasBarLine:v,barSize:b,leftDelim:o,rightDelim:m,size:w}},htmlBuilder:Bt,mathmlBuilder:Dt});B({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(r,e){var{parser:t,funcName:a,token:n}=r;return{type:"infix",mode:t.mode,replaceWith:"\\\\abovefrac",size:O(e[0],"size").value,token:n}}});B({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0],s=Va(O(e[1],"infix").size),o=e[2],h=s.number>0;return{type:"genfrac",mode:t.mode,numer:n,denom:o,continued:!1,hasBarLine:h,barSize:s,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:Bt,mathmlBuilder:Dt});var aa=(r,e)=>{var t=e.style,a,n;r.type==="supsub"?(a=r.sup?P(r.sup,e.havingStyle(t.sup()),e):P(r.sub,e.havingStyle(t.sub()),e),n=O(r.base,"horizBrace")):n=O(r,"horizBrace");var s=P(n.base,e.havingBaseStyle(R.DISPLAY)),o=N0.svgSpan(n,e),h;if(n.isOver?(h=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:o}]},e),h.children[0].children[0].children[1].classes.push("svg-align")):(h=y.makeVList({positionType:"bottom",positionData:s.depth+.1+o.height,children:[{type:"elem",elem:o},{type:"kern",size:.1},{type:"elem",elem:s}]},e),h.children[0].children[0].children[0].classes.push("svg-align")),a){var m=y.makeSpan(["mord",n.isOver?"mover":"munder"],[h],e);n.isOver?h=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:m},{type:"kern",size:.2},{type:"elem",elem:a}]},e):h=y.makeVList({positionType:"bottom",positionData:m.depth+.2+a.height+a.depth,children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:m}]},e)}return y.makeSpan(["mord",n.isOver?"mover":"munder"],[h],e)},m4=(r,e)=>{var t=N0.mathMLnode(r.label);return new S.MathNode(r.isOver?"mover":"munder",[X(r.base,e),t])};B({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(r,e){var{parser:t,funcName:a}=r;return{type:"horizBrace",mode:t.mode,label:a,isOver:/^\\over/.test(a),base:e[0]}},htmlBuilder:aa,mathmlBuilder:m4});B({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[1],n=O(e[0],"url").url;return t.settings.isTrusted({command:"\\href",url:n})?{type:"href",mode:t.mode,href:n,body:Q(a)}:t.formatUnsupportedCmd("\\href")},htmlBuilder:(r,e)=>{var t=t0(r.body,e,!1);return y.makeAnchor(r.href,[],t,e)},mathmlBuilder:(r,e)=>{var t=V0(r.body,e);return t instanceof c0||(t=new c0("mrow",[t])),t.setAttribute("href",r.href),t}});B({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=O(e[0],"url").url;if(!t.settings.isTrusted({command:"\\url",url:a}))return t.formatUnsupportedCmd("\\url");for(var n=[],s=0;s{var{parser:t,funcName:a,token:n}=r,s=O(e[0],"raw").string,o=e[1];t.settings.strict&&t.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var h,m={};switch(a){case"\\htmlClass":m.class=s,h={command:"\\htmlClass",class:s};break;case"\\htmlId":m.id=s,h={command:"\\htmlId",id:s};break;case"\\htmlStyle":m.style=s,h={command:"\\htmlStyle",style:s};break;case"\\htmlData":{for(var p=s.split(","),v=0;v{var t=t0(r.body,e,!1),a=["enclosing"];r.attributes.class&&a.push(...r.attributes.class.trim().split(/\s+/));var n=y.makeSpan(a,t,e);for(var s in r.attributes)s!=="class"&&r.attributes.hasOwnProperty(s)&&n.setAttribute(s,r.attributes[s]);return n},mathmlBuilder:(r,e)=>V0(r.body,e)});B({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"htmlmathml",mode:t.mode,html:Q(e[0]),mathml:Q(e[1])}},htmlBuilder:(r,e)=>{var t=t0(r.html,e,!1);return y.makeFragment(t)},mathmlBuilder:(r,e)=>V0(r.mathml,e)});var tt=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new M("Invalid size: '"+e+"' in \\includegraphics");var a={number:+(t[1]+t[2]),unit:t[3]};if(!kr(a))throw new M("Invalid unit: '"+a.unit+"' in \\includegraphics.");return a};B({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(r,e,t)=>{var{parser:a}=r,n={number:0,unit:"em"},s={number:.9,unit:"em"},o={number:0,unit:"em"},h="";if(t[0])for(var m=O(t[0],"raw").string,p=m.split(","),v=0;v{var t=K(r.height,e),a=0;r.totalheight.number>0&&(a=K(r.totalheight,e)-t);var n=0;r.width.number>0&&(n=K(r.width,e));var s={height:A(t+a)};n>0&&(s.width=A(n)),a>0&&(s.verticalAlign=A(-a));var o=new m1(r.src,r.alt,s);return o.height=t,o.depth=a,o},mathmlBuilder:(r,e)=>{var t=new S.MathNode("mglyph",[]);t.setAttribute("alt",r.alt);var a=K(r.height,e),n=0;if(r.totalheight.number>0&&(n=K(r.totalheight,e)-a,t.setAttribute("valign",A(-n))),t.setAttribute("height",A(a+n)),r.width.number>0){var s=K(r.width,e);t.setAttribute("width",A(s))}return t.setAttribute("src",r.src),t}});B({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:a}=r,n=O(e[0],"size");if(t.settings.strict){var s=a[1]==="m",o=n.value.unit==="mu";s?(o||t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, "+("not "+n.value.unit+" units")),t.mode!=="math"&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):o&&t.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:t.mode,dimension:n.value}},htmlBuilder(r,e){return y.makeGlue(r.dimension,e)},mathmlBuilder(r,e){var t=K(r.dimension,e);return new S.SpaceNode(t)}});B({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0];return{type:"lap",mode:t.mode,alignment:a.slice(5),body:n}},htmlBuilder:(r,e)=>{var t;r.alignment==="clap"?(t=y.makeSpan([],[P(r.body,e)]),t=y.makeSpan(["inner"],[t],e)):t=y.makeSpan(["inner"],[P(r.body,e)]);var a=y.makeSpan(["fix"],[]),n=y.makeSpan([r.alignment],[t,a],e),s=y.makeSpan(["strut"]);return s.style.height=A(n.height+n.depth),n.depth&&(s.style.verticalAlign=A(-n.depth)),n.children.unshift(s),n=y.makeSpan(["thinbox"],[n],e),y.makeSpan(["mord","vbox"],[n],e)},mathmlBuilder:(r,e)=>{var t=new S.MathNode("mpadded",[X(r.body,e)]);if(r.alignment!=="rlap"){var a=r.alignment==="llap"?"-1":"-0.5";t.setAttribute("lspace",a+"width")}return t.setAttribute("width","0px"),t}});B({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){var{funcName:t,parser:a}=r,n=a.mode;a.switchMode("math");var s=t==="\\("?"\\)":"$",o=a.parseExpression(!1,s);return a.expect(s),a.switchMode(n),{type:"styling",mode:a.mode,style:"text",body:o}}});B({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(r,e){throw new M("Mismatched "+r.funcName)}});var lr=(r,e)=>{switch(e.style.size){case R.DISPLAY.size:return r.display;case R.TEXT.size:return r.text;case R.SCRIPT.size:return r.script;case R.SCRIPTSCRIPT.size:return r.scriptscript;default:return r.text}};B({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(r,e)=>{var{parser:t}=r;return{type:"mathchoice",mode:t.mode,display:Q(e[0]),text:Q(e[1]),script:Q(e[2]),scriptscript:Q(e[3])}},htmlBuilder:(r,e)=>{var t=lr(r,e),a=t0(t,e,!1);return y.makeFragment(a)},mathmlBuilder:(r,e)=>{var t=lr(r,e);return V0(t,e)}});var na=(r,e,t,a,n,s,o)=>{r=y.makeSpan([],[r]);var h=t&&q.isCharacterBox(t),m,p;if(e){var v=P(e,a.havingStyle(n.sup()),a);p={elem:v,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-v.depth)}}if(t){var b=P(t,a.havingStyle(n.sub()),a);m={elem:b,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-b.height)}}var w;if(p&&m){var x=a.fontMetrics().bigOpSpacing5+m.elem.height+m.elem.depth+m.kern+r.depth+o;w=y.makeVList({positionType:"bottom",positionData:x,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:m.elem,marginLeft:A(-s)},{type:"kern",size:m.kern},{type:"elem",elem:r},{type:"kern",size:p.kern},{type:"elem",elem:p.elem,marginLeft:A(s)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}else if(m){var z=r.height-o;w=y.makeVList({positionType:"top",positionData:z,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:m.elem,marginLeft:A(-s)},{type:"kern",size:m.kern},{type:"elem",elem:r}]},a)}else if(p){var T=r.depth+o;w=y.makeVList({positionType:"bottom",positionData:T,children:[{type:"elem",elem:r},{type:"kern",size:p.kern},{type:"elem",elem:p.elem,marginLeft:A(s)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]},a)}else return r;var C=[w];if(m&&s!==0&&!h){var N=y.makeSpan(["mspace"],[],a);N.style.marginRight=A(s),C.unshift(N)}return y.makeSpan(["mop","op-limits"],C,a)},ia=["\\smallint"],re=(r,e)=>{var t,a,n=!1,s;r.type==="supsub"?(t=r.sup,a=r.sub,s=O(r.base,"op"),n=!0):s=O(r,"op");var o=e.style,h=!1;o.size===R.DISPLAY.size&&s.symbol&&!q.contains(ia,s.name)&&(h=!0);var m;if(s.symbol){var p=h?"Size2-Regular":"Size1-Regular",v="";if((s.name==="\\oiint"||s.name==="\\oiiint")&&(v=s.name.slice(1),s.name=v==="oiint"?"\\iint":"\\iiint"),m=y.makeSymbol(s.name,p,"math",e,["mop","op-symbol",h?"large-op":"small-op"]),v.length>0){var b=m.italic,w=y.staticSvg(v+"Size"+(h?"2":"1"),e);m=y.makeVList({positionType:"individualShift",children:[{type:"elem",elem:m,shift:0},{type:"elem",elem:w,shift:h?.08:0}]},e),s.name="\\"+v,m.classes.unshift("mop"),m.italic=b}}else if(s.body){var x=t0(s.body,e,!0);x.length===1&&x[0]instanceof p0?(m=x[0],m.classes[0]="mop"):m=y.makeSpan(["mop"],x,e)}else{for(var z=[],T=1;T{var t;if(r.symbol)t=new c0("mo",[v0(r.name,r.mode)]),q.contains(ia,r.name)&&t.setAttribute("largeop","false");else if(r.body)t=new c0("mo",o0(r.body,e));else{t=new c0("mi",[new ie(r.name.slice(1))]);var a=new c0("mo",[v0("⁡","text")]);r.parentIsSupSub?t=new c0("mrow",[t,a]):t=Er([t,a])}return t},c4={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};B({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=a;return n.length===1&&(n=c4[n]),{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:re,mathmlBuilder:me});B({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Q(a)}},htmlBuilder:re,mathmlBuilder:me});var d4={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};B({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:re,mathmlBuilder:me});B({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r;return{type:"op",mode:e.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:t}},htmlBuilder:re,mathmlBuilder:me});B({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(r){var{parser:e,funcName:t}=r,a=t;return a.length===1&&(a=d4[a]),{type:"op",mode:e.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:re,mathmlBuilder:me});var sa=(r,e)=>{var t,a,n=!1,s;r.type==="supsub"?(t=r.sup,a=r.sub,s=O(r.base,"operatorname"),n=!0):s=O(r,"operatorname");var o;if(s.body.length>0){for(var h=s.body.map(b=>{var w=b.text;return typeof w=="string"?{type:"textord",mode:b.mode,text:w}:b}),m=t0(h,e.withFont("mathrm"),!0),p=0;p{for(var t=o0(r.body,e.withFont("mathrm")),a=!0,n=0;nv.toText()).join("");t=[new S.TextNode(h)]}var m=new S.MathNode("mi",t);m.setAttribute("mathvariant","normal");var p=new S.MathNode("mo",[v0("⁡","text")]);return r.parentIsSupSub?new S.MathNode("mrow",[m,p]):S.newDocumentFragment([m,p])};B({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(r,e)=>{var{parser:t,funcName:a}=r,n=e[0];return{type:"operatorname",mode:t.mode,body:Q(n),alwaysHandleSupSub:a==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:sa,mathmlBuilder:f4});c("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");Y0({type:"ordgroup",htmlBuilder(r,e){return r.semisimple?y.makeFragment(t0(r.body,e,!1)):y.makeSpan(["mord"],t0(r.body,e,!0),e)},mathmlBuilder(r,e){return V0(r.body,e,!0)}});B({type:"overline",names:["\\overline"],props:{numArgs:1},handler(r,e){var{parser:t}=r,a=e[0];return{type:"overline",mode:t.mode,body:a}},htmlBuilder(r,e){var t=P(r.body,e.havingCrampedStyle()),a=y.makeLineSpan("overline-line",e),n=e.fontMetrics().defaultRuleThickness,s=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t},{type:"kern",size:3*n},{type:"elem",elem:a},{type:"kern",size:n}]},e);return y.makeSpan(["mord","overline"],[s],e)},mathmlBuilder(r,e){var t=new S.MathNode("mo",[new S.TextNode("‾")]);t.setAttribute("stretchy","true");var a=new S.MathNode("mover",[X(r.body,e),t]);return a.setAttribute("accent","true"),a}});B({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"phantom",mode:t.mode,body:Q(a)}},htmlBuilder:(r,e)=>{var t=t0(r.body,e.withPhantom(),!1);return y.makeFragment(t)},mathmlBuilder:(r,e)=>{var t=o0(r.body,e);return new S.MathNode("mphantom",t)}});B({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"hphantom",mode:t.mode,body:a}},htmlBuilder:(r,e)=>{var t=y.makeSpan([],[P(r.body,e.withPhantom())]);if(t.height=0,t.depth=0,t.children)for(var a=0;a{var t=o0(Q(r.body),e),a=new S.MathNode("mphantom",t),n=new S.MathNode("mpadded",[a]);return n.setAttribute("height","0px"),n.setAttribute("depth","0px"),n}});B({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(r,e)=>{var{parser:t}=r,a=e[0];return{type:"vphantom",mode:t.mode,body:a}},htmlBuilder:(r,e)=>{var t=y.makeSpan(["inner"],[P(r.body,e.withPhantom())]),a=y.makeSpan(["fix"],[]);return y.makeSpan(["mord","rlap"],[t,a],e)},mathmlBuilder:(r,e)=>{var t=o0(Q(r.body),e),a=new S.MathNode("mphantom",t),n=new S.MathNode("mpadded",[a]);return n.setAttribute("width","0px"),n}});B({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(r,e){var{parser:t}=r,a=O(e[0],"size").value,n=e[1];return{type:"raisebox",mode:t.mode,dy:a,body:n}},htmlBuilder(r,e){var t=P(r.body,e),a=K(r.dy,e);return y.makeVList({positionType:"shift",positionData:-a,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){var t=new S.MathNode("mpadded",[X(r.body,e)]),a=r.dy.number+r.dy.unit;return t.setAttribute("voffset",a),t}});B({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(r){var{parser:e}=r;return{type:"internal",mode:e.mode}}});B({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(r,e,t){var{parser:a}=r,n=t[0],s=O(e[0],"size"),o=O(e[1],"size");return{type:"rule",mode:a.mode,shift:n&&O(n,"size").value,width:s.value,height:o.value}},htmlBuilder(r,e){var t=y.makeSpan(["mord","rule"],[],e),a=K(r.width,e),n=K(r.height,e),s=r.shift?K(r.shift,e):0;return t.style.borderRightWidth=A(a),t.style.borderTopWidth=A(n),t.style.bottom=A(s),t.width=a,t.height=n+s,t.depth=-s,t.maxFontSize=n*1.125*e.sizeMultiplier,t},mathmlBuilder(r,e){var t=K(r.width,e),a=K(r.height,e),n=r.shift?K(r.shift,e):0,s=e.color&&e.getColor()||"black",o=new S.MathNode("mspace");o.setAttribute("mathbackground",s),o.setAttribute("width",A(t)),o.setAttribute("height",A(a));var h=new S.MathNode("mpadded",[o]);return n>=0?h.setAttribute("height",A(n)):(h.setAttribute("height",A(n)),h.setAttribute("depth",A(-n))),h.setAttribute("voffset",A(n)),h}});function la(r,e,t){for(var a=t0(r,e,!1),n=e.sizeMultiplier/t.sizeMultiplier,s=0;s{var t=e.havingSize(r.size);return la(r.body,t,e)};B({type:"sizing",names:or,props:{numArgs:0,allowedInText:!0},handler:(r,e)=>{var{breakOnTokenText:t,funcName:a,parser:n}=r,s=n.parseExpression(!1,t);return{type:"sizing",mode:n.mode,size:or.indexOf(a)+1,body:s}},htmlBuilder:p4,mathmlBuilder:(r,e)=>{var t=e.havingSize(r.size),a=o0(r.body,t),n=new S.MathNode("mstyle",a);return n.setAttribute("mathsize",A(t.sizeMultiplier)),n}});B({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(r,e,t)=>{var{parser:a}=r,n=!1,s=!1,o=t[0]&&O(t[0],"ordgroup");if(o)for(var h="",m=0;m{var t=y.makeSpan([],[P(r.body,e)]);if(!r.smashHeight&&!r.smashDepth)return t;if(r.smashHeight&&(t.height=0,t.children))for(var a=0;a{var t=new S.MathNode("mpadded",[X(r.body,e)]);return r.smashHeight&&t.setAttribute("height","0px"),r.smashDepth&&t.setAttribute("depth","0px"),t}});B({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(r,e,t){var{parser:a}=r,n=t[0],s=e[0];return{type:"sqrt",mode:a.mode,body:s,index:n}},htmlBuilder(r,e){var t=P(r.body,e.havingCrampedStyle());t.height===0&&(t.height=e.fontMetrics().xHeight),t=y.wrapFragment(t,e);var a=e.fontMetrics(),n=a.defaultRuleThickness,s=n;e.style.idt.height+t.depth+o&&(o=(o+b-t.height-t.depth)/2);var w=m.height-t.height-o-p;t.style.paddingLeft=A(v);var x=y.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:t,wrapperClasses:["svg-align"]},{type:"kern",size:-(t.height+w)},{type:"elem",elem:m},{type:"kern",size:p}]},e);if(r.index){var z=e.havingStyle(R.SCRIPTSCRIPT),T=P(r.index,z,e),C=.6*(x.height-x.depth),N=y.makeVList({positionType:"shift",positionData:-C,children:[{type:"elem",elem:T}]},e),H=y.makeSpan(["root"],[N]);return y.makeSpan(["mord","sqrt"],[H,x],e)}else return y.makeSpan(["mord","sqrt"],[x],e)},mathmlBuilder(r,e){var{body:t,index:a}=r;return a?new S.MathNode("mroot",[X(t,e),X(a,e)]):new S.MathNode("msqrt",[X(t,e)])}});var ur={display:R.DISPLAY,text:R.TEXT,script:R.SCRIPT,scriptscript:R.SCRIPTSCRIPT};B({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(r,e){var{breakOnTokenText:t,funcName:a,parser:n}=r,s=n.parseExpression(!0,t),o=a.slice(1,a.length-5);return{type:"styling",mode:n.mode,style:o,body:s}},htmlBuilder(r,e){var t=ur[r.style],a=e.havingStyle(t).withFont("");return la(r.body,a,e)},mathmlBuilder(r,e){var t=ur[r.style],a=e.havingStyle(t),n=o0(r.body,a),s=new S.MathNode("mstyle",n),o={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},h=o[r.style];return s.setAttribute("scriptlevel",h[0]),s.setAttribute("displaystyle",h[1]),s}});var v4=function(e,t){var a=e.base;if(a)if(a.type==="op"){var n=a.limits&&(t.style.size===R.DISPLAY.size||a.alwaysHandleSupSub);return n?re:null}else if(a.type==="operatorname"){var s=a.alwaysHandleSupSub&&(t.style.size===R.DISPLAY.size||a.limits);return s?sa:null}else{if(a.type==="accent")return q.isCharacterBox(a.base)?kt:null;if(a.type==="horizBrace"){var o=!e.sub;return o===a.isOver?aa:null}else return null}else return null};Y0({type:"supsub",htmlBuilder(r,e){var t=v4(r,e);if(t)return t(r,e);var{base:a,sup:n,sub:s}=r,o=P(a,e),h,m,p=e.fontMetrics(),v=0,b=0,w=a&&q.isCharacterBox(a);if(n){var x=e.havingStyle(e.style.sup());h=P(n,x,e),w||(v=o.height-x.fontMetrics().supDrop*x.sizeMultiplier/e.sizeMultiplier)}if(s){var z=e.havingStyle(e.style.sub());m=P(s,z,e),w||(b=o.depth+z.fontMetrics().subDrop*z.sizeMultiplier/e.sizeMultiplier)}var T;e.style===R.DISPLAY?T=p.sup1:e.style.cramped?T=p.sup3:T=p.sup2;var C=e.sizeMultiplier,N=A(.5/p.ptPerEm/C),H=null;if(m){var L=r.base&&r.base.type==="op"&&r.base.name&&(r.base.name==="\\oiint"||r.base.name==="\\oiiint");(o instanceof p0||L)&&(H=A(-o.italic))}var G;if(h&&m){v=Math.max(v,T,h.depth+.25*p.xHeight),b=Math.max(b,p.sub2);var F=p.defaultRuleThickness,U=4*F;if(v-h.depth-(m.height-b)0&&(v+=V,b-=V)}var j=[{type:"elem",elem:m,shift:b,marginRight:N,marginLeft:H},{type:"elem",elem:h,shift:-v,marginRight:N}];G=y.makeVList({positionType:"individualShift",children:j},e)}else if(m){b=Math.max(b,p.sub1,m.height-.8*p.xHeight);var $=[{type:"elem",elem:m,marginLeft:H,marginRight:N}];G=y.makeVList({positionType:"shift",positionData:b,children:$},e)}else if(h)v=Math.max(v,T,h.depth+.25*p.xHeight),G=y.makeVList({positionType:"shift",positionData:-v,children:[{type:"elem",elem:h,marginRight:N}]},e);else throw new Error("supsub must have either sup or sub.");var M0=ut(o,"right")||"mord";return y.makeSpan([M0],[o,y.makeSpan(["msupsub"],[G])],e)},mathmlBuilder(r,e){var t=!1,a,n;r.base&&r.base.type==="horizBrace"&&(n=!!r.sup,n===r.base.isOver&&(t=!0,a=r.base.isOver)),r.base&&(r.base.type==="op"||r.base.type==="operatorname")&&(r.base.parentIsSupSub=!0);var s=[X(r.base,e)];r.sub&&s.push(X(r.sub,e)),r.sup&&s.push(X(r.sup,e));var o;if(t)o=a?"mover":"munder";else if(r.sub)if(r.sup){var p=r.base;p&&p.type==="op"&&p.limits&&e.style===R.DISPLAY||p&&p.type==="operatorname"&&p.alwaysHandleSupSub&&(e.style===R.DISPLAY||p.limits)?o="munderover":o="msubsup"}else{var m=r.base;m&&m.type==="op"&&m.limits&&(e.style===R.DISPLAY||m.alwaysHandleSupSub)||m&&m.type==="operatorname"&&m.alwaysHandleSupSub&&(m.limits||e.style===R.DISPLAY)?o="munder":o="msub"}else{var h=r.base;h&&h.type==="op"&&h.limits&&(e.style===R.DISPLAY||h.alwaysHandleSupSub)||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(h.limits||e.style===R.DISPLAY)?o="mover":o="msup"}return new S.MathNode(o,s)}});Y0({type:"atom",htmlBuilder(r,e){return y.mathsym(r.text,r.mode,e,["m"+r.family])},mathmlBuilder(r,e){var t=new S.MathNode("mo",[v0(r.text,r.mode)]);if(r.family==="bin"){var a=xt(r,e);a==="bold-italic"&&t.setAttribute("mathvariant",a)}else r.family==="punct"?t.setAttribute("separator","true"):(r.family==="open"||r.family==="close")&&t.setAttribute("stretchy","false");return t}});var oa={mi:"italic",mn:"normal",mtext:"normal"};Y0({type:"mathord",htmlBuilder(r,e){return y.makeOrd(r,e,"mathord")},mathmlBuilder(r,e){var t=new S.MathNode("mi",[v0(r.text,r.mode,e)]),a=xt(r,e)||"italic";return a!==oa[t.type]&&t.setAttribute("mathvariant",a),t}});Y0({type:"textord",htmlBuilder(r,e){return y.makeOrd(r,e,"textord")},mathmlBuilder(r,e){var t=v0(r.text,r.mode,e),a=xt(r,e)||"normal",n;return r.mode==="text"?n=new S.MathNode("mtext",[t]):/[0-9]/.test(r.text)?n=new S.MathNode("mn",[t]):r.text==="\\prime"?n=new S.MathNode("mo",[t]):n=new S.MathNode("mi",[t]),a!==oa[n.type]&&n.setAttribute("mathvariant",a),n}});var rt={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},at={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Y0({type:"spacing",htmlBuilder(r,e){if(at.hasOwnProperty(r.text)){var t=at[r.text].className||"";if(r.mode==="text"){var a=y.makeOrd(r,e,"textord");return a.classes.push(t),a}else return y.makeSpan(["mspace",t],[y.mathsym(r.text,r.mode,e)],e)}else{if(rt.hasOwnProperty(r.text))return y.makeSpan(["mspace",rt[r.text]],[],e);throw new M('Unknown type of space "'+r.text+'"')}},mathmlBuilder(r,e){var t;if(at.hasOwnProperty(r.text))t=new S.MathNode("mtext",[new S.TextNode(" ")]);else{if(rt.hasOwnProperty(r.text))return new S.MathNode("mspace");throw new M('Unknown type of space "'+r.text+'"')}return t}});var hr=()=>{var r=new S.MathNode("mtd",[]);return r.setAttribute("width","50%"),r};Y0({type:"tag",mathmlBuilder(r,e){var t=new S.MathNode("mtable",[new S.MathNode("mtr",[hr(),new S.MathNode("mtd",[V0(r.body,e)]),hr(),new S.MathNode("mtd",[V0(r.tag,e)])])]);return t.setAttribute("width","100%"),t}});var mr={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},cr={"\\textbf":"textbf","\\textmd":"textmd"},g4={"\\textit":"textit","\\textup":"textup"},dr=(r,e)=>{var t=r.font;return t?mr[t]?e.withTextFontFamily(mr[t]):cr[t]?e.withTextFontWeight(cr[t]):e.withTextFontShape(g4[t]):e};B({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(r,e){var{parser:t,funcName:a}=r,n=e[0];return{type:"text",mode:t.mode,body:Q(n),font:a}},htmlBuilder(r,e){var t=dr(r,e),a=t0(r.body,t,!0);return y.makeSpan(["mord","text"],a,t)},mathmlBuilder(r,e){var t=dr(r,e);return V0(r.body,t)}});B({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(r,e){var{parser:t}=r;return{type:"underline",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=P(r.body,e),a=y.makeLineSpan("underline-line",e),n=e.fontMetrics().defaultRuleThickness,s=y.makeVList({positionType:"top",positionData:t.height,children:[{type:"kern",size:n},{type:"elem",elem:a},{type:"kern",size:3*n},{type:"elem",elem:t}]},e);return y.makeSpan(["mord","underline"],[s],e)},mathmlBuilder(r,e){var t=new S.MathNode("mo",[new S.TextNode("‾")]);t.setAttribute("stretchy","true");var a=new S.MathNode("munder",[X(r.body,e),t]);return a.setAttribute("accentunder","true"),a}});B({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(r,e){var{parser:t}=r;return{type:"vcenter",mode:t.mode,body:e[0]}},htmlBuilder(r,e){var t=P(r.body,e),a=e.fontMetrics().axisHeight,n=.5*(t.height-a-(t.depth+a));return y.makeVList({positionType:"shift",positionData:n,children:[{type:"elem",elem:t}]},e)},mathmlBuilder(r,e){return new S.MathNode("mpadded",[X(r.body,e)],["vcenter"])}});B({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(r,e,t){throw new M("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(r,e){for(var t=fr(r),a=[],n=e.havingStyle(e.style.text()),s=0;sr.body.replace(/ /g,r.star?"␣":" "),O0=Nr,ua=`[ \r - ]`,b4="\\\\[a-zA-Z@]+",y4="\\\\[^\uD800-\uDFFF]",x4="("+b4+")"+ua+"*",w4=`\\\\( -|[ \r ]+ -?)[ \r ]*`,dt="[̀-ͯ]",k4=new RegExp(dt+"+$"),S4="("+ua+"+)|"+(w4+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(dt+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(dt+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+x4)+("|"+y4+")");class pr{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(S4,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new f0("EOF",new u0(this,t,t));var a=this.tokenRegex.exec(e);if(a===null||a.index!==t)throw new M("Unexpected character: '"+e[t]+"'",new f0(e[t],new u0(this,t,t+1)));var n=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[n]===14){var s=e.indexOf(` -`,this.tokenRegex.lastIndex);return s===-1?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=s+1,this.lex()}return new f0(n,new u0(this,t,this.tokenRegex.lastIndex))}}class M4{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new M("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(e[t]==null?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,a){if(a===void 0&&(a=!1),a){for(var n=0;n0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var s=this.undefStack[this.undefStack.length-1];s&&!s.hasOwnProperty(e)&&(s[e]=this.current[e])}t==null?delete this.current[e]:this.current[e]=t}}var z4=Qr;c("\\noexpand",function(r){var e=r.popToken();return r.isExpandable(e.text)&&(e.noexpand=!0,e.treatAsRelax=!0),{tokens:[e],numArgs:0}});c("\\expandafter",function(r){var e=r.popToken();return r.expandOnce(!0),{tokens:[e],numArgs:0}});c("\\@firstoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[0],numArgs:0}});c("\\@secondoftwo",function(r){var e=r.consumeArgs(2);return{tokens:e[1],numArgs:0}});c("\\@ifnextchar",function(r){var e=r.consumeArgs(3);r.consumeSpaces();var t=r.future();return e[0].length===1&&e[0][0].text===t.text?{tokens:e[1],numArgs:0}:{tokens:e[2],numArgs:0}});c("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");c("\\TextOrMath",function(r){var e=r.consumeArgs(2);return r.mode==="text"?{tokens:e[0],numArgs:0}:{tokens:e[1],numArgs:0}});var vr={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};c("\\char",function(r){var e=r.popToken(),t,a="";if(e.text==="'")t=8,e=r.popToken();else if(e.text==='"')t=16,e=r.popToken();else if(e.text==="`")if(e=r.popToken(),e.text[0]==="\\")a=e.text.charCodeAt(1);else{if(e.text==="EOF")throw new M("\\char` missing argument");a=e.text.charCodeAt(0)}else t=10;if(t){if(a=vr[e.text],a==null||a>=t)throw new M("Invalid base-"+t+" digit "+e.text);for(var n;(n=vr[r.future().text])!=null&&n{var a=r.consumeArg().tokens;if(a.length!==1)throw new M("\\newcommand's first argument must be a macro name");var n=a[0].text,s=r.isDefined(n);if(s&&!e)throw new M("\\newcommand{"+n+"} attempting to redefine "+(n+"; use \\renewcommand"));if(!s&&!t)throw new M("\\renewcommand{"+n+"} when command "+n+" does not yet exist; use \\newcommand");var o=0;if(a=r.consumeArg().tokens,a.length===1&&a[0].text==="["){for(var h="",m=r.expandNextToken();m.text!=="]"&&m.text!=="EOF";)h+=m.text,m=r.expandNextToken();if(!h.match(/^\s*[0-9]+\s*$/))throw new M("Invalid number of arguments: "+h);o=parseInt(h),a=r.consumeArg().tokens}return r.macros.set(n,{tokens:a,numArgs:o}),""};c("\\newcommand",r=>Ct(r,!1,!0));c("\\renewcommand",r=>Ct(r,!0,!1));c("\\providecommand",r=>Ct(r,!0,!0));c("\\message",r=>{var e=r.consumeArgs(1)[0];return console.log(e.reverse().map(t=>t.text).join("")),""});c("\\errmessage",r=>{var e=r.consumeArgs(1)[0];return console.error(e.reverse().map(t=>t.text).join("")),""});c("\\show",r=>{var e=r.popToken(),t=e.text;return console.log(e,r.macros.get(t),O0[t],Y.math[t],Y.text[t]),""});c("\\bgroup","{");c("\\egroup","}");c("~","\\nobreakspace");c("\\lq","`");c("\\rq","'");c("\\aa","\\r a");c("\\AA","\\r A");c("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");c("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");c("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");c("ℬ","\\mathscr{B}");c("ℰ","\\mathscr{E}");c("ℱ","\\mathscr{F}");c("ℋ","\\mathscr{H}");c("ℐ","\\mathscr{I}");c("ℒ","\\mathscr{L}");c("ℳ","\\mathscr{M}");c("ℛ","\\mathscr{R}");c("ℭ","\\mathfrak{C}");c("ℌ","\\mathfrak{H}");c("ℨ","\\mathfrak{Z}");c("\\Bbbk","\\Bbb{k}");c("·","\\cdotp");c("\\llap","\\mathllap{\\textrm{#1}}");c("\\rlap","\\mathrlap{\\textrm{#1}}");c("\\clap","\\mathclap{\\textrm{#1}}");c("\\mathstrut","\\vphantom{(}");c("\\underbar","\\underline{\\text{#1}}");c("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');c("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");c("\\ne","\\neq");c("≠","\\neq");c("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");c("∉","\\notin");c("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");c("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");c("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");c("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");c("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");c("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");c("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");c("⟂","\\perp");c("‼","\\mathclose{!\\mkern-0.8mu!}");c("∌","\\notni");c("⌜","\\ulcorner");c("⌝","\\urcorner");c("⌞","\\llcorner");c("⌟","\\lrcorner");c("©","\\copyright");c("®","\\textregistered");c("️","\\textregistered");c("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');c("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');c("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');c("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');c("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}");c("⋮","\\vdots");c("\\varGamma","\\mathit{\\Gamma}");c("\\varDelta","\\mathit{\\Delta}");c("\\varTheta","\\mathit{\\Theta}");c("\\varLambda","\\mathit{\\Lambda}");c("\\varXi","\\mathit{\\Xi}");c("\\varPi","\\mathit{\\Pi}");c("\\varSigma","\\mathit{\\Sigma}");c("\\varUpsilon","\\mathit{\\Upsilon}");c("\\varPhi","\\mathit{\\Phi}");c("\\varPsi","\\mathit{\\Psi}");c("\\varOmega","\\mathit{\\Omega}");c("\\substack","\\begin{subarray}{c}#1\\end{subarray}");c("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");c("\\boxed","\\fbox{$\\displaystyle{#1}$}");c("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");c("\\implies","\\DOTSB\\;\\Longrightarrow\\;");c("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var gr={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};c("\\dots",function(r){var e="\\dotso",t=r.expandAfterFuture().text;return t in gr?e=gr[t]:(t.slice(0,4)==="\\not"||t in Y.math&&q.contains(["bin","rel"],Y.math[t].group))&&(e="\\dotsb"),e});var Nt={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};c("\\dotso",function(r){var e=r.future().text;return e in Nt?"\\ldots\\,":"\\ldots"});c("\\dotsc",function(r){var e=r.future().text;return e in Nt&&e!==","?"\\ldots\\,":"\\ldots"});c("\\cdots",function(r){var e=r.future().text;return e in Nt?"\\@cdots\\,":"\\@cdots"});c("\\dotsb","\\cdots");c("\\dotsm","\\cdots");c("\\dotsi","\\!\\cdots");c("\\dotsx","\\ldots\\,");c("\\DOTSI","\\relax");c("\\DOTSB","\\relax");c("\\DOTSX","\\relax");c("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");c("\\,","\\tmspace+{3mu}{.1667em}");c("\\thinspace","\\,");c("\\>","\\mskip{4mu}");c("\\:","\\tmspace+{4mu}{.2222em}");c("\\medspace","\\:");c("\\;","\\tmspace+{5mu}{.2777em}");c("\\thickspace","\\;");c("\\!","\\tmspace-{3mu}{.1667em}");c("\\negthinspace","\\!");c("\\negmedspace","\\tmspace-{4mu}{.2222em}");c("\\negthickspace","\\tmspace-{5mu}{.277em}");c("\\enspace","\\kern.5em ");c("\\enskip","\\hskip.5em\\relax");c("\\quad","\\hskip1em\\relax");c("\\qquad","\\hskip2em\\relax");c("\\tag","\\@ifstar\\tag@literal\\tag@paren");c("\\tag@paren","\\tag@literal{({#1})}");c("\\tag@literal",r=>{if(r.macros.get("\\df@tag"))throw new M("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});c("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");c("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");c("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");c("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");c("\\newline","\\\\\\relax");c("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var ha=A(x0["Main-Regular"]["T".charCodeAt(0)][1]-.7*x0["Main-Regular"]["A".charCodeAt(0)][1]);c("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+ha+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");c("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+ha+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");c("\\hspace","\\@ifstar\\@hspacer\\@hspace");c("\\@hspace","\\hskip #1\\relax");c("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");c("\\ordinarycolon",":");c("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");c("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');c("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');c("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');c("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');c("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');c("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');c("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');c("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');c("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');c("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');c("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');c("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');c("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');c("∷","\\dblcolon");c("∹","\\eqcolon");c("≔","\\coloneqq");c("≕","\\eqqcolon");c("⩴","\\Coloneqq");c("\\ratio","\\vcentcolon");c("\\coloncolon","\\dblcolon");c("\\colonequals","\\coloneqq");c("\\coloncolonequals","\\Coloneqq");c("\\equalscolon","\\eqqcolon");c("\\equalscoloncolon","\\Eqqcolon");c("\\colonminus","\\coloneq");c("\\coloncolonminus","\\Coloneq");c("\\minuscolon","\\eqcolon");c("\\minuscoloncolon","\\Eqcolon");c("\\coloncolonapprox","\\Colonapprox");c("\\coloncolonsim","\\Colonsim");c("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");c("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");c("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");c("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");c("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");c("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");c("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");c("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");c("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");c("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");c("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");c("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");c("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");c("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");c("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");c("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");c("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");c("\\nleqq","\\html@mathml{\\@nleqq}{≰}");c("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");c("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");c("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");c("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");c("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");c("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");c("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");c("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");c("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");c("\\imath","\\html@mathml{\\@imath}{ı}");c("\\jmath","\\html@mathml{\\@jmath}{ȷ}");c("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");c("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");c("⟦","\\llbracket");c("⟧","\\rrbracket");c("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");c("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");c("⦃","\\lBrace");c("⦄","\\rBrace");c("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");c("⦵","\\minuso");c("\\darr","\\downarrow");c("\\dArr","\\Downarrow");c("\\Darr","\\Downarrow");c("\\lang","\\langle");c("\\rang","\\rangle");c("\\uarr","\\uparrow");c("\\uArr","\\Uparrow");c("\\Uarr","\\Uparrow");c("\\N","\\mathbb{N}");c("\\R","\\mathbb{R}");c("\\Z","\\mathbb{Z}");c("\\alef","\\aleph");c("\\alefsym","\\aleph");c("\\Alpha","\\mathrm{A}");c("\\Beta","\\mathrm{B}");c("\\bull","\\bullet");c("\\Chi","\\mathrm{X}");c("\\clubs","\\clubsuit");c("\\cnums","\\mathbb{C}");c("\\Complex","\\mathbb{C}");c("\\Dagger","\\ddagger");c("\\diamonds","\\diamondsuit");c("\\empty","\\emptyset");c("\\Epsilon","\\mathrm{E}");c("\\Eta","\\mathrm{H}");c("\\exist","\\exists");c("\\harr","\\leftrightarrow");c("\\hArr","\\Leftrightarrow");c("\\Harr","\\Leftrightarrow");c("\\hearts","\\heartsuit");c("\\image","\\Im");c("\\infin","\\infty");c("\\Iota","\\mathrm{I}");c("\\isin","\\in");c("\\Kappa","\\mathrm{K}");c("\\larr","\\leftarrow");c("\\lArr","\\Leftarrow");c("\\Larr","\\Leftarrow");c("\\lrarr","\\leftrightarrow");c("\\lrArr","\\Leftrightarrow");c("\\Lrarr","\\Leftrightarrow");c("\\Mu","\\mathrm{M}");c("\\natnums","\\mathbb{N}");c("\\Nu","\\mathrm{N}");c("\\Omicron","\\mathrm{O}");c("\\plusmn","\\pm");c("\\rarr","\\rightarrow");c("\\rArr","\\Rightarrow");c("\\Rarr","\\Rightarrow");c("\\real","\\Re");c("\\reals","\\mathbb{R}");c("\\Reals","\\mathbb{R}");c("\\Rho","\\mathrm{P}");c("\\sdot","\\cdot");c("\\sect","\\S");c("\\spades","\\spadesuit");c("\\sub","\\subset");c("\\sube","\\subseteq");c("\\supe","\\supseteq");c("\\Tau","\\mathrm{T}");c("\\thetasym","\\vartheta");c("\\weierp","\\wp");c("\\Zeta","\\mathrm{Z}");c("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");c("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");c("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");c("\\bra","\\mathinner{\\langle{#1}|}");c("\\ket","\\mathinner{|{#1}\\rangle}");c("\\braket","\\mathinner{\\langle{#1}\\rangle}");c("\\Bra","\\left\\langle#1\\right|");c("\\Ket","\\left|#1\\right\\rangle");var ma=r=>e=>{var t=e.consumeArg().tokens,a=e.consumeArg().tokens,n=e.consumeArg().tokens,s=e.consumeArg().tokens,o=e.macros.get("|"),h=e.macros.get("\\|");e.macros.beginGroup();var m=b=>w=>{r&&(w.macros.set("|",o),n.length&&w.macros.set("\\|",h));var x=b;if(!b&&n.length){var z=w.future();z.text==="|"&&(w.popToken(),x=!0)}return{tokens:x?n:a,numArgs:0}};e.macros.set("|",m(!1)),n.length&&e.macros.set("\\|",m(!0));var p=e.consumeArg().tokens,v=e.expandTokens([...s,...p,...t]);return e.macros.endGroup(),{tokens:v.reverse(),numArgs:0}};c("\\bra@ket",ma(!1));c("\\bra@set",ma(!0));c("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");c("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");c("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");c("\\angln","{\\angl n}");c("\\blue","\\textcolor{##6495ed}{#1}");c("\\orange","\\textcolor{##ffa500}{#1}");c("\\pink","\\textcolor{##ff00af}{#1}");c("\\red","\\textcolor{##df0030}{#1}");c("\\green","\\textcolor{##28ae7b}{#1}");c("\\gray","\\textcolor{gray}{#1}");c("\\purple","\\textcolor{##9d38bd}{#1}");c("\\blueA","\\textcolor{##ccfaff}{#1}");c("\\blueB","\\textcolor{##80f6ff}{#1}");c("\\blueC","\\textcolor{##63d9ea}{#1}");c("\\blueD","\\textcolor{##11accd}{#1}");c("\\blueE","\\textcolor{##0c7f99}{#1}");c("\\tealA","\\textcolor{##94fff5}{#1}");c("\\tealB","\\textcolor{##26edd5}{#1}");c("\\tealC","\\textcolor{##01d1c1}{#1}");c("\\tealD","\\textcolor{##01a995}{#1}");c("\\tealE","\\textcolor{##208170}{#1}");c("\\greenA","\\textcolor{##b6ffb0}{#1}");c("\\greenB","\\textcolor{##8af281}{#1}");c("\\greenC","\\textcolor{##74cf70}{#1}");c("\\greenD","\\textcolor{##1fab54}{#1}");c("\\greenE","\\textcolor{##0d923f}{#1}");c("\\goldA","\\textcolor{##ffd0a9}{#1}");c("\\goldB","\\textcolor{##ffbb71}{#1}");c("\\goldC","\\textcolor{##ff9c39}{#1}");c("\\goldD","\\textcolor{##e07d10}{#1}");c("\\goldE","\\textcolor{##a75a05}{#1}");c("\\redA","\\textcolor{##fca9a9}{#1}");c("\\redB","\\textcolor{##ff8482}{#1}");c("\\redC","\\textcolor{##f9685d}{#1}");c("\\redD","\\textcolor{##e84d39}{#1}");c("\\redE","\\textcolor{##bc2612}{#1}");c("\\maroonA","\\textcolor{##ffbde0}{#1}");c("\\maroonB","\\textcolor{##ff92c6}{#1}");c("\\maroonC","\\textcolor{##ed5fa6}{#1}");c("\\maroonD","\\textcolor{##ca337c}{#1}");c("\\maroonE","\\textcolor{##9e034e}{#1}");c("\\purpleA","\\textcolor{##ddd7ff}{#1}");c("\\purpleB","\\textcolor{##c6b9fc}{#1}");c("\\purpleC","\\textcolor{##aa87ff}{#1}");c("\\purpleD","\\textcolor{##7854ab}{#1}");c("\\purpleE","\\textcolor{##543b78}{#1}");c("\\mintA","\\textcolor{##f5f9e8}{#1}");c("\\mintB","\\textcolor{##edf2df}{#1}");c("\\mintC","\\textcolor{##e0e5cc}{#1}");c("\\grayA","\\textcolor{##f6f7f7}{#1}");c("\\grayB","\\textcolor{##f0f1f2}{#1}");c("\\grayC","\\textcolor{##e3e5e6}{#1}");c("\\grayD","\\textcolor{##d6d8da}{#1}");c("\\grayE","\\textcolor{##babec2}{#1}");c("\\grayF","\\textcolor{##888d93}{#1}");c("\\grayG","\\textcolor{##626569}{#1}");c("\\grayH","\\textcolor{##3b3e40}{#1}");c("\\grayI","\\textcolor{##21242c}{#1}");c("\\kaBlue","\\textcolor{##314453}{#1}");c("\\kaGreen","\\textcolor{##71B307}{#1}");var ca={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class A4{constructor(e,t,a){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new M4(z4,t.macros),this.mode=a,this.stack=[]}feed(e){this.lexer=new pr(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,a,n;if(e){if(this.consumeSpaces(),this.future().text!=="[")return null;t=this.popToken(),{tokens:n,end:a}=this.consumeArg(["]"])}else({tokens:n,start:t,end:a}=this.consumeArg());return this.pushToken(new f0("EOF",a.loc)),this.pushTokens(n),t.range(a,"")}consumeSpaces(){for(;;){var e=this.future();if(e.text===" ")this.stack.pop();else break}}consumeArg(e){var t=[],a=e&&e.length>0;a||this.consumeSpaces();var n=this.future(),s,o=0,h=0;do{if(s=this.popToken(),t.push(s),s.text==="{")++o;else if(s.text==="}"){if(--o,o===-1)throw new M("Extra }",s)}else if(s.text==="EOF")throw new M("Unexpected end of input in a macro argument, expected '"+(e&&a?e[h]:"}")+"'",s);if(e&&a)if((o===0||o===1&&e[h]==="{")&&s.text===e[h]){if(++h,h===e.length){t.splice(-h,h);break}}else h=0}while(o!==0||a);return n.text==="{"&&t[t.length-1].text==="}"&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:n,end:s}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new M("The length of delimiters doesn't match the number of args!");for(var a=t[0],n=0;nthis.settings.maxExpand)throw new M("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){var t=this.popToken(),a=t.text,n=t.noexpand?null:this._getExpansion(a);if(n==null||e&&n.unexpandable){if(e&&n==null&&a[0]==="\\"&&!this.isDefined(a))throw new M("Undefined control sequence: "+a);return this.pushToken(t),!1}this.countExpansion(1);var s=n.tokens,o=this.consumeArgs(n.numArgs,n.delimiters);if(n.numArgs){s=s.slice();for(var h=s.length-1;h>=0;--h){var m=s[h];if(m.text==="#"){if(h===0)throw new M("Incomplete placeholder at end of macro body",m);if(m=s[--h],m.text==="#")s.splice(h+1,1);else if(/^[1-9]$/.test(m.text))s.splice(h,2,...o[+m.text-1]);else throw new M("Not a valid argument number",m)}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new f0(e)]):void 0}expandTokens(e){var t=[],a=this.stack.length;for(this.pushTokens(e);this.stack.length>a;)if(this.expandOnce(!0)===!1){var n=this.stack.pop();n.treatAsRelax&&(n.noexpand=!1,n.treatAsRelax=!1),t.push(n)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(a=>a.text).join("")}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var a=this.lexer.catcodes[e];if(a!=null&&a!==13)return}var n=typeof t=="function"?t(this):t;if(typeof n=="string"){var s=0;if(n.indexOf("#")!==-1)for(var o=n.replace(/##/g,"");o.indexOf("#"+(s+1))!==-1;)++s;for(var h=new pr(n,this.settings),m=[],p=h.lex();p.text!=="EOF";)m.push(p),p=h.lex();m.reverse();var v={tokens:m,numArgs:s};return v}return n}isDefined(e){return this.macros.has(e)||O0.hasOwnProperty(e)||Y.math.hasOwnProperty(e)||Y.text.hasOwnProperty(e)||ca.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return t!=null?typeof t=="string"||typeof t=="function"||!t.unexpandable:O0.hasOwnProperty(e)&&!O0[e].primitive}}var br=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Me=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),nt={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},yr={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class Oe{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new A4(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new M("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new f0("}")),this.gullet.pushTokens(e);var a=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,a}parseExpression(e,t){for(var a=[];;){this.mode==="math"&&this.consumeSpaces();var n=this.fetch();if(Oe.endOfExpression.indexOf(n.text)!==-1||t&&n.text===t||e&&O0[n.text]&&O0[n.text].infix)break;var s=this.parseAtom(t);if(s){if(s.type==="internal")continue}else break;a.push(s)}return this.mode==="text"&&this.formLigatures(a),this.handleInfixNodes(a)}handleInfixNodes(e){for(var t=-1,a,n=0;n=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var h=Y[this.mode][t].group,m=u0.range(e),p;if(f1.hasOwnProperty(h)){var v=h;p={type:"atom",mode:this.mode,family:v,loc:m,text:t}}else p={type:h,mode:this.mode,loc:m,text:t};o=p}else if(t.charCodeAt(0)>=128)this.settings.strict&&(wr(t.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'"'+(" ("+t.charCodeAt(0)+")"),e)),o={type:"textord",mode:"text",loc:u0.range(e),text:t};else return null;if(this.consume(),s)for(var b=0;b=r.length-1}function s(){return r[a],a++,r[a]}function o(){return a--,r[a],r[a]}function h(){for(;!n();){let p=s();if(p!==" "&&p!==" "){o();break}}}function m(){let p=s();if(p===` -`)return{kind:"symbol",value:"newline"};if(p==="{")return{kind:"symbol",value:"indent"};if(p==="}")return{kind:"symbol",value:"dedent"};if(p==="$"){let v="";for(;!n()&&(p=s(),p!=="$");)v+=p;return{kind:"expression",value:v}}else if(p==="#"){let v="";for(;!n();){if(p=s(),p===` -`){o();break}v+=p}return{kind:"comment",value:v}}else{let v=p;for(;!n();){if(p=s(),!/[a-z]/.test(p)){o();break}v+=p}return{kind:"keyword",value:v}}}for(h();!n();)t.push(m()),h();for(;t.length>0&&t[t.length-1].kind==="symbol"&&t[t.length-1].value==="newline";)t.pop();for(;t.length>0&&t[0].kind==="symbol"&&t[0].value==="newline";)t.shift();return t}function q4(r){console.log(r);function e(h){let m=document.createElement("span");return m.textContent=h,m.innerHTML}let t="",a=0,n=0,s=!0,o=!1;for(let h of r){if(h.kind==="symbol")if(h.value==="newline"){if(s&&!o){o=!0;continue}a++,t+="
",s=!0}else h.value==="indent"?(n===0&&(a=0),t+=": ",n++):n--;else if(h.kind==="expression"){n!==0&&s&&(t+=`
${a}
`);let m=new Map,p=C4.renderToString(h.value,{displayMode:!1,macros:{"\\fn":function(v){let b="";for(let x of v.consumeArgs(1)[0])b=x.text+b;let w=m.get(b);if(w===void 0){let x="FUNC"+crypto.randomUUID().replace(/-/g,"");m.set(b,x),w=x}return`\\text{${w}}`}}})+" ";for(let[v,b]of m){let w=v.split("-").map(x=>`${(x.at(0)||"").toUpperCase()}${x.slice(1).toUpperCase()}`).join("-");p=p.replaceAll(b,`${w}`)}t+=p}else if(h.kind==="comment"){let m=s;n!==0&&s&&(t+=`
${a}
`),m?t+=`# ${e(h.value)} `:t+=`# ${e(h.value)} `}else n!==0&&s&&(t+=`
${a}
`),t+=`${e(h.value)} `;s=s&&h.kind==="symbol",o=h.kind==="symbol"&&h.value==="newline"}return t}function E4(r){return q4(N4(r))}function R4(r){let e,t,a;const n=r[1].default,s=Sa(n,r,r[0],null);return{c(){e=Ma("div"),t=za("div","algorithm-inner"),s&&s.c(),this.h()},l(o){e=Lt(o,"DIV",{class:!0});var h=Ot(e);t=Lt(h,"DIV",{is:!0});var m=Ot(t);s&&s.l(m),m.forEach($e),h.forEach($e),this.h()},h(){Ft(t,"is","algorithm-inner"),Ft(e,"class","algorithm-container")},m(o,h){Aa(o,e,h),Ta(e,t),s&&s.m(t,null),a=!0},p(o,[h]){s&&s.p&&(!a||h&1)&&Ba(s,n,o,o[0],a?Ca(n,o[0],h,null):Da(o[0]),null)},i(o){a||(Na(s,o),a=!0)},o(o){qa(s,o),a=!1},d(o){o&&$e(e),s&&s.d(o)}}}const I4=` - `;if(typeof HTMLDivElement<"u"){class r extends HTMLDivElement{constructor(){super();Ue(this,"root");Ue(this,"code");this.root=this.attachShadow({mode:"closed"}),this.code=""}recompile(){const a=this.textContent||"";if(a===this.code)return;console.log(a);const n=E4(a);this.code=a,this.root.innerHTML=n+I4}connectedCallback(){this.recompile(),new MutationObserver(()=>this.recompile()).observe(this,{childList:!0,subtree:!0})}}customElements.define("algorithm-inner",r,{extends:"div"})}function H4(r,e,t){let{$$slots:a={},$$scope:n}=e;return r.$$set=s=>{"$$scope"in s&&t(0,n=s.$$scope)},[n,a]}class F4 extends xa{constructor(e){super(),wa(this,e,H4,R4,ka,{})}}export{F4 as A,C4 as k}; diff --git a/docs/_app/immutable/chunks/Proof.26996d3c.js b/docs/_app/immutable/chunks/Proof.26996d3c.js deleted file mode 100644 index 9f3a2ab..0000000 --- a/docs/_app/immutable/chunks/Proof.26996d3c.js +++ /dev/null @@ -1,3 +0,0 @@ -import{S as D,i as K,s as L,I as M,k as p,q as y,a as N,l as h,m as b,r as k,h as _,c as T,n as q,b as g,E as f,K as V,L as j,M as w,g as z,d as B}from"./index.488f1ee5.js";import"./State.8d241e02.js";function F(i){let t;return{c(){t=y("of Time Complexity")},l(e){t=k(e,"of Time Complexity")},m(e,o){g(e,t,o)},d(e){e&&_(t)}}}function G(i){let t;return{c(){t=y("of Correctness")},l(e){t=k(e,"of Correctness")},m(e,o){g(e,t,o)},d(e){e&&_(t)}}}function H(i){let t,e,o,u,r,c,d,P,m;function S(s,n){if(s[0]==="correctness")return G;if(s[0]==="time")return F}let v=S(i),a=v&&v(i);const C=i[2].default,l=M(C,i,i[1],null);return{c(){t=p("div"),e=p("i"),o=y(`Proof - `),a&&a.c(),u=N(),r=p("span"),l&&l.c(),c=N(),d=p("span"),P=y("⯀"),this.h()},l(s){t=h(s,"DIV",{class:!0});var n=b(t);e=h(n,"I",{class:!0});var E=b(e);o=k(E,`Proof - `),a&&a.l(E),E.forEach(_),u=T(n),r=h(n,"SPAN",{class:!0});var I=b(r);l&&l.l(I),I.forEach(_),c=T(n),d=h(n,"SPAN",{class:!0});var A=b(d);P=k(A,"⯀"),A.forEach(_),n.forEach(_),this.h()},h(){q(e,"class","svelte-16vvohq"),q(r,"class","child svelte-16vvohq"),q(d,"class","qed svelte-16vvohq"),q(t,"class","svelte-16vvohq")},m(s,n){g(s,t,n),f(t,e),f(e,o),a&&a.m(e,null),f(t,u),f(t,r),l&&l.m(r,null),f(t,c),f(t,d),f(d,P),m=!0},p(s,[n]){v!==(v=S(s))&&(a&&a.d(1),a=v&&v(s),a&&(a.c(),a.m(e,null))),l&&l.p&&(!m||n&2)&&V(l,C,s,s[1],m?w(C,s[1],n,null):j(s[1]),null)},i(s){m||(z(l,s),m=!0)},o(s){B(l,s),m=!1},d(s){s&&_(t),a&&a.d(),l&&l.d(s)}}}function J(i,t,e){let{$$slots:o={},$$scope:u}=t,{variant:r="proposition"}=t;return i.$$set=c=>{"variant"in c&&e(0,r=c.variant),"$$scope"in c&&e(1,u=c.$$scope)},[r,u,o]}class R extends D{constructor(t){super(),K(this,t,J,H,L,{variant:0})}}export{R as P}; diff --git a/docs/_app/immutable/chunks/State.8d241e02.js b/docs/_app/immutable/chunks/State.8d241e02.js deleted file mode 100644 index 980bda5..0000000 --- a/docs/_app/immutable/chunks/State.8d241e02.js +++ /dev/null @@ -1 +0,0 @@ -import{S as D,i as G,s as K,I as L,k as w,q as h,a as E,l as y,m as C,r as S,c as j,h as c,n as P,b as g,E as b,u as q,K as M,L as O,M as R,g as T,d as V}from"./index.488f1ee5.js";function U(a){let t;return{c(){t=h(a[2])},l(e){t=S(e,a[2])},m(e,n){g(e,t,n)},p(e,n){n&4&&q(t,e[2])},d(e){e&&c(t)}}}function A(a){let t,e,n;return{c(){t=h("("),e=h(a[1]),n=h(")")},l(s){t=S(s,"("),e=S(s,a[1]),n=S(s,")")},m(s,r){g(s,t,r),g(s,e,r),g(s,n,r)},p(s,r){r&2&&q(e,s[1])},d(s){s&&c(t),s&&c(e),s&&c(n)}}}function z(a){var I;let t,e,n=((I=a[0].at(0))==null?void 0:I.toUpperCase())+a[0].slice(1)+"",s,r,d,p,_,v,i=a[2]>0&&U(a),f=a[1]&&A(a);const k=a[4].default,o=L(k,a,a[3],null);return{c(){t=w("div"),e=w("strong"),s=h(n),r=E(),i&&i.c(),d=E(),f&&f.c(),p=E(),_=w("span"),o&&o.c(),this.h()},l(l){t=y(l,"DIV",{});var u=C(t);e=y(u,"STRONG",{class:!0});var m=C(e);s=S(m,n),r=j(m),i&&i.l(m),d=j(m),f&&f.l(m),m.forEach(c),p=j(u),_=y(u,"SPAN",{class:!0});var N=C(_);o&&o.l(N),N.forEach(c),u.forEach(c),this.h()},h(){P(e,"class","svelte-jww2m9"),P(_,"class","svelte-jww2m9")},m(l,u){g(l,t,u),b(t,e),b(e,s),b(e,r),i&&i.m(e,null),b(e,d),f&&f.m(e,null),b(t,p),b(t,_),o&&o.m(_,null),v=!0},p(l,[u]){var m;(!v||u&1)&&n!==(n=((m=l[0].at(0))==null?void 0:m.toUpperCase())+l[0].slice(1)+"")&&q(s,n),l[2]>0?i?i.p(l,u):(i=U(l),i.c(),i.m(e,d)):i&&(i.d(1),i=null),l[1]?f?f.p(l,u):(f=A(l),f.c(),f.m(e,null)):f&&(f.d(1),f=null),o&&o.p&&(!v||u&8)&&M(o,k,l,l[3],v?R(k,l[3],u,null):O(l[3]),null)},i(l){v||(T(o,l),v=!0)},o(l){V(o,l),v=!1},d(l){l&&c(t),i&&i.d(),f&&f.d(),o&&o.d(l)}}}function B(a,t,e){let{$$slots:n={},$$scope:s}=t,{variant:r="proposition"}=t,{name:d=""}=t,{number:p=-1}=t;return a.$$set=_=>{"variant"in _&&e(0,r=_.variant),"name"in _&&e(1,d=_.name),"number"in _&&e(2,p=_.number),"$$scope"in _&&e(3,s=_.$$scope)},[r,d,p,s,n]}class H extends D{constructor(t){super(),G(this,t,B,z,K,{variant:0,name:1,number:2})}}export{H as S}; diff --git a/docs/_app/immutable/chunks/common.2a229ee5.js b/docs/_app/immutable/chunks/common.2a229ee5.js deleted file mode 100644 index 80cece5..0000000 --- a/docs/_app/immutable/chunks/common.2a229ee5.js +++ /dev/null @@ -1 +0,0 @@ -import{w as e}from"./index.e524927c.js";let r=e(""),o=e(null),b=e(!0),f=e(!1);function u(t,a="/",s=!0,l=!1){r.set(t),o.set(a),b.set(s),f.set(l)}export{b as a,o as b,u as p,f as s,r as t}; diff --git a/docs/_app/immutable/chunks/index.488f1ee5.js b/docs/_app/immutable/chunks/index.488f1ee5.js deleted file mode 100644 index 550e9c2..0000000 --- a/docs/_app/immutable/chunks/index.488f1ee5.js +++ /dev/null @@ -1 +0,0 @@ -function E(){}function F(t,n){for(const e in n)t[e]=n[e];return t}function D(t){return t()}function C(){return Object.create(null)}function g(t){t.forEach(D)}function L(t){return typeof t=="function"}function ot(t,n){return t!=t?n==n:t!==n||t&&typeof t=="object"||typeof t=="function"}let b;function lt(t,n){return b||(b=document.createElement("a")),b.href=n,t===b.href}function R(t){return Object.keys(t).length===0}function W(t,...n){if(t==null)return E;const e=t.subscribe(...n);return e.unsubscribe?()=>e.unsubscribe():e}function st(t,n,e){t.$$.on_destroy.push(W(n,e))}function ft(t,n,e,i){if(t){const r=O(t,n,e,i);return t[0](r)}}function O(t,n,e,i){return t[1]&&i?F(e.ctx.slice(),t[1](i(n))):e.ctx}function at(t,n,e,i){if(t[2]&&i){const r=t[2](i(e));if(n.dirty===void 0)return r;if(typeof r=="object"){const s=[],u=Math.max(n.dirty.length,r.length);for(let o=0;o32){const n=[],e=t.ctx.length/32;for(let i=0;i>1);e(r)<=i?t=r+1:n=r}return t}function K(t){if(t.hydrate_init)return;t.hydrate_init=!0;let n=t.childNodes;if(t.nodeName==="HEAD"){const c=[];for(let l=0;l0&&n[e[r]].claim_order<=l?r+1:J(1,r,x=>n[e[x]].claim_order,l))-1;i[c]=e[a]+1;const f=a+1;e[f]=c,r=Math.max(f,r)}const s=[],u=[];let o=n.length-1;for(let c=e[r]+1;c!=0;c=i[c-1]){for(s.push(n[c-1]);o>=c;o--)u.push(n[o]);o--}for(;o>=0;o--)u.push(n[o]);s.reverse(),u.sort((c,l)=>c.claim_order-l.claim_order);for(let c=0,l=0;c=s[l].claim_order;)l++;const a=lt.removeEventListener(n,e,i)}function Et(t,n,e){e==null?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function X(t){return Array.from(t.childNodes)}function Y(t){t.claim_info===void 0&&(t.claim_info={last_index:0,total_claimed:0})}function q(t,n,e,i,r=!1){Y(t);const s=(()=>{for(let u=t.claim_info.last_index;u=0;u--){const o=t[u];if(n(o)){const c=e(o);return c===void 0?t.splice(u,1):t[u]=c,r?c===void 0&&t.claim_info.last_index--:t.claim_info.last_index=u,o}}return i()})();return s.claim_order=t.claim_info.total_claimed,t.claim_info.total_claimed+=1,s}function Z(t,n,e,i){return q(t,r=>r.nodeName===n,r=>{const s=[];for(let u=0;ur.removeAttribute(u))},()=>i(n))}function wt(t,n,e){return Z(t,n,e,V)}function tt(t,n){return q(t,e=>e.nodeType===3,e=>{const i=""+n;if(e.data.startsWith(i)){if(e.data.length!==i.length)return e.splitText(i.length)}else e.data=i},()=>j(n),!0)}function Nt(t){return tt(t," ")}function vt(t,n){n=""+n,t.data!==n&&(t.data=n)}function At(t,n){t.value=n??""}function jt(t,n,e,i){e==null?t.style.removeProperty(n):t.style.setProperty(n,e,i?"important":"")}function kt(t,n,e){t.classList[e?"add":"remove"](n)}function St(t,n){const e=[];let i=0;for(const r of n.childNodes)if(r.nodeType===8){const s=r.textContent.trim();s===`HEAD_${t}_END`?(i-=1,e.push(r)):s===`HEAD_${t}_START`&&(i+=1,e.push(r))}else i>0&&e.push(r);return e}function Ct(t,n){return new t(n)}let y;function p(t){y=t}function B(){if(!y)throw new Error("Function called outside component initialization");return y}function Tt(t){B().$$.on_mount.push(t)}function Mt(t){B().$$.after_update.push(t)}const h=[],T=[];let m=[];const M=[],H=Promise.resolve();let v=!1;function P(){v||(v=!0,H.then(z))}function Dt(){return P(),H}function A(t){m.push(t)}const N=new Set;let d=0;function z(){if(d!==0)return;const t=y;do{try{for(;dt.indexOf(i)===-1?n.push(i):e.push(i)),e.forEach(i=>i()),m=n}const $=new Set;let _;function Lt(){_={r:0,c:[],p:_}}function Ot(){_.r||g(_.c),_=_.p}function it(t,n){t&&t.i&&($.delete(t),t.i(n))}function qt(t,n,e,i){if(t&&t.o){if($.has(t))return;$.add(t),_.c.push(()=>{$.delete(t),i&&(e&&t.d(1),i())}),t.o(n)}else i&&i()}function Bt(t,n){const e={},i={},r={$$scope:1};let s=t.length;for(;s--;){const u=t[s],o=n[s];if(o){for(const c in u)c in o||(i[c]=1);for(const c in o)r[c]||(e[c]=o[c],r[c]=1);t[s]=o}else for(const c in u)r[c]=1}for(const u in i)u in e||(e[u]=void 0);return e}function Ht(t){return typeof t=="object"&&t!==null?t:{}}function Pt(t){t&&t.c()}function zt(t,n){t&&t.l(n)}function rt(t,n,e,i){const{fragment:r,after_update:s}=t.$$;r&&r.m(n,e),i||A(()=>{const u=t.$$.on_mount.map(D).filter(L);t.$$.on_destroy?t.$$.on_destroy.push(...u):g(u),t.$$.on_mount=[]}),s.forEach(A)}function ct(t,n){const e=t.$$;e.fragment!==null&&(et(e.after_update),g(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}function ut(t,n){t.$$.dirty[0]===-1&&(h.push(t),P(),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<{const S=k.length?k[0]:x;return l.ctx&&r(l.ctx[f],l.ctx[f]=S)&&(!l.skip_bound&&l.bound[f]&&l.bound[f](S),a&&ut(t,f)),x}):[],l.update(),a=!0,g(l.before_update),l.fragment=i?i(l.ctx):!1,n.target){if(n.hydrate){G();const f=X(n.target);l.fragment&&l.fragment.l(f),f.forEach(U)}else l.fragment&&l.fragment.c();n.intro&&it(t.$$.fragment),rt(t,n.target,n.anchor,n.customElement),I(),z()}p(c)}class Rt{$destroy(){ct(this,1),this.$destroy=E}$on(n,e){if(!L(e))return E;const i=this.$$.callbacks[n]||(this.$$.callbacks[n]=[]);return i.push(e),()=>{const r=i.indexOf(e);r!==-1&&i.splice(r,1)}}$set(n){this.$$set&&!R(n)&&(this.$$.skip_bound=!0,this.$$set(n),this.$$.skip_bound=!1)}}export{rt as A,ct as B,lt as C,kt as D,Q as E,$t as F,E as G,g as H,ft as I,St as J,_t as K,dt as L,at as M,st as N,F as O,Bt as P,Ht as Q,ht as R,Rt as S,mt as T,At as U,gt as V,yt as W,xt as a,pt as b,Nt as c,qt as d,bt as e,Ot as f,it as g,U as h,Ft as i,Mt as j,V as k,wt as l,X as m,Et as n,Tt as o,jt as p,j as q,tt as r,ot as s,Dt as t,vt as u,Lt as v,T as w,Ct as x,Pt as y,zt as z}; diff --git a/docs/_app/immutable/chunks/index.e524927c.js b/docs/_app/immutable/chunks/index.e524927c.js deleted file mode 100644 index 531f9ce..0000000 --- a/docs/_app/immutable/chunks/index.e524927c.js +++ /dev/null @@ -1 +0,0 @@ -import{G as f,s as l}from"./index.488f1ee5.js";const e=[];function h(n,u=f){let i;const o=new Set;function r(t){if(l(n,t)&&(n=t,i)){const c=!e.length;for(const s of o)s[1](),e.push(s,n);if(c){for(let s=0;s{o.delete(s),o.size===0&&i&&(i(),i=null)}}return{set:r,update:b,subscribe:p}}export{h as w}; diff --git a/docs/_app/immutable/chunks/layout.c8702512.js b/docs/_app/immutable/chunks/layout.c8702512.js deleted file mode 100644 index b23b762..0000000 --- a/docs/_app/immutable/chunks/layout.c8702512.js +++ /dev/null @@ -1 +0,0 @@ -import{S as H,i as J,s as M,k as y,a as L,q as Z,l as N,m as E,h as d,c as T,r as x,n as p,D,b as w,E as k,F as j,u as ee,g as b,v as F,d as $,f as P,H as te,N as S,e as V,W as U,y as W,z as X,A as z,B as O,I as le,J as se,K as ne,L as re,M as oe,G as ie}from"./index.488f1ee5.js";import{p as ae}from"./stores.dc3de9bf.js";import{t as ue,a as ce,b as fe}from"./common.2a229ee5.js";import{w as he}from"./index.e524927c.js";const C=[{title:"Experiment",sub:[{title:"画图",url:"/note/graph-experiment"}],url:""},{title:"Graph Theory",sub:[{title:"Network Flow",url:"/note/network-flow"}],url:""},{title:"Number Theory",sub:[{title:"Chinese Remainder Theorem (CRT)",url:"/note/chinese-remainder-theorem"},{title:"Dirichlet convolution",url:"/note/dirichlet-convolution"},{title:"Euler's Totient Function",url:"/note/eulers-totient-function"},{title:"Mobius Function",url:"/note/mobius-function"}],url:""},{title:"Numerical Analysis",sub:[{title:"Chebyshev Polynomial",url:"/note/chebyshev-polynomial"},{title:"Numeric Differentiation",url:"/note/numerical-differentiation"},{title:"Numeric Integration",url:"/note/numerical-integration"}],url:""}];let Q=he("");function me(o,t,s){ue.set("笔记 - "+o),ce.set(!1),fe.set(t),Q.set(t+"/"+s)}function _e(o){for(let t of C)for(let s of t.sub)if(s.url===o)return s.title;return""}function q(o,t,s){const e=o.slice();return e[7]=t[s],e}function B(o){let t,s,e=o[0].sub,n=[];for(let r=0;r$(n[r],1,1,()=>{n[r]=null});return{c(){for(let r=0;r{_=null}),P())},i(l){f||(b(_),f=!0)},o(l){$(_),f=!1},d(l){l&&d(t),_&&_.d(),g=!1,te(h)}}}function pe(o,t,s){let e;S(o,Q,f=>s(3,e=f));let{note:n}=t,c=!1,r=!1;const u=()=>s(1,c=!c),i=()=>s(1,c=!c),v=()=>s(1,c=!c);return o.$$set=f=>{"note"in f&&s(0,n=f.note)},o.$$.update=()=>{if(o.$$.dirty&9){let f=g=>{if(g.url===e)return!0;if(typeof g.sub<"u"){for(let h of g.sub)if(f(h))return!0}return!1};s(1,c=f(n)),s(2,r=n.url===e)}},[n,c,r,e,u,i,v]}class Y extends H{constructor(t){super(),J(this,t,pe,de,M,{note:0})}}function A(o,t,s){const e=o.slice();return e[5]=t[s],e}function G(o){let t,s;return t=new Y({props:{note:o[5]}}),{c(){W(t.$$.fragment)},l(e){X(t.$$.fragment,e)},m(e,n){z(t,e,n),s=!0},p:ie,i(e){s||(b(t.$$.fragment,e),s=!0)},o(e){$(t.$$.fragment,e),s=!1},d(e){O(t,e)}}}function ge(o){let t,s,e,n,c,r,u,i;const v=o[1].default,f=le(v,o,o[0],null);let g=C,h=[];for(let l=0;l$(h[l],1,1,()=>{h[l]=null});return{c(){t=y("link"),s=y("link"),e=y("link"),n=L(),c=y("div"),f&&f.c(),r=L(),u=y("div");for(let l=0;ls(2,e=i));let{$$slots:n={},$$scope:c}=t,r=e.url.pathname,u=r.lastIndexOf("/");return me(_e(r),r.substring(0,u),r.substring(u+1)),o.$$set=i=>{"$$scope"in i&&s(0,c=i.$$scope)},[c,n]}class $e extends H{constructor(t){super(),J(this,t,ve,ge,M,{})}}export{$e as L}; diff --git a/docs/_app/immutable/chunks/singletons.82bf7fa3.js b/docs/_app/immutable/chunks/singletons.82bf7fa3.js deleted file mode 100644 index 1132ff5..0000000 --- a/docs/_app/immutable/chunks/singletons.82bf7fa3.js +++ /dev/null @@ -1 +0,0 @@ -import{w as u}from"./index.e524927c.js";var _;const k=((_=globalThis.__sveltekit_nl8p4r)==null?void 0:_.base)??"";var g;const m=((g=globalThis.__sveltekit_nl8p4r)==null?void 0:g.assets)??k,w="1714752774009",T="sveltekit:snapshot",y="sveltekit:scroll",I="sveltekit:index",f={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},h=location.origin;function S(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function x(){return{x:pageXOffset,y:pageYOffset}}function c(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const d={...f,"":f.hover};function b(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function O(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=b(e)}}function U(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||A(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=(n==null?void 0:n.origin)===h&&e.hasAttribute("download");return{url:n,external:r,target:o,download:l}}function L(e){let t=null,n=null,o=null,r=null,l=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=c(s,"preload-code")),r===null&&(r=c(s,"preload-data")),t===null&&(t=c(s,"keepfocus")),n===null&&(n=c(s,"noscroll")),l===null&&(l=c(s,"reload")),a===null&&(a=c(s,"replacestate")),s=b(s);function i(v){switch(v){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:d[o??"off"],preload_data:d[r??"off"],keep_focus:i(t),noscroll:i(n),reload:i(l),replace_state:i(a)}}function p(e){const t=u(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function l(a){let s;return t.subscribe(i=>{(s===void 0||n&&i!==s)&&a(s=i)})}return{notify:o,set:r,subscribe:l}}function E(){const{set:e,subscribe:t}=u(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${m}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==w;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function A(e,t){return e.origin!==h||!e.pathname.startsWith(t)}function N(e){e.client}const P={url:p({}),page:p({}),navigating:u(null),updated:E()};export{I,f as P,y as S,T as a,U as b,L as c,P as d,k as e,O as f,S as g,N as h,A as i,h as o,x as s}; diff --git a/docs/_app/immutable/chunks/stores.dc3de9bf.js b/docs/_app/immutable/chunks/stores.dc3de9bf.js deleted file mode 100644 index 8cbbb04..0000000 --- a/docs/_app/immutable/chunks/stores.dc3de9bf.js +++ /dev/null @@ -1 +0,0 @@ -import{d as e}from"./singletons.82bf7fa3.js";const r=()=>{const s=e;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},b={subscribe(s){return r().page.subscribe(s)}};export{b as p}; diff --git a/docs/_app/immutable/entry/app.62c2f43c.js b/docs/_app/immutable/entry/app.62c2f43c.js deleted file mode 100644 index 94f710e..0000000 --- a/docs/_app/immutable/entry/app.62c2f43c.js +++ /dev/null @@ -1 +0,0 @@ -import{S as C,i as q,s as U,a as j,e as d,c as z,b as E,d as h,f as P,g as w,h as g,j as W,o as F,k as G,l as H,m as J,n as D,p,q as K,r as M,u as Q,v as A,t as X,w as I,x as b,y as k,z as O,A as R,B as L}from"../chunks/index.488f1ee5.js";const Y="modulepreload",Z=function(a,e){return new URL(a,e).href},T={},m=function(e,n,i){if(!n||n.length===0)return e();const r=document.getElementsByTagName("link");return Promise.all(n.map(f=>{if(f=Z(f,i),f in T)return;T[f]=!0;const t=f.endsWith(".css"),o=t?'[rel="stylesheet"]':"";if(!!i)for(let l=r.length-1;l>=0;l--){const u=r[l];if(u.href===f&&(!t||u.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${o}`))return;const s=document.createElement("link");if(s.rel=t?"stylesheet":Y,t||(s.as="script",s.crossOrigin=""),s.href=f,document.head.appendChild(s),t)return new Promise((l,u)=>{s.addEventListener("load",l),s.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${f}`)))})})).then(()=>e()).catch(f=>{const t=new Event("vite:preloadError",{cancelable:!0});if(t.payload=f,window.dispatchEvent(t),!t.defaultPrevented)throw f})},re={};function $(a){let e,n,i;var r=a[1][0];function f(t){return{props:{data:t[3],form:t[2]}}}return r&&(e=b(r,f(a)),a[12](e)),{c(){e&&k(e.$$.fragment),n=d()},l(t){e&&O(e.$$.fragment,t),n=d()},m(t,o){e&&R(e,t,o),E(t,n,o),i=!0},p(t,o){const c={};if(o&8&&(c.data=t[3]),o&4&&(c.form=t[2]),o&2&&r!==(r=t[1][0])){if(e){A();const s=e;h(s.$$.fragment,1,0,()=>{L(s,1)}),P()}r?(e=b(r,f(t)),t[12](e),k(e.$$.fragment),w(e.$$.fragment,1),R(e,n.parentNode,n)):e=null}else r&&e.$set(c)},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){a[12](null),t&&g(n),e&&L(e,t)}}}function x(a){let e,n,i;var r=a[1][0];function f(t){return{props:{data:t[3],$$slots:{default:[ee]},$$scope:{ctx:t}}}}return r&&(e=b(r,f(a)),a[11](e)),{c(){e&&k(e.$$.fragment),n=d()},l(t){e&&O(e.$$.fragment,t),n=d()},m(t,o){e&&R(e,t,o),E(t,n,o),i=!0},p(t,o){const c={};if(o&8&&(c.data=t[3]),o&8215&&(c.$$scope={dirty:o,ctx:t}),o&2&&r!==(r=t[1][0])){if(e){A();const s=e;h(s.$$.fragment,1,0,()=>{L(s,1)}),P()}r?(e=b(r,f(t)),t[11](e),k(e.$$.fragment),w(e.$$.fragment,1),R(e,n.parentNode,n)):e=null}else r&&e.$set(c)},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){a[11](null),t&&g(n),e&&L(e,t)}}}function ee(a){let e,n,i;var r=a[1][1];function f(t){return{props:{data:t[4],form:t[2]}}}return r&&(e=b(r,f(a)),a[10](e)),{c(){e&&k(e.$$.fragment),n=d()},l(t){e&&O(e.$$.fragment,t),n=d()},m(t,o){e&&R(e,t,o),E(t,n,o),i=!0},p(t,o){const c={};if(o&16&&(c.data=t[4]),o&4&&(c.form=t[2]),o&2&&r!==(r=t[1][1])){if(e){A();const s=e;h(s.$$.fragment,1,0,()=>{L(s,1)}),P()}r?(e=b(r,f(t)),t[10](e),k(e.$$.fragment),w(e.$$.fragment,1),R(e,n.parentNode,n)):e=null}else r&&e.$set(c)},i(t){i||(e&&w(e.$$.fragment,t),i=!0)},o(t){e&&h(e.$$.fragment,t),i=!1},d(t){a[10](null),t&&g(n),e&&L(e,t)}}}function V(a){let e,n=a[6]&&y(a);return{c(){e=G("div"),n&&n.c(),this.h()},l(i){e=H(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var r=J(e);n&&n.l(r),r.forEach(g),this.h()},h(){D(e,"id","svelte-announcer"),D(e,"aria-live","assertive"),D(e,"aria-atomic","true"),p(e,"position","absolute"),p(e,"left","0"),p(e,"top","0"),p(e,"clip","rect(0 0 0 0)"),p(e,"clip-path","inset(50%)"),p(e,"overflow","hidden"),p(e,"white-space","nowrap"),p(e,"width","1px"),p(e,"height","1px")},m(i,r){E(i,e,r),n&&n.m(e,null)},p(i,r){i[6]?n?n.p(i,r):(n=y(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},d(i){i&&g(e),n&&n.d()}}}function y(a){let e;return{c(){e=K(a[7])},l(n){e=M(n,a[7])},m(n,i){E(n,e,i)},p(n,i){i&128&&Q(e,n[7])},d(n){n&&g(e)}}}function te(a){let e,n,i,r,f;const t=[x,$],o=[];function c(l,u){return l[1][1]?0:1}e=c(a),n=o[e]=t[e](a);let s=a[5]&&V(a);return{c(){n.c(),i=j(),s&&s.c(),r=d()},l(l){n.l(l),i=z(l),s&&s.l(l),r=d()},m(l,u){o[e].m(l,u),E(l,i,u),s&&s.m(l,u),E(l,r,u),f=!0},p(l,[u]){let v=e;e=c(l),e===v?o[e].p(l,u):(A(),h(o[v],1,1,()=>{o[v]=null}),P(),n=o[e],n?n.p(l,u):(n=o[e]=t[e](l),n.c()),w(n,1),n.m(i.parentNode,i)),l[5]?s?s.p(l,u):(s=V(l),s.c(),s.m(r.parentNode,r)):s&&(s.d(1),s=null)},i(l){f||(w(n),f=!0)},o(l){h(n),f=!1},d(l){o[e].d(l),l&&g(i),s&&s.d(l),l&&g(r)}}}function ne(a,e,n){let{stores:i}=e,{page:r}=e,{constructors:f}=e,{components:t=[]}=e,{form:o}=e,{data_0:c=null}=e,{data_1:s=null}=e;W(i.page.notify);let l=!1,u=!1,v=null;F(()=>{const _=i.page.subscribe(()=>{l&&(n(6,u=!0),X().then(()=>{n(7,v=document.title||"untitled page")}))});return n(5,l=!0),_});function N(_){I[_?"unshift":"push"](()=>{t[1]=_,n(0,t)})}function S(_){I[_?"unshift":"push"](()=>{t[0]=_,n(0,t)})}function B(_){I[_?"unshift":"push"](()=>{t[0]=_,n(0,t)})}return a.$$set=_=>{"stores"in _&&n(8,i=_.stores),"page"in _&&n(9,r=_.page),"constructors"in _&&n(1,f=_.constructors),"components"in _&&n(0,t=_.components),"form"in _&&n(2,o=_.form),"data_0"in _&&n(3,c=_.data_0),"data_1"in _&&n(4,s=_.data_1)},a.$$.update=()=>{a.$$.dirty&768&&i.page.set(r)},[t,f,o,c,s,l,u,v,i,r,N,S,B]}class oe extends C{constructor(e){super(),q(this,e,ne,te,U,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const se=[()=>m(()=>import("../nodes/0.31054a69.js"),["../nodes/0.31054a69.js","../chunks/index.488f1ee5.js","../chunks/common.2a229ee5.js","../chunks/index.e524927c.js","../assets/0.f71657b6.css"],import.meta.url),()=>m(()=>import("../nodes/1.8962ba52.js"),["../nodes/1.8962ba52.js","../chunks/index.488f1ee5.js","../chunks/stores.dc3de9bf.js","../chunks/singletons.82bf7fa3.js","../chunks/index.e524927c.js"],import.meta.url),()=>m(()=>import("../nodes/2.f8da0bbd.js"),["../nodes/2.f8da0bbd.js","../chunks/index.488f1ee5.js","../chunks/common.2a229ee5.js","../chunks/index.e524927c.js","../assets/2.f82bd3d8.css"],import.meta.url),()=>m(()=>import("../nodes/3.1dac1c85.js"),["../nodes/3.1dac1c85.js","../chunks/index.488f1ee5.js","../chunks/layout.c8702512.js","../chunks/stores.dc3de9bf.js","../chunks/singletons.82bf7fa3.js","../chunks/index.e524927c.js","../chunks/common.2a229ee5.js","../assets/layout.4edc64fc.css"],import.meta.url),()=>m(()=>import("../nodes/4.6e2185d6.js"),["../nodes/4.6e2185d6.js","../chunks/index.488f1ee5.js","../chunks/layout.c8702512.js","../chunks/stores.dc3de9bf.js","../chunks/singletons.82bf7fa3.js","../chunks/index.e524927c.js","../chunks/common.2a229ee5.js","../assets/layout.4edc64fc.css","../chunks/Proof.26996d3c.js","../chunks/State.8d241e02.js","../assets/State.085f50e3.css"],import.meta.url),()=>m(()=>import("../nodes/5.57bd73af.js"),["../nodes/5.57bd73af.js","../chunks/index.488f1ee5.js","../chunks/layout.c8702512.js","../chunks/stores.dc3de9bf.js","../chunks/singletons.82bf7fa3.js","../chunks/index.e524927c.js","../chunks/common.2a229ee5.js","../assets/layout.4edc64fc.css","../chunks/State.8d241e02.js","../assets/State.085f50e3.css","../chunks/Proof.26996d3c.js"],import.meta.url),()=>m(()=>import("../nodes/6.c732de2c.js"),["../nodes/6.c732de2c.js","../chunks/index.488f1ee5.js","../chunks/layout.c8702512.js","../chunks/stores.dc3de9bf.js","../chunks/singletons.82bf7fa3.js","../chunks/index.e524927c.js","../chunks/common.2a229ee5.js","../assets/layout.4edc64fc.css","../chunks/State.8d241e02.js","../assets/State.085f50e3.css"],import.meta.url),()=>m(()=>import("../nodes/7.93740cfc.js"),["../nodes/7.93740cfc.js","../chunks/index.488f1ee5.js","../chunks/layout.c8702512.js","../chunks/stores.dc3de9bf.js","../chunks/singletons.82bf7fa3.js","../chunks/index.e524927c.js","../chunks/common.2a229ee5.js","../assets/layout.4edc64fc.css","../chunks/State.8d241e02.js","../assets/State.085f50e3.css","../chunks/Proof.26996d3c.js","../chunks/Algor.c1ca40d5.js"],import.meta.url),()=>m(()=>import("../nodes/8.b1ab7963.js"),["../nodes/8.b1ab7963.js","../chunks/index.488f1ee5.js","../chunks/layout.c8702512.js","../chunks/stores.dc3de9bf.js","../chunks/singletons.82bf7fa3.js","../chunks/index.e524927c.js","../chunks/common.2a229ee5.js","../assets/layout.4edc64fc.css","../assets/8.0f129be8.css"],import.meta.url),()=>m(()=>import("../nodes/9.6eb73fd6.js"),["../nodes/9.6eb73fd6.js","../chunks/index.488f1ee5.js","../chunks/layout.c8702512.js","../chunks/stores.dc3de9bf.js","../chunks/singletons.82bf7fa3.js","../chunks/index.e524927c.js","../chunks/common.2a229ee5.js","../assets/layout.4edc64fc.css","../chunks/Proof.26996d3c.js","../chunks/State.8d241e02.js","../assets/State.085f50e3.css"],import.meta.url),()=>m(()=>import("../nodes/10.f3e996dc.js"),["../nodes/10.f3e996dc.js","../chunks/index.488f1ee5.js","../chunks/layout.c8702512.js","../chunks/stores.dc3de9bf.js","../chunks/singletons.82bf7fa3.js","../chunks/index.e524927c.js","../chunks/common.2a229ee5.js","../assets/layout.4edc64fc.css","../chunks/Proof.26996d3c.js","../chunks/State.8d241e02.js","../assets/State.085f50e3.css","../chunks/Algor.c1ca40d5.js","../assets/10.eec39ab6.css"],import.meta.url),()=>m(()=>import("../nodes/11.0eac5311.js"),["../nodes/11.0eac5311.js","../chunks/index.488f1ee5.js","../chunks/layout.c8702512.js","../chunks/stores.dc3de9bf.js","../chunks/singletons.82bf7fa3.js","../chunks/index.e524927c.js","../chunks/common.2a229ee5.js","../assets/layout.4edc64fc.css"],import.meta.url),()=>m(()=>import("../nodes/12.62331ccd.js"),["../nodes/12.62331ccd.js","../chunks/index.488f1ee5.js","../chunks/layout.c8702512.js","../chunks/stores.dc3de9bf.js","../chunks/singletons.82bf7fa3.js","../chunks/index.e524927c.js","../chunks/common.2a229ee5.js","../assets/layout.4edc64fc.css","../chunks/Proof.26996d3c.js","../chunks/State.8d241e02.js","../assets/State.085f50e3.css"],import.meta.url)],ae=[],le={"/":[2],"/note":[3],"/note/chebyshev-polynomial":[4],"/note/chinese-remainder-theorem":[5],"/note/dirichlet-convolution":[6],"/note/eulers-totient-function":[7],"/note/graph-experiment":[8],"/note/mobius-function":[9],"/note/network-flow":[10],"/note/numerical-differentiation":[11],"/note/numerical-integration":[12]},fe={handleError:({error:a})=>{console.error(a)}};export{le as dictionary,fe as hooks,re as matchers,se as nodes,oe as root,ae as server_loads}; diff --git a/docs/_app/immutable/entry/start.ab42a901.js b/docs/_app/immutable/entry/start.ab42a901.js deleted file mode 100644 index 53f4d0c..0000000 --- a/docs/_app/immutable/entry/start.ab42a901.js +++ /dev/null @@ -1,3 +0,0 @@ -import{o as me,t as we}from"../chunks/index.488f1ee5.js";import{S as Ge,a as Je,I as M,g as Ce,f as De,b as ye,c as le,s as te,i as _e,d as B,e as q,o as Fe,P as Me,h as Ze}from"../chunks/singletons.82bf7fa3.js";function Qe(t,r){return t==="/"||r==="ignore"?t:r==="never"?t.endsWith("/")?t.slice(0,-1):t:r==="always"&&!t.endsWith("/")?t+"/":t}function et(t){return t.split("%25").map(decodeURI).join("%25")}function tt(t){for(const r in t)t[r]=decodeURIComponent(t[r]);return t}const nt=["href","pathname","search","searchParams","toString","toJSON"];function at(t,r){const f=new URL(t);for(const i of nt)Object.defineProperty(f,i,{get(){return r(),t[i]},enumerable:!0,configurable:!0});return rt(f),f}function rt(t){Object.defineProperty(t,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}const ot="/__data.json";function it(t){return t.replace(/\/$/,"")+ot}function st(...t){let r=5381;for(const f of t)if(typeof f=="string"){let i=f.length;for(;i;)r=r*33^f.charCodeAt(--i)}else if(ArrayBuffer.isView(f)){const i=new Uint8Array(f.buffer,f.byteOffset,f.byteLength);let h=i.length;for(;h;)r=r*33^i[--h]}else throw new TypeError("value must be a string or TypedArray");return(r>>>0).toString(36)}const Ke=window.fetch;window.fetch=(t,r)=>((t instanceof Request?t.method:(r==null?void 0:r.method)||"GET")!=="GET"&&ae.delete(Se(t)),Ke(t,r));const ae=new Map;function ct(t){const r=atob(t),f=new Uint8Array(r.length);for(let i=0;i0){const i=Se(t,f),h=ae.get(i);if(h){if(performance.now(){const h=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(i);if(h)return r.push({name:h[1],matcher:h[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const u=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(i);if(u)return r.push({name:u[1],matcher:u[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!i)return;const E=i.split(/\[(.+?)\](?!\])/);return"/"+E.map((g,m)=>{if(m%2){if(g.startsWith("x+"))return ve(String.fromCharCode(parseInt(g.slice(2),16)));if(g.startsWith("u+"))return ve(String.fromCharCode(...g.slice(2).split("-").map(U=>parseInt(U,16))));const d=ut.exec(g);if(!d)throw new Error(`Invalid param: ${g}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,N,T,R,D]=d;return r.push({name:R,matcher:D,optional:!!N,rest:!!T,chained:T?m===1&&E[0]==="":!1}),T?"(.*?)":N?"([^/]*)?":"([^/]+?)"}return ve(g)}).join("")}).join("")}/?$`),params:r}}function ht(t){return!/^\([^)]+\)$/.test(t)}function pt(t){return t.slice(1).split("/").filter(ht)}function gt(t,r,f){const i={},h=t.slice(1),u=h.filter(l=>l!==void 0);let E=0;for(let l=0;ld).join("/"),E=0),m===void 0){g.rest&&(i[g.name]="");continue}if(!g.matcher||f[g.matcher](m)){i[g.name]=m;const d=r[l+1],N=h[l+1];d&&!d.rest&&d.optional&&N&&g.chained&&(E=0),!d&&!N&&Object.keys(i).length===u.length&&(E=0);continue}if(g.optional&&g.chained){E++;continue}return}if(!E)return i}function ve(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function mt({nodes:t,server_loads:r,dictionary:f,matchers:i}){const h=new Set(r);return Object.entries(f).map(([l,[g,m,d]])=>{const{pattern:N,params:T}=dt(l),R={id:l,exec:D=>{const U=N.exec(D);if(U)return gt(U,T,i)},errors:[1,...d||[]].map(D=>t[D]),layouts:[0,...m||[]].map(E),leaf:u(g)};return R.errors.length=R.layouts.length=Math.max(R.errors.length,R.layouts.length),R});function u(l){const g=l<0;return g&&(l=~l),[g,t[l]]}function E(l){return l===void 0?l:[h.has(l),t[l]]}}function ze(t){try{return JSON.parse(sessionStorage[t])}catch{}}function Ve(t,r){const f=JSON.stringify(r);try{sessionStorage[t]=f}catch{}}const wt=-1,yt=-2,_t=-3,vt=-4,bt=-5,Et=-6;function St(t,r){if(typeof t=="number")return h(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const f=t,i=Array(f.length);function h(u,E=!1){if(u===wt)return;if(u===_t)return NaN;if(u===vt)return 1/0;if(u===bt)return-1/0;if(u===Et)return-0;if(E)throw new Error("Invalid input");if(u in i)return i[u];const l=f[u];if(!l||typeof l!="object")i[u]=l;else if(Array.isArray(l))if(typeof l[0]=="string"){const g=l[0],m=r==null?void 0:r[g];if(m)return i[u]=m(h(l[1]));switch(g){case"Date":i[u]=new Date(l[1]);break;case"Set":const d=new Set;i[u]=d;for(let R=1;Rr!=null)}const We=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...We];const Rt=new Set([...We]);[...Rt];async function At(t,r){var f;for(const i in t)if(typeof((f=t[i])==null?void 0:f.then)=="function")return Object.fromEntries(await Promise.all(Object.entries(t).map(async([h,u])=>[h,await u])));return t}class ne{constructor(r,f){this.status=r,typeof f=="string"?this.body={message:f}:f?this.body=f:this.body={message:`Error: ${r}`}}toString(){return JSON.stringify(this.body)}}class qe{constructor(r,f){this.status=r,this.location=f}}class It extends Error{constructor(r){super(),this.status=404,this.message=`Not found: ${r}`}}const Lt="x-sveltekit-invalidated",Pt="x-sveltekit-trailing-slash",J=ze(Ge)??{},ee=ze(Je)??{};function be(t){J[t]=te()}function K(t){return location.href=t.href,new Promise(()=>{})}function Ot(t,r){var je;const f=mt(t),i=t.nodes[0],h=t.nodes[1];i(),h();const u=document.documentElement,E=[],l=[];let g=null;const m={before_navigate:[],on_navigate:[],after_navigate:[]};let d={branch:[],error:null,url:null},N=!1,T=!1,R=!0,D=!1,U=!1,C=!1,z=!1,V,x=(je=history.state)==null?void 0:je[M];x||(x=Date.now(),history.replaceState({...history.state,[M]:x},"",location.href));const fe=J[x];fe&&(history.scrollRestoration="manual",scrollTo(fe.x,fe.y));let H,W,Y;async function ke(){if(Y=Y||Promise.resolve(),await Y,!Y)return;Y=null;const e=new URL(location.href),s=Z(e,!0);g=null;const n=W={},o=s&&await he(s);if(n===W&&o){if(o.type==="redirect")return re(new URL(o.location,e).href,{},1,n);o.props.page!==void 0&&(H=o.props.page),V.$set(o.props)}}function Re(e){l.some(s=>s==null?void 0:s.snapshot)&&(ee[e]=l.map(s=>{var n;return(n=s==null?void 0:s.snapshot)==null?void 0:n.capture()}))}function Ae(e){var s;(s=ee[e])==null||s.forEach((n,o)=>{var a,c;(c=(a=l[o])==null?void 0:a.snapshot)==null||c.restore(n)})}function Ie(){be(x),Ve(Ge,J),Re(x),Ve(Je,ee)}async function re(e,{noScroll:s=!1,replaceState:n=!1,keepFocus:o=!1,state:a={},invalidateAll:c=!1},p,_){return typeof e=="string"&&(e=new URL(e,Ce(document))),ce({url:e,scroll:s?te():null,keepfocus:o,redirect_count:p,details:{state:a,replaceState:n},nav_token:_,accepted:()=>{c&&(z=!0)},blocked:()=>{},type:"goto"})}async function Le(e){return g={id:e.id,promise:he(e).then(s=>(s.type==="loaded"&&s.state.error&&(g=null),s))},g.promise}async function oe(...e){const n=f.filter(o=>e.some(a=>o.exec(a))).map(o=>Promise.all([...o.layouts,o.leaf].map(a=>a==null?void 0:a[1]())));await Promise.all(n)}function Pe(e){var o;d=e.state;const s=document.querySelector("style[data-sveltekit]");s&&s.remove(),H=e.props.page,V=new t.root({target:r,props:{...e.props,stores:B,components:l},hydrate:!0}),Ae(x);const n={from:null,to:{params:d.params,route:{id:((o=d.route)==null?void 0:o.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};m.after_navigate.forEach(a=>a(n)),T=!0}async function X({url:e,params:s,branch:n,status:o,error:a,route:c,form:p}){let _="never";for(const y of n)(y==null?void 0:y.slash)!==void 0&&(_=y.slash);e.pathname=Qe(e.pathname,_),e.search=e.search;const b={type:"loaded",state:{url:e,params:s,branch:n,error:a,route:c},props:{constructors:kt(n).map(y=>y.node.component)}};p!==void 0&&(b.props.form=p);let v={},L=!H,A=0;for(let y=0;y(_.route=!0,w[O])}),params:new Proxy(o,{get:(w,O)=>(_.params.add(O),w[O])}),data:(c==null?void 0:c.data)??null,url:at(n,()=>{_.url=!0}),async fetch(w,O){let j;w instanceof Request?(j=w.url,O={body:w.method==="GET"||w.method==="HEAD"?void 0:await w.blob(),cache:w.cache,credentials:w.credentials,headers:w.headers,integrity:w.integrity,keepalive:w.keepalive,method:w.method,mode:w.mode,redirect:w.redirect,referrer:w.referrer,referrerPolicy:w.referrerPolicy,signal:w.signal,...O}):j=w;const F=new URL(j,n);return P(F.href),F.origin===n.origin&&(j=F.href.slice(n.origin.length)),T?ft(j,F.href,O):lt(j,O)},setHeaders:()=>{},depends:P,parent(){return _.parent=!0,s()}};p=await b.universal.load.call(null,y)??null,p=p?await At(p,a.id):null}return{node:b,loader:e,server:c,universal:(L=b.universal)!=null&&L.load?{type:"data",data:p,uses:_}:null,data:p??(c==null?void 0:c.data)??null,slash:n.pathname===q||n.pathname===q+"/"?"always":((A=b.universal)==null?void 0:A.trailingSlash)??(c==null?void 0:c.slash)}}function Oe(e,s,n,o,a){if(z)return!0;if(!o)return!1;if(o.parent&&e||o.route&&s||o.url&&n)return!0;for(const c of o.params)if(a[c]!==d.params[c])return!0;for(const c of o.dependencies)if(E.some(p=>p(new URL(c))))return!0;return!1}function de(e,s){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?s??null:null}async function he({id:e,invalidating:s,url:n,params:o,route:a}){if((g==null?void 0:g.id)===e)return g.promise;const{errors:c,layouts:p,leaf:_}=a,b=[...p,_];c.forEach(S=>S==null?void 0:S().catch(()=>{})),b.forEach(S=>S==null?void 0:S[1]().catch(()=>{}));let v=null;const L=d.url?e!==d.url.pathname+d.url.search:!1,A=d.route?a.id!==d.route.id:!1;let P=!1;const y=b.map((S,I)=>{var G;const k=d.branch[I],$=!!(S!=null&&S[0])&&((k==null?void 0:k.loader)!==S[1]||Oe(P,A,L,(G=k.server)==null?void 0:G.uses,o));return $&&(P=!0),$});if(y.some(Boolean)){try{v=await He(n,y)}catch(S){return ie({status:S instanceof ne?S.status:500,error:await Q(S,{url:n,params:o,route:{id:a.id}}),url:n,route:a})}if(v.type==="redirect")return v}const w=v==null?void 0:v.nodes;let O=!1;const j=b.map(async(S,I)=>{var pe;if(!S)return;const k=d.branch[I],$=w==null?void 0:w[I];if((!$||$.type==="skip")&&S[1]===(k==null?void 0:k.loader)&&!Oe(O,A,L,(pe=k.universal)==null?void 0:pe.uses,o))return k;if(O=!0,($==null?void 0:$.type)==="error")throw $;return ue({loader:S[1],url:n,params:o,route:a,parent:async()=>{var Te;const $e={};for(let ge=0;ge{});const F=[];for(let S=0;SPromise.resolve({}),server_data_node:de(c)}),b={node:await h(),loader:h,universal:null,server:null,data:null};return await X({url:n,params:a,branch:[_,b],status:e,error:s,route:null})}function Z(e,s){if(_e(e,q))return;const n=se(e);for(const o of f){const a=o.exec(n);if(a)return{id:e.pathname+e.search,invalidating:s,route:o,params:tt(a),url:e}}}function se(e){return et(e.pathname.slice(q.length)||"/")}function Ue({url:e,type:s,intent:n,delta:o}){let a=!1;const c=Be(d,n,e,s);o!==void 0&&(c.navigation.delta=o);const p={...c.navigation,cancel:()=>{a=!0,c.reject(new Error("navigation was cancelled"))}};return U||m.before_navigate.forEach(_=>_(p)),a?null:c}async function ce({url:e,scroll:s,keepfocus:n,redirect_count:o,details:a,type:c,delta:p,nav_token:_={},accepted:b,blocked:v}){var j,F,S;const L=Z(e,!1),A=Ue({url:e,type:c,delta:p,intent:L});if(!A){v();return}const P=x;b(),U=!0,T&&B.navigating.set(A.navigation),W=_;let y=L&&await he(L);if(!y){if(_e(e,q))return await K(e);y=await Ne(e,{id:null},await Q(new Error(`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404)}if(e=(L==null?void 0:L.url)||e,W!==_)return A.reject(new Error("navigation was aborted")),!1;if(y.type==="redirect")if(o>=20)y=await ie({status:500,error:await Q(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}});else return re(new URL(y.location,e).href,{},o+1,_),!1;else((j=y.props.page)==null?void 0:j.status)>=400&&await B.updated.check()&&await K(e);if(E.length=0,z=!1,D=!0,be(P),Re(P),(F=y.props.page)!=null&&F.url&&y.props.page.url.pathname!==e.pathname&&(e.pathname=(S=y.props.page)==null?void 0:S.url.pathname),a){const I=a.replaceState?0:1;if(a.state[M]=x+=I,history[a.replaceState?"replaceState":"pushState"](a.state,"",e),!a.replaceState){let k=x+1;for(;ee[k]||J[k];)delete ee[k],delete J[k],k+=1}}if(g=null,T){d=y.state,y.props.page&&(y.props.page.url=e);const I=(await Promise.all(m.on_navigate.map(k=>k(A.navigation)))).filter(k=>typeof k=="function");if(I.length>0){let k=function(){m.after_navigate=m.after_navigate.filter($=>!I.includes($))};I.push(k),m.after_navigate.push(...I)}V.$set(y.props)}else Pe(y);const{activeElement:w}=document;if(await we(),R){const I=e.hash&&document.getElementById(decodeURIComponent(e.hash.slice(1)));s?scrollTo(s.x,s.y):I?I.scrollIntoView():scrollTo(0,0)}const O=document.activeElement!==w&&document.activeElement!==document.body;!n&&!O&&Ee(),R=!0,y.props.page&&(H=y.props.page),U=!1,c==="popstate"&&Ae(x),A.fulfil(void 0),m.after_navigate.forEach(I=>I(A.navigation)),B.navigating.set(null),D=!1}async function Ne(e,s,n,o){return e.origin===Fe&&e.pathname===location.pathname&&!N?await ie({status:o,error:n,url:e,route:s}):await K(e)}function Xe(){let e;u.addEventListener("mousemove",c=>{const p=c.target;clearTimeout(e),e=setTimeout(()=>{o(p,2)},20)});function s(c){o(c.composedPath()[0],1)}u.addEventListener("mousedown",s),u.addEventListener("touchstart",s,{passive:!0});const n=new IntersectionObserver(c=>{for(const p of c)p.isIntersecting&&(oe(se(new URL(p.target.href))),n.unobserve(p.target))},{threshold:0});function o(c,p){const _=De(c,u);if(!_)return;const{url:b,external:v,download:L}=ye(_,q);if(v||L)return;const A=le(_);if(!A.reload)if(p<=A.preload_data){const P=Z(b,!1);P&&Le(P)}else p<=A.preload_code&&oe(se(b))}function a(){n.disconnect();for(const c of u.querySelectorAll("a")){const{url:p,external:_,download:b}=ye(c,q);if(_||b)continue;const v=le(c);v.reload||(v.preload_code===Me.viewport&&n.observe(c),v.preload_code===Me.eager&&oe(se(p)))}}m.after_navigate.push(a),a()}function Q(e,s){return e instanceof ne?e.body:t.hooks.handleError({error:e,event:s})??{message:s.route.id===null&&e instanceof It?"Not Found":"Internal Error"}}return{after_navigate:e=>{me(()=>(m.after_navigate.push(e),()=>{const s=m.after_navigate.indexOf(e);m.after_navigate.splice(s,1)}))},before_navigate:e=>{me(()=>(m.before_navigate.push(e),()=>{const s=m.before_navigate.indexOf(e);m.before_navigate.splice(s,1)}))},on_navigate:e=>{me(()=>(m.on_navigate.push(e),()=>{const s=m.on_navigate.indexOf(e);m.on_navigate.splice(s,1)}))},disable_scroll_handling:()=>{(D||!T)&&(R=!1)},goto:(e,s={})=>re(e,s,0),invalidate:e=>{if(typeof e=="function")E.push(e);else{const{href:s}=new URL(e,location.href);E.push(n=>n.href===s)}return ke()},invalidate_all:()=>(z=!0,ke()),preload_data:async e=>{const s=new URL(e,Ce(document)),n=Z(s,!1);if(!n)throw new Error(`Attempted to preload a URL that does not belong to this app: ${s}`);await Le(n)},preload_code:oe,apply_action:async e=>{if(e.type==="error"){const s=new URL(location.href),{branch:n,route:o}=d;if(!o)return;const a=await xe(d.branch.length,n,o.errors);if(a){const c=await X({url:s,params:d.params,branch:n.slice(0,a.idx).concat(a.node),status:e.status??500,error:e.error,route:o});d=c.state,V.$set(c.props),we().then(Ee)}}else e.type==="redirect"?re(e.location,{invalidateAll:!0},0):(V.$set({form:null,page:{...H,form:e.data,status:e.status}}),await we(),V.$set({form:e.data}),e.type==="success"&&Ee())},_start_router:()=>{var s;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let o=!1;if(Ie(),!U){const a=Be(d,void 0,null,"leave"),c={...a.navigation,cancel:()=>{o=!0,a.reject(new Error("navigation was cancelled"))}};m.before_navigate.forEach(p=>p(c))}o?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ie()}),(s=navigator.connection)!=null&&s.saveData||Xe(),u.addEventListener("click",n=>{var P;if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const o=De(n.composedPath()[0],u);if(!o)return;const{url:a,external:c,target:p,download:_}=ye(o,q);if(!a)return;if(p==="_parent"||p==="_top"){if(window.parent!==window)return}else if(p&&p!=="_self")return;const b=le(o);if(!(o instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||_)return;if(c||b.reload){Ue({url:a,type:"link"})?U=!0:n.preventDefault();return}const[L,A]=a.href.split("#");if(A!==void 0&&L===location.href.split("#")[0]){if(d.url.hash===a.hash){n.preventDefault(),(P=o.ownerDocument.getElementById(A))==null||P.scrollIntoView();return}if(C=!0,be(x),e(a),!b.replace_state)return;C=!1,n.preventDefault()}ce({url:a,scroll:b.noscroll?te():null,keepfocus:b.keep_focus??!1,redirect_count:0,details:{state:{},replaceState:b.replace_state??a.href===location.href},accepted:()=>n.preventDefault(),blocked:()=>n.preventDefault(),type:"link"})}),u.addEventListener("submit",n=>{if(n.defaultPrevented)return;const o=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formMethod)||o.method)!=="get")return;const p=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||o.action);if(_e(p,q))return;const _=n.target,{keep_focus:b,noscroll:v,reload:L,replace_state:A}=le(_);if(L)return;n.preventDefault(),n.stopPropagation();const P=new FormData(_),y=a==null?void 0:a.getAttribute("name");y&&P.append(y,(a==null?void 0:a.getAttribute("value"))??""),p.search=new URLSearchParams(P).toString(),ce({url:p,scroll:v?te():null,keepfocus:b??!1,redirect_count:0,details:{state:{},replaceState:A??p.href===location.href},nav_token:{},accepted:()=>{},blocked:()=>{},type:"form"})}),addEventListener("popstate",async n=>{var o,a;if(W={},(o=n.state)!=null&&o[M]){if(n.state[M]===x)return;const c=J[n.state[M]],p=new URL(location.href);if(((a=d.url)==null?void 0:a.href.split("#")[0])===location.href.split("#")[0]){e(p),J[x]=te(),x=n.state[M],scrollTo(c.x,c.y);return}const _=n.state[M]-x;await ce({url:p,scroll:c,keepfocus:!1,redirect_count:0,details:null,accepted:()=>{x=n.state[M]},blocked:()=>{history.go(-_)},type:"popstate",delta:_,nav_token:W})}else if(!C){const c=new URL(location.href);e(c)}}),addEventListener("hashchange",()=>{C&&(C=!1,history.replaceState({...history.state,[M]:++x},"",location.href))});for(const n of document.querySelectorAll("link"))n.rel==="icon"&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&B.navigating.set(null)});function e(n){d.url=n,B.page.set({...H,url:n}),B.page.notify()}},_hydrate:async({status:e=200,error:s,node_ids:n,params:o,route:a,data:c,form:p})=>{N=!0;const _=new URL(location.href);({params:o={},route:a={id:null}}=Z(_,!1)||{});let b;try{const v=n.map(async(P,y)=>{const w=c[y];return w!=null&&w.uses&&(w.uses=Ye(w.uses)),ue({loader:t.nodes[P],url:_,params:o,route:a,parent:async()=>{const O={};for(let j=0;jP===a.id);if(A){const P=A.layouts;for(let y=0;yu?"1":"0").join(""));const i=await Ke(f.href);if((h=i.headers.get("content-type"))!=null&&h.includes("text/html")&&await K(t),!i.ok)throw new ne(i.status,await i.json());return new Promise(async u=>{var N;const E=new Map,l=i.body.getReader(),g=new TextDecoder;function m(T){return St(T,{Promise:R=>new Promise((D,U)=>{E.set(R,{fulfil:D,reject:U})})})}let d="";for(;;){const{done:T,value:R}=await l.read();if(T&&!d)break;for(d+=!R&&d?` -`:g.decode(R);;){const D=d.indexOf(` -`);if(D===-1)break;const U=JSON.parse(d.slice(0,D));if(d=d.slice(D+1),U.type==="redirect")return u(U);if(U.type==="data")(N=U.nodes)==null||N.forEach(C=>{(C==null?void 0:C.type)==="data"&&(C.uses=Ye(C.uses),C.data=m(C.data))}),u(U);else if(U.type==="chunk"){const{id:C,data:z,error:V}=U,x=E.get(C);E.delete(C),V?x.reject(m(V)):x.fulfil(m(z))}}}})}function Ye(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url)}}function Ee(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const r=document.body,f=r.getAttribute("tabindex");r.tabIndex=-1,r.focus({preventScroll:!0,focusVisible:!1}),f!==null?r.setAttribute("tabindex",f):r.removeAttribute("tabindex");const i=getSelection();if(i&&i.type!=="None"){const h=[];for(let u=0;u{if(i.rangeCount===h.length){for(let u=0;u{h=d,u=N});return E.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((g=t.route)==null?void 0:g.id)??null},url:t.url},to:f&&{params:(r==null?void 0:r.params)??null,route:{id:((m=r==null?void 0:r.route)==null?void 0:m.id)??null},url:f},willUnload:!r,type:i,complete:E},fulfil:h,reject:u}}async function Nt(t,r,f){const i=Ot(t,r);Ze({client:i}),f?await i._hydrate(f):i.goto(location.href,{replaceState:!0}),i._start_router()}export{Nt as start}; diff --git a/docs/_app/immutable/nodes/0.31054a69.js b/docs/_app/immutable/nodes/0.31054a69.js deleted file mode 100644 index eda319d..0000000 --- a/docs/_app/immutable/nodes/0.31054a69.js +++ /dev/null @@ -1 +0,0 @@ -import{S as B,i as C,s as G,k as h,a as I,q as L,l as k,m as y,c as D,r as O,h as d,n as m,C as T,D as E,b as g,E as v,F as S,u as F,G as q,H,I as J,e as V,y as K,J as P,z as Q,A as R,K as U,L as W,M as X,g as j,d as z,B as Y,N as w}from"../chunks/index.488f1ee5.js";import{t as Z,s as $,b as x,a as ee}from"../chunks/common.2a229ee5.js";const te=!0,ce=Object.freeze(Object.defineProperty({__proto__:null,prerender:te},Symbol.toStringTag,{value:"Module"}));function se(n){let s,t,f,o,r,i,a,b,l,e,c,p;return{c(){s=h("div"),t=h("img"),r=I(),i=h("div"),a=h("b"),b=L(n[0]),l=I(),e=h("div"),this.h()},l(u){s=k(u,"DIV",{id:!0,class:!0});var _=y(s);t=k(_,"IMG",{id:!0,alt:!0,title:!0,src:!0,class:!0}),r=D(_),i=k(_,"DIV",{id:!0,class:!0});var M=y(i);a=k(M,"B",{});var N=y(a);b=O(N,n[0]),N.forEach(d),M.forEach(d),_.forEach(d),l=D(u),e=k(u,"DIV",{id:!0,class:!0}),y(e).forEach(d),this.h()},h(){m(t,"id","back-button"),m(t,"alt","返回"),m(t,"title","返回"),T(t.src,f="/assets/icon/parent.svg")||m(t,"src",f),t.hidden=o=!n[2],m(t,"class","svelte-arx3nc"),E(t,"empty",!n[2]),m(i,"id","topbar-title"),m(i,"class","svelte-arx3nc"),m(s,"id","topbar"),m(s,"class","svelte-arx3nc"),m(e,"id","klpbg"),m(e,"class","svelte-arx3nc"),E(e,"hide",!n[1])},m(u,_){g(u,s,_),v(s,t),v(s,r),v(s,i),v(i,a),v(a,b),g(u,l,_),g(u,e,_),c||(p=[S(t,"click",n[3]),S(t,"keypress",n[3])],c=!0)},p(u,[_]){_&4&&o!==(o=!u[2])&&(t.hidden=o),_&4&&E(t,"empty",!u[2]),_&1&&F(b,u[0]),_&2&&E(e,"hide",!u[1])},i:q,o:q,d(u){u&&d(s),u&&d(l),u&&d(e),c=!1,H(p)}}}function ae(n,s,t){let{title:f}=s,{background:o=!1}=s,{back:r}=s;function i(){typeof r=="string"?open(r,"_self"):typeof r=="function"&&r()}return n.$$set=a=>{"title"in a&&t(0,f=a.title),"background"in a&&t(1,o=a.background),"back"in a&&t(2,r=a.back)},[f,o,r,i]}class le extends B{constructor(s){super(),C(this,s,ae,se,G,{title:0,background:1,back:2})}}function A(n){let s;return{c(){s=h("meta"),this.h()},l(t){s=k(t,"META",{name:!0,content:!0}),this.h()},h(){m(s,"name","viewport"),m(s,"content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0")},m(t,f){g(t,s,f)},d(t){t&&d(s)}}}function ne(n){let s,t,f,o,r,i;document.title=s="夜莺洞穴 - "+n[0];let a=!n[1]&&A();o=new le({props:{title:n[0],back:n[2],background:n[3]}});const b=n[5].default,l=J(b,n,n[4],null);return{c(){a&&a.c(),t=V(),f=I(),K(o.$$.fragment),r=I(),l&&l.c()},l(e){const c=P("svelte-1ll9w4m",document.head);a&&a.l(c),t=V(),c.forEach(d),f=D(e),Q(o.$$.fragment,e),r=D(e),l&&l.l(e)},m(e,c){a&&a.m(document.head,null),v(document.head,t),g(e,f,c),R(o,e,c),g(e,r,c),l&&l.m(e,c),i=!0},p(e,[c]){(!i||c&1)&&s!==(s="夜莺洞穴 - "+e[0])&&(document.title=s),e[1]?a&&(a.d(1),a=null):a||(a=A(),a.c(),a.m(t.parentNode,t));const p={};c&1&&(p.title=e[0]),c&4&&(p.back=e[2]),c&8&&(p.background=e[3]),o.$set(p),l&&l.p&&(!i||c&16)&&U(l,b,e,e[4],i?X(b,e[4],c,null):W(e[4]),null)},i(e){i||(j(o.$$.fragment,e),j(l,e),i=!0)},o(e){z(o.$$.fragment,e),z(l,e),i=!1},d(e){a&&a.d(e),d(t),e&&d(f),Y(o,e),e&&d(r),l&&l.d(e)}}}function ie(n,s,t){let f,o,r,i;w(n,Z,l=>t(0,f=l)),w(n,$,l=>t(1,o=l)),w(n,x,l=>t(2,r=l)),w(n,ee,l=>t(3,i=l));let{$$slots:a={},$$scope:b}=s;return n.$$set=l=>{"$$scope"in l&&t(4,b=l.$$scope)},[f,o,r,i,b,a]}class ue extends B{constructor(s){super(),C(this,s,ie,ne,G,{})}}export{ue as component,ce as universal}; diff --git a/docs/_app/immutable/nodes/1.8962ba52.js b/docs/_app/immutable/nodes/1.8962ba52.js deleted file mode 100644 index 91c2d25..0000000 --- a/docs/_app/immutable/nodes/1.8962ba52.js +++ /dev/null @@ -1 +0,0 @@ -import{S as x,i as S,s as g,k as u,q as h,a as k,l as d,m as v,r as E,h as m,c as y,b as _,E as b,u as $,G as q,N as C}from"../chunks/index.488f1ee5.js";import{p as G}from"../chunks/stores.dc3de9bf.js";function H(l){var f;let a,t=l[0].status+"",r,o,n,p=((f=l[0].error)==null?void 0:f.message)+"",c;return{c(){a=u("h1"),r=h(t),o=k(),n=u("p"),c=h(p)},l(e){a=d(e,"H1",{});var s=v(a);r=E(s,t),s.forEach(m),o=y(e),n=d(e,"P",{});var i=v(n);c=E(i,p),i.forEach(m)},m(e,s){_(e,a,s),b(a,r),_(e,o,s),_(e,n,s),b(n,c)},p(e,[s]){var i;s&1&&t!==(t=e[0].status+"")&&$(r,t),s&1&&p!==(p=((i=e[0].error)==null?void 0:i.message)+"")&&$(c,p)},i:q,o:q,d(e){e&&m(a),e&&m(o),e&&m(n)}}}function N(l,a,t){let r;return C(l,G,o=>t(0,r=o)),[r]}class w extends x{constructor(a){super(),S(this,a,N,H,g,{})}}export{w as component}; diff --git a/docs/_app/immutable/nodes/10.f3e996dc.js b/docs/_app/immutable/nodes/10.f3e996dc.js deleted file mode 100644 index 14bc630..0000000 --- a/docs/_app/immutable/nodes/10.f3e996dc.js +++ /dev/null @@ -1,445 +0,0 @@ -var Ld=Object.defineProperty;var kd=(t,e,n)=>e in t?Ld(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var js=(t,e,n)=>(kd(t,typeof e!="symbol"?e+"":e,n),n),Lm=(t,e,n)=>{if(!e.has(t))throw TypeError("Cannot "+n)};var Ie=(t,e,n)=>(Lm(t,e,"read from private field"),n?n.call(t):e.get(t)),Rt=(t,e,n)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,n)},$t=(t,e,n,a)=>(Lm(t,e,"write to private field"),a?a.call(t,n):e.set(t,n),n);import{S as Mh,i as Sh,s as Ch,I as Ud,k as ie,V as Gd,l as ne,m as se,h as G,n as ve,b as Fe,E as k,K as Hd,L as Vd,M as Jd,g as dt,d as yt,O as xl,y as xt,z as bt,A as Nt,P as Zd,Q as km,B as Et,R as Um,q as pe,a as Ge,r as ce,c as He,G as Ot}from"../chunks/index.488f1ee5.js";import{L as Wd}from"../chunks/layout.c8702512.js";import{P as Ks}from"../chunks/Proof.26996d3c.js";import{S as Yt}from"../chunks/State.8d241e02.js";import{k as Yd,A as Xd}from"../chunks/Algor.c1ca40d5.js";function Gt(){return Gt=Object.assign?Object.assign.bind():function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:"any";const ae=U?p(U).index:r.length,he=[];for(let Ne=0;Ne{const he=a.get(ae);return!he.isAny&&he.test(R)});return U.length?U:["any"]}function c(R){return R&&typeof R=="function"&&"_typedFunctionData"in R}function f(R,U,ae){if(!c(R))throw new TypeError(Hm);const he=ae&&ae.exact,fe=Array.isArray(U)?U.join(","):U,Ne=x(fe),Te=w(Ne);if(!he||Te in R.signatures){const Qe=R._typedFunctionData.signatureMap.get(Te);if(Qe)return Qe}const Se=Ne.length;let Oe;if(he){Oe=[];let Qe;for(Qe in R.signatures)Oe.push(R._typedFunctionData.signatureMap.get(Qe))}else Oe=R._typedFunctionData.signatures;for(let Qe=0;Qe!Q.has(ye.name)))continue}Re.push(ht)}}if(Oe=Re,Oe.length===0)break}let Me;for(Me of Oe)if(Me.params.length<=Se)return Me;throw new TypeError("Signature not found (signature: "+(R.name||"unnamed")+"("+w(Ne,", ")+"))")}function v(R,U,ae){return f(R,U,ae).implementation}function h(R,U){const ae=p(U);if(ae.test(R))return R;const he=ae.conversionsTo;if(he.length===0)throw new Error("There are no conversions to "+U+" defined.");for(let fe=0;fe1&&arguments[1]!==void 0?arguments[1]:",";return R.map(ae=>ae.name).join(U)}function d(R){const U=R.indexOf("...")===0,he=(U?R.length>3?R.slice(3):"any":R).split("|").map(Se=>p(Se.trim()));let fe=!1,Ne=U?"...":"";return{types:he.map(function(Se){return fe=Se.isAny||fe,Ne+=Se.name+"|",{name:Se.name,typeIndex:Se.index,test:Se.test,isAny:Se.isAny,conversion:null,conversionIndex:-1}}),name:Ne.slice(0,-1),hasAny:fe,hasConversion:!1,restParam:U}}function N(R){const U=R.types.map(Te=>Te.name),ae=T(U);let he=R.hasAny,fe=R.name;const Ne=ae.map(function(Te){const Se=p(Te.from);return he=Se.isAny||he,fe+="|"+Te.from,{name:Te.from,typeIndex:Se.index,test:Se.test,isAny:Se.isAny,conversion:Te,conversionIndex:Te.index}});return{types:R.types.concat(Ne),name:fe,hasAny:he,hasConversion:Ne.length>0,restParam:R.restParam}}function g(R){return R.typeSet||(R.typeSet=new Set,R.types.forEach(U=>R.typeSet.add(U.name))),R.typeSet}function x(R){const U=[];if(typeof R!="string")throw new TypeError("Signatures must be strings");const ae=R.trim();if(ae==="")return U;const he=ae.split(",");for(let fe=0;fe=fe+1}}else return R.length===0?function(Ne){return Ne.length===0}:R.length===1?(ae=y(R[0]),function(Ne){return ae(Ne[0])&&Ne.length===1}):R.length===2?(ae=y(R[0]),he=y(R[1]),function(Ne){return ae(Ne[0])&&he(Ne[1])&&Ne.length===2}):(U=R.map(y),function(Ne){for(let Te=0;Te{const fe=E(he.params,U);let Ne;for(Ne of fe)ae.add(Ne)}),ae.has("any")?["any"]:Array.from(ae)}function C(R,U,ae){let he,fe;const Ne=R||"unnamed";let Te=ae,Se;for(Se=0;Se{const ht=A(Re.params,Se),F=y(ht);(Se0){const Re=u(U[Se]);return he=new TypeError("Unexpected type of argument in function "+Ne+" (expected: "+fe.join(" or ")+", actual: "+Re.join(" | ")+", index: "+Se+")"),he.data={category:"wrongType",fn:Ne,index:Se,actual:Re,expected:fe},he}}else Te=Ye}const Oe=Te.map(function(Ye){return b(Ye.params)?1/0:Ye.params.length});if(U.lengthMe)return he=new TypeError("Too many arguments in function "+Ne+" (expected: "+Me+", actual: "+U.length+")"),he.data={category:"tooManyArgs",fn:Ne,index:U.length,expectedLength:Me},he;const Qe=[];for(let Ye=0;Ye0)return 1;const he=O(R)-O(U);return he<0?-1:he>0?1:0}function $(R,U){const ae=R.params,he=U.params,fe=oe(ae),Ne=oe(he),Te=b(ae),Se=b(he);if(Te&&fe.hasAny){if(!Se||!Ne.hasAny)return 1}else if(Se&&Ne.hasAny)return-1;let Oe=0,Me=0,Qe;for(Qe of ae)Qe.hasAny&&++Oe,Qe.hasConversion&&++Me;let Ye=0,Re=0;for(Qe of he)Qe.hasAny&&++Ye,Qe.hasConversion&&++Re;if(Oe!==Ye)return Oe-Ye;if(Te&&fe.hasConversion){if(!Se||!Ne.hasConversion)return 1}else if(Se&&Ne.hasConversion)return-1;if(Me!==Re)return Me-Re;if(Te){if(!Se)return 1}else if(Se)return-1;const ht=(ae.length-he.length)*(Te?-1:1);if(ht!==0)return ht;const F=[];let Q=0;for(let Ce=0;Ce1&&U.sort((fe,Ne)=>fe.index-Ne.index);let ae=U[0].conversionsTo;if(R.length===1)return ae;ae=ae.concat([]);const he=new Set(R);for(let fe=1;fefe.hasConversion)){const fe=b(R),Ne=R.map(_);ae=function(){const Se=[],Oe=fe?arguments.length-1:arguments.length;for(let Me=0;MeOe.name).join("|"),hasAny:Se.some(Oe=>Oe.isAny),hasConversion:!1,restParam:!0}),Te.push(Ne)}else Te=Ne.types.map(function(Se){return{types:[Se],name:Se.name,hasAny:Se.isAny,hasConversion:Se.conversion,restParam:!1}});return be(Te,function(Se){return U(ae,he+1,fe.concat([Se]))})}else return[fe]}return U(R,0,[])}function K(R,U){const ae=Math.max(R.length,U.length);for(let Se=0;Se=he:Te?he>=fe:he===fe}function Y(R){return R.map(U=>le(U)?L(U.referToSelf.callback):J(U)?_e(U.referTo.references,U.referTo.callback):U)}function z(R,U,ae){const he=[];let fe;for(fe of R){let Ne=ae[fe];if(typeof Ne!="number")throw new TypeError('No definition for referenced signature "'+fe+'"');if(Ne=U[Ne],typeof Ne!="function")return!1;he.push(Ne)}return he}function j(R,U,ae){const he=Y(R),fe=new Array(he.length).fill(!1);let Ne=!0;for(;Ne;){Ne=!1;let Te=!0;for(let Se=0;Se{const he=R[ae];if(U.test(he.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function te(R,U){if(i.createCount++,Object.keys(U).length===0)throw new SyntaxError("No signatures provided");i.warnAgainstDeprecatedThis&&ge(U);const ae=[],he=[],fe={},Ne=[];let Te;for(Te in U){if(!Object.prototype.hasOwnProperty.call(U,Te))continue;const mt=x(Te);if(!mt)continue;ae.forEach(function(ba){if(K(ba,mt))throw new TypeError('Conflicting signatures "'+w(ba)+'" and "'+w(mt)+'".')}),ae.push(mt);const qt=he.length;he.push(U[Te]);const fr=mt.map(N);let Nr;for(Nr of W(fr)){const ba=w(Nr);Ne.push({params:Nr,name:ba,fn:qt}),Nr.every(hr=>!hr.hasConversion)&&(fe[ba]=qt)}}Ne.sort($);const Se=j(he,fe,cr);let Oe;for(Oe in fe)Object.prototype.hasOwnProperty.call(fe,Oe)&&(fe[Oe]=Se[fe[Oe]]);const Me=[],Qe=new Map;for(Oe of Ne)Qe.has(Oe.name)||(Oe.fn=Se[Oe.fn],Me.push(Oe),Qe.set(Oe.name,Oe));const Ye=Me[0]&&Me[0].params.length<=2&&!b(Me[0].params),Re=Me[1]&&Me[1].params.length<=2&&!b(Me[1].params),ht=Me[2]&&Me[2].params.length<=2&&!b(Me[2].params),F=Me[3]&&Me[3].params.length<=2&&!b(Me[3].params),Q=Me[4]&&Me[4].params.length<=2&&!b(Me[4].params),ye=Me[5]&&Me[5].params.length<=2&&!b(Me[5].params),Ce=Ye&&Re&&ht&&F&&Q&&ye;for(let mt=0;mtmt.test),Vn=Me.map(mt=>mt.implementation),pr=function(){for(let qt=mr;qtw(x(ae))),U=oe(arguments);if(typeof U!="function")throw new TypeError("Callback function expected as last argument");return _e(R,U)}function _e(R,U){return{referTo:{references:R,callback:U}}}function L(R){if(typeof R!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:R}}}function J(R){return R&&typeof R.referTo=="object"&&Array.isArray(R.referTo.references)&&typeof R.referTo.callback=="function"}function le(R){return R&&typeof R.referToSelf=="object"&&typeof R.referToSelf.callback=="function"}function V(R,U){if(!R)return U;if(U&&U!==R){const ae=new Error("Function names do not match (expected: "+R+", actual: "+U+")");throw ae.data={actual:U,expected:R},ae}return R}function X(R){let U;for(const ae in R)Object.prototype.hasOwnProperty.call(R,ae)&&(c(R[ae])||typeof R[ae].signature=="string")&&(U=V(U,R[ae].name));return U}function ee(R,U){let ae;for(ae in U)if(Object.prototype.hasOwnProperty.call(U,ae)){if(ae in R&&U[ae]!==R[ae]){const he=new Error('Signature "'+ae+'" is defined twice');throw he.data={signature:ae,sourceFunction:U[ae],destFunction:R[ae]},he}R[ae]=U[ae]}}const de=i;i=function(R){const U=typeof R=="string",ae=U?1:0;let he=U?R:"";const fe={};for(let Ne=ae;Nefe.from===R.from);if(!ae)throw new Error("Attempt to remove nonexistent conversion from "+R.from+" to "+R.to);if(ae.convert!==R.convert)throw new Error("Conversion to remove does not match existing conversion");const he=U.conversionsTo.indexOf(ae);U.conversionsTo.splice(he,1)},i.resolve=function(R,U){if(!c(R))throw new TypeError(Hm);const ae=R._typedFunctionData.signatures;for(let he=0;he0?1:t<0?-1:0},h0=Math.log2||function(e){return Math.log(e)/Math.LN2},v0=Math.log10||function(e){return Math.log(e)/Math.LN10},g0=Math.log1p||function(t){return Math.log(t+1)},d0=Math.cbrt||function(e){if(e===0)return e;var n=e<0,a;return n&&(e=-e),isFinite(e)?(a=Math.exp(Math.log(e)/3),a=(e/(a*a)+2*a)/3):a=e,n?-a:a},y0=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function ll(t,e,n){var a={2:"0b",8:"0o",16:"0x"},r=a[e],s="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!qe(n))throw new Error("size must be an integer");if(t>2**(n-1)-1||t<-(2**(n-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!qe(t))throw new Error("Value must be an integer");t<0&&(t=t+2**n),s="i".concat(n)}var i="";return t<0&&(t=-t,i="-"),"".concat(i).concat(r).concat(t.toString(e)).concat(s)}function yn(t,e){if(typeof e=="function")return e(t);if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(isNaN(t))return"NaN";var{notation:n,precision:a,wordSize:r}=Oh(e);switch(n){case"fixed":return Ph(t,a);case"exponential":return zh(t,a);case"engineering":return w0(t,a);case"bin":return ll(t,2,r);case"oct":return ll(t,8,r);case"hex":return ll(t,16,r);case"auto":return x0(t,a,e).replace(/((\.\d*?)(0+))($|e)/,function(){var s=arguments[2],i=arguments[4];return s!=="."?s+i:i});default:throw new Error('Unknown notation "'+n+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Oh(t){var e="auto",n,a;if(t!==void 0)if(tt(t))n=t;else if(at(t))n=t.toNumber();else if(_o(t))t.precision!==void 0&&(n=Vm(t.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),t.wordSize!==void 0&&(a=Vm(t.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),t.notation&&(e=t.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:e,precision:n,wordSize:a}}function gi(t){var e=String(t).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!e)throw new SyntaxError("Invalid number "+t);var n=e[1],a=e[2],r=parseFloat(e[4]||"0"),s=a.indexOf(".");r+=s!==-1?s-1:a.length-1;var i=a.replace(".","").replace(/^0*/,function(p){return r-=p.length,""}).replace(/0*$/,"").split("").map(function(p){return parseInt(p)});return i.length===0&&(i.push(0),r++),{sign:n,coefficients:i,exponent:r}}function w0(t,e){if(isNaN(t)||!isFinite(t))return String(t);var n=gi(t),a=Oo(n,e),r=a.exponent,s=a.coefficients,i=r%3===0?r:r<0?r-3-r%3:r-r%3;if(tt(e))for(;e>s.length||r-i+1>s.length;)s.push(0);else for(var p=Math.abs(r-i)-(s.length-1),m=0;m0;)l++,o--;var u=s.slice(l).join(""),c=tt(e)&&u.length||u.match(/[1-9]/)?"."+u:"",f=s.slice(0,l).join("")+c+"e"+(r>=0?"+":"")+i.toString();return a.sign+f}function Ph(t,e){if(isNaN(t)||!isFinite(t))return String(t);var n=gi(t),a=typeof e=="number"?Oo(n,n.exponent+1+e):n,r=a.coefficients,s=a.exponent+1,i=s+(e||0);return r.length0?"."+r.join(""):"")+"e"+(s>=0?"+":"")+s}function x0(t,e,n){if(isNaN(t)||!isFinite(t))return String(t);var a=Jm(n==null?void 0:n.lowerExp,-3),r=Jm(n==null?void 0:n.upperExp,5),s=gi(t),i=e?Oo(s,e):s;if(i.exponent=r)return zh(t,e);var p=i.coefficients,m=i.exponent;p.length0?m:0;return oe){var r=a.splice(e,a.length-e);if(r[0]>=5){var s=e-1;for(a[s]++;a[s]===10;)a.pop(),s===0&&(a.unshift(0),n.exponent++,s++),s--,a[s]++}}return n}function us(t){for(var e=[],n=0;n0?!0:t<0?!1:1/t===1/0,a=e>0?!0:e<0?!1:1/e===1/0;return n^a?-t:t}function Vm(t,e){if(tt(t))return t;if(at(t))return t.toNumber();e()}function Jm(t,e){return tt(t)?t:at(t)?t.toNumber():e}function ml(t,e,n){var a=t.constructor,r=new a(2),s="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!qe(n))throw new Error("size must be an integer");if(t.greaterThan(r.pow(n-1).sub(1))||t.lessThan(r.pow(n-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!t.isInteger())throw new Error("Value must be an integer");t.lessThan(0)&&(t=t.add(r.pow(n))),s="i".concat(n)}switch(e){case 2:return"".concat(t.toBinary()).concat(s);case 8:return"".concat(t.toOctal()).concat(s);case 16:return"".concat(t.toHexadecimal()).concat(s);default:throw new Error("Base ".concat(e," not supported "))}}function $0(t,e){if(typeof e=="function")return e(t);if(!t.isFinite())return t.isNaN()?"NaN":t.gt(0)?"Infinity":"-Infinity";var{notation:n,precision:a,wordSize:r}=Oh(e);switch(n){case"fixed":return _0(t,a);case"exponential":return Zm(t,a);case"engineering":return F0(t,a);case"bin":return ml(t,2,r);case"oct":return ml(t,8,r);case"hex":return ml(t,16,r);case"auto":{var s=Wm(e==null?void 0:e.lowerExp,-3),i=Wm(e==null?void 0:e.upperExp,5);if(t.isZero())return"0";var p,m=t.toSignificantDigits(a),o=m.e;return o>=s&&o=0?"+":"")+a.toString()}function Zm(t,e){return e!==void 0?t.toExponential(e-1):t.toExponential()}function _0(t,e){return t.toFixed(e)}function Wm(t,e){return tt(t)?t:at(t)?t.toNumber():e}function B0(t,e){var n=t.length-e.length,a=t.length;return t.substring(n,a)===e}function nt(t,e){var n=O0(t,e);return e&&typeof e=="object"&&"truncate"in e&&n.length>e.truncate?n.substring(0,e.truncate-3)+"...":n}function O0(t,e){if(typeof t=="number")return yn(t,e);if(at(t))return $0(t,e);if(P0(t))return!e||e.fraction!=="decimal"?t.s*t.n+"/"+t.d:t.toString();if(Array.isArray(t))return Rh(t,e);if(sa(t))return ss(t);if(typeof t=="function")return t.syntax?String(t.syntax):"function";if(t&&typeof t=="object"){if(typeof t.format=="function")return t.format(e);if(t&&t.toString(e)!=={}.toString())return t.toString(e);var n=Object.keys(t).map(a=>ss(a)+": "+nt(t[a],e));return"{"+n.join(", ")+"}"}return String(t)}function ss(t){for(var e=String(t),n="",a=0;a/g,">"),e}function Rh(t,e){if(Array.isArray(t)){for(var n="[",a=t.length,r=0;re?1:-1}function st(t,e,n){if(!(this instanceof st))throw new SyntaxError("Constructor must be called with the new operator");this.actual=t,this.expected=e,this.relation=n,this.message="Dimension mismatch ("+(Array.isArray(t)?"["+t.join(", ")+"]":t)+" "+(this.relation||"!=")+" "+(Array.isArray(e)?"["+e.join(", ")+"]":e)+")",this.stack=new Error().stack}st.prototype=new RangeError;st.prototype.constructor=RangeError;st.prototype.name="DimensionError";st.prototype.isDimensionError=!0;function Wa(t,e,n){if(!(this instanceof Wa))throw new SyntaxError("Constructor must be called with the new operator");this.index=t,arguments.length<3?(this.min=0,this.max=e):(this.min=e,this.max=n),this.min!==void 0&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}Wa.prototype=new RangeError;Wa.prototype.constructor=RangeError;Wa.prototype.name="IndexError";Wa.prototype.isIndexError=!0;function et(t){for(var e=[];Array.isArray(t);)e.push(t.length),t=t[0];return e}function Ih(t,e,n){var a,r=t.length;if(r!==e[n])throw new st(r,e[n]);if(n")}function Xm(t,e){var n=e.length===0;if(n){if(Array.isArray(t))throw new st(t.length,0)}else Ih(t,e,0)}function oo(t,e){var n=t.isMatrix?t._size:et(t),a=e._sourceSize;a.forEach((r,s)=>{if(r!==null&&r!==n[s])throw new st(r,n[s])})}function Dt(t,e){if(t!==void 0){if(!tt(t)||!qe(t))throw new TypeError("Index must be an integer (value: "+t+")");if(t<0||typeof e=="number"&&t>=e)throw new Wa(t,e)}}function ys(t){for(var e=0;e=0,m=e%n===0;if(p)if(m)a[s]=-e/n;else throw new Error("Could not replace wildcard, since "+e+" is no multiple of "+-n);return a}function qh(t){return t.reduce((e,n)=>e*n,1)}function z0(t,e){for(var n=t,a,r=e.length-1;r>0;r--){var s=e[r];a=[];for(var i=n.length/s,p=0;pe.test(n))}function Qm(t,e){return Array.prototype.join.call(t,e)}function xs(t){if(!Array.isArray(t))throw new TypeError("Array input expected");if(t.length===0)return t;var e=[],n=0;e[0]={value:t[0],identifier:0};for(var a=1;a1)return t.slice(1).reduce(function(n,a){return Hh(n,a,e,0)},t[0]);throw new Error("Wrong number of arguments in function concat")}function R0(){for(var t=arguments.length,e=new Array(t),n=0;nc.length),r=Math.max(...a),s=new Array(r).fill(null),i=0;is[l]&&(s[l]=p[o])}for(var u=0;u1||t[r]>e[s])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(t,") not possible to broadcast dimension ").concat(a," with size ").concat(t[r]," to size ").concat(e[s]))}}function jm(t,e){var n=et(t);if(bn(n,e))return t;po(n,e);var a=R0(n,e),r=a.length,s=[...Array(r-n.length).fill(1),...n],i=q0(t);n.length!k0(s)).every(s=>n[s]!==void 0);if(!a){var r=e.filter(s=>n[s]===void 0);throw new Error('Cannot create function "'.concat(t,'", ')+"some dependencies are missing: ".concat(r.map(s=>'"'.concat(s,'"')).join(", "),"."))}}function k0(t){return t&&t[0]==="?"}function U0(t){return t&&t[0]==="?"?t.slice(1):t}function fa(t,e){if(Zh(t)&&Jh(t,e))return t[e];throw typeof t[e]=="function"&&Zl(t,e)?new Error('Cannot access method "'+e+'" as a property'):new Error('No access to property "'+e+'"')}function bs(t,e,n){if(Zh(t)&&Jh(t,e))return t[e]=n,n;throw new Error('No access to property "'+e+'"')}function G0(t,e){return e in t}function Jh(t,e){return!t||typeof t!="object"?!1:ze(V0,e)?!0:!(e in Object.prototype||e in Function.prototype)}function H0(t,e){if(!Zl(t,e))throw new Error('No access to method "'+e+'"');return t[e]}function Zl(t,e){return t==null||typeof t[e]!="function"||ze(t,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(t)?!1:ze(J0,e)?!0:!(e in Object.prototype||e in Function.prototype)}function Zh(t){return typeof t=="object"&&t&&t.constructor===Object}var V0={length:!0,name:!0},J0={toString:!0,valueOf:!0,toLocaleString:!0};class zo{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(e){return fa(this.wrappedObject,e)}set(e,n){return bs(this.wrappedObject,e,n),this}has(e){return G0(this.wrappedObject,e)}entries(){return Yh(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var n of this.keys())e(this.get(n),n,this)}delete(e){delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}}class Wh{constructor(e,n,a){this.a=e,this.b=n,this.bKeys=a,this[Symbol.iterator]=this.entries}get(e){return this.bKeys.has(e)?this.b.get(e):this.a.get(e)}set(e,n){return this.bKeys.has(e)?this.b.set(e,n):this.a.set(e,n),this}has(e){return this.b.has(e)||this.a.has(e)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return Yh(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var n of this.keys())e(this.get(n),n,this)}delete(e){return this.bKeys.has(e)?this.b.delete(e):this.a.delete(e)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}function Yh(t,e){return{next:()=>{var n=t.next();return n.done?n:{value:e(n.value),done:!1}}}}function si(){return new Map}function ps(t){if(!t)return si();if(Xh(t))return t;if(_o(t))return new zo(t);throw new Error("createMap can create maps from objects or Maps")}function Z0(t){if(t instanceof zo)return t.wrappedObject;var e={};for(var n of t.keys()){var a=t.get(n);bs(e,n,a)}return e}function Xh(t){return t?t instanceof Map||t instanceof zo||typeof t.set=="function"&&typeof t.get=="function"&&typeof t.keys=="function"&&typeof t.has=="function":!1}var Qh=function(){return Qh=ns.create,ns},W0=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],Y0=q("typed",W0,function(e){var{BigNumber:n,Complex:a,DenseMatrix:r,Fraction:s}=e,i=Qh();return i.clear(),i.addTypes([{name:"number",test:tt},{name:"Complex",test:Fr},{name:"BigNumber",test:at},{name:"Fraction",test:hi},{name:"Unit",test:Oa},{name:"identifier",test:p=>sa&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(p)},{name:"string",test:sa},{name:"Chain",test:Fh},{name:"Array",test:vt},{name:"Matrix",test:Ve},{name:"DenseMatrix",test:io},{name:"SparseMatrix",test:hn},{name:"Range",test:Hl},{name:"Index",test:Fo},{name:"boolean",test:Qd},{name:"ResultSet",test:jd},{name:"Help",test:$h},{name:"function",test:Kd},{name:"Date",test:e0},{name:"RegExp",test:t0},{name:"null",test:a0},{name:"undefined",test:r0},{name:"AccessorNode",test:xn},{name:"ArrayNode",test:Ba},{name:"AssignmentNode",test:n0},{name:"BlockNode",test:s0},{name:"ConditionalNode",test:i0},{name:"ConstantNode",test:ut},{name:"FunctionNode",test:Kr},{name:"FunctionAssignmentNode",test:vi},{name:"IndexNode",test:Ms},{name:"Node",test:wt},{name:"ObjectNode",test:Bo},{name:"OperatorNode",test:It},{name:"ParenthesisNode",test:Br},{name:"RangeNode",test:o0},{name:"RelationalNode",test:l0},{name:"SymbolNode",test:Qt},{name:"Map",test:Xh},{name:"Object",test:_o}]),i.addConversions([{from:"number",to:"BigNumber",convert:function(m){if(n||ul(m),b0(m)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+m+"). Use function bignumber(x) to convert to BigNumber.");return new n(m)}},{from:"number",to:"Complex",convert:function(m){return a||Ii(m),new a(m,0)}},{from:"BigNumber",to:"Complex",convert:function(m){return a||Ii(m),new a(m.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(m){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(m){return a||Ii(m),new a(m.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(m){s||pl(m);var o=new s(m);if(o.valueOf()!==m)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+m+"). Use function fraction(x) to convert to Fraction.");return o}},{from:"string",to:"number",convert:function(m){var o=Number(m);if(isNaN(o))throw new Error('Cannot convert "'+m+'" to a number');return o}},{from:"string",to:"BigNumber",convert:function(m){n||ul(m);try{return new n(m)}catch{throw new Error('Cannot convert "'+m+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(m){s||pl(m);try{return new s(m)}catch{throw new Error('Cannot convert "'+m+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(m){a||Ii(m);try{return new a(m)}catch{throw new Error('Cannot convert "'+m+'" to Complex')}}},{from:"boolean",to:"number",convert:function(m){return+m}},{from:"boolean",to:"BigNumber",convert:function(m){return n||ul(m),new n(+m)}},{from:"boolean",to:"Fraction",convert:function(m){return s||pl(m),new s(+m)}},{from:"boolean",to:"string",convert:function(m){return String(m)}},{from:"Array",to:"Matrix",convert:function(m){return r||X0(),new r(m)}},{from:"Matrix",to:"Array",convert:function(m){return m.valueOf()}}]),i.onMismatch=(p,m,o)=>{var l=i.createError(p,m,o);if(["wrongType","mismatch"].includes(l.data.category)&&m.length===1&&Ra(m[0])&&o.some(c=>!c.params.includes(","))){var u=new TypeError("Function '".concat(p,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(p,")'."));throw u.data=l.data,u}throw l},i.onMismatch=(p,m,o)=>{var l=i.createError(p,m,o);if(["wrongType","mismatch"].includes(l.data.category)&&m.length===1&&Ra(m[0])&&o.some(c=>!c.params.includes(","))){var u=new TypeError("Function '".concat(p,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(p,")'."));throw u.data=l.data,u}throw l},i});function ul(t){throw new Error("Cannot convert value ".concat(t," into a BigNumber: no class 'BigNumber' provided"))}function Ii(t){throw new Error("Cannot convert value ".concat(t," into a Complex number: no class 'Complex' provided"))}function X0(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function pl(t){throw new Error("Cannot convert value ".concat(t," into a Fraction, no class 'Fraction' provided."))}var Q0="ResultSet",j0=[],K0=q(Q0,j0,()=>{function t(e){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");this.entries=e||[]}return t.prototype.type="ResultSet",t.prototype.isResultSet=!0,t.prototype.valueOf=function(){return this.entries},t.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},t.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},t.fromJSON=function(e){return new t(e.entries)},t},{isClass:!0});/*! - * decimal.js v10.4.3 - * An arbitrary-precision Decimal type for JavaScript. - * https://github.com/MikeMcl/decimal.js - * Copyright (c) 2022 Michael Mclaughlin - * MIT Licence - */var is=9e15,an=1e9,Dl="0123456789abcdef",co="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",fo="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Al={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-is,maxE:is,crypto:!1},jh,Tr,je=!0,Ro="[DecimalError] ",en=Ro+"Invalid argument: ",Kh=Ro+"Precision limit exceeded",ev=Ro+"crypto unavailable",tv="[object Decimal]",oa=Math.floor,kt=Math.pow,e1=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,t1=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,a1=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,av=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Va=1e7,Ze=7,r1=9007199254740991,n1=co.length-1,Ml=fo.length-1,$e={toStringTag:tv};$e.absoluteValue=$e.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),Le(t)};$e.ceil=function(){return Le(new this.constructor(this),this.e+1,2)};$e.clampedTo=$e.clamp=function(t,e){var n,a=this,r=a.constructor;if(t=new r(t),e=new r(e),!t.s||!e.s)return new r(NaN);if(t.gt(e))throw Error(en+e);return n=a.cmp(t),n<0?t:a.cmp(e)>0?e:new r(a)};$e.comparedTo=$e.cmp=function(t){var e,n,a,r,s=this,i=s.d,p=(t=new s.constructor(t)).d,m=s.s,o=t.s;if(!i||!p)return!m||!o?NaN:m!==o?m:i===p?0:!i^m<0?1:-1;if(!i[0]||!p[0])return i[0]?m:p[0]?-o:0;if(m!==o)return m;if(s.e!==t.e)return s.e>t.e^m<0?1:-1;for(a=i.length,r=p.length,e=0,n=ap[e]^m<0?1:-1;return a===r?0:a>r^m<0?1:-1};$e.cosine=$e.cos=function(){var t,e,n=this,a=n.constructor;return n.d?n.d[0]?(t=a.precision,e=a.rounding,a.precision=t+Math.max(n.e,n.sd())+Ze,a.rounding=1,n=s1(a,ov(a,n)),a.precision=t,a.rounding=e,Le(Tr==2||Tr==3?n.neg():n,t,e,!0)):new a(1):new a(NaN)};$e.cubeRoot=$e.cbrt=function(){var t,e,n,a,r,s,i,p,m,o,l=this,u=l.constructor;if(!l.isFinite()||l.isZero())return new u(l);for(je=!1,s=l.s*kt(l.s*l,1/3),!s||Math.abs(s)==1/0?(n=ea(l.d),t=l.e,(s=(t-n.length+1)%3)&&(n+=s==1||s==-2?"0":"00"),s=kt(n,1/3),t=oa((t+1)/3)-(t%3==(t<0?-1:2)),s==1/0?n="5e"+t:(n=s.toExponential(),n=n.slice(0,n.indexOf("e")+1)+t),a=new u(n),a.s=l.s):a=new u(s.toString()),i=(t=u.precision)+3;;)if(p=a,m=p.times(p).times(p),o=m.plus(l),a=_t(o.plus(l).times(p),o.plus(m),i+2,1),ea(p.d).slice(0,i)===(n=ea(a.d)).slice(0,i))if(n=n.slice(i-3,i+1),n=="9999"||!r&&n=="4999"){if(!r&&(Le(p,t+1,0),p.times(p).times(p).eq(l))){a=p;break}i+=4,r=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(Le(a,t+1,1),e=!a.times(a).times(a).eq(l));break}return je=!0,Le(a,t,u.rounding,e)};$e.decimalPlaces=$e.dp=function(){var t,e=this.d,n=NaN;if(e){if(t=e.length-1,n=(t-oa(this.e/Ze))*Ze,t=e[t],t)for(;t%10==0;t/=10)n--;n<0&&(n=0)}return n};$e.dividedBy=$e.div=function(t){return _t(this,new this.constructor(t))};$e.dividedToIntegerBy=$e.divToInt=function(t){var e=this,n=e.constructor;return Le(_t(e,new n(t),0,1,1),n.precision,n.rounding)};$e.equals=$e.eq=function(t){return this.cmp(t)===0};$e.floor=function(){return Le(new this.constructor(this),this.e+1,3)};$e.greaterThan=$e.gt=function(t){return this.cmp(t)>0};$e.greaterThanOrEqualTo=$e.gte=function(t){var e=this.cmp(t);return e==1||e===0};$e.hyperbolicCosine=$e.cosh=function(){var t,e,n,a,r,s=this,i=s.constructor,p=new i(1);if(!s.isFinite())return new i(s.s?1/0:NaN);if(s.isZero())return p;n=i.precision,a=i.rounding,i.precision=n+Math.max(s.e,s.sd())+4,i.rounding=1,r=s.d.length,r<32?(t=Math.ceil(r/3),e=(1/qo(4,t)).toString()):(t=16,e="2.3283064365386962890625e-10"),s=Ns(i,1,s.times(e),new i(1),!0);for(var m,o=t,l=new i(8);o--;)m=s.times(s),s=p.minus(m.times(l.minus(m.times(l))));return Le(s,i.precision=n,i.rounding=a,!0)};$e.hyperbolicSine=$e.sinh=function(){var t,e,n,a,r=this,s=r.constructor;if(!r.isFinite()||r.isZero())return new s(r);if(e=s.precision,n=s.rounding,s.precision=e+Math.max(r.e,r.sd())+4,s.rounding=1,a=r.d.length,a<3)r=Ns(s,2,r,r,!0);else{t=1.4*Math.sqrt(a),t=t>16?16:t|0,r=r.times(1/qo(5,t)),r=Ns(s,2,r,r,!0);for(var i,p=new s(5),m=new s(16),o=new s(20);t--;)i=r.times(r),r=r.times(p.plus(i.times(m.times(i).plus(o))))}return s.precision=e,s.rounding=n,Le(r,e,n,!0)};$e.hyperbolicTangent=$e.tanh=function(){var t,e,n=this,a=n.constructor;return n.isFinite()?n.isZero()?new a(n):(t=a.precision,e=a.rounding,a.precision=t+7,a.rounding=1,_t(n.sinh(),n.cosh(),a.precision=t,a.rounding=e)):new a(n.s)};$e.inverseCosine=$e.acos=function(){var t,e=this,n=e.constructor,a=e.abs().cmp(1),r=n.precision,s=n.rounding;return a!==-1?a===0?e.isNeg()?Ha(n,r,s):new n(0):new n(NaN):e.isZero()?Ha(n,r+4,s).times(.5):(n.precision=r+6,n.rounding=1,e=e.asin(),t=Ha(n,r+4,s).times(.5),n.precision=r,n.rounding=s,t.minus(e))};$e.inverseHyperbolicCosine=$e.acosh=function(){var t,e,n=this,a=n.constructor;return n.lte(1)?new a(n.eq(1)?0:NaN):n.isFinite()?(t=a.precision,e=a.rounding,a.precision=t+Math.max(Math.abs(n.e),n.sd())+4,a.rounding=1,je=!1,n=n.times(n).minus(1).sqrt().plus(n),je=!0,a.precision=t,a.rounding=e,n.ln()):new a(n)};$e.inverseHyperbolicSine=$e.asinh=function(){var t,e,n=this,a=n.constructor;return!n.isFinite()||n.isZero()?new a(n):(t=a.precision,e=a.rounding,a.precision=t+2*Math.max(Math.abs(n.e),n.sd())+6,a.rounding=1,je=!1,n=n.times(n).plus(1).sqrt().plus(n),je=!0,a.precision=t,a.rounding=e,n.ln())};$e.inverseHyperbolicTangent=$e.atanh=function(){var t,e,n,a,r=this,s=r.constructor;return r.isFinite()?r.e>=0?new s(r.abs().eq(1)?r.s/0:r.isZero()?r:NaN):(t=s.precision,e=s.rounding,a=r.sd(),Math.max(a,t)<2*-r.e-1?Le(new s(r),t,e,!0):(s.precision=n=a-r.e,r=_t(r.plus(1),new s(1).minus(r),n+t,1),s.precision=t+4,s.rounding=1,r=r.ln(),s.precision=t,s.rounding=e,r.times(.5))):new s(NaN)};$e.inverseSine=$e.asin=function(){var t,e,n,a,r=this,s=r.constructor;return r.isZero()?new s(r):(e=r.abs().cmp(1),n=s.precision,a=s.rounding,e!==-1?e===0?(t=Ha(s,n+4,a).times(.5),t.s=r.s,t):new s(NaN):(s.precision=n+6,s.rounding=1,r=r.div(new s(1).minus(r.times(r)).sqrt().plus(1)).atan(),s.precision=n,s.rounding=a,r.times(2)))};$e.inverseTangent=$e.atan=function(){var t,e,n,a,r,s,i,p,m,o=this,l=o.constructor,u=l.precision,c=l.rounding;if(o.isFinite()){if(o.isZero())return new l(o);if(o.abs().eq(1)&&u+4<=Ml)return i=Ha(l,u+4,c).times(.25),i.s=o.s,i}else{if(!o.s)return new l(NaN);if(u+4<=Ml)return i=Ha(l,u+4,c).times(.5),i.s=o.s,i}for(l.precision=p=u+10,l.rounding=1,n=Math.min(28,p/Ze+2|0),t=n;t;--t)o=o.div(o.times(o).plus(1).sqrt().plus(1));for(je=!1,e=Math.ceil(p/Ze),a=1,m=o.times(o),i=new l(o),r=o;t!==-1;)if(r=r.times(m),s=i.minus(r.div(a+=2)),r=r.times(m),i=s.plus(r.div(a+=2)),i.d[e]!==void 0)for(t=e;i.d[t]===s.d[t]&&t--;);return n&&(i=i.times(2<this.d.length-2};$e.isNaN=function(){return!this.s};$e.isNegative=$e.isNeg=function(){return this.s<0};$e.isPositive=$e.isPos=function(){return this.s>0};$e.isZero=function(){return!!this.d&&this.d[0]===0};$e.lessThan=$e.lt=function(t){return this.cmp(t)<0};$e.lessThanOrEqualTo=$e.lte=function(t){return this.cmp(t)<1};$e.logarithm=$e.log=function(t){var e,n,a,r,s,i,p,m,o=this,l=o.constructor,u=l.precision,c=l.rounding,f=5;if(t==null)t=new l(10),e=!0;else{if(t=new l(t),n=t.d,t.s<0||!n||!n[0]||t.eq(1))return new l(NaN);e=t.eq(10)}if(n=o.d,o.s<0||!n||!n[0]||o.eq(1))return new l(n&&!n[0]?-1/0:o.s!=1?NaN:n?0:1/0);if(e)if(n.length>1)s=!0;else{for(r=n[0];r%10===0;)r/=10;s=r!==1}if(je=!1,p=u+f,i=jr(o,p),a=e?ho(l,p+10):jr(t,p),m=_t(i,a,p,1),ii(m.d,r=u,c))do if(p+=10,i=jr(o,p),a=e?ho(l,p+10):jr(t,p),m=_t(i,a,p,1),!s){+ea(m.d).slice(r+1,r+15)+1==1e14&&(m=Le(m,u+1,0));break}while(ii(m.d,r+=10,c));return je=!0,Le(m,u,c)};$e.minus=$e.sub=function(t){var e,n,a,r,s,i,p,m,o,l,u,c,f=this,v=f.constructor;if(t=new v(t),!f.d||!t.d)return!f.s||!t.s?t=new v(NaN):f.d?t.s=-t.s:t=new v(t.d||f.s!==t.s?f:NaN),t;if(f.s!=t.s)return t.s=-t.s,f.plus(t);if(o=f.d,c=t.d,p=v.precision,m=v.rounding,!o[0]||!c[0]){if(c[0])t.s=-t.s;else if(o[0])t=new v(f);else return new v(m===3?-0:0);return je?Le(t,p,m):t}if(n=oa(t.e/Ze),l=oa(f.e/Ze),o=o.slice(),s=l-n,s){for(u=s<0,u?(e=o,s=-s,i=c.length):(e=c,n=l,i=o.length),a=Math.max(Math.ceil(p/Ze),i)+2,s>a&&(s=a,e.length=1),e.reverse(),a=s;a--;)e.push(0);e.reverse()}else{for(a=o.length,i=c.length,u=a0;--a)o[i++]=0;for(a=c.length;a>s;){if(o[--a]i?s+1:i+1,r>i&&(r=i,n.length=1),n.reverse();r--;)n.push(0);n.reverse()}for(i=o.length,r=l.length,i-r<0&&(r=i,n=l,l=o,o=n),e=0;r;)e=(o[--r]=o[r]+l[r]+e)/Va|0,o[r]%=Va;for(e&&(o.unshift(e),++a),i=o.length;o[--i]==0;)o.pop();return t.d=o,t.e=Io(o,a),je?Le(t,p,m):t};$e.precision=$e.sd=function(t){var e,n=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(en+t);return n.d?(e=rv(n.d),t&&n.e+1>e&&(e=n.e+1)):e=NaN,e};$e.round=function(){var t=this,e=t.constructor;return Le(new e(t),t.e+1,e.rounding)};$e.sine=$e.sin=function(){var t,e,n=this,a=n.constructor;return n.isFinite()?n.isZero()?new a(n):(t=a.precision,e=a.rounding,a.precision=t+Math.max(n.e,n.sd())+Ze,a.rounding=1,n=o1(a,ov(a,n)),a.precision=t,a.rounding=e,Le(Tr>2?n.neg():n,t,e,!0)):new a(NaN)};$e.squareRoot=$e.sqrt=function(){var t,e,n,a,r,s,i=this,p=i.d,m=i.e,o=i.s,l=i.constructor;if(o!==1||!p||!p[0])return new l(!o||o<0&&(!p||p[0])?NaN:p?i:1/0);for(je=!1,o=Math.sqrt(+i),o==0||o==1/0?(e=ea(p),(e.length+m)%2==0&&(e+="0"),o=Math.sqrt(e),m=oa((m+1)/2)-(m<0||m%2),o==1/0?e="5e"+m:(e=o.toExponential(),e=e.slice(0,e.indexOf("e")+1)+m),a=new l(e)):a=new l(o.toString()),n=(m=l.precision)+3;;)if(s=a,a=s.plus(_t(i,s,n+2,1)).times(.5),ea(s.d).slice(0,n)===(e=ea(a.d)).slice(0,n))if(e=e.slice(n-3,n+1),e=="9999"||!r&&e=="4999"){if(!r&&(Le(s,m+1,0),s.times(s).eq(i))){a=s;break}n+=4,r=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(Le(a,m+1,1),t=!a.times(a).eq(i));break}return je=!0,Le(a,m,l.rounding,t)};$e.tangent=$e.tan=function(){var t,e,n=this,a=n.constructor;return n.isFinite()?n.isZero()?new a(n):(t=a.precision,e=a.rounding,a.precision=t+10,a.rounding=1,n=n.sin(),n.s=1,n=_t(n,new a(1).minus(n.times(n)).sqrt(),t+10,0),a.precision=t,a.rounding=e,Le(Tr==2||Tr==4?n.neg():n,t,e,!0)):new a(NaN)};$e.times=$e.mul=function(t){var e,n,a,r,s,i,p,m,o,l=this,u=l.constructor,c=l.d,f=(t=new u(t)).d;if(t.s*=l.s,!c||!c[0]||!f||!f[0])return new u(!t.s||c&&!c[0]&&!f||f&&!f[0]&&!c?NaN:!c||!f?t.s/0:t.s*0);for(n=oa(l.e/Ze)+oa(t.e/Ze),m=c.length,o=f.length,m=0;){for(e=0,r=m+a;r>a;)p=s[r]+f[a]*c[r-a-1]+e,s[r--]=p%Va|0,e=p/Va|0;s[r]=(s[r]+e)%Va|0}for(;!s[--i];)s.pop();return e?++n:s.shift(),t.d=s,t.e=Io(s,n),je?Le(t,u.precision,u.rounding):t};$e.toBinary=function(t,e){return Wl(this,2,t,e)};$e.toDecimalPlaces=$e.toDP=function(t,e){var n=this,a=n.constructor;return n=new a(n),t===void 0?n:(Aa(t,0,an),e===void 0?e=a.rounding:Aa(e,0,8),Le(n,t+n.e+1,e))};$e.toExponential=function(t,e){var n,a=this,r=a.constructor;return t===void 0?n=dr(a,!0):(Aa(t,0,an),e===void 0?e=r.rounding:Aa(e,0,8),a=Le(new r(a),t+1,e),n=dr(a,!0,t+1)),a.isNeg()&&!a.isZero()?"-"+n:n};$e.toFixed=function(t,e){var n,a,r=this,s=r.constructor;return t===void 0?n=dr(r):(Aa(t,0,an),e===void 0?e=s.rounding:Aa(e,0,8),a=Le(new s(r),t+r.e+1,e),n=dr(a,!1,t+a.e+1)),r.isNeg()&&!r.isZero()?"-"+n:n};$e.toFraction=function(t){var e,n,a,r,s,i,p,m,o,l,u,c,f=this,v=f.d,h=f.constructor;if(!v)return new h(f);if(o=n=new h(1),a=m=new h(0),e=new h(a),s=e.e=rv(v)-f.e-1,i=s%Ze,e.d[0]=kt(10,i<0?Ze+i:i),t==null)t=s>0?e:o;else{if(p=new h(t),!p.isInt()||p.lt(o))throw Error(en+p);t=p.gt(e)?s>0?e:o:p}for(je=!1,p=new h(ea(v)),l=h.precision,h.precision=s=v.length*Ze*2;u=_t(p,e,0,1,1),r=n.plus(u.times(a)),r.cmp(t)!=1;)n=a,a=r,r=o,o=m.plus(u.times(r)),m=r,r=e,e=p.minus(u.times(r)),p=r;return r=_t(t.minus(n),a,0,1,1),m=m.plus(r.times(o)),n=n.plus(r.times(a)),m.s=o.s=f.s,c=_t(o,a,s,1).minus(f).abs().cmp(_t(m,n,s,1).minus(f).abs())<1?[o,a]:[m,n],h.precision=l,je=!0,c};$e.toHexadecimal=$e.toHex=function(t,e){return Wl(this,16,t,e)};$e.toNearest=function(t,e){var n=this,a=n.constructor;if(n=new a(n),t==null){if(!n.d)return n;t=new a(1),e=a.rounding}else{if(t=new a(t),e===void 0?e=a.rounding:Aa(e,0,8),!n.d)return t.s?n:t;if(!t.d)return t.s&&(t.s=n.s),t}return t.d[0]?(je=!1,n=_t(n,t,0,e,1).times(t),je=!0,Le(n)):(t.s=n.s,n=t),n};$e.toNumber=function(){return+this};$e.toOctal=function(t,e){return Wl(this,8,t,e)};$e.toPower=$e.pow=function(t){var e,n,a,r,s,i,p=this,m=p.constructor,o=+(t=new m(t));if(!p.d||!t.d||!p.d[0]||!t.d[0])return new m(kt(+p,o));if(p=new m(p),p.eq(1))return p;if(a=m.precision,s=m.rounding,t.eq(1))return Le(p,a,s);if(e=oa(t.e/Ze),e>=t.d.length-1&&(n=o<0?-o:o)<=r1)return r=nv(m,p,n,a),t.s<0?new m(1).div(r):Le(r,a,s);if(i=p.s,i<0){if(em.maxE+1||e0?i/0:0):(je=!1,m.rounding=p.s=1,n=Math.min(12,(e+"").length),r=Sl(t.times(jr(p,a+n)),a),r.d&&(r=Le(r,a+5,1),ii(r.d,a,s)&&(e=a+10,r=Le(Sl(t.times(jr(p,e+n)),e),e+5,1),+ea(r.d).slice(a+1,a+15)+1==1e14&&(r=Le(r,a+1,0)))),r.s=i,je=!0,m.rounding=s,Le(r,a,s))};$e.toPrecision=function(t,e){var n,a=this,r=a.constructor;return t===void 0?n=dr(a,a.e<=r.toExpNeg||a.e>=r.toExpPos):(Aa(t,1,an),e===void 0?e=r.rounding:Aa(e,0,8),a=Le(new r(a),t,e),n=dr(a,t<=a.e||a.e<=r.toExpNeg,t)),a.isNeg()&&!a.isZero()?"-"+n:n};$e.toSignificantDigits=$e.toSD=function(t,e){var n=this,a=n.constructor;return t===void 0?(t=a.precision,e=a.rounding):(Aa(t,1,an),e===void 0?e=a.rounding:Aa(e,0,8)),Le(new a(n),t,e)};$e.toString=function(){var t=this,e=t.constructor,n=dr(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+n:n};$e.truncated=$e.trunc=function(){return Le(new this.constructor(this),this.e+1,1)};$e.valueOf=$e.toJSON=function(){var t=this,e=t.constructor,n=dr(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+n:n};function ea(t){var e,n,a,r=t.length-1,s="",i=t[0];if(r>0){for(s+=i,e=1;en)throw Error(en+t)}function ii(t,e,n,a){var r,s,i,p;for(s=t[0];s>=10;s/=10)--e;return--e<0?(e+=Ze,r=0):(r=Math.ceil((e+1)/Ze),e%=Ze),s=kt(10,Ze-e),p=t[r]%s|0,a==null?e<3?(e==0?p=p/100|0:e==1&&(p=p/10|0),i=n<4&&p==99999||n>3&&p==49999||p==5e4||p==0):i=(n<4&&p+1==s||n>3&&p+1==s/2)&&(t[r+1]/s/100|0)==kt(10,e-2)-1||(p==s/2||p==0)&&(t[r+1]/s/100|0)==0:e<4?(e==0?p=p/1e3|0:e==1?p=p/100|0:e==2&&(p=p/10|0),i=(a||n<4)&&p==9999||!a&&n>3&&p==4999):i=((a||n<4)&&p+1==s||!a&&n>3&&p+1==s/2)&&(t[r+1]/s/1e3|0)==kt(10,e-3)-1,i}function ro(t,e,n){for(var a,r=[0],s,i=0,p=t.length;in-1&&(r[a+1]===void 0&&(r[a+1]=0),r[a+1]+=r[a]/n|0,r[a]%=n)}return r.reverse()}function s1(t,e){var n,a,r;if(e.isZero())return e;a=e.d.length,a<32?(n=Math.ceil(a/3),r=(1/qo(4,n)).toString()):(n=16,r="2.3283064365386962890625e-10"),t.precision+=n,e=Ns(t,1,e.times(r),new t(1));for(var s=n;s--;){var i=e.times(e);e=i.times(i).minus(i).times(8).plus(1)}return t.precision-=n,e}var _t=function(){function t(a,r,s){var i,p=0,m=a.length;for(a=a.slice();m--;)i=a[m]*r+p,a[m]=i%s|0,p=i/s|0;return p&&a.unshift(p),a}function e(a,r,s,i){var p,m;if(s!=i)m=s>i?1:-1;else for(p=m=0;pr[p]?1:-1;break}return m}function n(a,r,s,i){for(var p=0;s--;)a[s]-=p,p=a[s]1;)a.shift()}return function(a,r,s,i,p,m){var o,l,u,c,f,v,h,w,d,N,g,x,b,y,D,A,E,M,S,C,B=a.constructor,O=a.s==r.s?1:-1,P=a.d,$=r.d;if(!P||!P[0]||!$||!$[0])return new B(!a.s||!r.s||(P?$&&P[0]==$[0]:!$)?NaN:P&&P[0]==0||!$?O*0:O/0);for(m?(f=1,l=a.e-r.e):(m=Va,f=Ze,l=oa(a.e/f)-oa(r.e/f)),S=$.length,E=P.length,d=new B(O),N=d.d=[],u=0;$[u]==(P[u]||0);u++);if($[u]>(P[u]||0)&&l--,s==null?(y=s=B.precision,i=B.rounding):p?y=s+(a.e-r.e)+1:y=s,y<0)N.push(1),v=!0;else{if(y=y/f+2|0,u=0,S==1){for(c=0,$=$[0],y++;(u1&&($=t($,c,m),P=t(P,c,m),S=$.length,E=P.length),A=S,g=P.slice(0,S),x=g.length;x=m/2&&++M;do c=0,o=e($,g,S,x),o<0?(b=g[0],S!=x&&(b=b*m+(g[1]||0)),c=b/M|0,c>1?(c>=m&&(c=m-1),h=t($,c,m),w=h.length,x=g.length,o=e(h,g,w,x),o==1&&(c--,n(h,S=10;c/=10)u++;d.e=u+l*f-1,Le(d,p?s+d.e+1:s,i,v)}return d}}();function Le(t,e,n,a){var r,s,i,p,m,o,l,u,c,f=t.constructor;e:if(e!=null){if(u=t.d,!u)return t;for(r=1,p=u[0];p>=10;p/=10)r++;if(s=e-r,s<0)s+=Ze,i=e,l=u[c=0],m=l/kt(10,r-i-1)%10|0;else if(c=Math.ceil((s+1)/Ze),p=u.length,c>=p)if(a){for(;p++<=c;)u.push(0);l=m=0,r=1,s%=Ze,i=s-Ze+1}else break e;else{for(l=p=u[c],r=1;p>=10;p/=10)r++;s%=Ze,i=s-Ze+r,m=i<0?0:l/kt(10,r-i-1)%10|0}if(a=a||e<0||u[c+1]!==void 0||(i<0?l:l%kt(10,r-i-1)),o=n<4?(m||a)&&(n==0||n==(t.s<0?3:2)):m>5||m==5&&(n==4||a||n==6&&(s>0?i>0?l/kt(10,r-i):0:u[c-1])%10&1||n==(t.s<0?8:7)),e<1||!u[0])return u.length=0,o?(e-=t.e+1,u[0]=kt(10,(Ze-e%Ze)%Ze),t.e=-e||0):u[0]=t.e=0,t;if(s==0?(u.length=c,p=1,c--):(u.length=c+1,p=kt(10,Ze-s),u[c]=i>0?(l/kt(10,r-i)%kt(10,i)|0)*p:0),o)for(;;)if(c==0){for(s=1,i=u[0];i>=10;i/=10)s++;for(i=u[0]+=p,p=1;i>=10;i/=10)p++;s!=p&&(t.e++,u[0]==Va&&(u[0]=1));break}else{if(u[c]+=p,u[c]!=Va)break;u[c--]=0,p=1}for(s=u.length;u[--s]===0;)u.pop()}return je&&(t.e>f.maxE?(t.d=null,t.e=NaN):t.e0?s=s.charAt(0)+"."+s.slice(1)+Lr(a):i>1&&(s=s.charAt(0)+"."+s.slice(1)),s=s+(t.e<0?"e":"e+")+t.e):r<0?(s="0."+Lr(-r-1)+s,n&&(a=n-i)>0&&(s+=Lr(a))):r>=i?(s+=Lr(r+1-i),n&&(a=n-r-1)>0&&(s=s+"."+Lr(a))):((a=r+1)0&&(r+1===i&&(s+="."),s+=Lr(a))),s}function Io(t,e){var n=t[0];for(e*=Ze;n>=10;n/=10)e++;return e}function ho(t,e,n){if(e>n1)throw je=!0,n&&(t.precision=n),Error(Kh);return Le(new t(co),e,1,!0)}function Ha(t,e,n){if(e>Ml)throw Error(Kh);return Le(new t(fo),e,n,!0)}function rv(t){var e=t.length-1,n=e*Ze+1;if(e=t[e],e){for(;e%10==0;e/=10)n--;for(e=t[0];e>=10;e/=10)n++}return n}function Lr(t){for(var e="";t--;)e+="0";return e}function nv(t,e,n,a){var r,s=new t(1),i=Math.ceil(a/Ze+4);for(je=!1;;){if(n%2&&(s=s.times(e),eu(s.d,i)&&(r=!0)),n=oa(n/2),n===0){n=s.d.length-1,r&&s.d[n]===0&&++s.d[n];break}e=e.times(e),eu(e.d,i)}return je=!0,s}function Km(t){return t.d[t.d.length-1]&1}function sv(t,e,n){for(var a,r=new t(e[0]),s=0;++s17)return new c(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:0/0);for(e==null?(je=!1,m=v):m=e,p=new c(.03125);t.e>-2;)t=t.times(p),u+=5;for(a=Math.log(kt(2,u))/Math.LN10*2+5|0,m+=a,n=s=i=new c(1),c.precision=m;;){if(s=Le(s.times(t),m,1),n=n.times(++l),p=i.plus(_t(s,n,m,1)),ea(p.d).slice(0,m)===ea(i.d).slice(0,m)){for(r=u;r--;)i=Le(i.times(i),m,1);if(e==null)if(o<3&&ii(i.d,m-a,f,o))c.precision=m+=10,n=s=p=new c(1),l=0,o++;else return Le(i,c.precision=v,f,je=!0);else return c.precision=v,i}i=p}}function jr(t,e){var n,a,r,s,i,p,m,o,l,u,c,f=1,v=10,h=t,w=h.d,d=h.constructor,N=d.rounding,g=d.precision;if(h.s<0||!w||!w[0]||!h.e&&w[0]==1&&w.length==1)return new d(w&&!w[0]?-1/0:h.s!=1?NaN:w?0:h);if(e==null?(je=!1,l=g):l=e,d.precision=l+=v,n=ea(w),a=n.charAt(0),Math.abs(s=h.e)<15e14){for(;a<7&&a!=1||a==1&&n.charAt(1)>3;)h=h.times(t),n=ea(h.d),a=n.charAt(0),f++;s=h.e,a>1?(h=new d("0."+n),s++):h=new d(a+"."+n.slice(1))}else return o=ho(d,l+2,g).times(s+""),h=jr(new d(a+"."+n.slice(1)),l-v).plus(o),d.precision=g,e==null?Le(h,g,N,je=!0):h;for(u=h,m=i=h=_t(h.minus(1),h.plus(1),l,1),c=Le(h.times(h),l,1),r=3;;){if(i=Le(i.times(c),l,1),o=m.plus(_t(i,new d(r),l,1)),ea(o.d).slice(0,l)===ea(m.d).slice(0,l))if(m=m.times(2),s!==0&&(m=m.plus(ho(d,l+2,g).times(s+""))),m=_t(m,new d(f),l,1),e==null)if(ii(m.d,l-v,N,p))d.precision=l+=v,o=i=h=_t(u.minus(1),u.plus(1),l,1),c=Le(h.times(h),l,1),r=p=1;else return Le(m,d.precision=g,N,je=!0);else return d.precision=g,m;m=o,r+=2}}function iv(t){return String(t.s*t.s/0)}function Cl(t,e){var n,a,r;for((n=e.indexOf("."))>-1&&(e=e.replace(".","")),(a=e.search(/e/i))>0?(n<0&&(n=a),n+=+e.slice(a+1),e=e.substring(0,a)):n<0&&(n=e.length),a=0;e.charCodeAt(a)===48;a++);for(r=e.length;e.charCodeAt(r-1)===48;--r);if(e=e.slice(a,r),e){if(r-=a,t.e=n=n-a-1,t.d=[],a=(n+1)%Ze,n<0&&(a+=Ze),at.constructor.maxE?(t.d=null,t.e=NaN):t.e-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),av.test(e))return Cl(t,e)}else if(e==="Infinity"||e==="NaN")return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(t1.test(e))n=16,e=e.toLowerCase();else if(e1.test(e))n=2;else if(a1.test(e))n=8;else throw Error(en+e);for(s=e.search(/p/i),s>0?(m=+e.slice(s+1),e=e.substring(2,s)):e=e.slice(2),s=e.indexOf("."),i=s>=0,a=t.constructor,i&&(e=e.replace(".",""),p=e.length,s=p-s,r=nv(a,new a(n),s,s*2)),o=ro(e,n,Va),l=o.length-1,s=l;o[s]===0;--s)o.pop();return s<0?new a(t.s*0):(t.e=Io(o,l),t.d=o,je=!1,i&&(t=_t(t,r,p*4)),m&&(t=t.times(Math.abs(m)<54?kt(2,m):tn.pow(2,m))),je=!0,t)}function o1(t,e){var n,a=e.d.length;if(a<3)return e.isZero()?e:Ns(t,2,e,e);n=1.4*Math.sqrt(a),n=n>16?16:n|0,e=e.times(1/qo(5,n)),e=Ns(t,2,e,e);for(var r,s=new t(5),i=new t(16),p=new t(20);n--;)r=e.times(e),e=e.times(s.plus(r.times(i.times(r).minus(p))));return e}function Ns(t,e,n,a,r){var s,i,p,m,o=t.precision,l=Math.ceil(o/Ze);for(je=!1,m=n.times(n),p=new t(a);;){if(i=_t(p.times(m),new t(e++*e++),o,1),p=r?a.plus(i):a.minus(i),a=_t(i.times(m),new t(e++*e++),o,1),i=p.plus(a),i.d[l]!==void 0){for(s=l;i.d[s]===p.d[s]&&s--;);if(s==-1)break}s=p,p=a,a=i,i=s}return je=!0,i.d.length=l+1,i}function qo(t,e){for(var n=t;--e;)n*=t;return n}function ov(t,e){var n,a=e.s<0,r=Ha(t,t.precision,1),s=r.times(.5);if(e=e.abs(),e.lte(s))return Tr=a?4:1,e;if(n=e.divToInt(r),n.isZero())Tr=a?3:2;else{if(e=e.minus(n.times(r)),e.lte(s))return Tr=Km(n)?a?2:3:a?4:1,e;Tr=Km(n)?a?1:4:a?3:2}return e.minus(r).abs()}function Wl(t,e,n,a){var r,s,i,p,m,o,l,u,c,f=t.constructor,v=n!==void 0;if(v?(Aa(n,1,an),a===void 0?a=f.rounding:Aa(a,0,8)):(n=f.precision,a=f.rounding),!t.isFinite())l=iv(t);else{for(l=dr(t),i=l.indexOf("."),v?(r=2,e==16?n=n*4-3:e==8&&(n=n*3-2)):r=e,i>=0&&(l=l.replace(".",""),c=new f(1),c.e=l.length-i,c.d=ro(dr(c),10,r),c.e=c.d.length),u=ro(l,10,r),s=m=u.length;u[--m]==0;)u.pop();if(!u[0])l=v?"0p+0":"0";else{if(i<0?s--:(t=new f(t),t.d=u,t.e=s,t=_t(t,c,n,a,0,r),u=t.d,s=t.e,o=jh),i=u[n],p=r/2,o=o||u[n+1]!==void 0,o=a<4?(i!==void 0||o)&&(a===0||a===(t.s<0?3:2)):i>p||i===p&&(a===4||o||a===6&&u[n-1]&1||a===(t.s<0?8:7)),u.length=n,o)for(;++u[--n]>r-1;)u[n]=0,n||(++s,u.unshift(1));for(m=u.length;!u[m-1];--m);for(i=0,l="";i1)if(e==16||e==8){for(i=e==16?4:3,--m;m%i;m++)l+="0";for(u=ro(l,r,e),m=u.length;!u[m-1];--m);for(i=1,l="1.";im)for(s-=m;s--;)l+="0";else se)return t.length=e,!0}function l1(t){return new this(t).abs()}function m1(t){return new this(t).acos()}function u1(t){return new this(t).acosh()}function p1(t,e){return new this(t).plus(e)}function c1(t){return new this(t).asin()}function f1(t){return new this(t).asinh()}function h1(t){return new this(t).atan()}function v1(t){return new this(t).atanh()}function g1(t,e){t=new this(t),e=new this(e);var n,a=this.precision,r=this.rounding,s=a+4;return!t.s||!e.s?n=new this(NaN):!t.d&&!e.d?(n=Ha(this,s,1).times(e.s>0?.25:.75),n.s=t.s):!e.d||t.isZero()?(n=e.s<0?Ha(this,a,r):new this(0),n.s=t.s):!t.d||e.isZero()?(n=Ha(this,s,1).times(.5),n.s=t.s):e.s<0?(this.precision=s,this.rounding=1,n=this.atan(_t(t,e,s,1)),e=Ha(this,s,1),this.precision=a,this.rounding=r,n=t.s<0?n.minus(e):n.plus(e)):n=this.atan(_t(t,e,s,1)),n}function d1(t){return new this(t).cbrt()}function y1(t){return Le(t=new this(t),t.e+1,2)}function w1(t,e,n){return new this(t).clamp(e,n)}function x1(t){if(!t||typeof t!="object")throw Error(Ro+"Object expected");var e,n,a,r=t.defaults===!0,s=["precision",1,an,"rounding",0,8,"toExpNeg",-is,0,"toExpPos",0,is,"maxE",0,is,"minE",-is,0,"modulo",0,9];for(e=0;e=s[e+1]&&a<=s[e+2])this[n]=a;else throw Error(en+n+": "+a);if(n="crypto",r&&(this[n]=Al[n]),(a=t[n])!==void 0)if(a===!0||a===!1||a===0||a===1)if(a)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(ev);else this[n]=!1;else throw Error(en+n+": "+a);return this}function b1(t){return new this(t).cos()}function N1(t){return new this(t).cosh()}function lv(t){var e,n,a;function r(s){var i,p,m,o=this;if(!(o instanceof r))return new r(s);if(o.constructor=r,tu(s)){o.s=s.s,je?!s.d||s.e>r.maxE?(o.e=NaN,o.d=null):s.e=10;p/=10)i++;je?i>r.maxE?(o.e=NaN,o.d=null):i=429e7?e[s]=crypto.getRandomValues(new Uint32Array(1))[0]:p[s++]=r%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(a*=4);s=214e7?crypto.randomBytes(4).copy(e,s):(p.push(r%1e7),s+=4);s=a/4}else throw Error(ev);else for(;s=10;r/=10)a++;a{var{on:e,config:n}=t,a=tn.clone({precision:n.precision,modulo:tn.EUCLID});return a.prototype=Object.create(a.prototype),a.prototype.type="BigNumber",a.prototype.isBigNumber=!0,a.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},a.fromJSON=function(r){return new a(r.value)},e&&e("config",function(r,s){r.precision!==s.precision&&a.config({precision:r.precision})}),a},{isClass:!0}),Nn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function En(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function X1(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function a(){return this instanceof a?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(a){var r=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(n,a,r.get?r:{enumerable:!0,get:function(){return t[a]}})}),n}var mv={exports:{}};/** - * @license Complex.js v2.1.1 12/05/2020 - * - * Copyright (c) 2020, Robert Eisele (robert@xarg.org) - * Dual licensed under the MIT or GPL Version 2 licenses. - **/(function(t,e){(function(n){var a=Math.cosh||function(u){return Math.abs(u)<1e-9?1-u:(Math.exp(u)+Math.exp(-u))*.5},r=Math.sinh||function(u){return Math.abs(u)<1e-9?u:(Math.exp(u)-Math.exp(-u))*.5},s=function(u){var c=Math.PI/4;if(-c>u||u>c)return Math.cos(u)-1;var f=u*u;return f*(f*(f*(f*(f*(f*(f*(f/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},i=function(u,c){var f=Math.abs(u),v=Math.abs(c);return f<3e3&&v<3e3?Math.sqrt(f*f+v*v):(f0&&p();break;case"number":f.im=0,f.re=u;break;default:p()}return isNaN(f.re)||isNaN(f.im),f};function l(u,c){if(!(this instanceof l))return new l(u,c);var f=o(u,c);this.re=f.re,this.im=f.im}l.prototype={re:0,im:0,sign:function(){var u=this.abs();return new l(this.re/u,this.im/u)},add:function(u,c){var f=new l(u,c);return this.isInfinite()&&f.isInfinite()?l.NAN:this.isInfinite()||f.isInfinite()?l.INFINITY:new l(this.re+f.re,this.im+f.im)},sub:function(u,c){var f=new l(u,c);return this.isInfinite()&&f.isInfinite()?l.NAN:this.isInfinite()||f.isInfinite()?l.INFINITY:new l(this.re-f.re,this.im-f.im)},mul:function(u,c){var f=new l(u,c);return this.isInfinite()&&f.isZero()||this.isZero()&&f.isInfinite()?l.NAN:this.isInfinite()||f.isInfinite()?l.INFINITY:f.im===0&&this.im===0?new l(this.re*f.re,0):new l(this.re*f.re-this.im*f.im,this.re*f.im+this.im*f.re)},div:function(u,c){var f=new l(u,c);if(this.isZero()&&f.isZero()||this.isInfinite()&&f.isInfinite())return l.NAN;if(this.isInfinite()||f.isZero())return l.INFINITY;if(this.isZero()||f.isInfinite())return l.ZERO;u=this.re,c=this.im;var v=f.re,h=f.im,w,d;return h===0?new l(u/v,c/v):Math.abs(v)0)return new l(Math.pow(u,f.re),0);if(u===0)switch((f.re%4+4)%4){case 0:return new l(Math.pow(c,f.re),0);case 1:return new l(0,Math.pow(c,f.re));case 2:return new l(-Math.pow(c,f.re),0);case 3:return new l(0,-Math.pow(c,f.re))}}if(u===0&&c===0&&f.re>0&&f.im>=0)return l.ZERO;var v=Math.atan2(c,u),h=m(u,c);return u=Math.exp(f.re*h-f.im*v),c=f.im*h+f.re*v,new l(u*Math.cos(c),u*Math.sin(c))},sqrt:function(){var u=this.re,c=this.im,f=this.abs(),v,h;if(u>=0){if(c===0)return new l(Math.sqrt(u),0);v=.5*Math.sqrt(2*(f+u))}else v=Math.abs(c)/Math.sqrt(2*(f-u));return u<=0?h=.5*Math.sqrt(2*(f-u)):h=Math.abs(c)/Math.sqrt(2*(f+u)),new l(v,c<0?-h:h)},exp:function(){var u=Math.exp(this.re);return this.im,new l(u*Math.cos(this.im),u*Math.sin(this.im))},expm1:function(){var u=this.re,c=this.im;return new l(Math.expm1(u)*Math.cos(c)+s(c),Math.exp(u)*Math.sin(c))},log:function(){var u=this.re,c=this.im;return new l(m(u,c),Math.atan2(c,u))},abs:function(){return i(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){var u=this.re,c=this.im;return new l(Math.sin(u)*a(c),Math.cos(u)*r(c))},cos:function(){var u=this.re,c=this.im;return new l(Math.cos(u)*a(c),-Math.sin(u)*r(c))},tan:function(){var u=2*this.re,c=2*this.im,f=Math.cos(u)+a(c);return new l(Math.sin(u)/f,r(c)/f)},cot:function(){var u=2*this.re,c=2*this.im,f=Math.cos(u)-a(c);return new l(-Math.sin(u)/f,r(c)/f)},sec:function(){var u=this.re,c=this.im,f=.5*a(2*c)+.5*Math.cos(2*u);return new l(Math.cos(u)*a(c)/f,Math.sin(u)*r(c)/f)},csc:function(){var u=this.re,c=this.im,f=.5*a(2*c)-.5*Math.cos(2*u);return new l(Math.sin(u)*a(c)/f,-Math.cos(u)*r(c)/f)},asin:function(){var u=this.re,c=this.im,f=new l(c*c-u*u+1,-2*u*c).sqrt(),v=new l(f.re-c,f.im+u).log();return new l(v.im,-v.re)},acos:function(){var u=this.re,c=this.im,f=new l(c*c-u*u+1,-2*u*c).sqrt(),v=new l(f.re-c,f.im+u).log();return new l(Math.PI/2-v.im,v.re)},atan:function(){var u=this.re,c=this.im;if(u===0){if(c===1)return new l(0,1/0);if(c===-1)return new l(0,-1/0)}var f=u*u+(1-c)*(1-c),v=new l((1-c*c-u*u)/f,-2*u/f).log();return new l(-.5*v.im,.5*v.re)},acot:function(){var u=this.re,c=this.im;if(c===0)return new l(Math.atan2(1,u),0);var f=u*u+c*c;return f!==0?new l(u/f,-c/f).atan():new l(u!==0?u/0:0,c!==0?-c/0:0).atan()},asec:function(){var u=this.re,c=this.im;if(u===0&&c===0)return new l(0,1/0);var f=u*u+c*c;return f!==0?new l(u/f,-c/f).acos():new l(u!==0?u/0:0,c!==0?-c/0:0).acos()},acsc:function(){var u=this.re,c=this.im;if(u===0&&c===0)return new l(Math.PI/2,1/0);var f=u*u+c*c;return f!==0?new l(u/f,-c/f).asin():new l(u!==0?u/0:0,c!==0?-c/0:0).asin()},sinh:function(){var u=this.re,c=this.im;return new l(r(u)*Math.cos(c),a(u)*Math.sin(c))},cosh:function(){var u=this.re,c=this.im;return new l(a(u)*Math.cos(c),r(u)*Math.sin(c))},tanh:function(){var u=2*this.re,c=2*this.im,f=a(u)+Math.cos(c);return new l(r(u)/f,Math.sin(c)/f)},coth:function(){var u=2*this.re,c=2*this.im,f=a(u)-Math.cos(c);return new l(r(u)/f,-Math.sin(c)/f)},csch:function(){var u=this.re,c=this.im,f=Math.cos(2*c)-a(2*u);return new l(-2*r(u)*Math.cos(c)/f,2*a(u)*Math.sin(c)/f)},sech:function(){var u=this.re,c=this.im,f=Math.cos(2*c)+a(2*u);return new l(2*a(u)*Math.cos(c)/f,-2*r(u)*Math.sin(c)/f)},asinh:function(){var u=this.im;this.im=-this.re,this.re=u;var c=this.asin();return this.re=-this.im,this.im=u,u=c.re,c.re=-c.im,c.im=u,c},acosh:function(){var u=this.acos();if(u.im<=0){var c=u.re;u.re=-u.im,u.im=c}else{var c=u.im;u.im=-u.re,u.re=c}return u},atanh:function(){var u=this.re,c=this.im,f=u>1&&c===0,v=1-u,h=1+u,w=v*v+c*c,d=w!==0?new l((h*v-c*c)/w,(c*v+h*c)/w):new l(u!==-1?u/0:0,c!==0?c/0:0),N=d.re;return d.re=m(d.re,d.im)/2,d.im=Math.atan2(d.im,N)/2,f&&(d.im=-d.im),d},acoth:function(){var u=this.re,c=this.im;if(u===0&&c===0)return new l(0,Math.PI/2);var f=u*u+c*c;return f!==0?new l(u/f,-c/f).atanh():new l(u!==0?u/0:0,c!==0?-c/0:0).atanh()},acsch:function(){var u=this.re,c=this.im;if(c===0)return new l(u!==0?Math.log(u+Math.sqrt(u*u+1)):1/0,0);var f=u*u+c*c;return f!==0?new l(u/f,-c/f).asinh():new l(u!==0?u/0:0,c!==0?-c/0:0).asinh()},asech:function(){var u=this.re,c=this.im;if(this.isZero())return l.INFINITY;var f=u*u+c*c;return f!==0?new l(u/f,-c/f).acosh():new l(u!==0?u/0:0,c!==0?-c/0:0).acosh()},inverse:function(){if(this.isZero())return l.INFINITY;if(this.isInfinite())return l.ZERO;var u=this.re,c=this.im,f=u*u+c*c;return new l(u/f,-c/f)},conjugate:function(){return new l(this.re,-this.im)},neg:function(){return new l(-this.re,-this.im)},ceil:function(u){return u=Math.pow(10,u||0),new l(Math.ceil(this.re*u)/u,Math.ceil(this.im*u)/u)},floor:function(u){return u=Math.pow(10,u||0),new l(Math.floor(this.re*u)/u,Math.floor(this.im*u)/u)},round:function(u){return u=Math.pow(10,u||0),new l(Math.round(this.re*u)/u,Math.round(this.im*u)/u)},equals:function(u,c){var f=new l(u,c);return Math.abs(f.re-this.re)<=l.EPSILON&&Math.abs(f.im-this.im)<=l.EPSILON},clone:function(){return new l(this.re,this.im)},toString:function(){var u=this.re,c=this.im,f="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(u)(Object.defineProperty(Kt,"name",{value:"Complex"}),Kt.prototype.constructor=Kt,Kt.prototype.type="Complex",Kt.prototype.isComplex=!0,Kt.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Kt.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Kt.prototype.format=function(t){var e="",n=this.im,a=this.re,r=yn(this.re,t),s=yn(this.im,t),i=tt(t)?t:t?t.precision:null;if(i!==null){var p=Math.pow(10,-i);Math.abs(a/n)e.re?1:t.ree.im?1:t.im1&&(N[g]=(N[g]||0)+1):N[d]=(N[d]||0)+1,N}var m=function(d,N){var g=0,x=1,b=1,y=0,D=0,A=0,E=1,M=1,S=0,C=1,B=1,O=1,P=1e7,$;if(d!=null)if(N!==void 0){if(g=d,x=N,b=g*x,g%1!==0||x%1!==0)throw w()}else switch(typeof d){case"object":{if("d"in d&&"n"in d)g=d.n,x=d.d,"s"in d&&(g*=d.s);else if(0 in d)g=d[0],1 in d&&(x=d[1]);else throw h();b=g*x;break}case"number":{if(d<0&&(b=d,d=-d),d%1===0)g=d;else if(d>0){for(d>=1&&(M=Math.pow(10,Math.floor(1+Math.log(d)/Math.LN10)),d/=M);C<=P&&O<=P;)if($=(S+B)/(C+O),d===$){C+O<=P?(g=S+B,x=C+O):O>C?(g=B,x=O):(g=S,x=C);break}else d>$?(S+=B,C+=O):(B+=S,O+=C),C>P?(g=B,x=O):(g=S,x=C);g*=M}else(isNaN(d)||isNaN(N))&&(x=g=NaN);break}case"string":{if(C=d.match(/\d+|./g),C===null)throw h();if(C[S]==="-"?(b=-1,S++):C[S]==="+"&&S++,C.length===S+1?D=s(C[S++],b):C[S+1]==="."||C[S]==="."?(C[S]!=="."&&(y=s(C[S++],b)),S++,(S+1===C.length||C[S+1]==="("&&C[S+3]===")"||C[S+1]==="'"&&C[S+3]==="'")&&(D=s(C[S],b),E=Math.pow(10,C[S].length),S++),(C[S]==="("&&C[S+2]===")"||C[S]==="'"&&C[S+2]==="'")&&(A=s(C[S+1],b),M=Math.pow(10,C[S+1].length)-1,S+=3)):C[S+1]==="/"||C[S+1]===":"?(D=s(C[S],b),E=s(C[S+2],1),S+=3):C[S+3]==="/"&&C[S+1]===" "&&(y=s(C[S],b),D=s(C[S+2],b),E=s(C[S+4],1),S+=5),C.length<=S){x=E*M,b=g=A+x*y+M*D;break}}default:throw h()}if(x===0)throw v();r.s=b<0?-1:1,r.n=Math.abs(g),r.d=Math.abs(x)};function o(d,N,g){for(var x=1;N>0;d=d*d%g,N>>=1)N&1&&(x=x*d%g);return x}function l(d,N){for(;N%2===0;N/=2);for(;N%5===0;N/=5);if(N===1)return 0;for(var g=10%N,x=1;g!==1;x++)if(g=g*10%N,x>a)return 0;return x}function u(d,N,g){for(var x=1,b=o(10,g,N),y=0;y<300;y++){if(x===b)return y;x=x*10%N,b=b*10%N}return 0}function c(d,N){if(!d)return N;if(!N)return d;for(;;){if(d%=N,!d)return N;if(N%=d,!N)return d}}function f(d,N){if(m(d,N),this instanceof f)d=c(r.d,r.n),this.s=r.s,this.n=r.n/d,this.d=r.d/d;else return i(r.s*r.n,r.d)}var v=function(){return new Error("Division by Zero")},h=function(){return new Error("Invalid argument")},w=function(){return new Error("Parameters must be integer")};f.prototype={s:1,n:0,d:1,abs:function(){return i(this.n,this.d)},neg:function(){return i(-this.s*this.n,this.d)},add:function(d,N){return m(d,N),i(this.s*this.n*r.d+r.s*this.d*r.n,this.d*r.d)},sub:function(d,N){return m(d,N),i(this.s*this.n*r.d-r.s*this.d*r.n,this.d*r.d)},mul:function(d,N){return m(d,N),i(this.s*r.s*this.n*r.n,this.d*r.d)},div:function(d,N){return m(d,N),i(this.s*r.s*this.n*r.d,this.d*r.n)},clone:function(){return i(this.s*this.n,this.d)},mod:function(d,N){if(isNaN(this.n)||isNaN(this.d))return new f(NaN);if(d===void 0)return i(this.s*this.n%this.d,1);if(m(d,N),r.n===0&&this.d===0)throw v();return i(this.s*(r.d*this.n)%(r.n*this.d),r.d*this.d)},gcd:function(d,N){return m(d,N),i(c(r.n,this.n)*c(r.d,this.d),r.d*this.d)},lcm:function(d,N){return m(d,N),r.n===0&&this.n===0?i(0,1):i(r.n*this.n,c(r.n,this.n)*c(r.d,this.d))},ceil:function(d){return d=Math.pow(10,d||0),isNaN(this.n)||isNaN(this.d)?new f(NaN):i(Math.ceil(d*this.s*this.n/this.d),d)},floor:function(d){return d=Math.pow(10,d||0),isNaN(this.n)||isNaN(this.d)?new f(NaN):i(Math.floor(d*this.s*this.n/this.d),d)},round:function(d){return d=Math.pow(10,d||0),isNaN(this.n)||isNaN(this.d)?new f(NaN):i(Math.round(d*this.s*this.n/this.d),d)},inverse:function(){return i(this.s*this.d,this.n)},pow:function(d,N){if(m(d,N),r.d===1)return r.s<0?i(Math.pow(this.s*this.d,r.n),Math.pow(this.n,r.n)):i(Math.pow(this.s*this.n,r.n),Math.pow(this.d,r.n));if(this.s<0)return null;var g=p(this.n),x=p(this.d),b=1,y=1;for(var D in g)if(D!=="1"){if(D==="0"){b=0;break}if(g[D]*=r.n,g[D]%r.d===0)g[D]/=r.d;else return null;b*=Math.pow(D,g[D])}for(var D in x)if(D!=="1"){if(x[D]*=r.n,x[D]%r.d===0)x[D]/=r.d;else return null;y*=Math.pow(D,x[D])}return r.s<0?i(y,b):i(b,y)},equals:function(d,N){return m(d,N),this.s*this.n*r.d===r.s*r.n*this.d},compare:function(d,N){m(d,N);var g=this.s*this.n*r.d-r.s*r.n*this.d;return(0=0;y--)b=b.inverse().add(g[y]);if(Math.abs(b.sub(N).valueOf())0&&(g+=N,g+=" ",x%=b),g+=x,g+="/",g+=b),g},toLatex:function(d){var N,g="",x=this.n,b=this.d;return this.s<0&&(g+="-"),b===1?g+=x:(d&&(N=Math.floor(x/b))>0&&(g+=N,x%=b),g+="\\frac{",g+=x,g+="}{",g+=b,g+="}"),g},toContinued:function(){var d,N=this.n,g=this.d,x=[];if(isNaN(N)||isNaN(g))return x;do x.push(Math.floor(N/g)),d=N%g,N=g,g=d;while(N!==1);return x},toString:function(d){var N=this.n,g=this.d;if(isNaN(N)||isNaN(g))return"NaN";d=d||15;var x=l(N,g),b=u(N,g,x),y=this.s<0?"-":"";if(y+=N/g|0,N%=g,N*=10,N&&(y+="."),x){for(var D=b;D--;)y+=N/g|0,N%=g,N*=10;y+="(";for(var D=x;D--;)y+=N/g|0,N%=g,N*=10;y+=")"}else for(var D=d;N&&D--;)y+=N/g|0,N%=g,N*=10;return y}},Object.defineProperty(f,"__esModule",{value:!0}),f.default=f,f.Fraction=f,t.exports=f})()})(uv);var ty=uv.exports;const Er=En(ty);var ay="Fraction",ry=[],ny=q(ay,ry,()=>(Object.defineProperty(Er,"name",{value:"Fraction"}),Er.prototype.constructor=Er,Er.prototype.type="Fraction",Er.prototype.isFraction=!0,Er.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Er.fromJSON=function(t){return new Er(t)},Er),{isClass:!0}),sy="Range",iy=[],oy=q(sy,iy,()=>{function t(e,n,a){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");var r=e!=null,s=n!=null,i=a!=null;if(r){if(at(e))e=e.toNumber();else if(typeof e!="number")throw new TypeError("Parameter start must be a number")}if(s){if(at(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter end must be a number")}if(i){if(at(a))a=a.toNumber();else if(typeof a!="number")throw new TypeError("Parameter step must be a number")}this.start=r?parseFloat(e):0,this.end=s?parseFloat(n):0,this.step=i?parseFloat(a):1}return t.prototype.type="Range",t.prototype.isRange=!0,t.parse=function(e){if(typeof e!="string")return null;var n=e.split(":"),a=n.map(function(s){return parseFloat(s)}),r=a.some(function(s){return isNaN(s)});if(r)return null;switch(a.length){case 2:return new t(a[0],a[1]);case 3:return new t(a[0],a[2],a[1]);default:return null}},t.prototype.clone=function(){return new t(this.start,this.end,this.step)},t.prototype.size=function(){var e=0,n=this.start,a=this.step,r=this.end,s=r-n;return Qr(a)===Qr(s)?e=Math.ceil(s/a):s===0&&(e=0),isNaN(e)&&(e=0),[e]},t.prototype.min=function(){var e=this.size()[0];if(e>0)return this.step>0?this.start:this.start+(e-1)*this.step},t.prototype.max=function(){var e=this.size()[0];if(e>0)return this.step>0?this.start+(e-1)*this.step:this.start},t.prototype.forEach=function(e){var n=this.start,a=this.step,r=this.end,s=0;if(a>0)for(;nr;)e(n,[s],this),n+=a,s++},t.prototype.map=function(e){var n=[];return this.forEach(function(a,r,s){n[r[0]]=e(a,r,s)}),n},t.prototype.toArray=function(){var e=[];return this.forEach(function(n,a){e[a[0]]=n}),e},t.prototype.valueOf=function(){return this.toArray()},t.prototype.format=function(e){var n=yn(this.start,e);return this.step!==1&&(n+=":"+yn(this.step,e)),n+=":"+yn(this.end,e),n},t.prototype.toString=function(){return this.format()},t.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},t.fromJSON=function(e){return new t(e.start,e.end,e.step)},t},{isClass:!0}),ly="Matrix",my=[],uy=q(ly,my,()=>{function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator")}return t.prototype.type="Matrix",t.prototype.isMatrix=!0,t.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},t.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},t.prototype.create=function(e,n){throw new Error("Cannot invoke create on a Matrix interface")},t.prototype.subset=function(e,n,a){throw new Error("Cannot invoke subset on a Matrix interface")},t.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},t.prototype.set=function(e,n,a){throw new Error("Cannot invoke set on a Matrix interface")},t.prototype.resize=function(e,n){throw new Error("Cannot invoke resize on a Matrix interface")},t.prototype.reshape=function(e,n){throw new Error("Cannot invoke reshape on a Matrix interface")},t.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},t.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},t.prototype.map=function(e,n){throw new Error("Cannot invoke map on a Matrix interface")},t.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},t.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},t.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},t.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},t.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},t.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},t},{isClass:!0});function py(t){var e=0,n=1,a=Object.create(null),r=Object.create(null),s=0,i=function(m){var o=r[m];if(o&&(delete a[o],delete r[m],--e,n===o)){if(!e){s=0,n=1;return}for(;!Object.prototype.hasOwnProperty.call(a,++n););}};return t=Math.abs(t),{hit:function(m){var o=r[m],l=++s;if(a[l]=m,r[m]=l,!o)return++e,e<=t?void 0:(m=a[n],i(m),m);if(delete a[o],n===o)for(;!Object.prototype.hasOwnProperty.call(a,++n););},delete:i,clear:function(){e=s=0,n=1,a=Object.create(null),r=Object.create(null)}}}function di(t){var{hasher:e,limit:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=n??Number.POSITIVE_INFINITY,e=e??JSON.stringify,function a(){typeof a.cache!="object"&&(a.cache={values:new Map,lru:py(n||Number.POSITIVE_INFINITY)});for(var r=[],s=0;s{var{Matrix:e}=t;function n(l,u){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(u&&!sa(u))throw new Error("Invalid datatype: "+u);if(Ve(l))l.type==="DenseMatrix"?(this._data=Xe(l._data),this._size=Xe(l._size),this._datatype=u||l._datatype):(this._data=l.toArray(),this._size=l.size(),this._datatype=u||l._datatype);else if(l&&vt(l.data)&&vt(l.size))this._data=l.data,this._size=l.size,Xm(this._data,this._size),this._datatype=u||l.datatype;else if(vt(l))this._data=o(l),this._size=et(this._data),Xm(this._data,this._size),this._datatype=u;else{if(l)throw new TypeError("Unsupported type of data ("+St(l)+")");this._data=[],this._size=[0],this._datatype=u}}n.prototype=new e,n.prototype.createDenseMatrix=function(l,u){return new n(l,u)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return ni(this._data,St)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(l,u){return new n(l,u)},n.prototype.subset=function(l,u,c){switch(arguments.length){case 1:return a(this,l);case 2:case 3:return s(this,l,u,c);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(l){if(!vt(l))throw new TypeError("Array expected");if(l.length!==this._size.length)throw new st(l.length,this._size.length);for(var u=0;u");var g=u.max().map(function(y){return y+1});m(l,g,f);var x=v.length,b=0;i(l._data,u,c,x,b)}return l}function i(l,u,c,f,v){var h=v===f-1,w=u.dimension(v);h?w.forEach(function(d,N){Dt(d),l[d]=c[N[0]]}):w.forEach(function(d,N){Dt(d),i(l[d],u,c[N[0]],f,v+1)})}n.prototype.resize=function(l,u,c){if(!Ra(l))throw new TypeError("Array or Matrix expected");var f=l.valueOf().map(h=>Array.isArray(h)&&h.length===1?h[0]:h),v=c?this.clone():this;return p(v,f,u)};function p(l,u,c){if(u.length===0){for(var f=l._data;vt(f);)f=f[0];return f}return l._size=u.slice(0),l._data=ws(l._data,l._size,c),l}n.prototype.reshape=function(l,u){var c=u?this.clone():this;c._data=Vl(c._data,l);var f=c._size.reduce((v,h)=>v*h);return c._size=Jl(l,f),c};function m(l,u,c){for(var f=l._size.slice(0),v=!1;f.lengthf[h]&&(f[h]=u[h],v=!0);v&&p(l,f,c)}n.prototype.clone=function(){var l=new n({data:Xe(this._data),size:Xe(this._size),datatype:this._datatype});return l},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(l){var u=this,c=pv(l),f=function w(d,N){return vt(d)?d.map(function(g,x){return w(g,N.concat(x))}):c===1?l(d):c===2?l(d,N):l(d,N,u)},v=f(this._data,[]),h=this._datatype!==void 0?ni(v,St):void 0;return new n(v,h)},n.prototype.forEach=function(l){var u=this,c=function f(v,h){vt(v)?v.forEach(function(w,d){f(w,h.concat(d))}):l(v,h,u)};c(this._data,[])},n.prototype[Symbol.iterator]=function*(){var l=function*u(c,f){if(vt(c))for(var v=0;v[g[d]]);u.push(new n(N,l._datatype))},h=0;h0?l:0,c=l<0?-l:0,f=this._size[0],v=this._size[1],h=Math.min(f-c,v-u),w=[],d=0;d0?c:0,h=c<0?-c:0,w=l[0],d=l[1],N=Math.min(w-h,d-v),g;if(vt(u)){if(u.length!==N)throw new Error("Invalid value array length");g=function(A){return u[A]}}else if(Ve(u)){var x=u.size();if(x.length!==1||x[0]!==N)throw new Error("Invalid matrix length");g=function(A){return u.get([A])}}else g=function(){return u};f||(f=at(g(0))?g(0).mul(0):0);var b=[];if(l.length>0){b=ws(b,l,f);for(var y=0;y{var{typed:e}=t;return e(au,{any:Xe})});function cv(t){var e=t.length,n=t[0].length,a,r,s=[];for(r=0;r=a.length)throw new Wa(e,a.length);return Ve(t)?t.create(vo(t.valueOf(),e,n)):vo(t,e,n)}function vo(t,e,n){var a,r,s,i;if(e<=0)if(Array.isArray(t[0])){for(i=cv(t),r=[],a=0;a{var{typed:e}=t;return e(nu,{number:qe,BigNumber:function(a){return a.isInt()},Fraction:function(a){return a.d===1&&isFinite(a.n)},"Array | Matrix":e.referToSelf(n=>a=>it(a,n))})}),Ya="number",Cs="number, number";function fv(t){return Math.abs(t)}fv.signature=Ya;function hv(t,e){return t+e}hv.signature=Cs;function vv(t,e){return t-e}vv.signature=Cs;function gv(t,e){return t*e}gv.signature=Cs;function dv(t){return-t}dv.signature=Ya;function yv(t){return t}yv.signature=Ya;function ai(t){return d0(t)}ai.signature=Ya;function wv(t){return t*t*t}wv.signature=Ya;function xv(t){return Math.exp(t)}xv.signature=Ya;function bv(t){return y0(t)}bv.signature=Ya;function Nv(t,e){if(!qe(t)||!qe(e))throw new Error("Parameters in function lcm must be integer numbers");if(t===0||e===0)return 0;for(var n,a=t*e;e!==0;)n=e,e=t%n,t=n;return Math.abs(a/t)}Nv.signature=Cs;function wy(t,e){return e?Math.log(t)/Math.log(e):Math.log(t)}function Ev(t){return v0(t)}Ev.signature=Ya;function Dv(t){return h0(t)}Dv.signature=Ya;function su(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,n=e<0;if(n&&(e=-e),e===0)throw new Error("Root must be non-zero");if(t<0&&Math.abs(e)%2!==1)throw new Error("Root must be odd when a is negative.");if(t===0)return n?1/0:0;if(!isFinite(t))return n?0:t;var a=Math.pow(Math.abs(t),1/e);return a=t<0?-a:a,n?1/a:a}function Tl(t){return Qr(t)}Tl.signature=Ya;function Av(t){return t*t}Av.signature=Ya;function Mv(t,e){var n,a,r,s=0,i=1,p=1,m=0;if(!qe(t)||!qe(e))throw new Error("Parameters in function xgcd must be integer numbers");for(;e;)a=Math.floor(t/e),r=t-a*e,n=s,s=i-a*s,i=n,n=p,p=m-a*p,m=n,t=e,e=r;var o;return t<0?o=[-t,-i,-m]:o=[t,t?i:0,m],o}Mv.signature=Cs;function Sv(t,e){return t*t<1&&e===1/0||t*t>1&&e===-1/0?0:Math.pow(t,e)}Sv.signature=Cs;function ei(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!qe(e)||e<0||e>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(Ph(t,e))}var xy="number",Ts="number, number";function Cv(t,e){if(!qe(t)||!qe(e))throw new Error("Integers expected in function bitAnd");return t&e}Cv.signature=Ts;function Tv(t){if(!qe(t))throw new Error("Integer expected in function bitNot");return~t}Tv.signature=xy;function $v(t,e){if(!qe(t)||!qe(e))throw new Error("Integers expected in function bitOr");return t|e}$v.signature=Ts;function Fv(t,e){if(!qe(t)||!qe(e))throw new Error("Integers expected in function bitXor");return t^e}Fv.signature=Ts;function _v(t,e){if(!qe(t)||!qe(e))throw new Error("Integers expected in function leftShift");return t<>e}Bv.signature=Ts;function Ov(t,e){if(!qe(t)||!qe(e))throw new Error("Integers expected in function rightLogShift");return t>>>e}Ov.signature=Ts;function $r(t,e){if(e>1;return $r(t,n)*$r(n+1,e)}function Pv(t,e){if(!qe(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(!qe(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(e>t)throw new TypeError("k must be less than or equal to n");for(var n=t-e,a=1,r=e171?1/0:$r(1,t-1);if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*go(1-t));if(t>=171.35)return 1/0;if(t>85){var n=t*t,a=n*t,r=a*t,s=r*t;return Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*n)-139/(51840*a)-571/(2488320*r)+163879/(209018880*s)+5246819/(75246796800*s*t))}--t,e=cs[0];for(var i=1;i=1;a--)n+=iu[a]/(t+a);return kv+(t+.5)*Math.log(e)-e+Math.log(n)}yo.signature="number";var la="number";function Uv(t){return E0(t)}Uv.signature=la;function Gv(t){return Math.atan(1/t)}Gv.signature=la;function Hv(t){return isFinite(t)?(Math.log((t+1)/t)+Math.log(t/(t-1)))/2:0}Hv.signature=la;function Vv(t){return Math.asin(1/t)}Vv.signature=la;function Jv(t){var e=1/t;return Math.log(e+Math.sqrt(e*e+1))}Jv.signature=la;function Zv(t){return Math.acos(1/t)}Zv.signature=la;function Wv(t){var e=1/t,n=Math.sqrt(e*e-1);return Math.log(n+e)}Wv.signature=la;function Yv(t){return D0(t)}Yv.signature=la;function Xv(t){return A0(t)}Xv.signature=la;function Qv(t){return 1/Math.tan(t)}Qv.signature=la;function jv(t){var e=Math.exp(2*t);return(e+1)/(e-1)}jv.signature=la;function Kv(t){return 1/Math.sin(t)}Kv.signature=la;function eg(t){return t===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(t)-Math.exp(-t)))*Qr(t)}eg.signature=la;function tg(t){return 1/Math.cos(t)}tg.signature=la;function ag(t){return 2/(Math.exp(t)+Math.exp(-t))}ag.signature=la;function rg(t){return S0(t)}rg.signature=la;var ko="number";function ng(t){return t<0}ng.signature=ko;function sg(t){return t>0}sg.signature=ko;function ig(t){return t===0}ig.signature=ko;function og(t){return Number.isNaN(t)}og.signature=ko;var ou="isNegative",Cy=["typed"],Ty=q(ou,Cy,t=>{var{typed:e}=t;return e(ou,{number:ng,BigNumber:function(a){return a.isNeg()&&!a.isZero()&&!a.isNaN()},Fraction:function(a){return a.s<0},Unit:e.referToSelf(n=>a=>e.find(n,a.valueType())(a.value)),"Array | Matrix":e.referToSelf(n=>a=>it(a,n))})}),lu="isNumeric",$y=["typed"],Fy=q(lu,$y,t=>{var{typed:e}=t;return e(lu,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":e.referToSelf(n=>a=>it(a,n))})}),mu="hasNumericValue",_y=["typed","isNumeric"],By=q(mu,_y,t=>{var{typed:e,isNumeric:n}=t;return e(mu,{boolean:()=>!0,string:function(r){return r.trim().length>0&&!isNaN(Number(r))},any:function(r){return n(r)}})}),uu="isPositive",Oy=["typed"],Py=q(uu,Oy,t=>{var{typed:e}=t;return e(uu,{number:sg,BigNumber:function(a){return!a.isNeg()&&!a.isZero()&&!a.isNaN()},Fraction:function(a){return a.s>0&&a.n>0},Unit:e.referToSelf(n=>a=>e.find(n,a.valueType())(a.value)),"Array | Matrix":e.referToSelf(n=>a=>it(a,n))})}),pu="isZero",zy=["typed"],Ry=q(pu,zy,t=>{var{typed:e}=t;return e(pu,{number:ig,BigNumber:function(a){return a.isZero()},Complex:function(a){return a.re===0&&a.im===0},Fraction:function(a){return a.d===1&&a.n===0},Unit:e.referToSelf(n=>a=>e.find(n,a.valueType())(a.value)),"Array | Matrix":e.referToSelf(n=>a=>it(a,n))})}),cu="isNaN",Iy=["typed"],qy=q(cu,Iy,t=>{var{typed:e}=t;return e(cu,{number:og,BigNumber:function(a){return a.isNaN()},Fraction:function(a){return!1},Complex:function(a){return a.isNaN()},Unit:function(a){return Number.isNaN(a.value)},"Array | Matrix":e.referToSelf(n=>a=>it(a,n))})}),fu="typeOf",Ly=["typed"],ky=q(fu,Ly,t=>{var{typed:e}=t;return e(fu,{any:St})});function Ia(t,e,n){if(n==null)return t.eq(e);if(t.eq(e))return!0;if(t.isNaN()||e.isNaN())return!1;if(t.isFinite()&&e.isFinite()){var a=t.minus(e).abs();if(a.isZero())return!0;var r=t.constructor.max(t.abs(),e.abs());return a.lte(r.times(n))}return!1}function Uy(t,e,n){return ga(t.re,e.re,n)&&ga(t.im,e.im,n)}var $s=q("compareUnits",["typed"],t=>{var{typed:e}=t;return{"Unit, Unit":e.referToSelf(n=>(a,r)=>{if(!a.equalBase(r))throw new Error("Cannot compare units with different base");return e.find(n,[a.valueType(),r.valueType()])(a.value,r.value)})}}),wo="equalScalar",Gy=["typed","config"],Hy=q(wo,Gy,t=>{var{typed:e,config:n}=t,a=$s({typed:e});return e(wo,{"boolean, boolean":function(s,i){return s===i},"number, number":function(s,i){return ga(s,i,n.epsilon)},"BigNumber, BigNumber":function(s,i){return s.eq(i)||Ia(s,i,n.epsilon)},"Fraction, Fraction":function(s,i){return s.equals(i)},"Complex, Complex":function(s,i){return Uy(s,i,n.epsilon)}},a)});q(wo,["typed","config"],t=>{var{typed:e,config:n}=t;return e(wo,{"number, number":function(r,s){return ga(r,s,n.epsilon)}})});var Vy="SparseMatrix",Jy=["typed","equalScalar","Matrix"],Zy=q(Vy,Jy,t=>{var{typed:e,equalScalar:n,Matrix:a}=t;function r(h,w){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(w&&!sa(w))throw new Error("Invalid datatype: "+w);if(Ve(h))s(this,h,w);else if(h&&vt(h.index)&&vt(h.ptr)&&vt(h.size))this._values=h.values,this._index=h.index,this._ptr=h.ptr,this._size=h.size,this._datatype=w||h.datatype;else if(vt(h))i(this,h,w);else{if(h)throw new TypeError("Unsupported type of data ("+St(h)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=w}}function s(h,w,d){w.type==="SparseMatrix"?(h._values=w._values?Xe(w._values):void 0,h._index=Xe(w._index),h._ptr=Xe(w._ptr),h._size=Xe(w._size),h._datatype=d||w._datatype):i(h,w.valueOf(),d||w._datatype)}function i(h,w,d){h._values=[],h._index=[],h._ptr=[],h._datatype=d;var N=w.length,g=0,x=n,b=0;if(sa(d)&&(x=e.find(n,[d,d])||n,b=e.convert(0,d)),N>0){var y=0;do{h._ptr.push(h._index.length);for(var D=0;D");if(g.length===1){var A=w.dimension(0);A.forEach(function(S,C){Dt(S),h.set([S,0],d[C[0]],N)})}else{var E=w.dimension(0),M=w.dimension(1);E.forEach(function(S,C){Dt(S),M.forEach(function(B,O){Dt(B),h.set([S,B],d[C[0]][O[0]],N)})})}}return h}r.prototype.get=function(h){if(!vt(h))throw new TypeError("Array expected");if(h.length!==this._size.length)throw new st(h.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var w=h[0],d=h[1];Dt(w,this._size[0]),Dt(d,this._size[1]);var N=o(w,this._ptr[d],this._ptr[d+1],this._index);return Nx-1||g>b-1)&&(c(this,Math.max(N+1,x),Math.max(g+1,b),d),x=this._size[0],b=this._size[1]),Dt(N,x),Dt(g,b);var A=o(N,this._ptr[g],this._ptr[g+1],this._index);return AArray.isArray(x)&&x.length===1?x[0]:x);if(N.length!==2)throw new Error("Only two dimensions matrix are supported");N.forEach(function(x){if(!tt(x)||!qe(x)||x<0)throw new TypeError("Invalid size, must contain positive integers (size: "+nt(N)+")")});var g=d?this.clone():this;return c(g,N[0],N[1],w)};function c(h,w,d,N){var g=N||0,x=n,b=0;sa(h._datatype)&&(x=e.find(n,[h._datatype,h._datatype])||n,b=e.convert(0,h._datatype),g=e.convert(g,h._datatype));var y=!x(g,b),D=h._size[0],A=h._size[1],E,M,S;if(d>A){for(M=A;MD){if(y){var C=0;for(M=0;Mw-1&&(h._values.splice(S,1),h._index.splice(S,1),O++)}h._ptr[M]=h._values.length}return h._size[0]=w,h._size[1]=d,h}r.prototype.reshape=function(h,w){if(!vt(h))throw new TypeError("Array expected");if(h.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");h.forEach(function(_){if(!tt(_)||!qe(_)||_<=-2||_===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+nt(h)+")")});var d=this._size[0]*this._size[1];h=Jl(h,d);var N=h[0]*h[1];if(d!==N)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var g=w?this.clone():this;if(this._size[0]===h[0]&&this._size[1]===h[1])return g;for(var x=[],b=0;b=w&&$<=d&&S(h._values[P],$-w,C-N)}else{for(var T={},I=B;I "+(this._values?nt(this._values[D],h):"X")}return g},r.prototype.toString=function(){return nt(this.toArray())},r.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},r.prototype.diagonal=function(h){if(h){if(at(h)&&(h=h.toNumber()),!tt(h)||!qe(h))throw new TypeError("The parameter k must be an integer number")}else h=0;var w=h>0?h:0,d=h<0?-h:0,N=this._size[0],g=this._size[1],x=Math.min(N-d,g-w),b=[],y=[],D=[];D[0]=0;for(var A=w;A0?d:0,D=d<0?-d:0,A=h[0],E=h[1],M=Math.min(A-D,E-y),S;if(vt(w)){if(w.length!==M)throw new Error("Invalid value array length");S=function(W){return w[W]}}else if(Ve(w)){var C=w.size();if(C.length!==1||C[0]!==M)throw new Error("Invalid matrix length");S=function(W){return w.get([W])}}else S=function(){return w};for(var B=[],O=[],P=[],$=0;$=0&&T=D||g[E]!==w)){var S=N?N[A]:void 0;g.splice(E,0,w),N&&N.splice(E,0,S),g.splice(E<=A?A+1:A,1),N&&N.splice(E<=A?A+1:A,1);continue}if(E=D||g[A]!==h)){var C=N?N[E]:void 0;g.splice(A,0,h),N&&N.splice(A,0,C),g.splice(A<=E?E+1:E,1),N&&N.splice(A<=E?E+1:E,1)}}},r},{isClass:!0}),Wy="number",Yy=["typed"];function Xy(t){var e=t.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(e){var n={"0b":2,"0o":8,"0x":16}[e[1]],a=e[2],r=e[3];return{input:t,radix:n,integerPart:a,fractionalPart:r}}else return null}function Qy(t){for(var e=parseInt(t.integerPart,t.radix),n=0,a=0;a{var{typed:e}=t,n=e("number",{"":function(){return 0},number:function(r){return r},string:function(r){if(r==="NaN")return NaN;var s=Xy(r);if(s)return Qy(s);var i=0,p=r.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);p&&(i=Number(p[2]),r=p[1]);var m=Number(r);if(isNaN(m))throw new SyntaxError('String "'+r+'" is not a valid number');if(p){if(m>2**i-1)throw new SyntaxError('String "'.concat(r,'" is out of range'));m>=2**(i-1)&&(m=m-2**i)}return m},BigNumber:function(r){return r.toNumber()},Fraction:function(r){return r.valueOf()},Unit:e.referToSelf(a=>r=>{var s=r.clone();return s.value=a(r.value),s}),null:function(r){return 0},"Unit, string | Unit":function(r,s){return r.toNumber(s)},"Array | Matrix":e.referToSelf(a=>r=>it(r,a))});return n.fromJSON=function(a){return parseFloat(a.value)},n}),hu="string",Ky=["typed"],ew=q(hu,Ky,t=>{var{typed:e}=t;return e(hu,{"":function(){return""},number:yn,null:function(a){return"null"},boolean:function(a){return a+""},string:function(a){return a},"Array | Matrix":e.referToSelf(n=>a=>it(a,n)),any:function(a){return String(a)}})}),vu="boolean",tw=["typed"],aw=q(vu,tw,t=>{var{typed:e}=t;return e(vu,{"":function(){return!1},boolean:function(a){return a},number:function(a){return!!a},null:function(a){return!1},BigNumber:function(a){return!a.isZero()},string:function(a){var r=a.toLowerCase();if(r==="true")return!0;if(r==="false")return!1;var s=Number(a);if(a!==""&&!isNaN(s))return!!s;throw new Error('Cannot convert "'+a+'" to a boolean')},"Array | Matrix":e.referToSelf(n=>a=>it(a,n))})}),rw="bignumber",nw=["typed","BigNumber"],sw=q(rw,nw,t=>{var{typed:e,BigNumber:n}=t;return e("bignumber",{"":function(){return new n(0)},number:function(r){return new n(r+"")},string:function(r){var s=r.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(s){var i=s[2],p=n(s[1]),m=new n(2).pow(Number(i));if(p.gt(m.sub(1)))throw new SyntaxError('String "'.concat(r,'" is out of range'));var o=new n(2).pow(Number(i)-1);return p.gte(o)?p.sub(m):p}return new n(r)},BigNumber:function(r){return r},Unit:e.referToSelf(a=>r=>{var s=r.clone();return s.value=a(r.value),s}),Fraction:function(r){return new n(r.n).div(r.d).times(r.s)},null:function(r){return new n(0)},"Array | Matrix":e.referToSelf(a=>r=>it(r,a))})}),iw="complex",ow=["typed","Complex"],lw=q(iw,ow,t=>{var{typed:e,Complex:n}=t;return e("complex",{"":function(){return n.ZERO},number:function(r){return new n(r,0)},"number, number":function(r,s){return new n(r,s)},"BigNumber, BigNumber":function(r,s){return new n(r.toNumber(),s.toNumber())},Fraction:function(r){return new n(r.valueOf(),0)},Complex:function(r){return r.clone()},string:function(r){return n(r)},null:function(r){return n(0)},Object:function(r){if("re"in r&&"im"in r)return new n(r.re,r.im);if("r"in r&&"phi"in r||"abs"in r&&"arg"in r)return new n(r);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":e.referToSelf(a=>r=>it(r,a))})}),mw="fraction",uw=["typed","Fraction"],pw=q(mw,uw,t=>{var{typed:e,Fraction:n}=t;return e("fraction",{number:function(r){if(!isFinite(r)||isNaN(r))throw new Error(r+" cannot be represented as a fraction");return new n(r)},string:function(r){return new n(r)},"number, number":function(r,s){return new n(r,s)},null:function(r){return new n(0)},BigNumber:function(r){return new n(r.toString())},Fraction:function(r){return r},Unit:e.referToSelf(a=>r=>{var s=r.clone();return s.value=a(r.value),s}),Object:function(r){return new n(r)},"Array | Matrix":e.referToSelf(a=>r=>it(r,a))})}),gu="matrix",cw=["typed","Matrix","DenseMatrix","SparseMatrix"],fw=q(gu,cw,t=>{var{typed:e,Matrix:n,DenseMatrix:a,SparseMatrix:r}=t;return e(gu,{"":function(){return s([])},string:function(p){return s([],p)},"string, string":function(p,m){return s([],p,m)},Array:function(p){return s(p)},Matrix:function(p){return s(p,p.storage())},"Array | Matrix, string":s,"Array | Matrix, string, string":s});function s(i,p,m){if(p==="dense"||p==="default"||p===void 0)return new a(i,m);if(p==="sparse")return new r(i,m);throw new TypeError("Unknown matrix type "+JSON.stringify(p)+".")}}),du="matrixFromFunction",hw=["typed","matrix","isZero"],vw=q(du,hw,t=>{var{typed:e,matrix:n,isZero:a}=t;return e(du,{"Array | Matrix, function, string, string":function(i,p,m,o){return r(i,p,m,o)},"Array | Matrix, function, string":function(i,p,m){return r(i,p,m)},"Matrix, function":function(i,p){return r(i,p,"dense")},"Array, function":function(i,p){return r(i,p,"dense").toArray()},"Array | Matrix, string, function":function(i,p,m){return r(i,m,p)},"Array | Matrix, string, string, function":function(i,p,m,o){return r(i,o,p,m)}});function r(s,i,p,m){var o;return m!==void 0?o=n(p,m):o=n(p),o.resize(s),o.forEach(function(l,u){var c=i(u);a(c)||o.set(u,c)}),o}}),yu="matrixFromRows",gw=["typed","matrix","flatten","size"],dw=q(yu,gw,t=>{var{typed:e,matrix:n,flatten:a,size:r}=t;return e(yu,{"...Array":function(m){return s(m)},"...Matrix":function(m){return n(s(m.map(o=>o.toArray())))}});function s(p){if(p.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var m=i(p[0]),o=[];for(var l of p){var u=i(l);if(u!==m)throw new TypeError("The vectors had different length: "+(m|0)+" ≠ "+(u|0));o.push(a(l))}return o}function i(p){var m=r(p);if(m.length===1)return m[0];if(m.length===2){if(m[0]===1)return m[1];if(m[1]===1)return m[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}}),wu="matrixFromColumns",yw=["typed","matrix","flatten","size"],ww=q(wu,yw,t=>{var{typed:e,matrix:n,flatten:a,size:r}=t;return e(wu,{"...Array":function(m){return s(m)},"...Matrix":function(m){return n(s(m.map(o=>o.toArray())))}});function s(p){if(p.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var m=i(p[0]),o=[],l=0;l{var{typed:e}=t;return e(xu,{"Unit, Array":function(a,r){return a.splitUnit(r)}})}),bu="unaryMinus",Nw=["typed"],Ew=q(bu,Nw,t=>{var{typed:e}=t;return e(bu,{number:dv,"Complex | BigNumber | Fraction":n=>n.neg(),Unit:e.referToSelf(n=>a=>{var r=a.clone();return r.value=e.find(n,r.valueType())(a.value),r}),"Array | Matrix":e.referToSelf(n=>a=>it(a,n))})}),Nu="unaryPlus",Dw=["typed","config","BigNumber"],Aw=q(Nu,Dw,t=>{var{typed:e,config:n,BigNumber:a}=t;return e(Nu,{number:yv,Complex:function(s){return s},BigNumber:function(s){return s},Fraction:function(s){return s},Unit:function(s){return s.clone()},"Array | Matrix":e.referToSelf(r=>s=>it(s,r)),"boolean | string":function(s){return n.number==="BigNumber"?new a(+s):+s}})}),Eu="abs",Mw=["typed"],Sw=q(Eu,Mw,t=>{var{typed:e}=t;return e(Eu,{number:fv,"Complex | BigNumber | Fraction | Unit":n=>n.abs(),"Array | Matrix":e.referToSelf(n=>a=>it(a,n))})}),Du="apply",Cw=["typed","isInteger"],Xl=q(Du,Cw,t=>{var{typed:e,isInteger:n}=t;return e(Du,{"Array | Matrix, number | BigNumber, function":function(r,s,i){if(!n(s))throw new TypeError("Integer number expected for dimension");var p=Array.isArray(r)?et(r):r.size();if(s<0||s>=p.length)throw new Wa(s,p.length);return Ve(r)?r.create(xo(r.valueOf(),s,i)):xo(r,s,i)}})});function xo(t,e,n){var a,r,s;if(e<=0)if(Array.isArray(t[0])){for(s=Tw(t),r=[],a=0;a{var{typed:e}=t;return e(Au,{"number, number":hv,"Complex, Complex":function(a,r){return a.add(r)},"BigNumber, BigNumber":function(a,r){return a.plus(r)},"Fraction, Fraction":function(a,r){return a.add(r)},"Unit, Unit":e.referToSelf(n=>(a,r)=>{if(a.value===null||a.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(r.value===null||r.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!a.equalBase(r))throw new Error("Units do not match");var s=a.clone();return s.value=e.find(n,[s.valueType(),r.valueType()])(s.value,r.value),s.fixPrefix=!1,s})})}),Mu="subtractScalar",_w=["typed"],Bw=q(Mu,_w,t=>{var{typed:e}=t;return e(Mu,{"number, number":vv,"Complex, Complex":function(a,r){return a.sub(r)},"BigNumber, BigNumber":function(a,r){return a.minus(r)},"Fraction, Fraction":function(a,r){return a.sub(r)},"Unit, Unit":e.referToSelf(n=>(a,r)=>{if(a.value===null||a.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(r.value===null||r.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!a.equalBase(r))throw new Error("Units do not match");var s=a.clone();return s.value=e.find(n,[s.valueType(),r.valueType()])(s.value,r.value),s.fixPrefix=!1,s})})}),Su="cbrt",Ow=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],Pw=q(Su,Ow,t=>{var{config:e,typed:n,isNegative:a,unaryMinus:r,matrix:s,Complex:i,BigNumber:p,Fraction:m}=t;return n(Su,{number:ai,Complex:o,"Complex, boolean":o,BigNumber:function(c){return c.cbrt()},Unit:l});function o(u,c){var f=u.arg()/3,v=u.abs(),h=new i(ai(v),0).mul(new i(0,f).exp());if(c){var w=[h,new i(ai(v),0).mul(new i(0,f+Math.PI*2/3).exp()),new i(ai(v),0).mul(new i(0,f-Math.PI*2/3).exp())];return e.matrix==="Array"?w:s(w)}else return h}function l(u){if(u.value&&Fr(u.value)){var c=u.clone();return c.value=1,c=c.pow(1/3),c.value=o(u.value),c}else{var f=a(u.value);f&&(u.value=r(u.value));var v;at(u.value)?v=new p(1).div(3):hi(u.value)?v=new m(1,3):v=1/3;var h=u.pow(v);return f&&(h.value=r(h.value)),h}}}),zw="matAlgo11xS0s",Rw=["typed","equalScalar"],aa=q(zw,Rw,t=>{var{typed:e,equalScalar:n}=t;return function(r,s,i,p){var m=r._values,o=r._index,l=r._ptr,u=r._size,c=r._datatype;if(!m)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var f=u[0],v=u[1],h,w=n,d=0,N=i;typeof c=="string"&&(h=c,w=e.find(n,[h,h]),d=e.convert(0,h),s=e.convert(s,h),N=e.find(i,[h,h]));for(var g=[],x=[],b=[],y=0;y{var{typed:e,DenseMatrix:n}=t;return function(r,s,i,p){var m=r._values,o=r._index,l=r._ptr,u=r._size,c=r._datatype;if(!m)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var f=u[0],v=u[1],h,w=i;typeof c=="string"&&(h=c,s=e.convert(s,h),w=e.find(i,[h,h]));for(var d=[],N=[],g=[],x=0;x{var{typed:e}=t;return function(r,s,i,p){var m=r._data,o=r._size,l=r._datatype,u,c=i;typeof l=="string"&&(u=l,s=e.convert(s,u),c=e.find(i,[u,u]));var f=o.length>0?n(c,0,o,o[0],m,s,p):[];return r.createDenseMatrix({data:f,size:Xe(o),datatype:u})};function n(a,r,s,i,p,m,o){var l=[];if(r===s.length-1)for(var u=0;u{var{typed:e,config:n,round:a}=t;return e($l,{number:function(s){return ga(s,a(s),n.epsilon)?a(s):Math.ceil(s)},"number, number":function(s,i){if(ga(s,a(s,i),n.epsilon))return a(s,i);var[p,m]="".concat(s,"e").split("e"),o=Math.ceil(Number("".concat(p,"e").concat(Number(m)+i)));return[p,m]="".concat(o,"e").split("e"),Number("".concat(p,"e").concat(Number(m)-i))}})}),Hw=q($l,Uw,t=>{var{typed:e,config:n,round:a,matrix:r,equalScalar:s,zeros:i,DenseMatrix:p}=t,m=aa({typed:e,equalScalar:s}),o=Jt({typed:e,DenseMatrix:p}),l=Xa({typed:e}),u=Gw({typed:e,config:n,round:a});return e("ceil",{number:u.signatures.number,"number,number":u.signatures["number,number"],Complex:function(f){return f.ceil()},"Complex, number":function(f,v){return f.ceil(v)},"Complex, BigNumber":function(f,v){return f.ceil(v.toNumber())},BigNumber:function(f){return Ia(f,a(f),n.epsilon)?a(f):f.ceil()},"BigNumber, BigNumber":function(f,v){return Ia(f,a(f,v),n.epsilon)?a(f,v):f.toDecimalPlaces(v.toNumber(),tn.ROUND_CEIL)},Fraction:function(f){return f.ceil()},"Fraction, number":function(f,v){return f.ceil(v)},"Fraction, BigNumber":function(f,v){return f.ceil(v.toNumber())},"Array | Matrix":e.referToSelf(c=>f=>it(f,c)),"Array, number | BigNumber":e.referToSelf(c=>(f,v)=>it(f,h=>c(h,v))),"SparseMatrix, number | BigNumber":e.referToSelf(c=>(f,v)=>m(f,v,c,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(c=>(f,v)=>l(f,v,c,!1)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(c=>(f,v)=>l(r(v),f,c,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(c=>(f,v)=>s(f,0)?i(v.size(),v.storage()):v.storage()==="dense"?l(v,f,c,!0):o(v,f,c,!0))})}),Cu="cube",Vw=["typed"],Jw=q(Cu,Vw,t=>{var{typed:e}=t;return e(Cu,{number:wv,Complex:function(a){return a.mul(a).mul(a)},BigNumber:function(a){return a.times(a).times(a)},Fraction:function(a){return a.pow(3)},Unit:function(a){return a.pow(3)}})}),Tu="exp",Zw=["typed"],Ww=q(Tu,Zw,t=>{var{typed:e}=t;return e(Tu,{number:xv,Complex:function(a){return a.exp()},BigNumber:function(a){return a.exp()}})}),$u="expm1",Yw=["typed","Complex"],Xw=q($u,Yw,t=>{var{typed:e,Complex:n}=t;return e($u,{number:bv,Complex:function(r){var s=Math.exp(r.re);return new n(s*Math.cos(r.im)-1,s*Math.sin(r.im))},BigNumber:function(r){return r.exp().minus(1)}})}),Fl="fix",Qw=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],jw=q(Fl,["typed","ceil","floor"],t=>{var{typed:e,ceil:n,floor:a}=t;return e(Fl,{number:function(s){return s>0?a(s):n(s)},"number, number":function(s,i){return s>0?a(s,i):n(s,i)}})}),Kw=q(Fl,Qw,t=>{var{typed:e,Complex:n,matrix:a,ceil:r,floor:s,equalScalar:i,zeros:p,DenseMatrix:m}=t,o=Jt({typed:e,DenseMatrix:m}),l=Xa({typed:e}),u=jw({typed:e,ceil:r,floor:s});return e("fix",{number:u.signatures.number,"number, number | BigNumber":u.signatures["number,number"],Complex:function(f){return new n(f.re>0?Math.floor(f.re):Math.ceil(f.re),f.im>0?Math.floor(f.im):Math.ceil(f.im))},"Complex, number":function(f,v){return new n(f.re>0?s(f.re,v):r(f.re,v),f.im>0?s(f.im,v):r(f.im,v))},"Complex, BigNumber":function(f,v){var h=v.toNumber();return new n(f.re>0?s(f.re,h):r(f.re,h),f.im>0?s(f.im,h):r(f.im,h))},BigNumber:function(f){return f.isNegative()?r(f):s(f)},"BigNumber, number | BigNumber":function(f,v){return f.isNegative()?r(f,v):s(f,v)},Fraction:function(f){return f.s<0?f.ceil():f.floor()},"Fraction, number | BigNumber":function(f,v){return f.s<0?r(f,v):s(f,v)},"Array | Matrix":e.referToSelf(c=>f=>it(f,c)),"Array | Matrix, number | BigNumber":e.referToSelf(c=>(f,v)=>it(f,h=>c(h,v))),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(c=>(f,v)=>l(a(v),f,c,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(c=>(f,v)=>i(f,0)?p(v.size(),v.storage()):v.storage()==="dense"?l(v,f,c,!0):o(v,f,c,!0))})}),_l="floor",ex=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],tx=q(_l,["typed","config","round"],t=>{var{typed:e,config:n,round:a}=t;return e(_l,{number:function(s){return ga(s,a(s),n.epsilon)?a(s):Math.floor(s)},"number, number":function(s,i){if(ga(s,a(s,i),n.epsilon))return a(s,i);var[p,m]="".concat(s,"e").split("e"),o=Math.floor(Number("".concat(p,"e").concat(Number(m)+i)));return[p,m]="".concat(o,"e").split("e"),Number("".concat(p,"e").concat(Number(m)-i))}})}),lg=q(_l,ex,t=>{var{typed:e,config:n,round:a,matrix:r,equalScalar:s,zeros:i,DenseMatrix:p}=t,m=aa({typed:e,equalScalar:s}),o=Jt({typed:e,DenseMatrix:p}),l=Xa({typed:e}),u=tx({typed:e,config:n,round:a});return e("floor",{number:u.signatures.number,"number,number":u.signatures["number,number"],Complex:function(f){return f.floor()},"Complex, number":function(f,v){return f.floor(v)},"Complex, BigNumber":function(f,v){return f.floor(v.toNumber())},BigNumber:function(f){return Ia(f,a(f),n.epsilon)?a(f):f.floor()},"BigNumber, BigNumber":function(f,v){return Ia(f,a(f,v),n.epsilon)?a(f,v):f.toDecimalPlaces(v.toNumber(),tn.ROUND_FLOOR)},Fraction:function(f){return f.floor()},"Fraction, number":function(f,v){return f.floor(v)},"Fraction, BigNumber":function(f,v){return f.floor(v.toNumber())},"Array | Matrix":e.referToSelf(c=>f=>it(f,c)),"Array, number | BigNumber":e.referToSelf(c=>(f,v)=>it(f,h=>c(h,v))),"SparseMatrix, number | BigNumber":e.referToSelf(c=>(f,v)=>m(f,v,c,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(c=>(f,v)=>l(f,v,c,!1)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(c=>(f,v)=>l(r(v),f,c,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(c=>(f,v)=>s(f,0)?i(v.size(),v.storage()):v.storage()==="dense"?l(v,f,c,!0):o(v,f,c,!0))})}),ax="matAlgo02xDS0",rx=["typed","equalScalar"],Qa=q(ax,rx,t=>{var{typed:e,equalScalar:n}=t;return function(r,s,i,p){var m=r._data,o=r._size,l=r._datatype||r.getDataType(),u=s._values,c=s._index,f=s._ptr,v=s._size,h=s._datatype||s._data===void 0?s._datatype:s.getDataType();if(o.length!==v.length)throw new st(o.length,v.length);if(o[0]!==v[0]||o[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+v+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var w=o[0],d=o[1],N,g=n,x=0,b=i;typeof l=="string"&&l===h&&l!=="mixed"&&(N=l,g=e.find(n,[N,N]),x=e.convert(0,N),b=e.find(i,[N,N]));for(var y=[],D=[],A=[],E=0;E{var{typed:e}=t;return function(a,r,s,i){var p=a._data,m=a._size,o=a._datatype||a.getDataType(),l=r._values,u=r._index,c=r._ptr,f=r._size,v=r._datatype||r._data===void 0?r._datatype:r.getDataType();if(m.length!==f.length)throw new st(m.length,f.length);if(m[0]!==f[0]||m[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+m+") must match Matrix B ("+f+")");if(!l)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h=m[0],w=m[1],d,N=0,g=s;typeof o=="string"&&o===v&&o!=="mixed"&&(d=o,N=e.convert(0,d),g=e.find(s,[d,d]));for(var x=[],b=0;b{var{typed:e,equalScalar:n}=t;return function(r,s,i){var p=r._values,m=r._index,o=r._ptr,l=r._size,u=r._datatype||r._data===void 0?r._datatype:r.getDataType(),c=s._values,f=s._index,v=s._ptr,h=s._size,w=s._datatype||s._data===void 0?s._datatype:s.getDataType();if(l.length!==h.length)throw new st(l.length,h.length);if(l[0]!==h[0]||l[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+h+")");var d=l[0],N=l[1],g,x=n,b=0,y=i;typeof u=="string"&&u===w&&u!=="mixed"&&(g=u,x=e.find(n,[g,g]),b=e.convert(0,g),y=e.find(i,[g,g]));var D=p&&c?[]:void 0,A=[],E=[],M=D?[]:void 0,S=D?[]:void 0,C=[],B=[],O,P,$,T;for(P=0;P{var{typed:e}=t;return function(r,s,i){var p=r._data,m=r._size,o=r._datatype,l=s._data,u=s._size,c=s._datatype,f=[];if(m.length!==u.length)throw new st(m.length,u.length);for(var v=0;v0?n(w,0,f,f[0],p,l):[];return r.createDenseMatrix({data:d,size:f,datatype:h})};function n(a,r,s,i,p,m){var o=[];if(r===s.length-1)for(var l=0;l{var{concat:e}=t;return function(r,s){var i=Math.max(r._size.length,s._size.length);if(r._size.length===s._size.length&&r._size.every((v,h)=>v===s._size[h]))return[r,s];for(var p=n(r._size,i,0),m=n(s._size,i,0),o=[],l=0;l{var{typed:e,matrix:n,concat:a}=t,r=ux({typed:e}),s=Xa({typed:e}),i=fx({concat:a});return function(m){var o=m.elop,l=m.SD||m.DS,u;o?(u={"DenseMatrix, DenseMatrix":(h,w)=>r(...i(h,w),o),"Array, Array":(h,w)=>r(...i(n(h),n(w)),o).valueOf(),"Array, DenseMatrix":(h,w)=>r(...i(n(h),w),o),"DenseMatrix, Array":(h,w)=>r(...i(h,n(w)),o)},m.SS&&(u["SparseMatrix, SparseMatrix"]=(h,w)=>m.SS(...i(h,w),o,!1)),m.DS&&(u["DenseMatrix, SparseMatrix"]=(h,w)=>m.DS(...i(h,w),o,!1),u["Array, SparseMatrix"]=(h,w)=>m.DS(...i(n(h),w),o,!1)),l&&(u["SparseMatrix, DenseMatrix"]=(h,w)=>l(...i(w,h),o,!0),u["SparseMatrix, Array"]=(h,w)=>l(...i(n(w),h),o,!0))):(u={"DenseMatrix, DenseMatrix":e.referToSelf(h=>(w,d)=>r(...i(w,d),h)),"Array, Array":e.referToSelf(h=>(w,d)=>r(...i(n(w),n(d)),h).valueOf()),"Array, DenseMatrix":e.referToSelf(h=>(w,d)=>r(...i(n(w),d),h)),"DenseMatrix, Array":e.referToSelf(h=>(w,d)=>r(...i(w,n(d)),h))},m.SS&&(u["SparseMatrix, SparseMatrix"]=e.referToSelf(h=>(w,d)=>m.SS(...i(w,d),h,!1))),m.DS&&(u["DenseMatrix, SparseMatrix"]=e.referToSelf(h=>(w,d)=>m.DS(...i(w,d),h,!1)),u["Array, SparseMatrix"]=e.referToSelf(h=>(w,d)=>m.DS(...i(n(w),d),h,!1))),l&&(u["SparseMatrix, DenseMatrix"]=e.referToSelf(h=>(w,d)=>l(...i(d,w),h,!0)),u["SparseMatrix, Array"]=e.referToSelf(h=>(w,d)=>l(...i(n(d),w),h,!0))));var c=m.scalar||"any",f=m.Ds||m.Ss;f&&(o?(u["DenseMatrix,"+c]=(h,w)=>s(h,w,o,!1),u[c+", DenseMatrix"]=(h,w)=>s(w,h,o,!0),u["Array,"+c]=(h,w)=>s(n(h),w,o,!1).valueOf(),u[c+", Array"]=(h,w)=>s(n(w),h,o,!0).valueOf()):(u["DenseMatrix,"+c]=e.referToSelf(h=>(w,d)=>s(w,d,h,!1)),u[c+", DenseMatrix"]=e.referToSelf(h=>(w,d)=>s(d,w,h,!0)),u["Array,"+c]=e.referToSelf(h=>(w,d)=>s(n(w),d,h,!1).valueOf()),u[c+", Array"]=e.referToSelf(h=>(w,d)=>s(n(d),w,h,!0).valueOf())));var v=m.sS!==void 0?m.sS:m.Ss;return o?(m.Ss&&(u["SparseMatrix,"+c]=(h,w)=>m.Ss(h,w,o,!1)),v&&(u[c+", SparseMatrix"]=(h,w)=>v(w,h,o,!0))):(m.Ss&&(u["SparseMatrix,"+c]=e.referToSelf(h=>(w,d)=>m.Ss(w,d,h,!1))),v&&(u[c+", SparseMatrix"]=e.referToSelf(h=>(w,d)=>v(d,w,h,!0)))),o&&o.signatures&&_h(u,o.signatures),u}}),Fu="mod",gx=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],mg=q(Fu,gx,t=>{var{typed:e,config:n,round:a,matrix:r,equalScalar:s,zeros:i,DenseMatrix:p,concat:m}=t,o=lg({typed:e,config:n,round:a,matrix:r,equalScalar:s,zeros:i,DenseMatrix:p}),l=Qa({typed:e,equalScalar:s}),u=ya({typed:e}),c=Uo({typed:e,equalScalar:s}),f=aa({typed:e,equalScalar:s}),v=Jt({typed:e,DenseMatrix:p}),h=Tt({typed:e,matrix:r,concat:m});return e(Fu,{"number, number":w,"BigNumber, BigNumber":function(N,g){return g.isZero()?N:N.sub(g.mul(o(N.div(g))))},"Fraction, Fraction":function(N,g){return g.equals(0)?N:N.sub(g.mul(o(N.div(g))))}},h({SS:c,DS:u,SD:l,Ss:f,sS:v}));function w(d,N){return N===0?d:d-N*o(d/N)}}),dx="matAlgo01xDSid",yx=["typed"],rn=q(dx,yx,t=>{var{typed:e}=t;return function(a,r,s,i){var p=a._data,m=a._size,o=a._datatype||a.getDataType(),l=r._values,u=r._index,c=r._ptr,f=r._size,v=r._datatype||r._data===void 0?r._datatype:r.getDataType();if(m.length!==f.length)throw new st(m.length,f.length);if(m[0]!==f[0]||m[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+m+") must match Matrix B ("+f+")");if(!l)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h=m[0],w=m[1],d=typeof o=="string"&&o!=="mixed"&&o===v?o:void 0,N=d?e.find(s,[d,d]):s,g,x,b=[];for(g=0;g{var{typed:e,equalScalar:n}=t;return function(r,s,i){var p=r._values,m=r._index,o=r._ptr,l=r._size,u=r._datatype||r._data===void 0?r._datatype:r.getDataType(),c=s._values,f=s._index,v=s._ptr,h=s._size,w=s._datatype||s._data===void 0?s._datatype:s.getDataType();if(l.length!==h.length)throw new st(l.length,h.length);if(l[0]!==h[0]||l[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+h+")");var d=l[0],N=l[1],g,x=n,b=0,y=i;typeof u=="string"&&u===w&&u!=="mixed"&&(g=u,x=e.find(n,[g,g]),b=e.convert(0,g),y=e.find(i,[g,g]));var D=p&&c?[]:void 0,A=[],E=[],M=p&&c?[]:void 0,S=p&&c?[]:void 0,C=[],B=[],O,P,$,T,I;for(P=0;P{var{typed:e,DenseMatrix:n}=t;return function(r,s,i,p){var m=r._values,o=r._index,l=r._ptr,u=r._size,c=r._datatype;if(!m)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var f=u[0],v=u[1],h,w=i;typeof c=="string"&&(h=c,s=e.convert(s,h),w=e.find(i,[h,h]));for(var d=[],N=[],g=[],x=0;xArray.isArray(e))}var Ax=q(_u,Ex,t=>{var{typed:e,matrix:n,config:a,round:r,equalScalar:s,zeros:i,BigNumber:p,DenseMatrix:m,concat:o}=t,l=mg({typed:e,config:a,round:r,matrix:n,equalScalar:s,zeros:i,DenseMatrix:m,concat:o}),u=rn({typed:e}),c=Ql({typed:e,equalScalar:s}),f=Dn({typed:e,DenseMatrix:m}),v=Tt({typed:e,matrix:n,concat:o});return e(_u,{"number, number":h,"BigNumber, BigNumber":w,"Fraction, Fraction":(d,N)=>d.gcd(N)},v({SS:c,DS:u,Ss:f}),{[Dx]:e.referToSelf(d=>(N,g,x)=>{for(var b=d(N,g),y=0;yN=>{if(N.length===1&&Array.isArray(N[0])&&Bu(N[0]))return d(...N[0]);if(Bu(N))return d(...N);throw new An("gcd() supports only 1d matrices!")}),Matrix:e.referToSelf(d=>N=>d(N.toArray()))});function h(d,N){if(!qe(d)||!qe(N))throw new Error("Parameters in function gcd must be integer numbers");for(var g;N!==0;)g=l(d,N),d=N,N=g;return d<0?-d:d}function w(d,N){if(!d.isInt()||!N.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var g=new p(0);!N.isZero();){var x=l(d,N);d=N,N=x}return d.lt(g)?d.neg():d}}),Mx="matAlgo06xS0S0",Sx=["typed","equalScalar"],Go=q(Mx,Sx,t=>{var{typed:e,equalScalar:n}=t;return function(r,s,i){var p=r._values,m=r._size,o=r._datatype||r._data===void 0?r._datatype:r.getDataType(),l=s._values,u=s._size,c=s._datatype||s._data===void 0?s._datatype:s.getDataType();if(m.length!==u.length)throw new st(m.length,u.length);if(m[0]!==u[0]||m[1]!==u[1])throw new RangeError("Dimension mismatch. Matrix A ("+m+") must match Matrix B ("+u+")");var f=m[0],v=m[1],h,w=n,d=0,N=i;typeof o=="string"&&o===c&&o!=="mixed"&&(h=o,w=e.find(n,[h,h]),d=e.convert(0,h),N=e.find(i,[h,h]));for(var g=p&&l?[]:void 0,x=[],b=[],y=g?[]:void 0,D=[],A=[],E=0;E{var{typed:e,matrix:n,equalScalar:a,concat:r}=t,s=Qa({typed:e,equalScalar:a}),i=Go({typed:e,equalScalar:a}),p=aa({typed:e,equalScalar:a}),m=Tt({typed:e,matrix:n,concat:r}),o="number | BigNumber | Fraction | Matrix | Array",l={};return l["".concat(o,", ").concat(o,", ...").concat(o)]=e.referToSelf(c=>(f,v,h)=>{for(var w=c(f,v),d=0;dc.lcm(f)},m({SS:i,DS:s,Ss:p}),l);function u(c,f){if(!c.isInt()||!f.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(c.isZero())return c;if(f.isZero())return f;for(var v=c.times(f);!f.isZero();){var h=f;f=c.mod(h),c=h}return v.div(c).abs()}}),Pu="log10",$x=["typed","config","Complex"],Fx=q(Pu,$x,t=>{var{typed:e,config:n,Complex:a}=t;return e(Pu,{number:function(s){return s>=0||n.predictable?Ev(s):new a(s,0).log().div(Math.LN10)},Complex:function(s){return new a(s).log().div(Math.LN10)},BigNumber:function(s){return!s.isNegative()||n.predictable?s.log():new a(s.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":e.referToSelf(r=>s=>it(s,r))})}),zu="log2",_x=["typed","config","Complex"],Bx=q(zu,_x,t=>{var{typed:e,config:n,Complex:a}=t;return e(zu,{number:function(i){return i>=0||n.predictable?Dv(i):r(new a(i,0))},Complex:r,BigNumber:function(i){return!i.isNegative()||n.predictable?i.log(2):r(new a(i.toNumber(),0))},"Array | Matrix":e.referToSelf(s=>i=>it(i,s))});function r(s){var i=Math.sqrt(s.re*s.re+s.im*s.im);return new a(Math.log2?Math.log2(i):Math.log(i)/Math.LN2,Math.atan2(s.im,s.re)/Math.LN2)}}),Ox="multiplyScalar",Px=["typed"],zx=q(Ox,Px,t=>{var{typed:e}=t;return e("multiplyScalar",{"number, number":gv,"Complex, Complex":function(a,r){return a.mul(r)},"BigNumber, BigNumber":function(a,r){return a.times(r)},"Fraction, Fraction":function(a,r){return a.mul(r)},"number | Fraction | BigNumber | Complex, Unit":(n,a)=>a.multiply(n),"Unit, number | Fraction | BigNumber | Complex | Unit":(n,a)=>n.multiply(a)})}),Ru="multiply",Rx=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],Ix=q(Ru,Rx,t=>{var{typed:e,matrix:n,addScalar:a,multiplyScalar:r,equalScalar:s,dot:i}=t,p=aa({typed:e,equalScalar:s}),m=Xa({typed:e});function o(b,y){switch(b.length){case 1:switch(y.length){case 1:if(b[0]!==y[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(b[0]!==y[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+b[0]+") must match Matrix rows ("+y[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+y.length+" dimensions)")}break;case 2:switch(y.length){case 1:if(b[1]!==y[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+b[1]+") must match Vector length ("+y[0]+")");break;case 2:if(b[1]!==y[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+b[1]+") must match Matrix B rows ("+y[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+y.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+b.length+" dimensions)")}}function l(b,y,D){if(D===0)throw new Error("Cannot multiply two empty vectors");return i(b,y)}function u(b,y){if(y.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return c(b,y)}function c(b,y){var D=b._data,A=b._size,E=b._datatype||b.getDataType(),M=y._data,S=y._size,C=y._datatype||y.getDataType(),B=A[0],O=S[1],P,$=a,T=r;E&&C&&E===C&&typeof E=="string"&&E!=="mixed"&&(P=E,$=e.find(a,[P,P]),T=e.find(r,[P,P]));for(var I=[],_=0;_re)for(var oe=0,ue=0;ue(y,D)=>{o(et(y),et(D));var A=b(n(y),n(D));return Ve(A)?A.valueOf():A}),"Matrix, Matrix":function(y,D){var A=y.size(),E=D.size();return o(A,E),A.length===1?E.length===1?l(y,D,A[0]):u(y,D):E.length===1?f(y,D):v(y,D)},"Matrix, Array":e.referTo("Matrix,Matrix",b=>(y,D)=>b(y,n(D))),"Array, Matrix":e.referToSelf(b=>(y,D)=>b(n(y,D.storage()),D)),"SparseMatrix, any":function(y,D){return p(y,D,r,!1)},"DenseMatrix, any":function(y,D){return m(y,D,r,!1)},"any, SparseMatrix":function(y,D){return p(D,y,r,!0)},"any, DenseMatrix":function(y,D){return m(D,y,r,!0)},"Array, any":function(y,D){return m(n(y),D,r,!1).valueOf()},"any, Array":function(y,D){return m(n(D),y,r,!0).valueOf()},"any, any":r,"any, any, ...any":e.referToSelf(b=>(y,D,A)=>{for(var E=b(y,D),M=0;M{var{typed:e,matrix:n,equalScalar:a,BigNumber:r,concat:s}=t,i=rn({typed:e}),p=Qa({typed:e,equalScalar:a}),m=Go({typed:e,equalScalar:a}),o=aa({typed:e,equalScalar:a}),l=Tt({typed:e,matrix:n,concat:s});function u(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return e(Iu,{number:su,"number, number":su,BigNumber:f=>c(f,new r(2)),"BigNumber, BigNumber":c,Complex:u,"Complex, number":u,Array:e.referTo("DenseMatrix,number",f=>v=>f(n(v),2).valueOf()),DenseMatrix:e.referTo("DenseMatrix,number",f=>v=>f(v,2)),SparseMatrix:e.referTo("SparseMatrix,number",f=>v=>f(v,2)),"SparseMatrix, SparseMatrix":e.referToSelf(f=>(v,h)=>{if(h.density()===1)return m(v,h,f);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":e.referToSelf(f=>(v,h)=>{if(h.density()===1)return i(v,h,f,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":e.referTo("DenseMatrix,SparseMatrix",f=>(v,h)=>f(n(v),h)),"number | BigNumber, SparseMatrix":e.referToSelf(f=>(v,h)=>{if(h.density()===1)return o(h,v,f,!0);throw new Error("Root must be non-zero")})},l({scalar:"number | BigNumber",SD:p,Ss:o,sS:!1}));function c(f,v){var h=r.precision,w=r.clone({precision:h+2}),d=new r(0),N=new w(1),g=v.isNegative();if(g&&(v=v.neg()),v.isZero())throw new Error("Root must be non-zero");if(f.isNegative()&&!v.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(f.isZero())return g?new w(1/0):0;if(!f.isFinite())return g?d:f;var x=f.abs().pow(N.div(v));return x=f.isNeg()?x.neg():x,new r((g?N.div(x):x).toPrecision(h))}}),qu="sign",kx=["typed","BigNumber","Fraction","complex"],Ux=q(qu,kx,t=>{var{typed:e,BigNumber:n,complex:a,Fraction:r}=t;return e(qu,{number:Tl,Complex:function(i){return i.im===0?a(Tl(i.re)):i.sign()},BigNumber:function(i){return new n(i.cmp(0))},Fraction:function(i){return new r(i.s,1)},"Array | Matrix":e.referToSelf(s=>i=>it(i,s)),Unit:e.referToSelf(s=>i=>{if(!i._isDerived()&&i.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return e.find(s,i.valueType())(i.value)})})}),Gx="sqrt",Hx=["config","typed","Complex"],Vx=q(Gx,Hx,t=>{var{config:e,typed:n,Complex:a}=t;return n("sqrt",{number:r,Complex:function(i){return i.sqrt()},BigNumber:function(i){return!i.isNegative()||e.predictable?i.sqrt():r(i.toNumber())},Unit:function(i){return i.pow(.5)}});function r(s){return isNaN(s)?NaN:s>=0||e.predictable?Math.sqrt(s):new a(s,0).sqrt()}}),Lu="square",Jx=["typed"],Zx=q(Lu,Jx,t=>{var{typed:e}=t;return e(Lu,{number:Av,Complex:function(a){return a.mul(a)},BigNumber:function(a){return a.times(a)},Fraction:function(a){return a.mul(a)},Unit:function(a){return a.pow(2)}})}),ku="subtract",Wx=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],Yx=q(ku,Wx,t=>{var{typed:e,matrix:n,equalScalar:a,subtractScalar:r,unaryMinus:s,DenseMatrix:i,concat:p}=t,m=rn({typed:e}),o=ya({typed:e}),l=Uo({typed:e,equalScalar:a}),u=Dn({typed:e,DenseMatrix:i}),c=Jt({typed:e,DenseMatrix:i}),f=Tt({typed:e,matrix:n,concat:p});return e(ku,{"any, any":r},f({elop:r,SS:l,DS:m,SD:o,Ss:c,sS:u}))}),Uu="xgcd",Xx=["typed","config","matrix","BigNumber"],Qx=q(Uu,Xx,t=>{var{typed:e,config:n,matrix:a,BigNumber:r}=t;return e(Uu,{"number, number":function(p,m){var o=Mv(p,m);return n.matrix==="Array"?o:a(o)},"BigNumber, BigNumber":s});function s(i,p){var m,o,l,u=new r(0),c=new r(1),f=u,v=c,h=c,w=u;if(!i.isInt()||!p.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!p.isZero();)o=i.div(p).floor(),l=i.mod(p),m=f,f=v.minus(o.times(f)),v=m,m=h,h=w.minus(o.times(h)),w=m,i=p,p=l;var d;return i.lt(u)?d=[i.neg(),v.neg(),w.neg()]:d=[i,i.isZero()?0:v,w],n.matrix==="Array"?d:a(d)}}),Gu="invmod",jx=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],Kx=q(Gu,jx,t=>{var{typed:e,config:n,BigNumber:a,xgcd:r,equal:s,smaller:i,mod:p,add:m,isInteger:o}=t;return e(Gu,{"number, number":l,"BigNumber, BigNumber":l});function l(u,c){if(!o(u)||!o(c))throw new Error("Parameters in function invmod must be integer numbers");if(u=p(u,c),s(c,0))throw new Error("Divisor must be non zero");var f=r(u,c);f=f.valueOf();var[v,h]=f;return s(v,a(1))?(h=p(h,c),i(h,a(0))&&(h=m(h,c)),h):NaN}}),eb="matAlgo09xS0Sf",tb=["typed","equalScalar"],ug=q(eb,tb,t=>{var{typed:e,equalScalar:n}=t;return function(r,s,i){var p=r._values,m=r._index,o=r._ptr,l=r._size,u=r._datatype||r._data===void 0?r._datatype:r.getDataType(),c=s._values,f=s._index,v=s._ptr,h=s._size,w=s._datatype||s._data===void 0?s._datatype:s.getDataType();if(l.length!==h.length)throw new st(l.length,h.length);if(l[0]!==h[0]||l[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+h+")");var d=l[0],N=l[1],g,x=n,b=0,y=i;typeof u=="string"&&u===w&&u!=="mixed"&&(g=u,x=e.find(n,[g,g]),b=e.convert(0,g),y=e.find(i,[g,g]));var D=p&&c?[]:void 0,A=[],E=[],M=D?[]:void 0,S=[],C,B,O,P,$;for(B=0;B{var{typed:e,matrix:n,equalScalar:a,multiplyScalar:r,concat:s}=t,i=Qa({typed:e,equalScalar:a}),p=ug({typed:e,equalScalar:a}),m=aa({typed:e,equalScalar:a}),o=Tt({typed:e,matrix:n,concat:s});return e(Hu,o({elop:r,SS:p,DS:i,Ss:m}))});function nb(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function bitAnd");var n=t.constructor;if(t.isNaN()||e.isNaN())return new n(NaN);if(t.isZero()||e.eq(-1)||t.eq(e))return t;if(e.isZero()||t.eq(-1))return e;if(!t.isFinite()||!e.isFinite()){if(!t.isFinite()&&!e.isFinite())return t.isNegative()===e.isNegative()?t:new n(0);if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new n(0):e;if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new n(0):t}return jl(t,e,function(a,r){return a&r})}function oi(t){if(t.isFinite()&&!t.isInteger())throw new Error("Integer expected in function bitNot");var e=t.constructor,n=e.precision;e.config({precision:1e9});var a=t.plus(new e(1));return a.s=-a.s||null,e.config({precision:n}),a}function sb(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function bitOr");var n=t.constructor;if(t.isNaN()||e.isNaN())return new n(NaN);var a=new n(-1);return t.isZero()||e.eq(a)||t.eq(e)?e:e.isZero()||t.eq(a)?t:!t.isFinite()||!e.isFinite()?!t.isFinite()&&!t.isNegative()&&e.isNegative()||t.isNegative()&&!e.isNegative()&&!e.isFinite()?a:t.isNegative()&&e.isNegative()?t.isFinite()?t:e:t.isFinite()?e:t:jl(t,e,function(r,s){return r|s})}function jl(t,e,n){var a=t.constructor,r,s,i=+(t.s<0),p=+(e.s<0);if(i){r=qi(oi(t));for(var m=0;m0;)n(l[--f],u[--v])===h&&(w=w.plus(d)),d=d.times(N);for(;v>0;)n(c,u[--v])===h&&(w=w.plus(d)),d=d.times(N);return a.config({precision:g}),h===0&&(w.s=-w.s),w}function qi(t){for(var e=t.d,n=e[0]+"",a=1;a0)if(++p>o)for(p-=o;p--;)m+="0";else p1&&((l[f+1]===null||l[f+1]===void 0)&&(l[f+1]=0),l[f+1]+=l[f]>>1,l[f]&=1)}return l.reverse()}function ib(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function bitXor");var n=t.constructor;if(t.isNaN()||e.isNaN())return new n(NaN);if(t.isZero())return e;if(e.isZero())return t;if(t.eq(e))return new n(0);var a=new n(-1);return t.eq(a)?oi(e):e.eq(a)?oi(t):!t.isFinite()||!e.isFinite()?!t.isFinite()&&!e.isFinite()?a:new n(t.isNegative()===e.isNegative()?1/0:-1/0):jl(t,e,function(r,s){return r^s})}function ob(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function leftShift");var n=t.constructor;return t.isNaN()||e.isNaN()||e.isNegative()&&!e.isZero()?new n(NaN):t.isZero()||e.isZero()?t:!t.isFinite()&&!e.isFinite()?new n(NaN):e.lt(55)?t.times(Math.pow(2,e.toNumber())+""):t.times(new n(2).pow(e))}function lb(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function rightArithShift");var n=t.constructor;return t.isNaN()||e.isNaN()||e.isNegative()&&!e.isZero()?new n(NaN):t.isZero()||e.isZero()?t:e.isFinite()?e.lt(55)?t.div(Math.pow(2,e.toNumber())+"").floor():t.div(new n(2).pow(e)).floor():t.isNegative()?new n(-1):t.isFinite()?new n(0):new n(NaN)}var Vu="bitAnd",mb=["typed","matrix","equalScalar","concat"],pg=q(Vu,mb,t=>{var{typed:e,matrix:n,equalScalar:a,concat:r}=t,s=Qa({typed:e,equalScalar:a}),i=Go({typed:e,equalScalar:a}),p=aa({typed:e,equalScalar:a}),m=Tt({typed:e,matrix:n,concat:r});return e(Vu,{"number, number":Cv,"BigNumber, BigNumber":nb},m({SS:i,DS:s,Ss:p}))}),Ju="bitNot",ub=["typed"],pb=q(Ju,ub,t=>{var{typed:e}=t;return e(Ju,{number:Tv,BigNumber:oi,"Array | Matrix":e.referToSelf(n=>a=>it(a,n))})}),Zu="bitOr",cb=["typed","matrix","equalScalar","DenseMatrix","concat"],cg=q(Zu,cb,t=>{var{typed:e,matrix:n,equalScalar:a,DenseMatrix:r,concat:s}=t,i=rn({typed:e}),p=Ql({typed:e,equalScalar:a}),m=Dn({typed:e,DenseMatrix:r}),o=Tt({typed:e,matrix:n,concat:s});return e(Zu,{"number, number":$v,"BigNumber, BigNumber":sb},o({SS:p,DS:i,Ss:m}))}),fb="matAlgo07xSSf",hb=["typed","DenseMatrix"],yr=q(fb,hb,t=>{var{typed:e,DenseMatrix:n}=t;return function(s,i,p){var m=s._size,o=s._datatype||s._data===void 0?s._datatype:s.getDataType(),l=i._size,u=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(m.length!==l.length)throw new st(m.length,l.length);if(m[0]!==l[0]||m[1]!==l[1])throw new RangeError("Dimension mismatch. Matrix A ("+m+") must match Matrix B ("+l+")");var c=m[0],f=m[1],v,h=0,w=p;typeof o=="string"&&o===u&&o!=="mixed"&&(v=o,h=e.convert(0,v),w=e.find(p,[v,v]));var d,N,g=[];for(d=0;d{var{typed:e,matrix:n,DenseMatrix:a,concat:r}=t,s=ya({typed:e}),i=yr({typed:e,DenseMatrix:a}),p=Jt({typed:e,DenseMatrix:a}),m=Tt({typed:e,matrix:n,concat:r});return e(Wu,{"number, number":Fv,"BigNumber, BigNumber":ib},m({SS:i,DS:s,Ss:p}))}),Yu="arg",db=["typed"],yb=q(Yu,db,t=>{var{typed:e}=t;return e(Yu,{number:function(a){return Math.atan2(0,a)},BigNumber:function(a){return a.constructor.atan2(0,a)},Complex:function(a){return a.arg()},"Array | Matrix":e.referToSelf(n=>a=>it(a,n))})}),Xu="conj",wb=["typed"],xb=q(Xu,wb,t=>{var{typed:e}=t;return e(Xu,{"number | BigNumber | Fraction":n=>n,Complex:n=>n.conjugate(),"Array | Matrix":e.referToSelf(n=>a=>it(a,n))})}),Qu="im",bb=["typed"],Nb=q(Qu,bb,t=>{var{typed:e}=t;return e(Qu,{number:()=>0,"BigNumber | Fraction":n=>n.mul(0),Complex:n=>n.im,"Array | Matrix":e.referToSelf(n=>a=>it(a,n))})}),ju="re",Eb=["typed"],Db=q(ju,Eb,t=>{var{typed:e}=t;return e(ju,{"number | BigNumber | Fraction":n=>n,Complex:n=>n.re,"Array | Matrix":e.referToSelf(n=>a=>it(a,n))})}),Ku="not",Ab=["typed"],Mb=q(Ku,Ab,t=>{var{typed:e}=t;return e(Ku,{"null | undefined":()=>!0,number:zv,Complex:function(a){return a.re===0&&a.im===0},BigNumber:function(a){return a.isZero()||a.isNaN()},Unit:e.referToSelf(n=>a=>e.find(n,a.valueType())(a.value)),"Array | Matrix":e.referToSelf(n=>a=>it(a,n))})}),ep="or",Sb=["typed","matrix","equalScalar","DenseMatrix","concat"],fg=q(ep,Sb,t=>{var{typed:e,matrix:n,equalScalar:a,DenseMatrix:r,concat:s}=t,i=ya({typed:e}),p=Uo({typed:e,equalScalar:a}),m=Jt({typed:e,DenseMatrix:r}),o=Tt({typed:e,matrix:n,concat:s});return e(ep,{"number, number":Rv,"Complex, Complex":function(u,c){return u.re!==0||u.im!==0||c.re!==0||c.im!==0},"BigNumber, BigNumber":function(u,c){return!u.isZero()&&!u.isNaN()||!c.isZero()&&!c.isNaN()},"Unit, Unit":e.referToSelf(l=>(u,c)=>l(u.value||0,c.value||0))},o({SS:p,DS:i,Ss:m}))}),tp="xor",Cb=["typed","matrix","DenseMatrix","concat"],Tb=q(tp,Cb,t=>{var{typed:e,matrix:n,DenseMatrix:a,concat:r}=t,s=ya({typed:e}),i=yr({typed:e,DenseMatrix:a}),p=Jt({typed:e,DenseMatrix:a}),m=Tt({typed:e,matrix:n,concat:r});return e(tp,{"number, number":Iv,"Complex, Complex":function(l,u){return(l.re!==0||l.im!==0)!=(u.re!==0||u.im!==0)},"BigNumber, BigNumber":function(l,u){return(!l.isZero()&&!l.isNaN())!=(!u.isZero()&&!u.isNaN())},"Unit, Unit":e.referToSelf(o=>(l,u)=>o(l.value||0,u.value||0))},m({SS:i,DS:s,Ss:p}))}),ap="concat",$b=["typed","matrix","isInteger"],hg=q(ap,$b,t=>{var{typed:e,matrix:n,isInteger:a}=t;return e(ap,{"...Array | Matrix | number | BigNumber":function(s){var i,p=s.length,m=-1,o,l=!1,u=[];for(i=0;i0&&m>o)throw new Wa(m,o+1)}else{var f=Xe(c).valueOf(),v=et(f);if(u[i]=f,o=m,m=v.length-1,i>0&&m!==o)throw new st(o+1,m+1)}}if(u.length===0)throw new SyntaxError("At least one matrix expected");for(var h=u.shift();u.length;)h=Vh(h,u.shift(),m);return l?n(h):h},"...string":function(s){return s.join("")}})}),rp="column",Fb=["typed","Index","matrix","range"],vg=q(rp,Fb,t=>{var{typed:e,Index:n,matrix:a,range:r}=t;return e(rp,{"Matrix, number":s,"Array, number":function(p,m){return s(a(Xe(p)),m).valueOf()}});function s(i,p){if(i.size().length!==2)throw new Error("Only two dimensional matrix is supported");Dt(p,i.size()[1]);var m=r(0,i.size()[0]),o=new n(m,p),l=i.subset(o);return Ve(l)?l:a([[l]])}}),np="count",_b=["typed","size","prod"],Bb=q(np,_b,t=>{var{typed:e,size:n,prod:a}=t;return e(np,{string:function(s){return s.length},"Matrix | Array":function(s){return a(n(s))}})}),sp="cross",Ob=["typed","matrix","subtract","multiply"],Pb=q(sp,Ob,t=>{var{typed:e,matrix:n,subtract:a,multiply:r}=t;return e(sp,{"Matrix, Matrix":function(p,m){return n(s(p.toArray(),m.toArray()))},"Matrix, Array":function(p,m){return n(s(p.toArray(),m))},"Array, Matrix":function(p,m){return n(s(p,m.toArray()))},"Array, Array":s});function s(i,p){var m=Math.max(et(i).length,et(p).length);i=lo(i),p=lo(p);var o=et(i),l=et(p);if(o.length!==1||l.length!==1||o[0]!==3||l[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+o.join(", ")+"], B = ["+l.join(", ")+"])");var u=[a(r(i[1],p[2]),r(i[2],p[1])),a(r(i[2],p[0]),r(i[0],p[2])),a(r(i[0],p[1]),r(i[1],p[0]))];return m>1?[u]:u}}),ip="diag",zb=["typed","matrix","DenseMatrix","SparseMatrix"],Rb=q(ip,zb,t=>{var{typed:e,matrix:n,DenseMatrix:a,SparseMatrix:r}=t;return e(ip,{Array:function(o){return s(o,0,et(o),null)},"Array, number":function(o,l){return s(o,l,et(o),null)},"Array, BigNumber":function(o,l){return s(o,l.toNumber(),et(o),null)},"Array, string":function(o,l){return s(o,0,et(o),l)},"Array, number, string":function(o,l,u){return s(o,l,et(o),u)},"Array, BigNumber, string":function(o,l,u){return s(o,l.toNumber(),et(o),u)},Matrix:function(o){return s(o,0,o.size(),o.storage())},"Matrix, number":function(o,l){return s(o,l,o.size(),o.storage())},"Matrix, BigNumber":function(o,l){return s(o,l.toNumber(),o.size(),o.storage())},"Matrix, string":function(o,l){return s(o,0,o.size(),l)},"Matrix, number, string":function(o,l,u){return s(o,l,o.size(),u)},"Matrix, BigNumber, string":function(o,l,u){return s(o,l.toNumber(),o.size(),u)}});function s(m,o,l,u){if(!qe(o))throw new TypeError("Second parameter in function diag must be an integer");var c=o>0?o:0,f=o<0?-o:0;switch(l.length){case 1:return i(m,o,u,l[0],f,c);case 2:return p(m,o,u,l,f,c)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function i(m,o,l,u,c,f){var v=[u+c,u+f];if(l&&l!=="sparse"&&l!=="dense")throw new TypeError("Unknown matrix type ".concat(l,'"'));var h=l==="sparse"?r.diagonal(v,m,o):a.diagonal(v,m,o);return l!==null?h:h.valueOf()}function p(m,o,l,u,c,f){if(Ve(m)){var v=m.diagonal(o);return l!==null?l!==v.storage()?n(v,l):v:v.valueOf()}for(var h=Math.min(u[0]-c,u[1]-f),w=[],d=0;d=2&&h.push("index: ".concat(St(n))),f.length>=3&&h.push("array: ".concat(St(a))),new TypeError("Function ".concat(r," cannot apply callback arguments ")+"".concat(t.name,"(").concat(h.join(", "),") at index ").concat(JSON.stringify(n)))}else throw new TypeError("Function ".concat(r," cannot apply callback arguments ")+"to function ".concat(t.name,": ").concat(w.message))}}}var Ib="filter",qb=["typed"],Lb=q(Ib,qb,t=>{var{typed:e}=t;return e("filter",{"Array, function":op,"Matrix, function":function(a,r){return a.create(op(a.toArray(),r))},"Array, RegExp":mo,"Matrix, RegExp":function(a,r){return a.create(mo(a.toArray(),r))}})});function op(t,e){return Gh(t,function(n,a,r){return Fs(e,n,[a],r,"filter")})}var lp="flatten",kb=["typed","matrix"],Ub=q(lp,kb,t=>{var{typed:e,matrix:n}=t;return e(lp,{Array:function(r){return ft(r)},Matrix:function(r){var s=ft(r.toArray());return n(s)}})}),mp="forEach",Gb=["typed"],Hb=q(mp,Gb,t=>{var{typed:e}=t;return e(mp,{"Array, function":Vb,"Matrix, function":function(a,r){a.forEach(r)}})});function Vb(t,e){var n=function a(r,s){if(Array.isArray(r))Po(r,function(i,p){a(i,s.concat(p))});else return Fs(e,r,s,t,"forEach")};n(t,[])}var up="getMatrixDataType",Jb=["typed"],Zb=q(up,Jb,t=>{var{typed:e}=t;return e(up,{Array:function(a){return ni(a,St)},Matrix:function(a){return a.getDataType()}})}),pp="identity",Wb=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],Yb=q(pp,Wb,t=>{var{typed:e,config:n,matrix:a,BigNumber:r,DenseMatrix:s,SparseMatrix:i}=t;return e(pp,{"":function(){return n.matrix==="Matrix"?a([]):[]},string:function(l){return a(l)},"number | BigNumber":function(l){return m(l,l,n.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(l,u){return m(l,l,u)},"number | BigNumber, number | BigNumber":function(l,u){return m(l,u,n.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(l,u,c){return m(l,u,c)},Array:function(l){return p(l)},"Array, string":function(l,u){return p(l,u)},Matrix:function(l){return p(l.valueOf(),l.storage())},"Matrix, string":function(l,u){return p(l.valueOf(),u)}});function p(o,l){switch(o.length){case 0:return l?a(l):[];case 1:return m(o[0],o[0],l);case 2:return m(o[0],o[1],l);default:throw new Error("Vector containing two values expected")}}function m(o,l,u){var c=at(o)||at(l)?r:null;if(at(o)&&(o=o.toNumber()),at(l)&&(l=l.toNumber()),!qe(o)||o<1)throw new Error("Parameters in function identity must be positive integers");if(!qe(l)||l<1)throw new Error("Parameters in function identity must be positive integers");var f=c?new r(1):1,v=c?new c(0):0,h=[o,l];if(u){if(u==="sparse")return i.diagonal(h,f,0,v);if(u==="dense")return s.diagonal(h,f,0,v);throw new TypeError('Unknown matrix type "'.concat(u,'"'))}for(var w=ws([],h,v),d=o{var{typed:e,matrix:n,multiplyScalar:a}=t;return e(cp,{"Matrix, Matrix":function(i,p){return n(r(i.toArray(),p.toArray()))},"Matrix, Array":function(i,p){return n(r(i.toArray(),p))},"Array, Matrix":function(i,p){return n(r(i,p.toArray()))},"Array, Array":r});function r(s,i){if(et(s).length===1&&(s=[s]),et(i).length===1&&(i=[i]),et(s).length>2||et(i).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(s.length)+", y = "+JSON.stringify(i.length)+")");var p=[],m=[];return s.map(function(o){return i.map(function(l){return m=[],p.push(m),o.map(function(u){return l.map(function(c){return m.push(a(u,c))})})})})&&p}}),fp="map",jb=["typed"],Kb=q(fp,jb,t=>{var{typed:e}=t;return e(fp,{"Array, function":e2,"Matrix, function":function(a,r){return a.map(r)}})});function e2(t,e){var n=function a(r,s){return Array.isArray(r)?r.map(function(i,p){return a(i,s.concat(p))}):Fs(e,r,s,t,"map")};return n(t,[])}var hp="diff",t2=["typed","matrix","subtract","number"],gg=q(hp,t2,t=>{var{typed:e,matrix:n,subtract:a,number:r}=t;return e(hp,{"Array | Matrix":function(l){return Ve(l)?n(i(l.toArray())):i(l)},"Array | Matrix, number":function(l,u){if(!qe(u))throw new RangeError("Dimension must be a whole number");return Ve(l)?n(s(l.toArray(),u)):s(l,u)},"Array, BigNumber":e.referTo("Array,number",o=>(l,u)=>o(l,r(u))),"Matrix, BigNumber":e.referTo("Matrix,number",o=>(l,u)=>o(l,r(u)))});function s(o,l){if(Ve(o)&&(o=o.toArray()),!Array.isArray(o))throw RangeError("Array/Matrix does not have that many dimensions");if(l>0){var u=[];return o.forEach(c=>{u.push(s(c,l-1))}),u}else{if(l===0)return i(o);throw RangeError("Cannot have negative dimension")}}function i(o){for(var l=[],u=o.length,c=1;c{var{typed:e,config:n,matrix:a,BigNumber:r}=t;return e("ones",{"":function(){return n.matrix==="Array"?s([]):s([],"default")},"...number | BigNumber | string":function(o){var l=o[o.length-1];if(typeof l=="string"){var u=o.pop();return s(o,u)}else return n.matrix==="Array"?s(o):s(o,"default")},Array:s,Matrix:function(o){var l=o.storage();return s(o.valueOf(),l)},"Array | Matrix, string":function(o,l){return s(o.valueOf(),l)}});function s(m,o){var l=i(m),u=l?new r(1):1;if(p(m),o){var c=a(o);return m.length>0?c.resize(m,u):c}else{var f=[];return m.length>0?ws(f,m,u):f}}function i(m){var o=!1;return m.forEach(function(l,u,c){at(l)&&(o=!0,c[u]=l.toNumber())}),o}function p(m){m.forEach(function(o){if(typeof o!="number"||!qe(o)||o<0)throw new Error("Parameters in function ones must be positive integers")})}});function Kl(){throw new Error('No "bignumber" implementation available')}function dg(){throw new Error('No "fraction" implementation available')}function yg(){throw new Error('No "matrix" implementation available')}var vp="range",s2=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],wg=q(vp,s2,t=>{var{typed:e,config:n,matrix:a,bignumber:r,smaller:s,smallerEq:i,larger:p,largerEq:m,add:o,isPositive:l}=t;return e(vp,{string:c,"string, boolean":c,"number, number":function(w,d){return u(f(w,d,1,!1))},"number, number, number":function(w,d,N){return u(f(w,d,N,!1))},"number, number, boolean":function(w,d,N){return u(f(w,d,1,N))},"number, number, number, boolean":function(w,d,N,g){return u(f(w,d,N,g))},"BigNumber, BigNumber":function(w,d){var N=w.constructor;return u(f(w,d,new N(1),!1))},"BigNumber, BigNumber, BigNumber":function(w,d,N){return u(f(w,d,N,!1))},"BigNumber, BigNumber, boolean":function(w,d,N){var g=w.constructor;return u(f(w,d,new g(1),N))},"BigNumber, BigNumber, BigNumber, boolean":function(w,d,N,g){return u(f(w,d,N,g))},"Unit, Unit, Unit":function(w,d,N){return u(f(w,d,N,!1))},"Unit, Unit, Unit, boolean":function(w,d,N,g){return u(f(w,d,N,g))}});function u(h){return n.matrix==="Matrix"?a?a(h):yg():h}function c(h,w){var d=v(h);if(!d)throw new SyntaxError('String "'+h+'" is no valid range');return n.number==="BigNumber"?(r===void 0&&Kl(),u(f(r(d.start),r(d.end),r(d.step)))):u(f(d.start,d.end,d.step,w))}function f(h,w,d,N){for(var g=[],x=l(d)?N?i:s:N?m:p,b=h;x(b,w);)g.push(b),b=o(b,d);return g}function v(h){var w=h.split(":"),d=w.map(function(g){return Number(g)}),N=d.some(function(g){return isNaN(g)});if(N)return null;switch(d.length){case 2:return{start:d[0],end:d[1],step:1};case 3:return{start:d[0],end:d[2],step:d[1]};default:return null}}}),gp="reshape",i2=["typed","isInteger","matrix"],o2=q(gp,i2,t=>{var{typed:e,isInteger:n}=t;return e(gp,{"Matrix, Array":function(r,s){return r.reshape(s,!0)},"Array, Array":function(r,s){return s.forEach(function(i){if(!n(i))throw new TypeError("Invalid size for dimension: "+i)}),Vl(r,s)}})}),l2="resize",m2=["config","matrix"],u2=q(l2,m2,t=>{var{config:e,matrix:n}=t;return function(s,i,p){if(arguments.length!==2&&arguments.length!==3)throw new An("resize",arguments.length,2,3);if(Ve(i)&&(i=i.valueOf()),at(i[0])&&(i=i.map(function(l){return at(l)?l.toNumber():l})),Ve(s))return s.resize(i,p,!0);if(typeof s=="string")return a(s,i,p);var m=Array.isArray(s)?!1:e.matrix!=="Array";if(i.length===0){for(;Array.isArray(s);)s=s[0];return Xe(s)}else{Array.isArray(s)||(s=[s]),s=Xe(s);var o=ws(s,i,p);return m?n(o):o}};function a(r,s,i){if(i!==void 0){if(typeof i!="string"||i.length!==1)throw new TypeError("Single character expected as defaultValue")}else i=" ";if(s.length!==1)throw new st(s.length,1);var p=s[0];if(typeof p!="number"||!qe(p))throw new TypeError("Invalid size, must contain positive integers (size: "+nt(s)+")");if(r.length>p)return r.substring(0,p);if(r.length{var{typed:e,multiply:n,rotationMatrix:a}=t;return e(dp,{"Array , number | BigNumber | Complex | Unit":function(i,p){r(i,2);var m=n(a(p),i);return m.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(i,p){return r(i,2),n(a(p),i)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(i,p,m){r(i,3);var o=n(a(p,m),i);return o},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(i,p,m){return r(i,3),n(a(p,m),i)}});function r(s,i){var p=Array.isArray(s)?et(s):s.size();if(p.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(i));if(p.length===2&&p[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(i));if(p[0]!==i)throw new RangeError("Vector must be of dimensions 1x".concat(i))}}),yp="rotationMatrix",f2=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],h2=q(yp,f2,t=>{var{typed:e,config:n,multiplyScalar:a,addScalar:r,unaryMinus:s,norm:i,BigNumber:p,matrix:m,DenseMatrix:o,SparseMatrix:l,cos:u,sin:c}=t;return e(yp,{"":function(){return n.matrix==="Matrix"?m([]):[]},string:function(g){return m(g)},"number | BigNumber | Complex | Unit":function(g){return f(g,n.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(g,x){return f(g,x)},"number | BigNumber | Complex | Unit, Array":function(g,x){var b=m(x);return v(b),d(g,b,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(g,x){v(x);var b=x.storage()||(n.matrix==="Matrix"?"dense":void 0);return d(g,x,b)},"number | BigNumber | Complex | Unit, Array, string":function(g,x,b){var y=m(x);return v(y),d(g,y,b)},"number | BigNumber | Complex | Unit, Matrix, string":function(g,x,b){return v(x),d(g,x,b)}});function f(N,g){var x=at(N),b=x?new p(-1):-1,y=u(N),D=c(N),A=[[y,a(b,D)],[D,y]];return w(A,g)}function v(N){var g=N.size();if(g.length<1||g[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function h(N){return N.reduce((g,x)=>a(g,x))}function w(N,g){if(g){if(g==="sparse")return new l(N);if(g==="dense")return new o(N);throw new TypeError('Unknown matrix type "'.concat(g,'"'))}return N}function d(N,g,x){var b=i(g);if(b===0)throw new RangeError("Rotation around zero vector");var y=at(N)?p:null,D=y?new y(1):1,A=y?new y(-1):-1,E=y?new y(g.get([0])/b):g.get([0])/b,M=y?new y(g.get([1])/b):g.get([1])/b,S=y?new y(g.get([2])/b):g.get([2])/b,C=u(N),B=r(D,s(C)),O=c(N),P=r(C,h([E,E,B])),$=r(h([E,M,B]),h([A,S,O])),T=r(h([E,S,B]),h([M,O])),I=r(h([E,M,B]),h([S,O])),_=r(C,h([M,M,B])),W=r(h([M,S,B]),h([A,E,O])),K=r(h([E,S,B]),h([A,M,O])),Y=r(h([M,S,B]),h([E,O])),z=r(C,h([S,S,B])),j=[[P,$,T],[I,_,W],[K,Y,z]];return w(j,x)}}),wp="row",v2=["typed","Index","matrix","range"],xg=q(wp,v2,t=>{var{typed:e,Index:n,matrix:a,range:r}=t;return e(wp,{"Matrix, number":s,"Array, number":function(p,m){return s(a(Xe(p)),m).valueOf()}});function s(i,p){if(i.size().length!==2)throw new Error("Only two dimensional matrix is supported");Dt(p,i.size()[0]);var m=r(0,i.size()[1]),o=new n(p,m),l=i.subset(o);return Ve(l)?l:a([[l]])}}),xp="size",g2=["typed","config","?matrix"],d2=q(xp,g2,t=>{var{typed:e,config:n,matrix:a}=t;return e(xp,{Matrix:function(s){return s.create(s.size())},Array:et,string:function(s){return n.matrix==="Array"?[s.length]:a([s.length])},"number | Complex | BigNumber | Unit | boolean | null":function(s){return n.matrix==="Array"?[]:a?a([]):yg()}})}),bp="squeeze",y2=["typed","matrix"],w2=q(bp,y2,t=>{var{typed:e,matrix:n}=t;return e(bp,{Array:function(r){return lo(Xe(r))},Matrix:function(r){var s=lo(r.toArray());return Array.isArray(s)?n(s):s},any:function(r){return Xe(r)}})}),Np="subset",x2=["typed","matrix","zeros","add"],bg=q(Np,x2,t=>{var{typed:e,matrix:n,zeros:a,add:r}=t;return e(Np,{"Matrix, Index":function(p,m){return ys(m)?n():(oo(p,m),p.subset(m))},"Array, Index":e.referTo("Matrix, Index",function(i){return function(p,m){var o=i(n(p),m);return m.isScalar()?o:o.valueOf()}}),"Object, Index":N2,"string, Index":b2,"Matrix, Index, any, any":function(p,m,o,l){return ys(m)?p:(oo(p,m),p.clone().subset(m,s(o,m),l))},"Array, Index, any, any":e.referTo("Matrix, Index, any, any",function(i){return function(p,m,o,l){var u=i(n(p),m,o,l);return u.isMatrix?u.valueOf():u}}),"Array, Index, any":e.referTo("Matrix, Index, any, any",function(i){return function(p,m,o){return i(n(p),m,o,void 0).valueOf()}}),"Matrix, Index, any":e.referTo("Matrix, Index, any, any",function(i){return function(p,m,o){return i(p,m,o,void 0)}}),"string, Index, string":Ep,"string, Index, string, string":Ep,"Object, Index, any":E2});function s(i,p){if(typeof i=="string")throw new Error("can't boradcast a string");if(p._isScalar)return i;var m=p.size();if(m.every(o=>o>0))try{return r(i,a(m))}catch{return i}else return i}});function b2(t,e){if(!Fo(e))throw new TypeError("Index expected");if(ys(e))return"";if(oo(Array.from(t),e),e.size().length!==1)throw new st(e.size().length,1);var n=t.length;Dt(e.min()[0],n),Dt(e.max()[0],n);var a=e.dimension(0),r="";return a.forEach(function(s){r+=t.charAt(s)}),r}function Ep(t,e,n,a){if(!e||e.isIndex!==!0)throw new TypeError("Index expected");if(ys(e))return t;if(oo(Array.from(t),e),e.size().length!==1)throw new st(e.size().length,1);if(a!==void 0){if(typeof a!="string"||a.length!==1)throw new TypeError("Single character expected as defaultValue")}else a=" ";var r=e.dimension(0),s=r.size()[0];if(s!==n.length)throw new st(r.size()[0],n.length);var i=t.length;Dt(e.min()[0]),Dt(e.max()[0]);for(var p=[],m=0;mi)for(var o=i-1,l=p.length;o{var{typed:e,matrix:n}=t;return e(Dp,{Array:i=>a(n(i)).valueOf(),Matrix:a,any:Xe});function a(i){var p=i.size(),m;switch(p.length){case 1:m=i.clone();break;case 2:{var o=p[0],l=p[1];if(l===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+nt(p)+")");switch(i.storage()){case"dense":m=r(i,o,l);break;case"sparse":m=s(i,o,l);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+nt(p)+")")}return m}function r(i,p,m){for(var o=i._data,l=[],u,c=0;c{var{typed:e,transpose:n,conj:a}=t;return e(Ap,{any:function(s){return a(n(s))}})}),Mp="zeros",C2=["typed","config","matrix","BigNumber"],T2=q(Mp,C2,t=>{var{typed:e,config:n,matrix:a,BigNumber:r}=t;return e(Mp,{"":function(){return n.matrix==="Array"?s([]):s([],"default")},"...number | BigNumber | string":function(o){var l=o[o.length-1];if(typeof l=="string"){var u=o.pop();return s(o,u)}else return n.matrix==="Array"?s(o):s(o,"default")},Array:s,Matrix:function(o){var l=o.storage();return s(o.valueOf(),l)},"Array | Matrix, string":function(o,l){return s(o.valueOf(),l)}});function s(m,o){var l=i(m),u=l?new r(0):0;if(p(m),o){var c=a(o);return m.length>0?c.resize(m,u):c}else{var f=[];return m.length>0?ws(f,m,u):f}}function i(m){var o=!1;return m.forEach(function(l,u,c){at(l)&&(o=!0,c[u]=l.toNumber())}),o}function p(m){m.forEach(function(o){if(typeof o!="number"||!qe(o)||o<0)throw new Error("Parameters in function zeros must be positive integers")})}}),Sp="fft",$2=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],F2=q(Sp,$2,t=>{var{typed:e,matrix:n,addScalar:a,multiplyScalar:r,divideScalar:s,exp:i,tau:p,i:m,dotDivide:o,conj:l,pow:u,ceil:c,log2:f}=t;return e(Sp,{Array:v,Matrix:function(g){return g.create(v(g.toArray()))}});function v(N){var g=et(N);return g.length===1?d(N,g[0]):h(N.map(x=>v(x,g.slice(1))),0)}function h(N,g){var x=et(N);if(g!==0)return new Array(x[0]).fill(0).map((y,D)=>h(N[D],g-1));if(x.length===1)return d(N);function b(y){var D=et(y);return new Array(D[1]).fill(0).map((A,E)=>new Array(D[0]).fill(0).map((M,S)=>y[S][E]))}return b(h(b(N),1))}function w(N){for(var g=N.length,x=i(s(r(-1,r(m,p)),g)),b=[],y=1-g;yr(N[T],b[g-1+T])),...new Array(D-g).fill(0)],E=[...new Array(g+g-1).fill(0).map(($,T)=>s(1,b[T])),...new Array(D-(g+g-1)).fill(0)],M=d(A),S=d(E),C=new Array(D).fill(0).map(($,T)=>r(M[T],S[T])),B=o(l(v(l(C))),D),O=[],P=g-1;PE%2===0)),...d(N.filter((A,E)=>E%2===1))],b=0;b{var{typed:e,fft:n,dotDivide:a,conj:r}=t;return e(Cp,{"Array | Matrix":function(i){var p=Ve(i)?i.size():et(i);return a(r(n(r(i))),p.reduce((m,o)=>m*o,1))}})});function li(t){"@babel/helpers - typeof";return li=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},li(t)}function O2(t,e){if(li(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var a=n.call(t,e||"default");if(li(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function P2(t){var e=O2(t,"string");return li(e)=="symbol"?e:e+""}function Vt(t,e,n){return e=P2(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Tp(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function z2(t){for(var e=1;e{var{typed:e,add:n,subtract:a,multiply:r,divide:s,max:i,map:p,abs:m,isPositive:o,isNegative:l,larger:u,smaller:c,matrix:f,bignumber:v,unaryMinus:h}=t;function w(A){return function(E,M,S,C){var B=!(M.length===2&&(M.every(y)||M.every(Oa)));if(B)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var O=M[0],P=M[1],$=u(P,O),T=C.firstStep;if(T!==void 0&&!o(T))throw new Error('"firstStep" must be positive');var I=C.maxStep;if(I!==void 0&&!o(I))throw new Error('"maxStep" must be positive');var _=C.minStep;if(_&&l(_))throw new Error('"minStep" must be positive or zero');var W=[O,P,T,_,I].filter(R=>R!==void 0);if(!(W.every(y)||W.every(Oa)))throw new Error('Inconsistent type of "t" dependant variables');for(var K=1,Y=C.tol?C.tol:1e-4,z=C.minDelta?C.minDelta:.2,j=C.maxDelta?C.maxDelta:5,ge=C.maxIter?C.maxIter:1e4,te=[O,P,...S,I,_].some(at),[re,me,oe,ue]=te?[v(A.a),v(A.c),v(A.b),v(A.bp)]:[A.a,A.c,A.b,A.bp],we=T?$?T:h(T):s(a(P,O),K),be=[O],Ae=[S],_e=a(oe,ue),L=0,J=0,le=x($),V=b($);le(be[L],P);){var X=[];we=V(be[L],P,we),X.push(E(be[L],Ae[L]));for(var ee=1;eeOa(R)?R.value:R)));de1/4&&(be.push(n(be[L],we)),Ae.push(n(Ae[L],r(we,oe,X))),L++);var xe=.84*(Y/de)**(1/5);if(c(xe,z)?xe=z:u(xe,j)&&(xe=j),xe=te?v(xe):xe,we=r(we,xe),I&&u(m(we),I)?we=$?I:h(I):_&&c(m(we),_)&&(we=$?_:h(_)),J++,J>ge)throw new Error("Maximum number of iterations reached, try changing options")}return{t:be,y:Ae}}}function d(A,E,M,S){var C=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],B=[null,1/2,3/4,1],O=[2/9,1/3,4/9,0],P=[7/24,1/4,1/3,1/8],$={a:C,c:B,b:O,bp:P};return w($)(A,E,M,S)}function N(A,E,M,S){var C=[[],[.2],[.075,.225],[.9777777777777777,-3.7333333333333334,3.5555555555555554],[2.9525986892242035,-11.595793324188385,9.822892851699436,-.2908093278463649],[2.8462752525252526,-10.757575757575758,8.906422717743473,.2784090909090909,-.2735313036020583],[.09114583333333333,0,.44923629829290207,.6510416666666666,-.322376179245283,.13095238095238096]],B=[null,1/5,3/10,4/5,8/9,1,1],O=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],P=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],$={a:C,c:B,b:O,bp:P};return w($)(A,E,M,S)}function g(A,E,M,S){var C=S.method?S.method:"RK45",B={RK23:d,RK45:N};if(C.toUpperCase()in B){var O=z2({},S);return delete O.method,B[C.toUpperCase()](A,E,M,O)}else{var P=Object.keys(B).map(T=>'"'.concat(T,'"')),$="".concat(P.slice(0,-1).join(", ")," and ").concat(P.slice(-1));throw new Error('Unavailable method "'.concat(C,'". Available methods are ').concat($))}}function x(A){return A?c:u}function b(A){var E=A?u:c;return function(M,S,C){var B=n(M,C);return E(B,S)?a(S,M):C}}function y(A){return at(A)||tt(A)}function D(A,E,M,S){var C=g(A,E.toArray(),M.toArray(),S);return{t:f(C.t),y:f(C.y)}}return e("solveODE",{"function, Array, Array, Object":g,"function, Matrix, Matrix, Object":D,"function, Array, Array":(A,E,M)=>g(A,E,M,{}),"function, Matrix, Matrix":(A,E,M)=>D(A,E,M,{}),"function, Array, number | BigNumber | Unit":(A,E,M)=>{var S=g(A,E,[M],{});return{t:S.t,y:S.y.map(C=>C[0])}},"function, Matrix, number | BigNumber | Unit":(A,E,M)=>{var S=g(A,E.toArray(),[M],{});return{t:f(S.t),y:f(S.y.map(C=>C[0]))}},"function, Array, number | BigNumber | Unit, Object":(A,E,M,S)=>{var C=g(A,E,[M],S);return{t:C.t,y:C.y.map(B=>B[0])}},"function, Matrix, number | BigNumber | Unit, Object":(A,E,M,S)=>{var C=g(A,E.toArray(),[M],S);return{t:f(C.t),y:f(C.y.map(B=>B[0]))}}})}),L2="erf",k2=["typed"],U2=q(L2,k2,t=>{var{typed:e}=t;return e("name",{number:function(i){var p=Math.abs(i);return p>=V2?Qr(i):p<=G2?Qr(i)*n(p):p<=4?Qr(i)*(1-a(p)):Qr(i)*(1-r(p))},"Array | Matrix":e.referToSelf(s=>i=>it(i,s))});function n(s){var i=s*s,p=Dr[0][4]*i,m=i,o;for(o=0;o<3;o+=1)p=(p+Dr[0][o])*i,m=(m+es[0][o])*i;return s*(p+Dr[0][3])/(m+es[0][3])}function a(s){var i=Dr[1][8]*s,p=s,m;for(m=0;m<7;m+=1)i=(i+Dr[1][m])*s,p=(p+es[1][m])*s;var o=(i+Dr[1][7])/(p+es[1][7]),l=parseInt(s*16)/16,u=(s-l)*(s+l);return Math.exp(-l*l)*Math.exp(-u)*o}function r(s){var i=1/(s*s),p=Dr[2][5]*i,m=i,o;for(o=0;o<4;o+=1)p=(p+Dr[2][o])*i,m=(m+es[2][o])*i;var l=i*(p+Dr[2][4])/(m+es[2][4]);l=(H2-l)/s,i=parseInt(s*16)/16;var u=(s-i)*(s+i);return Math.exp(-i*i)*Math.exp(-u)*l}}),G2=.46875,H2=.5641895835477563,Dr=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],es=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],V2=Math.pow(2,53),$p="zeta",J2=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],Z2=q($p,J2,t=>{var{typed:e,config:n,multiply:a,pow:r,divide:s,factorial:i,equal:p,smallerEq:m,isNegative:o,gamma:l,sin:u,subtract:c,add:f,Complex:v,BigNumber:h,pi:w}=t;return e($p,{number:y=>d(y,D=>D,()=>20),BigNumber:y=>d(y,D=>new h(D),()=>Math.abs(Math.log10(n.epsilon))),Complex:N});function d(y,D,A){return p(y,0)?D(-.5):p(y,1)?D(NaN):isFinite(y)?g(y,D,A,E=>E):o(y)?D(NaN):D(1)}function N(y){return y.re===0&&y.im===0?new v(-.5):y.re===1?new v(NaN,NaN):y.re===1/0&&y.im===0?new v(1):y.im===1/0||y.re===-1/0?new v(NaN,NaN):g(y,D=>D,D=>Math.round(1.3*15+.9*Math.abs(D.im)),D=>D.re)}function g(y,D,A,E){var M=A(y);if(E(y)>-(M-1)/2)return b(y,D(M),D);var S=a(r(2,y),r(D(w),c(y,1)));return S=a(S,u(a(s(D(w),2),y))),S=a(S,l(c(1,y))),a(S,g(c(1,y),D,A,E))}function x(y,D){for(var A=y,E=y;m(E,D);E=f(E,1)){var M=s(a(i(f(D,c(E,1))),r(4,E)),a(i(c(D,E)),i(a(2,E))));A=f(A,M)}return a(D,A)}function b(y,D,A){for(var E=s(1,a(x(A(0),D),c(1,r(2,c(1,y))))),M=A(0),S=A(1);m(S,D);S=f(S,1))M=f(M,s(a((-1)**(S-1),x(S,D)),r(S,y)));return a(E,M)}}),Fp="mode",W2=["typed","isNaN","isNumeric"],Y2=q(Fp,W2,t=>{var{typed:e,isNaN:n,isNumeric:a}=t;return e(Fp,{"Array | Matrix":r,"...":function(i){return r(i)}});function r(s){s=ft(s.valueOf());var i=s.length;if(i===0)throw new Error("Cannot calculate mode of an empty array");for(var p={},m=[],o=0,l=0;lo&&(o=p[u],m=[u])}return m}});function da(t,e,n){var a;return String(t).indexOf("Unexpected type")!==-1?(a=arguments.length>2?" (type: "+St(n)+", value: "+JSON.stringify(n)+")":" (type: "+t.data.actual+")",new TypeError("Cannot calculate "+e+", unexpected type of argument"+a)):String(t).indexOf("complex numbers")!==-1?(a=arguments.length>2?" (type: "+St(n)+", value: "+JSON.stringify(n)+")":"",new TypeError("Cannot calculate "+e+", no ordering relation is defined for complex numbers"+a)):t}var _p="prod",X2=["typed","config","multiplyScalar","numeric"],Q2=q(_p,X2,t=>{var{typed:e,config:n,multiplyScalar:a,numeric:r}=t;return e(_p,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(p,m){throw new Error("prod(A, dim) is not yet supported")},"...":function(p){return s(p)}});function s(i){var p;if(Or(i,function(m){try{p=p===void 0?m:a(p,m)}catch(o){throw da(o,"prod",m)}}),typeof p=="string"&&(p=r(p,n.number)),p===void 0)throw new Error("Cannot calculate prod of an empty array");return p}}),Bp="format",j2=["typed"],K2=q(Bp,j2,t=>{var{typed:e}=t;return e(Bp,{any:nt,"any, Object | function | number | BigNumber":nt})}),Op="bin",e3=["typed","format"],t3=q(Op,e3,t=>{var{typed:e,format:n}=t;return e(Op,{"number | BigNumber":function(r){return n(r,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(r,s){return n(r,{notation:"bin",wordSize:s})}})}),Pp="oct",a3=["typed","format"],r3=q(Pp,a3,t=>{var{typed:e,format:n}=t;return e(Pp,{"number | BigNumber":function(r){return n(r,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(r,s){return n(r,{notation:"oct",wordSize:s})}})}),zp="hex",n3=["typed","format"],s3=q(zp,n3,t=>{var{typed:e,format:n}=t;return e(zp,{"number | BigNumber":function(r){return n(r,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(r,s){return n(r,{notation:"hex",wordSize:s})}})}),Ng=/\$([\w.]+)/g,Rp="print",i3=["typed"],Eg=q(Rp,i3,t=>{var{typed:e}=t;return e(Rp,{"string, Object | Array":Ip,"string, Object | Array, number | Object":Ip})});function Ip(t,e,n){return t.replace(Ng,function(a,r){var s=r.split("."),i=e[s.shift()];for(i!==void 0&&i.isMatrix&&(i=i.toArray());s.length&&i!==void 0;){var p=s.shift();i=p?i[p]:i+"."}return i!==void 0?sa(i)?i:nt(i,n):a})}var qp="to",o3=["typed","matrix","concat"],l3=q(qp,o3,t=>{var{typed:e,matrix:n,concat:a}=t,r=Tt({typed:e,matrix:n,concat:a});return e(qp,{"Unit, Unit | string":(s,i)=>s.to(i)},r({Ds:!0}))}),Lp="isPrime",m3=["typed"],u3=q(Lp,m3,t=>{var{typed:e}=t;return e(Lp,{number:function(a){if(a*0!==0)return!1;if(a<=3)return a>1;if(a%2===0||a%3===0)return!1;for(var r=5;r*r<=a;r+=6)if(a%r===0||a%(r+2)===0)return!1;return!0},BigNumber:function(a){if(a.toNumber()*0!==0)return!1;if(a.lte(3))return a.gt(1);if(a.mod(2).eq(0)||a.mod(3).eq(0))return!1;if(a.lt(Math.pow(2,32))){for(var r=a.toNumber(),s=5;s*s<=r;s+=6)if(r%s===0||r%(s+2)===0)return!1;return!0}function i(N,g,x){for(var b=1;!g.eq(0);)g.mod(2).eq(0)?(g=g.div(2),N=N.mul(N).mod(x)):(g=g.sub(1),b=N.mul(b).mod(x));return b}var p=a.constructor.clone({precision:a.toFixed(0).length*2});a=new p(a);for(var m=0,o=a.sub(1);o.mod(2).eq(0);)o=o.div(2),m+=1;var l=null;if(a.lt("3317044064679887385961981"))l=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(N=>Na=>it(a,n))})}),p3="numeric",c3=["number","?bignumber","?fraction"],f3=q(p3,c3,t=>{var{number:e,bignumber:n,fraction:a}=t,r={string:!0,number:!0,BigNumber:!0,Fraction:!0},s={number:i=>e(i),BigNumber:n?i=>n(i):Kl,Fraction:a?i=>a(i):dg};return function(p){var m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",o=arguments.length>2?arguments[2]:void 0;if(o!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var l=St(p);if(!(l in r))throw new TypeError("Cannot convert "+p+' of type "'+l+'"; valid input types are '+Object.keys(r).join(", "));if(!(m in s))throw new TypeError("Cannot convert "+p+' to type "'+m+'"; valid output types are '+Object.keys(s).join(", "));return m===l?p:s[m](p)}}),kp="divideScalar",h3=["typed","numeric"],v3=q(kp,h3,t=>{var{typed:e,numeric:n}=t;return e(kp,{"number, number":function(r,s){return r/s},"Complex, Complex":function(r,s){return r.div(s)},"BigNumber, BigNumber":function(r,s){return r.div(s)},"Fraction, Fraction":function(r,s){return r.div(s)},"Unit, number | Complex | Fraction | BigNumber | Unit":(a,r)=>a.divide(r),"number | Fraction | Complex | BigNumber, Unit":(a,r)=>r.divideInto(a)})}),Up="pow",g3=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],d3=q(Up,g3,t=>{var{typed:e,config:n,identity:a,multiply:r,matrix:s,inv:i,number:p,fraction:m,Complex:o}=t;return e(Up,{"number, number":l,"Complex, Complex":function(v,h){return v.pow(h)},"BigNumber, BigNumber":function(v,h){return h.isInteger()||v>=0||n.predictable?v.pow(h):new o(v.toNumber(),0).pow(h.toNumber(),0)},"Fraction, Fraction":function(v,h){var w=v.pow(h);if(w!=null)return w;if(n.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return l(v.valueOf(),h.valueOf())},"Array, number":u,"Array, BigNumber":function(v,h){return u(v,h.toNumber())},"Matrix, number":c,"Matrix, BigNumber":function(v,h){return c(v,h.toNumber())},"Unit, number | BigNumber":function(v,h){return v.pow(h)}});function l(f,v){if(n.predictable&&!qe(v)&&f<0)try{var h=m(v),w=p(h);if((v===w||Math.abs((v-w)/v)<1e-14)&&h.d%2===1)return(h.n%2===0?1:-1)*Math.pow(-f,v)}catch{}return n.predictable&&(f<-1&&v===1/0||f>-1&&f<0&&v===-1/0)?NaN:qe(v)||f>=0||n.predictable?Sv(f,v):f*f<1&&v===1/0||f*f>1&&v===-1/0?0:new o(f,0).pow(v,0)}function u(f,v){if(!qe(v))throw new TypeError("For A^b, b must be an integer (value is "+v+")");var h=et(f);if(h.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+h.length+" dimensions)");if(h[0]!==h[1])throw new Error("For A^b, A must be square (size is "+h[0]+"x"+h[1]+")");if(v<0)try{return u(i(f),-v)}catch(N){throw N.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+v+")"):N}for(var w=a(h[0]).valueOf(),d=f;v>=1;)(v&1)===1&&(w=r(d,w)),v>>=1,d=r(d,d);return w}function c(f,v){return s(u(f.valueOf(),v))}}),ts="Number of decimals in function round must be an integer",Gp="round",y3=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],w3=q(Gp,y3,t=>{var{typed:e,config:n,matrix:a,equalScalar:r,zeros:s,BigNumber:i,DenseMatrix:p}=t,m=aa({typed:e,equalScalar:r}),o=Jt({typed:e,DenseMatrix:p}),l=Xa({typed:e});function u(c){return Math.abs(gi(c).exponent)}return e(Gp,{number:function(f){var v=ei(f,u(n.epsilon)),h=ga(f,v,n.epsilon)?v:f;return ei(h)},"number, number":function(f,v){var h=u(n.epsilon);if(v>=h)return ei(f,v);var w=ei(f,h),d=ga(f,w,n.epsilon)?w:f;return ei(d,v)},"number, BigNumber":function(f,v){if(!v.isInteger())throw new TypeError(ts);return new i(f).toDecimalPlaces(v.toNumber())},Complex:function(f){return f.round()},"Complex, number":function(f,v){if(v%1)throw new TypeError(ts);return f.round(v)},"Complex, BigNumber":function(f,v){if(!v.isInteger())throw new TypeError(ts);var h=v.toNumber();return f.round(h)},BigNumber:function(f){var v=new i(f).toDecimalPlaces(u(n.epsilon)),h=Ia(f,v,n.epsilon)?v:f;return h.toDecimalPlaces(0)},"BigNumber, BigNumber":function(f,v){if(!v.isInteger())throw new TypeError(ts);var h=u(n.epsilon);if(v>=h)return f.toDecimalPlaces(v.toNumber());var w=f.toDecimalPlaces(h),d=Ia(f,w,n.epsilon)?w:f;return d.toDecimalPlaces(v.toNumber())},Fraction:function(f){return f.round()},"Fraction, number":function(f,v){if(v%1)throw new TypeError(ts);return f.round(v)},"Fraction, BigNumber":function(f,v){if(!v.isInteger())throw new TypeError(ts);return f.round(v.toNumber())},"Unit, number, Unit":e.referToSelf(c=>function(f,v,h){var w=f.toNumeric(h);return h.multiply(c(w,v))}),"Unit, BigNumber, Unit":e.referToSelf(c=>(f,v,h)=>c(f,v.toNumber(),h)),"Unit, Unit":e.referToSelf(c=>(f,v)=>c(f,0,v)),"Array | Matrix, number, Unit":e.referToSelf(c=>(f,v,h)=>it(f,w=>c(w,v,h))),"Array | Matrix, BigNumber, Unit":e.referToSelf(c=>(f,v,h)=>c(f,v.toNumber(),h)),"Array | Matrix, Unit":e.referToSelf(c=>(f,v)=>c(f,0,v)),"Array | Matrix":e.referToSelf(c=>f=>it(f,c)),"SparseMatrix, number | BigNumber":e.referToSelf(c=>(f,v)=>m(f,v,c,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(c=>(f,v)=>l(f,v,c,!1)),"Array, number | BigNumber":e.referToSelf(c=>(f,v)=>l(a(f),v,c,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":e.referToSelf(c=>(f,v)=>r(f,0)?s(v.size(),v.storage()):o(v,f,c,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":e.referToSelf(c=>(f,v)=>r(f,0)?s(v.size(),v.storage()):l(v,f,c,!0)),"number | Complex | BigNumber | Fraction, Array":e.referToSelf(c=>(f,v)=>l(a(v),f,c,!0).valueOf())})}),Hp="log",x3=["config","typed","divideScalar","Complex"],b3=q(Hp,x3,t=>{var{typed:e,config:n,divideScalar:a,Complex:r}=t;return e(Hp,{number:function(i){return i>=0||n.predictable?wy(i):new r(i,0).log()},Complex:function(i){return i.log()},BigNumber:function(i){return!i.isNegative()||n.predictable?i.ln():new r(i.toNumber(),0).log()},"any, any":e.referToSelf(s=>(i,p)=>a(s(i),s(p)))})}),Vp="log1p",N3=["typed","config","divideScalar","log","Complex"],E3=q(Vp,N3,t=>{var{typed:e,config:n,divideScalar:a,log:r,Complex:s}=t;return e(Vp,{number:function(m){return m>=-1||n.predictable?g0(m):i(new s(m,0))},Complex:i,BigNumber:function(m){var o=m.plus(1);return!o.isNegative()||n.predictable?o.ln():i(new s(m.toNumber(),0))},"Array | Matrix":e.referToSelf(p=>m=>it(m,p)),"any, any":e.referToSelf(p=>(m,o)=>a(p(m),r(o)))});function i(p){var m=p.re+1;return new s(Math.log(Math.sqrt(m*m+p.im*p.im)),Math.atan2(p.im,m))}}),Jp="nthRoots",D3=["config","typed","divideScalar","Complex"],A3=q(Jp,D3,t=>{var{typed:e,config:n,divideScalar:a,Complex:r}=t,s=[function(m){return new r(m,0)},function(m){return new r(0,m)},function(m){return new r(-m,0)},function(m){return new r(0,-m)}];function i(p,m){if(m<0)throw new Error("Root must be greater than zero");if(m===0)throw new Error("Root must be non-zero");if(m%1!==0)throw new Error("Root must be an integer");if(p===0||p.abs()===0)return[new r(0,0)];var o=typeof p=="number",l;(o||p.re===0||p.im===0)&&(o?l=2*+(p<0):p.im===0?l=2*+(p.re<0):l=2*+(p.im<0)+1);for(var u=p.arg(),c=p.abs(),f=[],v=Math.pow(c,1/m),h=0;h{var{typed:e,equalScalar:n,matrix:a,pow:r,DenseMatrix:s,concat:i}=t,p=ya({typed:e}),m=yr({typed:e,DenseMatrix:s}),o=aa({typed:e,equalScalar:n}),l=Jt({typed:e,DenseMatrix:s}),u=Tt({typed:e,matrix:a,concat:i}),c={};for(var f in r.signatures)Object.prototype.hasOwnProperty.call(r.signatures,f)&&!f.includes("Matrix")&&!f.includes("Array")&&(c[f]=r.signatures[f]);var v=e(c);return e(Zp,u({elop:v,SS:m,DS:p,Ss:o,sS:l}))}),Wp="dotDivide",C3=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],T3=q(Wp,C3,t=>{var{typed:e,matrix:n,equalScalar:a,divideScalar:r,DenseMatrix:s,concat:i}=t,p=Qa({typed:e,equalScalar:a}),m=ya({typed:e}),o=yr({typed:e,DenseMatrix:s}),l=aa({typed:e,equalScalar:a}),u=Jt({typed:e,DenseMatrix:s}),c=Tt({typed:e,matrix:n,concat:i});return e(Wp,c({elop:r,SS:o,DS:m,SD:p,Ss:l,sS:u}))});function yi(t){var{DenseMatrix:e}=t;return function(a,r,s){var i=a.size();if(i.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+nt(i)+")");var p=i[0],m=i[1];if(p!==m)throw new RangeError("Matrix must be square (size: "+nt(i)+")");var o=[];if(Ve(r)){var l=r.size(),u=r._data;if(l.length===1){if(l[0]!==p)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var c=0;c{var{typed:e,matrix:n,divideScalar:a,multiplyScalar:r,subtractScalar:s,equalScalar:i,DenseMatrix:p}=t,m=yi({DenseMatrix:p});return e(Yp,{"SparseMatrix, Array | Matrix":function(c,f){return l(c,f)},"DenseMatrix, Array | Matrix":function(c,f){return o(c,f)},"Array, Array | Matrix":function(c,f){var v=n(c),h=o(v,f);return h.valueOf()}});function o(u,c){c=m(u,c,!0);for(var f=c._data,v=u._size[0],h=u._size[1],w=[],d=u._data,N=0;Nx&&(D.push(w[S]),A.push(C))}if(i(y,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var B=a(b,y),O=0,P=A.length;O{var{typed:e,matrix:n,divideScalar:a,multiplyScalar:r,subtractScalar:s,equalScalar:i,DenseMatrix:p}=t,m=yi({DenseMatrix:p});return e(Xp,{"SparseMatrix, Array | Matrix":function(c,f){return l(c,f)},"DenseMatrix, Array | Matrix":function(c,f){return o(c,f)},"Array, Array | Matrix":function(c,f){var v=n(c),h=o(v,f);return h.valueOf()}});function o(u,c){c=m(u,c,!0);for(var f=c._data,v=u._size[0],h=u._size[1],w=[],d=u._data,N=h-1;N>=0;N--){var g=f[N][0]||0,x=void 0;if(i(g,0))x=0;else{var b=d[N][N];if(i(b,0))throw new Error("Linear system cannot be solved since matrix is singular");x=a(g,b);for(var y=N-1;y>=0;y--)f[y]=[s(f[y][0]||0,r(x,d[y][N]))]}w[N]=[x]}return new p({data:w,size:[v,1]})}function l(u,c){c=m(u,c,!0);for(var f=c._data,v=u._size[0],h=u._size[1],w=u._values,d=u._index,N=u._ptr,g=[],x=h-1;x>=0;x--){var b=f[x][0]||0;if(i(b,0))g[x]=[0];else{for(var y=0,D=[],A=[],E=N[x],M=N[x+1],S=M-1;S>=E;S--){var C=d[S];C===x?y=w[S]:C{var{typed:e,matrix:n,divideScalar:a,multiplyScalar:r,subtractScalar:s,equalScalar:i,DenseMatrix:p}=t,m=yi({DenseMatrix:p});return e(Qp,{"SparseMatrix, Array | Matrix":function(c,f){return l(c,f)},"DenseMatrix, Array | Matrix":function(c,f){return o(c,f)},"Array, Array | Matrix":function(c,f){var v=n(c),h=o(v,f);return h.map(w=>w.valueOf())}});function o(u,c){for(var f=[m(u,c,!0)._data.map(A=>A[0])],v=u._data,h=u._size[0],w=u._size[1],d=0;dnew p({data:A.map(E=>[E]),size:[h,1]}))}function l(u,c){for(var f=[m(u,c,!0)._data.map(K=>K[0])],v=u._size[0],h=u._size[1],w=u._values,d=u._index,N=u._ptr,g=0;gg&&(D.push(w[C]),A.push(B))}if(i(S,0))if(i(y[g],0)){if(b===0){var T=[...y];T[g]=1;for(var I=0,_=A.length;I<_;I++){var W=A[I];T[W]=s(T[W],D[I])}f.push(T)}}else{if(b===0)return[];f.splice(b,1),b-=1,x-=1}else{y[g]=a(y[g],S);for(var O=0,P=A.length;Onew p({data:K.map(Y=>[Y]),size:[v,1]}))}}),jp="usolveAll",z3=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],R3=q(jp,z3,t=>{var{typed:e,matrix:n,divideScalar:a,multiplyScalar:r,subtractScalar:s,equalScalar:i,DenseMatrix:p}=t,m=yi({DenseMatrix:p});return e(jp,{"SparseMatrix, Array | Matrix":function(c,f){return l(c,f)},"DenseMatrix, Array | Matrix":function(c,f){return o(c,f)},"Array, Array | Matrix":function(c,f){var v=n(c),h=o(v,f);return h.map(w=>w.valueOf())}});function o(u,c){for(var f=[m(u,c,!0)._data.map(A=>A[0])],v=u._data,h=u._size[0],w=u._size[1],d=w-1;d>=0;d--)for(var N=f.length,g=0;g=0;D--)y[D]=s(y[D],v[D][d]);f.push(y)}}else{if(g===0)return[];f.splice(g,1),g-=1,N-=1}else{x[d]=a(x[d],v[d][d]);for(var b=d-1;b>=0;b--)x[b]=s(x[b],r(x[d],v[b][d]))}}return f.map(A=>new p({data:A.map(E=>[E]),size:[h,1]}))}function l(u,c){for(var f=[m(u,c,!0)._data.map(K=>K[0])],v=u._size[0],h=u._size[1],w=u._values,d=u._index,N=u._ptr,g=h-1;g>=0;g--)for(var x=f.length,b=0;b=E;C--){var B=d[C];B===g?S=w[C]:Bnew p({data:K.map(Y=>[Y]),size:[v,1]}))}}),I3="matAlgo08xS0Sid",q3=["typed","equalScalar"],em=q(I3,q3,t=>{var{typed:e,equalScalar:n}=t;return function(r,s,i){var p=r._values,m=r._index,o=r._ptr,l=r._size,u=r._datatype||r._data===void 0?r._datatype:r.getDataType(),c=s._values,f=s._index,v=s._ptr,h=s._size,w=s._datatype||s._data===void 0?s._datatype:s.getDataType();if(l.length!==h.length)throw new st(l.length,h.length);if(l[0]!==h[0]||l[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+h+")");if(!p||!c)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var d=l[0],N=l[1],g,x=n,b=0,y=i;typeof u=="string"&&u===w&&u!=="mixed"&&(g=u,x=e.find(n,[g,g]),b=e.convert(0,g),y=e.find(i,[g,g]));for(var D=[],A=[],E=[],M=[],S=[],C,B,O,P,$=0;${var{typed:e,matrix:n}=t;return{"Array, number":e.referTo("DenseMatrix, number",a=>(r,s)=>a(n(r),s).valueOf()),"Array, BigNumber":e.referTo("DenseMatrix, BigNumber",a=>(r,s)=>a(n(r),s).valueOf()),"number, Array":e.referTo("number, DenseMatrix",a=>(r,s)=>a(r,n(s)).valueOf()),"BigNumber, Array":e.referTo("BigNumber, DenseMatrix",a=>(r,s)=>a(r,n(s)).valueOf())}}),Kp="leftShift",L3=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],k3=q(Kp,L3,t=>{var{typed:e,matrix:n,equalScalar:a,zeros:r,DenseMatrix:s,concat:i}=t,p=rn({typed:e}),m=Qa({typed:e,equalScalar:a}),o=em({typed:e,equalScalar:a}),l=Dn({typed:e,DenseMatrix:s}),u=aa({typed:e,equalScalar:a}),c=Xa({typed:e}),f=Tt({typed:e,matrix:n,concat:i}),v=tm({typed:e,matrix:n});return e(Kp,{"number, number":_v,"BigNumber, BigNumber":ob,"SparseMatrix, number | BigNumber":e.referToSelf(h=>(w,d)=>a(d,0)?w.clone():u(w,d,h,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(h=>(w,d)=>a(d,0)?w.clone():c(w,d,h,!1)),"number | BigNumber, SparseMatrix":e.referToSelf(h=>(w,d)=>a(w,0)?r(d.size(),d.storage()):l(d,w,h,!0)),"number | BigNumber, DenseMatrix":e.referToSelf(h=>(w,d)=>a(w,0)?r(d.size(),d.storage()):c(d,w,h,!0))},v,f({SS:o,DS:p,SD:m}))}),ec="rightArithShift",U3=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],G3=q(ec,U3,t=>{var{typed:e,matrix:n,equalScalar:a,zeros:r,DenseMatrix:s,concat:i}=t,p=rn({typed:e}),m=Qa({typed:e,equalScalar:a}),o=em({typed:e,equalScalar:a}),l=Dn({typed:e,DenseMatrix:s}),u=aa({typed:e,equalScalar:a}),c=Xa({typed:e}),f=Tt({typed:e,matrix:n,concat:i}),v=tm({typed:e,matrix:n});return e(ec,{"number, number":Bv,"BigNumber, BigNumber":lb,"SparseMatrix, number | BigNumber":e.referToSelf(h=>(w,d)=>a(d,0)?w.clone():u(w,d,h,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(h=>(w,d)=>a(d,0)?w.clone():c(w,d,h,!1)),"number | BigNumber, SparseMatrix":e.referToSelf(h=>(w,d)=>a(w,0)?r(d.size(),d.storage()):l(d,w,h,!0)),"number | BigNumber, DenseMatrix":e.referToSelf(h=>(w,d)=>a(w,0)?r(d.size(),d.storage()):c(d,w,h,!0))},v,f({SS:o,DS:p,SD:m}))}),tc="rightLogShift",H3=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],V3=q(tc,H3,t=>{var{typed:e,matrix:n,equalScalar:a,zeros:r,DenseMatrix:s,concat:i}=t,p=rn({typed:e}),m=Qa({typed:e,equalScalar:a}),o=em({typed:e,equalScalar:a}),l=Dn({typed:e,DenseMatrix:s}),u=aa({typed:e,equalScalar:a}),c=Xa({typed:e}),f=Tt({typed:e,matrix:n,concat:i}),v=tm({typed:e,matrix:n});return e(tc,{"number, number":Ov,"SparseMatrix, number | BigNumber":e.referToSelf(h=>(w,d)=>a(d,0)?w.clone():u(w,d,h,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(h=>(w,d)=>a(d,0)?w.clone():c(w,d,h,!1)),"number | BigNumber, SparseMatrix":e.referToSelf(h=>(w,d)=>a(w,0)?r(d.size(),d.storage()):l(d,w,h,!0)),"number | BigNumber, DenseMatrix":e.referToSelf(h=>(w,d)=>a(w,0)?r(d.size(),d.storage()):c(d,w,h,!0))},v,f({SS:o,DS:p,SD:m}))}),ac="and",J3=["typed","matrix","equalScalar","zeros","not","concat"],Dg=q(ac,J3,t=>{var{typed:e,matrix:n,equalScalar:a,zeros:r,not:s,concat:i}=t,p=Qa({typed:e,equalScalar:a}),m=Go({typed:e,equalScalar:a}),o=aa({typed:e,equalScalar:a}),l=Xa({typed:e}),u=Tt({typed:e,matrix:n,concat:i});return e(ac,{"number, number":qv,"Complex, Complex":function(f,v){return(f.re!==0||f.im!==0)&&(v.re!==0||v.im!==0)},"BigNumber, BigNumber":function(f,v){return!f.isZero()&&!v.isZero()&&!f.isNaN()&&!v.isNaN()},"Unit, Unit":e.referToSelf(c=>(f,v)=>c(f.value||0,v.value||0)),"SparseMatrix, any":e.referToSelf(c=>(f,v)=>s(v)?r(f.size(),f.storage()):o(f,v,c,!1)),"DenseMatrix, any":e.referToSelf(c=>(f,v)=>s(v)?r(f.size(),f.storage()):l(f,v,c,!1)),"any, SparseMatrix":e.referToSelf(c=>(f,v)=>s(f)?r(f.size(),f.storage()):o(v,f,c,!0)),"any, DenseMatrix":e.referToSelf(c=>(f,v)=>s(f)?r(f.size(),f.storage()):l(v,f,c,!0)),"Array, any":e.referToSelf(c=>(f,v)=>c(n(f),v).valueOf()),"any, Array":e.referToSelf(c=>(f,v)=>c(f,n(v)).valueOf())},u({SS:m,DS:p}))}),bo="compare",Z3=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],W3=q(bo,Z3,t=>{var{typed:e,config:n,equalScalar:a,matrix:r,BigNumber:s,Fraction:i,DenseMatrix:p,concat:m}=t,o=ya({typed:e}),l=Uo({typed:e,equalScalar:a}),u=Jt({typed:e,DenseMatrix:p}),c=Tt({typed:e,matrix:r,concat:m}),f=$s({typed:e});return e(bo,Y3({typed:e,config:n}),{"boolean, boolean":function(h,w){return h===w?0:h>w?1:-1},"BigNumber, BigNumber":function(h,w){return Ia(h,w,n.epsilon)?new s(0):new s(h.cmp(w))},"Fraction, Fraction":function(h,w){return new i(h.compare(w))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:l,DS:o,Ss:u}))}),Y3=q(bo,["typed","config"],t=>{var{typed:e,config:n}=t;return e(bo,{"number, number":function(r,s){return ga(r,s,n.epsilon)?0:r>s?1:-1}})}),X3=function t(e,n){var a=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,r=/(^[ ]*|[ ]*$)/g,s=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,i=/^0x[0-9a-f]+$/i,p=/^0/,m=function(g){return t.insensitive&&(""+g).toLowerCase()||""+g},o=m(e).replace(r,"")||"",l=m(n).replace(r,"")||"",u=o.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),c=l.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),f=parseInt(o.match(i),16)||u.length!==1&&o.match(s)&&Date.parse(o),v=parseInt(l.match(i),16)||f&&l.match(s)&&Date.parse(l)||null,h,w;if(v){if(fv)return 1}for(var d=0,N=Math.max(u.length,c.length);dw)return 1}return 0};const as=En(X3);var rc="compareNatural",Q3=["typed","compare"],j3=q(rc,Q3,t=>{var{typed:e,compare:n}=t,a=n.signatures["boolean,boolean"];return e(rc,{"any, any":r});function r(m,o){var l=St(m),u=St(o),c;if((l==="number"||l==="BigNumber"||l==="Fraction")&&(u==="number"||u==="BigNumber"||u==="Fraction"))return c=n(m,o),c.toString()!=="0"?c>0?1:-1:as(l,u);var f=["Array","DenseMatrix","SparseMatrix"];if(f.includes(l)||f.includes(u))return c=s(r,m,o),c!==0?c:as(l,u);if(l!==u)return as(l,u);if(l==="Complex")return K3(m,o);if(l==="Unit")return m.equalBase(o)?r(m.value,o.value):i(r,m.formatUnits(),o.formatUnits());if(l==="boolean")return a(m,o);if(l==="string")return as(m,o);if(l==="Object")return p(r,m,o);if(l==="null"||l==="undefined")return 0;throw new TypeError('Unsupported type of value "'+l+'"')}function s(m,o,l){return hn(o)&&hn(l)?i(m,o.toJSON().values,l.toJSON().values):hn(o)?s(m,o.toArray(),l):hn(l)?s(m,o,l.toArray()):io(o)?s(m,o.toJSON().data,l):io(l)?s(m,o,l.toJSON().data):Array.isArray(o)?Array.isArray(l)?i(m,o,l):s(m,o,[l]):s(m,[o],l)}function i(m,o,l){for(var u=0,c=Math.min(o.length,l.length);ul.length?1:o.lengthe.re?1:t.ree.im?1:t.im{var{typed:e,matrix:n,concat:a}=t,r=Tt({typed:e,matrix:n,concat:a});return e(nc,Nl,r({elop:Nl,Ds:!0}))}),No="equal",aN=["typed","matrix","equalScalar","DenseMatrix","concat"],rN=q(No,aN,t=>{var{typed:e,matrix:n,equalScalar:a,DenseMatrix:r,concat:s}=t,i=ya({typed:e}),p=yr({typed:e,DenseMatrix:r}),m=Jt({typed:e,DenseMatrix:r}),o=Tt({typed:e,matrix:n,concat:s});return e(No,nN({typed:e,equalScalar:a}),o({elop:a,SS:p,DS:i,Ss:m}))}),nN=q(No,["typed","equalScalar"],t=>{var{typed:e,equalScalar:n}=t;return e(No,{"any, any":function(r,s){return r===null?s===null:s===null?r===null:r===void 0?s===void 0:s===void 0?r===void 0:n(r,s)}})}),sc="equalText",sN=["typed","compareText","isZero"],iN=q(sc,sN,t=>{var{typed:e,compareText:n,isZero:a}=t;return e(sc,{"any, any":function(s,i){return a(n(s,i))}})}),Eo="smaller",oN=["typed","config","matrix","DenseMatrix","concat"],lN=q(Eo,oN,t=>{var{typed:e,config:n,matrix:a,DenseMatrix:r,concat:s}=t,i=ya({typed:e}),p=yr({typed:e,DenseMatrix:r}),m=Jt({typed:e,DenseMatrix:r}),o=Tt({typed:e,matrix:a,concat:s}),l=$s({typed:e});return e(Eo,mN({typed:e,config:n}),{"boolean, boolean":(u,c)=>uu.compare(c)===-1,"Complex, Complex":function(c,f){throw new TypeError("No ordering relation is defined for complex numbers")}},l,o({SS:p,DS:i,Ss:m}))}),mN=q(Eo,["typed","config"],t=>{var{typed:e,config:n}=t;return e(Eo,{"number, number":function(r,s){return r{var{typed:e,config:n,matrix:a,DenseMatrix:r,concat:s}=t,i=ya({typed:e}),p=yr({typed:e,DenseMatrix:r}),m=Jt({typed:e,DenseMatrix:r}),o=Tt({typed:e,matrix:a,concat:s}),l=$s({typed:e});return e(Do,cN({typed:e,config:n}),{"boolean, boolean":(u,c)=>u<=c,"BigNumber, BigNumber":function(c,f){return c.lte(f)||Ia(c,f,n.epsilon)},"Fraction, Fraction":(u,c)=>u.compare(c)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},l,o({SS:p,DS:i,Ss:m}))}),cN=q(Do,["typed","config"],t=>{var{typed:e,config:n}=t;return e(Do,{"number, number":function(r,s){return r<=s||ga(r,s,n.epsilon)}})}),Ao="larger",fN=["typed","config","matrix","DenseMatrix","concat"],hN=q(Ao,fN,t=>{var{typed:e,config:n,matrix:a,DenseMatrix:r,concat:s}=t,i=ya({typed:e}),p=yr({typed:e,DenseMatrix:r}),m=Jt({typed:e,DenseMatrix:r}),o=Tt({typed:e,matrix:a,concat:s}),l=$s({typed:e});return e(Ao,vN({typed:e,config:n}),{"boolean, boolean":(u,c)=>u>c,"BigNumber, BigNumber":function(c,f){return c.gt(f)&&!Ia(c,f,n.epsilon)},"Fraction, Fraction":(u,c)=>u.compare(c)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},l,o({SS:p,DS:i,Ss:m}))}),vN=q(Ao,["typed","config"],t=>{var{typed:e,config:n}=t;return e(Ao,{"number, number":function(r,s){return r>s&&!ga(r,s,n.epsilon)}})}),Mo="largerEq",gN=["typed","config","matrix","DenseMatrix","concat"],dN=q(Mo,gN,t=>{var{typed:e,config:n,matrix:a,DenseMatrix:r,concat:s}=t,i=ya({typed:e}),p=yr({typed:e,DenseMatrix:r}),m=Jt({typed:e,DenseMatrix:r}),o=Tt({typed:e,matrix:a,concat:s}),l=$s({typed:e});return e(Mo,yN({typed:e,config:n}),{"boolean, boolean":(u,c)=>u>=c,"BigNumber, BigNumber":function(c,f){return c.gte(f)||Ia(c,f,n.epsilon)},"Fraction, Fraction":(u,c)=>u.compare(c)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},l,o({SS:p,DS:i,Ss:m}))}),yN=q(Mo,["typed","config"],t=>{var{typed:e,config:n}=t;return e(Mo,{"number, number":function(r,s){return r>=s||ga(r,s,n.epsilon)}})}),ic="deepEqual",wN=["typed","equal"],xN=q(ic,wN,t=>{var{typed:e,equal:n}=t;return e(ic,{"any, any":function(s,i){return a(s.valueOf(),i.valueOf())}});function a(r,s){if(Array.isArray(r))if(Array.isArray(s)){var i=r.length;if(i!==s.length)return!1;for(var p=0;p{var{typed:e,config:n,equalScalar:a,matrix:r,DenseMatrix:s,concat:i}=t,p=ya({typed:e}),m=yr({typed:e,DenseMatrix:s}),o=Jt({typed:e,DenseMatrix:s}),l=Tt({typed:e,matrix:r,concat:i});return e(So,EN({typed:e,equalScalar:a}),l({elop:u,SS:m,DS:p,Ss:o}));function u(c,f){return!a(c,f)}}),EN=q(So,["typed","equalScalar"],t=>{var{typed:e,equalScalar:n}=t;return e(So,{"any, any":function(r,s){return r===null?s!==null:s===null?r!==null:r===void 0?s!==void 0:s===void 0?r!==void 0:!n(r,s)}})}),oc="partitionSelect",DN=["typed","isNumeric","isNaN","compare"],AN=q(oc,DN,t=>{var{typed:e,isNumeric:n,isNaN:a,compare:r}=t,s=r,i=(o,l)=>-r(o,l);return e(oc,{"Array | Matrix, number":function(l,u){return p(l,u,s)},"Array | Matrix, number, string":function(l,u,c){if(c==="asc")return p(l,u,s);if(c==="desc")return p(l,u,i);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":p});function p(o,l,u){if(!qe(l)||l<0)throw new Error("k must be a non-negative integer");if(Ve(o)){var c=o.size();if(c.length>1)throw new Error("Only one dimensional matrices supported");return m(o.valueOf(),l,u)}if(Array.isArray(o))return m(o,l,u)}function m(o,l,u){if(l>=o.length)throw new Error("k out of bounds");for(var c=0;c=0){var N=o[w];o[w]=o[h],o[h]=N,--w}else++h;u(o[h],d)>0&&--h,l<=h?v=h:f=h+1}return o[l]}}),lc="sort",MN=["typed","matrix","compare","compareNatural"],SN=q(lc,MN,t=>{var{typed:e,matrix:n,compare:a,compareNatural:r}=t,s=a,i=(l,u)=>-a(l,u);return e(lc,{Array:function(u){return m(u),u.sort(s)},Matrix:function(u){return o(u),n(u.toArray().sort(s),u.storage())},"Array, function":function(u,c){return m(u),u.sort(c)},"Matrix, function":function(u,c){return o(u),n(u.toArray().sort(c),u.storage())},"Array, string":function(u,c){return m(u),u.sort(p(c))},"Matrix, string":function(u,c){return o(u),n(u.toArray().sort(p(c)),u.storage())}});function p(l){if(l==="asc")return s;if(l==="desc")return i;if(l==="natural")return r;throw new Error('String "asc", "desc", or "natural" expected')}function m(l){if(et(l).length!==1)throw new Error("One dimensional array expected")}function o(l){if(l.size().length!==1)throw new Error("One dimensional matrix expected")}}),mc="max",CN=["typed","config","numeric","larger"],Ag=q(mc,CN,t=>{var{typed:e,config:n,numeric:a,larger:r}=t;return e(mc,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(m,o){return Lo(m,o.valueOf(),s)},"...":function(m){if(Ss(m))throw new TypeError("Scalar values expected in function max");return i(m)}});function s(p,m){try{return r(p,m)?p:m}catch(o){throw da(o,"max",m)}}function i(p){var m;if(Or(p,function(o){try{isNaN(o)&&typeof o=="number"?m=NaN:(m===void 0||r(o,m))&&(m=o)}catch(l){throw da(l,"max",o)}}),m===void 0)throw new Error("Cannot calculate max of an empty array");return typeof m=="string"&&(m=a(m,n.number)),m}}),uc="min",TN=["typed","config","numeric","smaller"],Mg=q(uc,TN,t=>{var{typed:e,config:n,numeric:a,smaller:r}=t;return e(uc,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(m,o){return Lo(m,o.valueOf(),s)},"...":function(m){if(Ss(m))throw new TypeError("Scalar values expected in function min");return i(m)}});function s(p,m){try{return r(p,m)?p:m}catch(o){throw da(o,"min",m)}}function i(p){var m;if(Or(p,function(o){try{isNaN(o)&&typeof o=="number"?m=NaN:(m===void 0||r(o,m))&&(m=o)}catch(l){throw da(l,"min",o)}}),m===void 0)throw new Error("Cannot calculate min of an empty array");return typeof m=="string"&&(m=a(m,n.number)),m}}),$N="ImmutableDenseMatrix",FN=["smaller","DenseMatrix"],_N=q($N,FN,t=>{var{smaller:e,DenseMatrix:n}=t;function a(r,s){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if(s&&!sa(s))throw new Error("Invalid datatype: "+s);if(Ve(r)||vt(r)){var i=new n(r,s);this._data=i._data,this._size=i._size,this._datatype=i._datatype,this._min=null,this._max=null}else if(r&&vt(r.data)&&vt(r.size))this._data=r.data,this._size=r.size,this._datatype=r.datatype,this._min=typeof r.min<"u"?r.min:null,this._max=typeof r.max<"u"?r.max:null;else{if(r)throw new TypeError("Unsupported type of data ("+St(r)+")");this._data=[],this._size=[0],this._datatype=s,this._min=null,this._max=null}}return a.prototype=new n,a.prototype.type="ImmutableDenseMatrix",a.prototype.isImmutableDenseMatrix=!0,a.prototype.subset=function(r){switch(arguments.length){case 1:{var s=n.prototype.subset.call(this,r);return Ve(s)?new a({data:s._data,size:s._size,datatype:s._datatype}):s}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},a.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},a.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},a.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},a.prototype.clone=function(){return new a({data:Xe(this._data),size:Xe(this._size),datatype:this._datatype})},a.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},a.fromJSON=function(r){return new a(r)},a.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},a.prototype.min=function(){if(this._min===null){var r=null;this.forEach(function(s){(r===null||e(s,r))&&(r=s)}),this._min=r!==null?r:void 0}return this._min},a.prototype.max=function(){if(this._max===null){var r=null;this.forEach(function(s){(r===null||e(r,s))&&(r=s)}),this._max=r!==null?r:void 0}return this._max},a},{isClass:!0}),BN="Index",ON=["ImmutableDenseMatrix","getMatrixDataType"],PN=q(BN,ON,t=>{var{ImmutableDenseMatrix:e,getMatrixDataType:n}=t;function a(s){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var i=0,p=arguments.length;i{n&&e.push(a)}),e}var zN="FibonacciHeap",RN=["smaller","larger"],IN=q(zN,RN,t=>{var{smaller:e,larger:n}=t,a=1/Math.log((1+Math.sqrt(5))/2);function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}r.prototype.type="FibonacciHeap",r.prototype.isFibonacciHeap=!0,r.prototype.insert=function(l,u){var c={key:l,value:u,degree:0};if(this._minimum){var f=this._minimum;c.left=f,c.right=f.right,f.right=c,c.right.left=c,e(l,f.key)&&(this._minimum=c)}else c.left=c,c.right=c,this._minimum=c;return this._size++,c},r.prototype.size=function(){return this._size},r.prototype.clear=function(){this._minimum=null,this._size=0},r.prototype.isEmpty=function(){return this._size===0},r.prototype.extractMinimum=function(){var l=this._minimum;if(l===null)return l;for(var u=this._minimum,c=l.degree,f=l.child;c>0;){var v=f.right;f.left.right=f.right,f.right.left=f.left,f.left=u,f.right=u.right,u.right=f,f.right.left=f,f.parent=null,f=v,c--}return l.left.right=l.right,l.right.left=l.left,l===l.right?u=null:(u=l.right,u=o(u,this._size)),this._size--,this._minimum=u,l},r.prototype.remove=function(l){this._minimum=s(this._minimum,l,-1),this.extractMinimum()};function s(l,u,c){u.key=c;var f=u.parent;return f&&e(u.key,f.key)&&(i(l,u,f),p(l,f)),e(u.key,l.key)&&(l=u),l}function i(l,u,c){u.left.right=u.right,u.right.left=u.left,c.degree--,c.child===u&&(c.child=u.right),c.degree===0&&(c.child=null),u.left=l,u.right=l.right,l.right=u,u.right.left=u,u.parent=null,u.mark=!1}function p(l,u){var c=u.parent;c&&(u.mark?(i(l,u,c),p(c)):u.mark=!0)}var m=function(u,c){u.left.right=u.right,u.right.left=u.left,u.parent=c,c.child?(u.left=c.child,u.right=c.child.right,c.child.right=u,u.right.left=u):(c.child=u,u.right=u,u.left=u),c.degree++,u.mark=!1};function o(l,u){var c=Math.floor(Math.log(u)*a)+1,f=new Array(c),v=0,h=l;if(h)for(v++,h=h.right;h!==l;)v++,h=h.right;for(var w;v>0;){for(var d=h.degree,N=h.right;w=f[d],!!w;){if(n(h.key,w.key)){var g=w;w=h,h=g}m(w,h),f[d]=null,d++}f[d]=h,h=N,v--}l=null;for(var x=0;x{var{addScalar:e,equalScalar:n,FibonacciHeap:a}=t;function r(){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new a}return r.prototype.type="Spa",r.prototype.isSpa=!0,r.prototype.set=function(s,i){if(this._values[s])this._values[s].value=i;else{var p=this._heap.insert(s,i);this._values[s]=p}},r.prototype.get=function(s){var i=this._values[s];return i?i.value:0},r.prototype.accumulate=function(s,i){var p=this._values[s];p?p.value=e(p.value,i):(p=this._heap.insert(s,i),this._values[s]=p)},r.prototype.forEach=function(s,i,p){var m=this._heap,o=this._values,l=[],u=m.extractMinimum();for(u&&l.push(u);u&&u.key<=i;)u.key>=s&&(n(u.value,0)||p(u.key,u.value,this)),u=m.extractMinimum(),u&&l.push(u);for(var c=0;c{var{on:e,config:n,addScalar:a,subtractScalar:r,multiplyScalar:s,divideScalar:i,pow:p,abs:m,fix:o,round:l,equal:u,isNumeric:c,format:f,number:v,Complex:h,BigNumber:w,Fraction:d}=t,N=v;function g(L,J){if(!(this instanceof g))throw new Error("Constructor must be called with the new operator");if(!(L==null||c(L)||Fr(L)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,J===void 0)this.units=[],this.dimensions=I.map(V=>0);else if(typeof J=="string"){var le=g.parse(J);this.units=le.units,this.dimensions=le.dimensions}else if(Oa(J)&&J.value===null)this.fixPrefix=J.fixPrefix,this.skipAutomaticSimplification=J.skipAutomaticSimplification,this.dimensions=J.dimensions.slice(0),this.units=J.units.map(V=>Gt({},V));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(L)}Object.defineProperty(g,"name",{value:"Unit"}),g.prototype.constructor=g,g.prototype.type="Unit",g.prototype.isUnit=!0;var x,b,y;function D(){for(;y===" "||y===" ";)M()}function A(L){return L>="0"&&L<="9"||L==="."}function E(L){return L>="0"&&L<="9"}function M(){b++,y=x.charAt(b)}function S(L){b=L,y=x.charAt(b)}function C(){var L="",J=b;if(y==="+"?M():y==="-"&&(L+=y,M()),!A(y))return S(J),null;if(y==="."){if(L+=y,M(),!E(y))return S(J),null}else{for(;E(y);)L+=y,M();y==="."&&(L+=y,M())}for(;E(y);)L+=y,M();if(y==="E"||y==="e"){var le="",V=b;if(le+=y,M(),(y==="+"||y==="-")&&(le+=y,M()),!E(y))return S(V),L;for(L=L+le;E(y);)L+=y,M()}return L}function B(){for(var L="";E(y)||g.isValidAlpha(y);)L+=y,M();var J=L.charAt(0);return g.isValidAlpha(J)?L:null}function O(L){return y===L?(M(),L):null}g.parse=function(L,J){if(J=J||{},x=L,b=-1,y="",typeof x!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var le=new g;le.units=[];var V=1,X=!1;M(),D();var ee=C(),de=null;if(ee){if(n.number==="BigNumber")de=new w(ee);else if(n.number==="Fraction")try{de=new d(ee)}catch{de=parseFloat(ee)}else de=parseFloat(ee);D(),O("*")?(V=1,X=!0):O("/")&&(V=-1,X=!0)}for(var xe=[],R=1;;){for(D();y==="(";)xe.push(V),R*=V,V=1,M(),D();var U=void 0;if(y){var ae=y;if(U=B(),U===null)throw new SyntaxError('Unexpected "'+ae+'" in "'+x+'" at index '+b.toString())}else break;var he=P(U);if(he===null)throw new SyntaxError('Unit "'+U+'" not found.');var fe=V*R;if(D(),O("^")){D();var Ne=C();if(Ne===null)throw new SyntaxError('In "'+L+'", "^" must be followed by a floating-point number');fe*=Ne}le.units.push({unit:he.unit,prefix:he.prefix,power:fe});for(var Te=0;Te1||Math.abs(this.units[0].power-1)>1e-15},g.prototype._normalize=function(L){if(L==null||this.units.length===0)return L;for(var J=L,le=g._getNumberConverter(St(L)),V=0;V{if(ze(z,L)){var J=z[L],le=J.prefixes[""];return{unit:J,prefix:le}}for(var V in z)if(ze(z,V)&&B0(L,V)){var X=z[V],ee=L.length-V.length,de=L.substring(0,ee),xe=ze(X.prefixes,de)?X.prefixes[de]:void 0;if(xe!==void 0)return{unit:X,prefix:xe}}return null},{hasher:L=>L[0],limit:100});g.isValuelessUnit=function(L){return P(L)!==null},g.prototype.hasBase=function(L){if(typeof L=="string"&&(L=_[L]),!L)return!1;for(var J=0;J1e-12)return!1;return!0},g.prototype.equalBase=function(L){for(var J=0;J1e-12)return!1;return!0},g.prototype.equals=function(L){return this.equalBase(L)&&u(this.value,L.value)},g.prototype.multiply=function(L){for(var J=this.clone(),le=Oa(L)?L:new g(L),V=0;V1e-12&&(ze(re,xe)?J.push({unit:re[xe].unit,prefix:re[xe].prefix,power:L.dimensions[de]||0}):ee=!0)}J.length1e-12)if(ze(te.si,V))J.push({unit:te.si[V].unit,prefix:te.si[V].prefix,power:L.dimensions[le]||0});else throw new Error("Cannot express custom unit "+V+" in SI units")}return L.units=J,L.fixPrefix=!0,L.skipAutomaticSimplification=!0,this.value!==null?(L.value=null,this.to(L)):L},g.prototype.formatUnits=function(){for(var L="",J="",le=0,V=0,X=0;X0?(le++,L+=" "+this.units[X].prefix.name+this.units[X].unit.name,Math.abs(this.units[X].power-1)>1e-15&&(L+="^"+this.units[X].power)):this.units[X].power<0&&V++;if(V>0)for(var ee=0;ee0?(J+=" "+this.units[ee].prefix.name+this.units[ee].unit.name,Math.abs(this.units[ee].power+1)>1e-15&&(J+="^"+-this.units[ee].power)):(J+=" "+this.units[ee].prefix.name+this.units[ee].unit.name,J+="^"+this.units[ee].power));L=L.substr(1),J=J.substr(1),le>1&&V>0&&(L="("+L+")"),V>1&&le>0&&(J="("+J+")");var de=L;return le>0&&V>0&&(de+=" / "),de+=J,de},g.prototype.format=function(L){var J=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),le=!1;typeof J.value<"u"&&J.value!==null&&Fr(J.value)&&(le=Math.abs(J.value.re)<1e-14);for(var V in J.units)ze(J.units,V)&&J.units[V].unit&&(J.units[V].unit.name==="VA"&&le?J.units[V].unit=z.VAR:J.units[V].unit.name==="VAR"&&!le&&(J.units[V].unit=z.VA));J.units.length===1&&!J.fixPrefix&&Math.abs(J.units[0].power-Math.round(J.units[0].power))<1e-14&&(J.units[0].prefix=J._bestPrefix());var X=J._denormalize(J.value),ee=J.value!==null?f(X,L||{}):"",de=J.formatUnits();return J.value&&Fr(J.value)&&(ee="("+ee+")"),de.length>0&&ee.length>0&&(ee+=" "),ee+=de,ee},g.prototype._bestPrefix=function(){if(this.units.length!==1)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var L=this.value!==null?m(this.value):0,J=m(this.units[0].unit.value),le=this.units[0].prefix;if(L===0)return le;var V=this.units[0].power,X=Math.log(L/Math.pow(le.value*J,V))/Math.LN10-1.2;if(X>-2.200001&&X<1.800001)return le;X=Math.abs(X);var ee=this.units[0].unit.prefixes;for(var de in ee)if(ze(ee,de)){var xe=ee[de];if(xe.scientific){var R=Math.abs(Math.log(L/Math.pow(xe.value*J,V))/Math.LN10-1.2);(R0)},z={meter:{name:"meter",base:_.LENGTH,prefixes:T.LONG,value:1,offset:0},inch:{name:"inch",base:_.LENGTH,prefixes:T.NONE,value:.0254,offset:0},foot:{name:"foot",base:_.LENGTH,prefixes:T.NONE,value:.3048,offset:0},yard:{name:"yard",base:_.LENGTH,prefixes:T.NONE,value:.9144,offset:0},mile:{name:"mile",base:_.LENGTH,prefixes:T.NONE,value:1609.344,offset:0},link:{name:"link",base:_.LENGTH,prefixes:T.NONE,value:.201168,offset:0},rod:{name:"rod",base:_.LENGTH,prefixes:T.NONE,value:5.0292,offset:0},chain:{name:"chain",base:_.LENGTH,prefixes:T.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:_.LENGTH,prefixes:T.NONE,value:1e-10,offset:0},m:{name:"m",base:_.LENGTH,prefixes:T.SHORT,value:1,offset:0},in:{name:"in",base:_.LENGTH,prefixes:T.NONE,value:.0254,offset:0},ft:{name:"ft",base:_.LENGTH,prefixes:T.NONE,value:.3048,offset:0},yd:{name:"yd",base:_.LENGTH,prefixes:T.NONE,value:.9144,offset:0},mi:{name:"mi",base:_.LENGTH,prefixes:T.NONE,value:1609.344,offset:0},li:{name:"li",base:_.LENGTH,prefixes:T.NONE,value:.201168,offset:0},rd:{name:"rd",base:_.LENGTH,prefixes:T.NONE,value:5.02921,offset:0},ch:{name:"ch",base:_.LENGTH,prefixes:T.NONE,value:20.1168,offset:0},mil:{name:"mil",base:_.LENGTH,prefixes:T.NONE,value:254e-7,offset:0},m2:{name:"m2",base:_.SURFACE,prefixes:T.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:_.SURFACE,prefixes:T.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:_.SURFACE,prefixes:T.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:_.SURFACE,prefixes:T.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:_.SURFACE,prefixes:T.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:_.SURFACE,prefixes:T.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:_.SURFACE,prefixes:T.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:_.SURFACE,prefixes:T.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:_.SURFACE,prefixes:T.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:_.SURFACE,prefixes:T.NONE,value:1e4,offset:0},m3:{name:"m3",base:_.VOLUME,prefixes:T.CUBIC,value:1,offset:0},L:{name:"L",base:_.VOLUME,prefixes:T.SHORT,value:.001,offset:0},l:{name:"l",base:_.VOLUME,prefixes:T.SHORT,value:.001,offset:0},litre:{name:"litre",base:_.VOLUME,prefixes:T.LONG,value:.001,offset:0},cuin:{name:"cuin",base:_.VOLUME,prefixes:T.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:_.VOLUME,prefixes:T.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:_.VOLUME,prefixes:T.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:_.VOLUME,prefixes:T.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:_.VOLUME,prefixes:T.NONE,value:15e-6,offset:0},drop:{name:"drop",base:_.VOLUME,prefixes:T.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:_.VOLUME,prefixes:T.NONE,value:5e-8,offset:0},minim:{name:"minim",base:_.VOLUME,prefixes:T.NONE,value:6161152e-14,offset:0},fluiddram:{name:"fluiddram",base:_.VOLUME,prefixes:T.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:_.VOLUME,prefixes:T.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:_.VOLUME,prefixes:T.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:_.VOLUME,prefixes:T.NONE,value:1e-6,offset:0},cup:{name:"cup",base:_.VOLUME,prefixes:T.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:_.VOLUME,prefixes:T.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:_.VOLUME,prefixes:T.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:_.VOLUME,prefixes:T.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:_.VOLUME,prefixes:T.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:_.VOLUME,prefixes:T.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:_.VOLUME,prefixes:T.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:_.VOLUME,prefixes:T.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:_.VOLUME,prefixes:T.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:_.VOLUME,prefixes:T.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:_.VOLUME,prefixes:T.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:_.VOLUME,prefixes:T.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:_.VOLUME,prefixes:T.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:_.VOLUME,prefixes:T.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:_.VOLUME,prefixes:T.NONE,value:.1173478,offset:0},obl:{name:"obl",base:_.VOLUME,prefixes:T.NONE,value:.1589873,offset:0},g:{name:"g",base:_.MASS,prefixes:T.SHORT,value:.001,offset:0},gram:{name:"gram",base:_.MASS,prefixes:T.LONG,value:.001,offset:0},ton:{name:"ton",base:_.MASS,prefixes:T.SHORT,value:907.18474,offset:0},t:{name:"t",base:_.MASS,prefixes:T.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:_.MASS,prefixes:T.LONG,value:1e3,offset:0},grain:{name:"grain",base:_.MASS,prefixes:T.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:_.MASS,prefixes:T.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:_.MASS,prefixes:T.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:_.MASS,prefixes:T.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:_.MASS,prefixes:T.NONE,value:45.359237,offset:0},stick:{name:"stick",base:_.MASS,prefixes:T.NONE,value:.115,offset:0},stone:{name:"stone",base:_.MASS,prefixes:T.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:_.MASS,prefixes:T.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:_.MASS,prefixes:T.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:_.MASS,prefixes:T.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:_.MASS,prefixes:T.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:_.MASS,prefixes:T.NONE,value:45.359237,offset:0},s:{name:"s",base:_.TIME,prefixes:T.SHORT,value:1,offset:0},min:{name:"min",base:_.TIME,prefixes:T.NONE,value:60,offset:0},h:{name:"h",base:_.TIME,prefixes:T.NONE,value:3600,offset:0},second:{name:"second",base:_.TIME,prefixes:T.LONG,value:1,offset:0},sec:{name:"sec",base:_.TIME,prefixes:T.LONG,value:1,offset:0},minute:{name:"minute",base:_.TIME,prefixes:T.NONE,value:60,offset:0},hour:{name:"hour",base:_.TIME,prefixes:T.NONE,value:3600,offset:0},day:{name:"day",base:_.TIME,prefixes:T.NONE,value:86400,offset:0},week:{name:"week",base:_.TIME,prefixes:T.NONE,value:7*86400,offset:0},month:{name:"month",base:_.TIME,prefixes:T.NONE,value:2629800,offset:0},year:{name:"year",base:_.TIME,prefixes:T.NONE,value:31557600,offset:0},decade:{name:"decade",base:_.TIME,prefixes:T.NONE,value:315576e3,offset:0},century:{name:"century",base:_.TIME,prefixes:T.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:_.TIME,prefixes:T.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:_.FREQUENCY,prefixes:T.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:_.FREQUENCY,prefixes:T.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:_.ANGLE,prefixes:T.SHORT,value:1,offset:0},radian:{name:"radian",base:_.ANGLE,prefixes:T.LONG,value:1,offset:0},deg:{name:"deg",base:_.ANGLE,prefixes:T.SHORT,value:null,offset:0},degree:{name:"degree",base:_.ANGLE,prefixes:T.LONG,value:null,offset:0},grad:{name:"grad",base:_.ANGLE,prefixes:T.SHORT,value:null,offset:0},gradian:{name:"gradian",base:_.ANGLE,prefixes:T.LONG,value:null,offset:0},cycle:{name:"cycle",base:_.ANGLE,prefixes:T.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:_.ANGLE,prefixes:T.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:_.ANGLE,prefixes:T.NONE,value:null,offset:0},A:{name:"A",base:_.CURRENT,prefixes:T.SHORT,value:1,offset:0},ampere:{name:"ampere",base:_.CURRENT,prefixes:T.LONG,value:1,offset:0},K:{name:"K",base:_.TEMPERATURE,prefixes:T.SHORT,value:1,offset:0},degC:{name:"degC",base:_.TEMPERATURE,prefixes:T.SHORT,value:1,offset:273.15},degF:{name:"degF",base:_.TEMPERATURE,prefixes:T.SHORT,value:new d(5,9),offset:459.67},degR:{name:"degR",base:_.TEMPERATURE,prefixes:T.SHORT,value:new d(5,9),offset:0},kelvin:{name:"kelvin",base:_.TEMPERATURE,prefixes:T.LONG,value:1,offset:0},celsius:{name:"celsius",base:_.TEMPERATURE,prefixes:T.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:_.TEMPERATURE,prefixes:T.LONG,value:new d(5,9),offset:459.67},rankine:{name:"rankine",base:_.TEMPERATURE,prefixes:T.LONG,value:new d(5,9),offset:0},mol:{name:"mol",base:_.AMOUNT_OF_SUBSTANCE,prefixes:T.SHORT,value:1,offset:0},mole:{name:"mole",base:_.AMOUNT_OF_SUBSTANCE,prefixes:T.LONG,value:1,offset:0},cd:{name:"cd",base:_.LUMINOUS_INTENSITY,prefixes:T.SHORT,value:1,offset:0},candela:{name:"candela",base:_.LUMINOUS_INTENSITY,prefixes:T.LONG,value:1,offset:0},N:{name:"N",base:_.FORCE,prefixes:T.SHORT,value:1,offset:0},newton:{name:"newton",base:_.FORCE,prefixes:T.LONG,value:1,offset:0},dyn:{name:"dyn",base:_.FORCE,prefixes:T.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:_.FORCE,prefixes:T.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:_.FORCE,prefixes:T.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:_.FORCE,prefixes:T.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:_.FORCE,prefixes:T.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:_.FORCE,prefixes:T.NONE,value:9.80665,offset:0},J:{name:"J",base:_.ENERGY,prefixes:T.SHORT,value:1,offset:0},joule:{name:"joule",base:_.ENERGY,prefixes:T.LONG,value:1,offset:0},erg:{name:"erg",base:_.ENERGY,prefixes:T.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:_.ENERGY,prefixes:T.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:_.ENERGY,prefixes:T.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:_.ENERGY,prefixes:T.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:_.ENERGY,prefixes:T.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:_.POWER,prefixes:T.SHORT,value:1,offset:0},watt:{name:"watt",base:_.POWER,prefixes:T.LONG,value:1,offset:0},hp:{name:"hp",base:_.POWER,prefixes:T.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:_.POWER,prefixes:T.SHORT,value:h.I,offset:0},VA:{name:"VA",base:_.POWER,prefixes:T.SHORT,value:1,offset:0},Pa:{name:"Pa",base:_.PRESSURE,prefixes:T.SHORT,value:1,offset:0},psi:{name:"psi",base:_.PRESSURE,prefixes:T.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:_.PRESSURE,prefixes:T.NONE,value:101325,offset:0},bar:{name:"bar",base:_.PRESSURE,prefixes:T.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:_.PRESSURE,prefixes:T.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:_.PRESSURE,prefixes:T.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:_.PRESSURE,prefixes:T.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:_.PRESSURE,prefixes:T.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:_.ELECTRIC_CHARGE,prefixes:T.LONG,value:1,offset:0},C:{name:"C",base:_.ELECTRIC_CHARGE,prefixes:T.SHORT,value:1,offset:0},farad:{name:"farad",base:_.ELECTRIC_CAPACITANCE,prefixes:T.LONG,value:1,offset:0},F:{name:"F",base:_.ELECTRIC_CAPACITANCE,prefixes:T.SHORT,value:1,offset:0},volt:{name:"volt",base:_.ELECTRIC_POTENTIAL,prefixes:T.LONG,value:1,offset:0},V:{name:"V",base:_.ELECTRIC_POTENTIAL,prefixes:T.SHORT,value:1,offset:0},ohm:{name:"ohm",base:_.ELECTRIC_RESISTANCE,prefixes:T.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:_.ELECTRIC_INDUCTANCE,prefixes:T.LONG,value:1,offset:0},H:{name:"H",base:_.ELECTRIC_INDUCTANCE,prefixes:T.SHORT,value:1,offset:0},siemens:{name:"siemens",base:_.ELECTRIC_CONDUCTANCE,prefixes:T.LONG,value:1,offset:0},S:{name:"S",base:_.ELECTRIC_CONDUCTANCE,prefixes:T.SHORT,value:1,offset:0},weber:{name:"weber",base:_.MAGNETIC_FLUX,prefixes:T.LONG,value:1,offset:0},Wb:{name:"Wb",base:_.MAGNETIC_FLUX,prefixes:T.SHORT,value:1,offset:0},tesla:{name:"tesla",base:_.MAGNETIC_FLUX_DENSITY,prefixes:T.LONG,value:1,offset:0},T:{name:"T",base:_.MAGNETIC_FLUX_DENSITY,prefixes:T.SHORT,value:1,offset:0},b:{name:"b",base:_.BIT,prefixes:T.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:_.BIT,prefixes:T.BINARY_LONG,value:1,offset:0},B:{name:"B",base:_.BIT,prefixes:T.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:_.BIT,prefixes:T.BINARY_LONG,value:8,offset:0}},j={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fluiddrams:"fluiddram",fluidounces:"fluidounce",gills:"gill",cups:"cup",pints:"pint",quarts:"quart",gallons:"gallon",beerbarrels:"beerbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function ge(L){if(L.number==="BigNumber"){var J=am(w);z.rad.value=new w(1),z.deg.value=J.div(180),z.grad.value=J.div(200),z.cycle.value=J.times(2),z.arcsec.value=J.div(648e3),z.arcmin.value=J.div(10800)}else z.rad.value=1,z.deg.value=Math.PI/180,z.grad.value=Math.PI/200,z.cycle.value=Math.PI*2,z.arcsec.value=Math.PI/648e3,z.arcmin.value=Math.PI/10800;z.radian.value=z.rad.value,z.degree.value=z.deg.value,z.gradian.value=z.grad.value}ge(n),e&&e("config",function(L,J){L.number!==J.number&&ge(L)});var te={si:{NONE:{unit:Y,prefix:T.NONE[""]},LENGTH:{unit:z.m,prefix:T.SHORT[""]},MASS:{unit:z.g,prefix:T.SHORT.k},TIME:{unit:z.s,prefix:T.SHORT[""]},CURRENT:{unit:z.A,prefix:T.SHORT[""]},TEMPERATURE:{unit:z.K,prefix:T.SHORT[""]},LUMINOUS_INTENSITY:{unit:z.cd,prefix:T.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:z.mol,prefix:T.SHORT[""]},ANGLE:{unit:z.rad,prefix:T.SHORT[""]},BIT:{unit:z.bits,prefix:T.SHORT[""]},FORCE:{unit:z.N,prefix:T.SHORT[""]},ENERGY:{unit:z.J,prefix:T.SHORT[""]},POWER:{unit:z.W,prefix:T.SHORT[""]},PRESSURE:{unit:z.Pa,prefix:T.SHORT[""]},ELECTRIC_CHARGE:{unit:z.C,prefix:T.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:z.F,prefix:T.SHORT[""]},ELECTRIC_POTENTIAL:{unit:z.V,prefix:T.SHORT[""]},ELECTRIC_RESISTANCE:{unit:z.ohm,prefix:T.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:z.H,prefix:T.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:z.S,prefix:T.SHORT[""]},MAGNETIC_FLUX:{unit:z.Wb,prefix:T.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:z.T,prefix:T.SHORT[""]},FREQUENCY:{unit:z.Hz,prefix:T.SHORT[""]}}};te.cgs=JSON.parse(JSON.stringify(te.si)),te.cgs.LENGTH={unit:z.m,prefix:T.SHORT.c},te.cgs.MASS={unit:z.g,prefix:T.SHORT[""]},te.cgs.FORCE={unit:z.dyn,prefix:T.SHORT[""]},te.cgs.ENERGY={unit:z.erg,prefix:T.NONE[""]},te.us=JSON.parse(JSON.stringify(te.si)),te.us.LENGTH={unit:z.ft,prefix:T.NONE[""]},te.us.MASS={unit:z.lbm,prefix:T.NONE[""]},te.us.TEMPERATURE={unit:z.degF,prefix:T.NONE[""]},te.us.FORCE={unit:z.lbf,prefix:T.NONE[""]},te.us.ENERGY={unit:z.BTU,prefix:T.BTU[""]},te.us.POWER={unit:z.hp,prefix:T.NONE[""]},te.us.PRESSURE={unit:z.psi,prefix:T.NONE[""]},te.auto=JSON.parse(JSON.stringify(te.si));var re=te.auto;g.setUnitSystem=function(L){if(ze(te,L))re=te[L];else throw new Error("Unit system "+L+" does not exist. Choices are: "+Object.keys(te).join(", "))},g.getUnitSystem=function(){for(var L in te)if(ze(te,L)&&te[L]===re)return L},g.typeConverters={BigNumber:function(J){return J!=null&&J.isFraction?new w(J.n).div(J.d).times(J.s):new w(J+"")},Fraction:function(J){return new d(J)},Complex:function(J){return J},number:function(J){return J!=null&&J.isFraction?v(J):J}},g.prototype._numberConverter=function(){var L=g.typeConverters[this.valueType()];if(L)return L;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},g._getNumberConverter=function(L){if(!g.typeConverters[L])throw new TypeError('Unsupported type "'+L+'"');return g.typeConverters[L]};for(var me in z)if(ze(z,me)){var oe=z[me];oe.dimensions=oe.base.dimensions}for(var ue in j)if(ze(j,ue)){var we=z[j[ue]],be={};for(var Ae in we)ze(we,Ae)&&(be[Ae]=we[Ae]);be.name=ue,z[ue]=be}g.isValidAlpha=function(J){return/^[a-zA-Z]$/.test(J)};function _e(L){for(var J=0;J0&&!(g.isValidAlpha(y)||E(y)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+L+'"')}}return g.createUnit=function(L,J){if(typeof L!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(J&&J.override){for(var le in L)if(ze(L,le)&&g.deleteUnit(le),L[le].aliases)for(var V=0;V"u"||J===null)&&(J={}),typeof L!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(ze(z,L))throw new Error('Cannot create unit "'+L+'": a unit with that name already exists');_e(L);var le=null,V=[],X=0,ee,de,xe;if(J&&J.type==="Unit")le=J.clone();else if(typeof J=="string")J!==""&&(ee=J);else if(typeof J=="object")ee=J.definition,de=J.prefixes,X=J.offset,xe=J.baseName,J.aliases&&(V=J.aliases.valueOf());else throw new TypeError('Cannot create unit "'+L+'" from "'+J.toString()+'": expecting "string" or "Unit" or "Object"');if(V){for(var R=0;R1e-12){Se=!1;break}if(Se){Ne=!0,U.base=_[Te];break}}if(!Ne){xe=xe||L+"_STUFF";var Me={dimensions:le.dimensions.slice(0)};Me.key=xe,_[xe]=Me,re[xe]={unit:U,prefix:T.NONE[""]},U.base=_[xe]}}else{if(xe=xe||L+"_STUFF",I.indexOf(xe)>=0)throw new Error('Cannot create new base unit "'+L+'": a base unit with that name already exists (and cannot be overridden)');I.push(xe);for(var ae in _)ze(_,ae)&&(_[ae].dimensions[I.length-1]=0);for(var he={dimensions:[]},fe=0;fe{var{typed:e,Unit:n}=t;return e(fc,{Unit:function(r){return r.clone()},string:function(r){return n.isValuelessUnit(r)?new n(null,r):n.parse(r,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(r,s){return new n(r,s)},"number | BigNumber | Fraction":function(r){return new n(r)},"Array | Matrix":e.referToSelf(a=>r=>it(r,a))})}),hc="sparse",XN=["typed","SparseMatrix"],QN=q(hc,XN,t=>{var{typed:e,SparseMatrix:n}=t;return e(hc,{"":function(){return new n([])},string:function(r){return new n([],r)},"Array | Matrix":function(r){return new n(r)},"Array | Matrix, string":function(r,s){return new n(r,s)}})}),vc="createUnit",jN=["typed","Unit"],KN=q(vc,jN,t=>{var{typed:e,Unit:n}=t;return e(vc,{"Object, Object":function(r,s){return n.createUnit(r,s)},Object:function(r){return n.createUnit(r,{})},"string, Unit | string | Object, Object":function(r,s,i){var p={};return p[r]=s,n.createUnit(p,i)},"string, Unit | string | Object":function(r,s){var i={};return i[r]=s,n.createUnit(i,{})},string:function(r){var s={};return s[r]={},n.createUnit(s,{})}})}),gc="acos",eE=["typed","config","Complex"],tE=q(gc,eE,t=>{var{typed:e,config:n,Complex:a}=t;return e(gc,{number:function(s){return s>=-1&&s<=1||n.predictable?Math.acos(s):new a(s,0).acos()},Complex:function(s){return s.acos()},BigNumber:function(s){return s.acos()}})}),dc="acosh",aE=["typed","config","Complex"],rE=q(dc,aE,t=>{var{typed:e,config:n,Complex:a}=t;return e(dc,{number:function(s){return s>=1||n.predictable?Uv(s):s<=-1?new a(Math.log(Math.sqrt(s*s-1)-s),Math.PI):new a(s,0).acosh()},Complex:function(s){return s.acosh()},BigNumber:function(s){return s.acosh()}})}),yc="acot",nE=["typed","BigNumber"],sE=q(yc,nE,t=>{var{typed:e,BigNumber:n}=t;return e(yc,{number:Gv,Complex:function(r){return r.acot()},BigNumber:function(r){return new n(1).div(r).atan()}})}),wc="acoth",iE=["typed","config","Complex","BigNumber"],oE=q(wc,iE,t=>{var{typed:e,config:n,Complex:a,BigNumber:r}=t;return e(wc,{number:function(i){return i>=1||i<=-1||n.predictable?Hv(i):new a(i,0).acoth()},Complex:function(i){return i.acoth()},BigNumber:function(i){return new r(1).div(i).atanh()}})}),xc="acsc",lE=["typed","config","Complex","BigNumber"],mE=q(xc,lE,t=>{var{typed:e,config:n,Complex:a,BigNumber:r}=t;return e(xc,{number:function(i){return i<=-1||i>=1||n.predictable?Vv(i):new a(i,0).acsc()},Complex:function(i){return i.acsc()},BigNumber:function(i){return new r(1).div(i).asin()}})}),bc="acsch",uE=["typed","BigNumber"],pE=q(bc,uE,t=>{var{typed:e,BigNumber:n}=t;return e(bc,{number:Jv,Complex:function(r){return r.acsch()},BigNumber:function(r){return new n(1).div(r).asinh()}})}),Nc="asec",cE=["typed","config","Complex","BigNumber"],fE=q(Nc,cE,t=>{var{typed:e,config:n,Complex:a,BigNumber:r}=t;return e(Nc,{number:function(i){return i<=-1||i>=1||n.predictable?Zv(i):new a(i,0).asec()},Complex:function(i){return i.asec()},BigNumber:function(i){return new r(1).div(i).acos()}})}),Ec="asech",hE=["typed","config","Complex","BigNumber"],vE=q(Ec,hE,t=>{var{typed:e,config:n,Complex:a,BigNumber:r}=t;return e(Ec,{number:function(i){if(i<=1&&i>=-1||n.predictable){var p=1/i;if(p>0||n.predictable)return Wv(i);var m=Math.sqrt(p*p-1);return new a(Math.log(m-p),Math.PI)}return new a(i,0).asech()},Complex:function(i){return i.asech()},BigNumber:function(i){return new r(1).div(i).acosh()}})}),Dc="asin",gE=["typed","config","Complex"],dE=q(Dc,gE,t=>{var{typed:e,config:n,Complex:a}=t;return e(Dc,{number:function(s){return s>=-1&&s<=1||n.predictable?Math.asin(s):new a(s,0).asin()},Complex:function(s){return s.asin()},BigNumber:function(s){return s.asin()}})}),yE="asinh",wE=["typed"],xE=q(yE,wE,t=>{var{typed:e}=t;return e("asinh",{number:Yv,Complex:function(a){return a.asinh()},BigNumber:function(a){return a.asinh()}})}),bE="atan",NE=["typed"],EE=q(bE,NE,t=>{var{typed:e}=t;return e("atan",{number:function(a){return Math.atan(a)},Complex:function(a){return a.atan()},BigNumber:function(a){return a.atan()}})}),Ac="atan2",DE=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],AE=q(Ac,DE,t=>{var{typed:e,matrix:n,equalScalar:a,BigNumber:r,DenseMatrix:s,concat:i}=t,p=Qa({typed:e,equalScalar:a}),m=ya({typed:e}),o=ug({typed:e,equalScalar:a}),l=aa({typed:e,equalScalar:a}),u=Jt({typed:e,DenseMatrix:s}),c=Tt({typed:e,matrix:n,concat:i});return e(Ac,{"number, number":Math.atan2,"BigNumber, BigNumber":(f,v)=>r.atan2(f,v)},c({scalar:"number | BigNumber",SS:o,DS:m,SD:p,Ss:l,sS:u}))}),Mc="atanh",ME=["typed","config","Complex"],SE=q(Mc,ME,t=>{var{typed:e,config:n,Complex:a}=t;return e(Mc,{number:function(s){return s<=1&&s>=-1||n.predictable?Xv(s):new a(s,0).atanh()},Complex:function(s){return s.atanh()},BigNumber:function(s){return s.atanh()}})}),_s=q("trigUnit",["typed"],t=>{var{typed:e}=t;return{Unit:e.referToSelf(n=>a=>{if(!a.hasBase(a.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return e.find(n,a.valueType())(a.value)})}}),Sc="cos",CE=["typed"],TE=q(Sc,CE,t=>{var{typed:e}=t,n=_s({typed:e});return e(Sc,{number:Math.cos,"Complex | BigNumber":a=>a.cos()},n)}),Cc="cosh",$E=["typed"],FE=q(Cc,$E,t=>{var{typed:e}=t;return e(Cc,{number:M0,"Complex | BigNumber":n=>n.cosh()})}),Tc="cot",_E=["typed","BigNumber"],BE=q(Tc,_E,t=>{var{typed:e,BigNumber:n}=t,a=_s({typed:e});return e(Tc,{number:Qv,Complex:r=>r.cot(),BigNumber:r=>new n(1).div(r.tan())},a)}),$c="coth",OE=["typed","BigNumber"],PE=q($c,OE,t=>{var{typed:e,BigNumber:n}=t;return e($c,{number:jv,Complex:a=>a.coth(),BigNumber:a=>new n(1).div(a.tanh())})}),Fc="csc",zE=["typed","BigNumber"],RE=q(Fc,zE,t=>{var{typed:e,BigNumber:n}=t,a=_s({typed:e});return e(Fc,{number:Kv,Complex:r=>r.csc(),BigNumber:r=>new n(1).div(r.sin())},a)}),_c="csch",IE=["typed","BigNumber"],qE=q(_c,IE,t=>{var{typed:e,BigNumber:n}=t;return e(_c,{number:eg,Complex:a=>a.csch(),BigNumber:a=>new n(1).div(a.sinh())})}),Bc="sec",LE=["typed","BigNumber"],kE=q(Bc,LE,t=>{var{typed:e,BigNumber:n}=t,a=_s({typed:e});return e(Bc,{number:tg,Complex:r=>r.sec(),BigNumber:r=>new n(1).div(r.cos())},a)}),Oc="sech",UE=["typed","BigNumber"],GE=q(Oc,UE,t=>{var{typed:e,BigNumber:n}=t;return e(Oc,{number:ag,Complex:a=>a.sech(),BigNumber:a=>new n(1).div(a.cosh())})}),Pc="sin",HE=["typed"],VE=q(Pc,HE,t=>{var{typed:e}=t,n=_s({typed:e});return e(Pc,{number:Math.sin,"Complex | BigNumber":a=>a.sin()},n)}),zc="sinh",JE=["typed"],ZE=q(zc,JE,t=>{var{typed:e}=t;return e(zc,{number:rg,"Complex | BigNumber":n=>n.sinh()})}),Rc="tan",WE=["typed"],YE=q(Rc,WE,t=>{var{typed:e}=t,n=_s({typed:e});return e(Rc,{number:Math.tan,"Complex | BigNumber":a=>a.tan()},n)}),XE="tanh",QE=["typed"],jE=q(XE,QE,t=>{var{typed:e}=t;return e("tanh",{number:C0,"Complex | BigNumber":n=>n.tanh()})}),Ic="setCartesian",KE=["typed","size","subset","compareNatural","Index","DenseMatrix"],e5=q(Ic,KE,t=>{var{typed:e,size:n,subset:a,compareNatural:r,Index:s,DenseMatrix:i}=t;return e(Ic,{"Array | Matrix, Array | Matrix":function(m,o){var l=[];if(a(n(m),new s(0))!==0&&a(n(o),new s(0))!==0){var u=ft(Array.isArray(m)?m:m.toArray()).sort(r),c=ft(Array.isArray(o)?o:o.toArray()).sort(r);l=[];for(var f=0;f{var{typed:e,size:n,subset:a,compareNatural:r,Index:s,DenseMatrix:i}=t;return e(qc,{"Array | Matrix, Array | Matrix":function(m,o){var l;if(a(n(m),new s(0))===0)l=[];else{if(a(n(o),new s(0))===0)return ft(m.toArray());var u=xs(ft(Array.isArray(m)?m:m.toArray()).sort(r)),c=xs(ft(Array.isArray(o)?o:o.toArray()).sort(r));l=[];for(var f,v=0;v{var{typed:e,size:n,subset:a,compareNatural:r,Index:s,DenseMatrix:i}=t;return e(Lc,{"Array | Matrix":function(m){var o;if(a(n(m),new s(0))===0)o=[];else{var l=ft(Array.isArray(m)?m:m.toArray()).sort(r);o=[],o.push(l[0]);for(var u=1;u{var{typed:e,size:n,subset:a,compareNatural:r,Index:s,DenseMatrix:i}=t;return e(kc,{"Array | Matrix, Array | Matrix":function(m,o){var l;if(a(n(m),new s(0))===0||a(n(o),new s(0))===0)l=[];else{var u=xs(ft(Array.isArray(m)?m:m.toArray()).sort(r)),c=xs(ft(Array.isArray(o)?o:o.toArray()).sort(r));l=[];for(var f=0;f{var{typed:e,size:n,subset:a,compareNatural:r,Index:s}=t;return e(Uc,{"Array | Matrix, Array | Matrix":function(p,m){if(a(n(p),new s(0))===0)return!0;if(a(n(m),new s(0))===0)return!1;for(var o=xs(ft(Array.isArray(p)?p:p.toArray()).sort(r)),l=xs(ft(Array.isArray(m)?m:m.toArray()).sort(r)),u,c=0;c{var{typed:e,size:n,subset:a,compareNatural:r,Index:s}=t;return e(Gc,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(p,m){if(a(n(m),new s(0))===0)return 0;for(var o=ft(Array.isArray(m)?m:m.toArray()),l=0,u=0;u{var{typed:e,size:n,subset:a,compareNatural:r,Index:s}=t;return e(Hc,{"Array | Matrix":function(o){if(a(n(o),new s(0))===0)return[];for(var l=ft(Array.isArray(o)?o:o.toArray()).sort(r),u=[],c=0;c.toString(2).length<=l.length;)u.push(i(l,c.toString(2).split("").reverse())),c++;return p(u)}});function i(m,o){for(var l=[],u=0;u0;l--)for(var u=0;um[u+1].length&&(o=m[u],m[u]=m[u+1],m[u+1]=o);return m}}),Vc="setSize",f5=["typed","compareNatural"],h5=q(Vc,f5,t=>{var{typed:e,compareNatural:n}=t;return e(Vc,{"Array | Matrix":function(r){return Array.isArray(r)?ft(r).length:ft(r.toArray()).length},"Array | Matrix, boolean":function(r,s){if(s===!1||r.length===0)return Array.isArray(r)?ft(r).length:ft(r.toArray()).length;for(var i=ft(Array.isArray(r)?r:r.toArray()).sort(n),p=1,m=1;m{var{typed:e,size:n,concat:a,subset:r,setDifference:s,Index:i}=t;return e(Jc,{"Array | Matrix, Array | Matrix":function(m,o){if(r(n(m),new i(0))===0)return ft(o);if(r(n(o),new i(0))===0)return ft(m);var l=ft(m),u=ft(o);return a(s(l,u),s(u,l))}})}),Zc="setUnion",d5=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],y5=q(Zc,d5,t=>{var{typed:e,size:n,concat:a,subset:r,setIntersect:s,setSymDifference:i,Index:p}=t;return e(Zc,{"Array | Matrix, Array | Matrix":function(o,l){if(r(n(o),new p(0))===0)return ft(l);if(r(n(l),new p(0))===0)return ft(o);var u=ft(o),c=ft(l);return a(i(u,c),s(u,c))}})}),Wc="add",w5=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],x5=q(Wc,w5,t=>{var{typed:e,matrix:n,addScalar:a,equalScalar:r,DenseMatrix:s,SparseMatrix:i,concat:p}=t,m=rn({typed:e}),o=Ql({typed:e,equalScalar:r}),l=Dn({typed:e,DenseMatrix:s}),u=Tt({typed:e,matrix:n,concat:p});return e(Wc,{"any, any":a,"any, any, ...any":e.referToSelf(c=>(f,v,h)=>{for(var w=c(f,v),d=0;d{var{typed:e,abs:n,addScalar:a,divideScalar:r,multiplyScalar:s,sqrt:i,smaller:p,isPositive:m}=t;return e(Yc,{"... number | BigNumber":o,Array:o,Matrix:l=>o(ft(l.toArray()))});function o(l){for(var u=0,c=0,f=0;f{var{typed:e,abs:n,add:a,pow:r,conj:s,sqrt:i,multiply:p,equalScalar:m,larger:o,smaller:l,matrix:u,ctranspose:c,eigs:f}=t;return e(Xc,{number:Math.abs,Complex:function(A){return A.abs()},BigNumber:function(A){return A.abs()},boolean:function(A){return Math.abs(A)},Array:function(A){return y(u(A),2)},Matrix:function(A){return y(A,2)},"Array, number | BigNumber | string":function(A,E){return y(u(A),E)},"Matrix, number | BigNumber | string":function(A,E){return y(A,E)}});function v(D){var A=0;return D.forEach(function(E){var M=n(E);o(M,A)&&(A=M)},!0),A}function h(D){var A;return D.forEach(function(E){var M=n(E);(!A||l(M,A))&&(A=M)},!0),A||0}function w(D,A){if(A===Number.POSITIVE_INFINITY||A==="inf")return v(D);if(A===Number.NEGATIVE_INFINITY||A==="-inf")return h(D);if(A==="fro")return y(D,2);if(typeof A=="number"&&!isNaN(A)){if(!m(A,0)){var E=0;return D.forEach(function(M){E=a(r(n(M),A),E)},!0),r(E,1/A)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function d(D){var A=0;return D.forEach(function(E,M){A=a(A,p(E,s(E)))}),n(i(A))}function N(D){var A=[],E=0;return D.forEach(function(M,S){var C=S[1],B=a(A[C]||0,n(M));o(B,E)&&(E=B),A[C]=B},!0),E}function g(D){var A=D.size();if(A[0]!==A[1])throw new RangeError("Invalid matrix dimensions");var E=c(D),M=p(E,D),S=f(M).values.toArray(),C=S[S.length-1];return n(i(C))}function x(D){var A=[],E=0;return D.forEach(function(M,S){var C=S[0],B=a(A[C]||0,n(M));o(B,E)&&(E=B),A[C]=B},!0),E}function b(D,A){if(A===1)return N(D);if(A===Number.POSITIVE_INFINITY||A==="inf")return x(D);if(A==="fro")return d(D);if(A===2)return g(D);throw new Error("Unsupported parameter value "+A)}function y(D,A){var E=D.size();if(E.length===1)return w(D,A);if(E.length===2){if(E[0]&&E[1])return b(D,A);throw new RangeError("Invalid matrix dimensions")}}}),Qc="dot",A5=["typed","addScalar","multiplyScalar","conj","size"],M5=q(Qc,A5,t=>{var{typed:e,addScalar:n,multiplyScalar:a,conj:r,size:s}=t;return e(Qc,{"Array | DenseMatrix, Array | DenseMatrix":p,"SparseMatrix, SparseMatrix":m});function i(l,u){var c=o(l),f=o(u),v,h;if(c.length===1)v=c[0];else if(c.length===2&&c[1]===1)v=c[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+c.join(", ")+")");if(f.length===1)h=f[0];else if(f.length===2&&f[1]===1)h=f[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+f.join(", ")+")");if(v!==h)throw new RangeError("Vectors must have equal length ("+v+" != "+h+")");if(v===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return v}function p(l,u){var c=i(l,u),f=Ve(l)?l._data:l,v=Ve(l)?l._datatype||l.getDataType():void 0,h=Ve(u)?u._data:u,w=Ve(u)?u._datatype||u.getDataType():void 0,d=o(l).length===2,N=o(u).length===2,g=n,x=a;if(v&&w&&v===w&&typeof v=="string"&&v!=="mixed"){var b=v;g=e.find(n,[b,b]),x=e.find(a,[b,b])}if(!d&&!N){for(var y=x(r(f[0]),h[0]),D=1;Dy){x++;continue}b===y&&(w=d(w,N(f[g],h[x])),g++,x++)}return w}function o(l){return Ve(l)?l.size():s(l)}}),S5="trace",C5=["typed","matrix","add"],T5=q(S5,C5,t=>{var{typed:e,matrix:n,add:a}=t;return e("trace",{Array:function(p){return r(n(p))},SparseMatrix:s,DenseMatrix:r,any:Xe});function r(i){var p=i._size,m=i._data;switch(p.length){case 1:if(p[0]===1)return Xe(m[0]);throw new RangeError("Matrix must be square (size: "+nt(p)+")");case 2:{var o=p[0],l=p[1];if(o===l){for(var u=0,c=0;c0)for(var v=0;vv)break}return f}throw new RangeError("Matrix must be square (size: "+nt(l)+")")}}),jc="index",$5=["typed","Index"],F5=q(jc,$5,t=>{var{typed:e,Index:n}=t;return e(jc,{"...number | string | BigNumber | Range | Array | Matrix":function(r){var s=r.map(function(p){return at(p)?p.toNumber():vt(p)||Ve(p)?p.map(function(m){return at(m)?m.toNumber():m}):p}),i=new n;return n.apply(i,s),i}})}),Sg=new Set(["end"]),_5="Node",B5=["mathWithTransform"],O5=q(_5,B5,t=>{var{mathWithTransform:e}=t;function n(r){for(var s of[...Sg])if(r.has(s))throw new Error('Scope contains an illegal symbol, "'+s+'" is a reserved keyword')}class a{get type(){return"Node"}get isNode(){return!0}evaluate(s){return this.compile().evaluate(s)}compile(){var s=this._compile(e,{}),i={},p=null;function m(o){var l=ps(o);return n(l),s(l,i,p)}return{evaluate:m}}_compile(s,i){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(s){throw new Error("Cannot run forEach on a Node interface")}map(s){throw new Error("Cannot run map on a Node interface")}_ifNode(s){if(!wt(s))throw new TypeError("Callback function must return a Node");return s}traverse(s){s(this,null,null);function i(p,m){p.forEach(function(o,l,u){m(o,l,u),i(o,m)})}i(this,s)}transform(s){function i(p,m,o){var l=s(p,m,o);return l!==p?l:p.map(i)}return i(this,null,null)}filter(s){var i=[];return this.traverse(function(p,m,o){s(p,m,o)&&i.push(p)}),i}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(s){return s.cloneDeep()})}equals(s){return s?this.type===s.type&&bn(this,s):!1}toString(s){var i=this._getCustomString(s);return typeof i<"u"?i:this._toString(s)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(s){var i=this._getCustomString(s);return typeof i<"u"?i:this._toHTML(s)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(s){var i=this._getCustomString(s);return typeof i<"u"?i:this._toTex(s)}_toTex(s){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(s){if(s&&typeof s=="object")switch(typeof s.handler){case"object":case"undefined":return;case"function":return s.handler(this,s);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return a},{isClass:!0,isNode:!0});function wa(t){return t&&t.isIndexError?new Wa(t.index+1,t.min+1,t.max!==void 0?t.max+1:void 0):t}function Cg(t){var{subset:e}=t;return function(a,r){try{if(Array.isArray(a))return e(a,r);if(a&&typeof a.subset=="function")return a.subset(r);if(typeof a=="string")return e(a,r);if(typeof a=="object"){if(!r.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return fa(a,r.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(s){throw wa(s)}}}var Li="AccessorNode",P5=["subset","Node"],z5=q(Li,P5,t=>{var{subset:e,Node:n}=t,a=Cg({subset:e});function r(i){return!(xn(i)||Ba(i)||ut(i)||Kr(i)||Bo(i)||Br(i)||Qt(i))}class s extends n{constructor(p,m){if(super(),!wt(p))throw new TypeError('Node expected for parameter "object"');if(!Ms(m))throw new TypeError('IndexNode expected for parameter "index"');this.object=p,this.index=m}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Li}get isAccessorNode(){return!0}_compile(p,m){var o=this.object._compile(p,m),l=this.index._compile(p,m);if(this.index.isObjectProperty()){var u=this.index.getObjectProperty();return function(f,v,h){return fa(o(f,v,h),u)}}else return function(f,v,h){var w=o(f,v,h),d=l(f,v,w);return a(w,d)}}forEach(p){p(this.object,"object",this),p(this.index,"index",this)}map(p){return new s(this._ifNode(p(this.object,"object",this)),this._ifNode(p(this.index,"index",this)))}clone(){return new s(this.object,this.index)}_toString(p){var m=this.object.toString(p);return r(this.object)&&(m="("+m+")"),m+this.index.toString(p)}_toHTML(p){var m=this.object.toHTML(p);return r(this.object)&&(m='('+m+')'),m+this.index.toHTML(p)}_toTex(p){var m=this.object.toTex(p);return r(this.object)&&(m="\\left(' + object + '\\right)"),m+this.index.toTex(p)}toJSON(){return{mathjs:Li,object:this.object,index:this.index}}static fromJSON(p){return new s(p.object,p.index)}}return Vt(s,"name",Li),s},{isClass:!0,isNode:!0}),ki="ArrayNode",R5=["Node"],I5=q(ki,R5,t=>{var{Node:e}=t;class n extends e{constructor(r){if(super(),this.items=r||[],!Array.isArray(this.items)||!this.items.every(wt))throw new TypeError("Array containing Nodes expected")}get type(){return ki}get isArrayNode(){return!0}_compile(r,s){var i=_r(this.items,function(o){return o._compile(r,s)}),p=r.config.matrix!=="Array";if(p){var m=r.matrix;return function(l,u,c){return m(_r(i,function(f){return f(l,u,c)}))}}else return function(l,u,c){return _r(i,function(f){return f(l,u,c)})}}forEach(r){for(var s=0;s['+s.join(',')+']'}_toTex(r){function s(i,p){var m=i.some(Ba)&&!i.every(Ba),o=p||m,l=o?"&":"\\\\",u=i.map(function(c){return c.items?s(c.items,!p):c.toTex(r)}).join(l);return m||!o||o&&!p?"\\begin{bmatrix}"+u+"\\end{bmatrix}":u}return s(this.items,!1)}}return Vt(n,"name",ki),n},{isClass:!0,isNode:!0});function q5(t){var{subset:e,matrix:n}=t;return function(r,s,i){try{if(Array.isArray(r)){var p=n(r).subset(s,i).valueOf();return p.forEach((m,o)=>{r[o]=m}),r}else{if(r&&typeof r.subset=="function")return r.subset(s,i);if(typeof r=="string")return e(r,s,i);if(typeof r=="object"){if(!s.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return bs(r,s.getObjectProperty(),i),r}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(m){throw wa(m)}}}var Ua=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function Ui(t,e){if(!e||e!=="auto")return t;for(var n=t;Br(n);)n=n.content;return n}function Mt(t,e,n,a){var r=t;e!=="keep"&&(r=t.getContent());for(var s=r.getIdentifier(),i=null,p=0;p{var{subset:e,matrix:n,Node:a}=t,r=Cg({subset:e}),s=q5({subset:e,matrix:n});function i(m,o,l){o||(o="keep");var u=Mt(m,o,l),c=Mt(m.value,o,l);return o==="all"||c!==null&&c<=u}class p extends a{constructor(o,l,u){if(super(),this.object=o,this.index=u?l:null,this.value=u||l,!Qt(o)&&!xn(o))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(Qt(o)&&o.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!Ms(this.index))throw new TypeError('IndexNode expected as "index"');if(!wt(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Gi}get isAssignmentNode(){return!0}_compile(o,l){var u=this.object._compile(o,l),c=this.index?this.index._compile(o,l):null,f=this.value._compile(o,l),v=this.object.name;if(this.index)if(this.index.isObjectProperty()){var h=this.index.getObjectProperty();return function(x,b,y){var D=u(x,b,y),A=f(x,b,y);return bs(D,h,A),A}}else{if(Qt(this.object))return function(x,b,y){var D=u(x,b,y),A=f(x,b,y),E=c(x,b,D);return x.set(v,s(D,E,A)),A};var w=this.object.object._compile(o,l);if(this.object.index.isObjectProperty()){var d=this.object.index.getObjectProperty();return function(x,b,y){var D=w(x,b,y),A=fa(D,d),E=c(x,b,A),M=f(x,b,y);return bs(D,d,s(A,E,M)),M}}else{var N=this.object.index._compile(o,l);return function(x,b,y){var D=w(x,b,y),A=N(x,b,D),E=r(D,A),M=c(x,b,E),S=f(x,b,y);return s(D,A,s(E,M,S)),S}}}else{if(!Qt(this.object))throw new TypeError("SymbolNode expected as object");return function(x,b,y){var D=f(x,b,y);return x.set(v,D),D}}}forEach(o){o(this.object,"object",this),this.index&&o(this.index,"index",this),o(this.value,"value",this)}map(o){var l=this._ifNode(o(this.object,"object",this)),u=this.index?this._ifNode(o(this.index,"index",this)):null,c=this._ifNode(o(this.value,"value",this));return new p(l,u,c)}clone(){return new p(this.object,this.index,this.value)}_toString(o){var l=this.object.toString(o),u=this.index?this.index.toString(o):"",c=this.value.toString(o);return i(this,o&&o.parenthesis,o&&o.implicit)&&(c="("+c+")"),l+u+" = "+c}toJSON(){return{mathjs:Gi,object:this.object,index:this.index,value:this.value}}static fromJSON(o){return new p(o.object,o.index,o.value)}_toHTML(o){var l=this.object.toHTML(o),u=this.index?this.index.toHTML(o):"",c=this.value.toHTML(o);return i(this,o&&o.parenthesis,o&&o.implicit)&&(c='('+c+')'),l+u+'='+c}_toTex(o){var l=this.object.toTex(o),u=this.index?this.index.toTex(o):"",c=this.value.toTex(o);return i(this,o&&o.parenthesis,o&&o.implicit)&&(c="\\left(".concat(c,"\\right)")),l+u+"="+c}}return Vt(p,"name",Gi),p},{isClass:!0,isNode:!0}),Hi="BlockNode",G5=["ResultSet","Node"],H5=q(Hi,G5,t=>{var{ResultSet:e,Node:n}=t;class a extends n{constructor(s){if(super(),!Array.isArray(s))throw new Error("Array expected");this.blocks=s.map(function(i){var p=i&&i.node,m=i&&i.visible!==void 0?i.visible:!0;if(!wt(p))throw new TypeError('Property "node" must be a Node');if(typeof m!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:p,visible:m}})}get type(){return Hi}get isBlockNode(){return!0}_compile(s,i){var p=_r(this.blocks,function(m){return{evaluate:m.node._compile(s,i),visible:m.visible}});return function(o,l,u){var c=[];return Po(p,function(v){var h=v.evaluate(o,l,u);v.visible&&c.push(h)}),new e(c)}}forEach(s){for(var i=0;i;')}).join('
')}_toTex(s){return this.blocks.map(function(i){return i.node.toTex(s)+(i.visible?"":";")}).join(`\\;\\; -`)}}return Vt(a,"name",Hi),a},{isClass:!0,isNode:!0}),Vi="ConditionalNode",V5=["Node"],J5=q(Vi,V5,t=>{var{Node:e}=t;function n(r){if(typeof r=="number"||typeof r=="boolean"||typeof r=="string")return!!r;if(r){if(at(r))return!r.isZero();if(Fr(r))return!!(r.re||r.im);if(Oa(r))return!!r.value}if(r==null)return!1;throw new TypeError('Unsupported type of condition "'+St(r)+'"')}class a extends e{constructor(s,i,p){if(super(),!wt(s))throw new TypeError("Parameter condition must be a Node");if(!wt(i))throw new TypeError("Parameter trueExpr must be a Node");if(!wt(p))throw new TypeError("Parameter falseExpr must be a Node");this.condition=s,this.trueExpr=i,this.falseExpr=p}get type(){return Vi}get isConditionalNode(){return!0}_compile(s,i){var p=this.condition._compile(s,i),m=this.trueExpr._compile(s,i),o=this.falseExpr._compile(s,i);return function(u,c,f){return n(p(u,c,f))?m(u,c,f):o(u,c,f)}}forEach(s){s(this.condition,"condition",this),s(this.trueExpr,"trueExpr",this),s(this.falseExpr,"falseExpr",this)}map(s){return new a(this._ifNode(s(this.condition,"condition",this)),this._ifNode(s(this.trueExpr,"trueExpr",this)),this._ifNode(s(this.falseExpr,"falseExpr",this)))}clone(){return new a(this.condition,this.trueExpr,this.falseExpr)}_toString(s){var i=s&&s.parenthesis?s.parenthesis:"keep",p=Mt(this,i,s&&s.implicit),m=this.condition.toString(s),o=Mt(this.condition,i,s&&s.implicit);(i==="all"||this.condition.type==="OperatorNode"||o!==null&&o<=p)&&(m="("+m+")");var l=this.trueExpr.toString(s),u=Mt(this.trueExpr,i,s&&s.implicit);(i==="all"||this.trueExpr.type==="OperatorNode"||u!==null&&u<=p)&&(l="("+l+")");var c=this.falseExpr.toString(s),f=Mt(this.falseExpr,i,s&&s.implicit);return(i==="all"||this.falseExpr.type==="OperatorNode"||f!==null&&f<=p)&&(c="("+c+")"),m+" ? "+l+" : "+c}toJSON(){return{mathjs:Vi,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(s){return new a(s.condition,s.trueExpr,s.falseExpr)}_toHTML(s){var i=s&&s.parenthesis?s.parenthesis:"keep",p=Mt(this,i,s&&s.implicit),m=this.condition.toHTML(s),o=Mt(this.condition,i,s&&s.implicit);(i==="all"||this.condition.type==="OperatorNode"||o!==null&&o<=p)&&(m='('+m+')');var l=this.trueExpr.toHTML(s),u=Mt(this.trueExpr,i,s&&s.implicit);(i==="all"||this.trueExpr.type==="OperatorNode"||u!==null&&u<=p)&&(l='('+l+')');var c=this.falseExpr.toHTML(s),f=Mt(this.falseExpr,i,s&&s.implicit);return(i==="all"||this.falseExpr.type==="OperatorNode"||f!==null&&f<=p)&&(c='('+c+')'),m+'?'+l+':'+c}_toTex(s){return"\\begin{cases} {"+this.trueExpr.toTex(s)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(s)+"}\\\\{"+this.falseExpr.toTex(s)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return Vt(a,"name",Vi),a},{isClass:!0,isNode:!0}),Bl=Object.assign||function(t){for(var e=1;e1&&arguments[1]!==void 0?arguments[1]:{},n=e.preserveFormatting,a=n===void 0?!1:n,r=e.escapeMapFn,s=r===void 0?Y5:r,i=String(t),p="",m=s(Bl({},Z5),a?Bl({},W5):{}),o=Object.keys(m),l=function(){var c=!1;o.forEach(function(f,v){c||i.length>=f.length&&i.slice(0,f.length)===f&&(p+=m[o[v]],i=i.slice(f.length,i.length),c=!0)}),c||(p+=i.slice(0,1),i=i.slice(1,i.length))};i;)l();return p};const Q5=En(X5);var Ol={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"},ct={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divide:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},Kc={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(ct.add,"${args[1]}\\right)")},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:"\\left(${args[0]}".concat(ct.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(ct.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(ct.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(ct.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(ct.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(ct.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(ct.pow,"{${args[1]}}")},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:"\\left(${args[0]}".concat(ct.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(ct.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(ct.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(ct.bitAnd,"${args[1]}\\right)")},bitNot:{1:ct.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(ct.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(ct.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(ct.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(ct.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(ct.rightLogShift,"${args[1]}\\right)")},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:"\\left(${args[0]}".concat(ct.and,"${args[1]}\\right)")},not:{1:ct.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(ct.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(ct.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(ct.ctranspose)},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},pinv:{1:"\\left(${args[0]}\\right)^{+}"},sqrtm:{1:"{${args[0]}}".concat(ct.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(ct.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(ct.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(ct.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(ct.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(ct.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(ct.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(ct.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(ct.unequal,"${args[1]}\\right)")},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:"\\left(${args[0]}".concat(ct.to,"${args[1]}\\right)")},numeric:function(e,n){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(Ol.i,"\\cdot\\left(${args[1]}\\right)\\right)")},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},j5="\\mathrm{${name}}\\left(${args}\\right)",ef={deg:"^\\circ"};function Pl(t){return Q5(t,{preserveFormatting:!0})}function Tg(t,e){return e=typeof e>"u"?!1:e,e?ze(ef,t)?ef[t]:"\\mathrm{"+Pl(t)+"}":ze(Ol,t)?Ol[t]:Pl(t)}var Ji="ConstantNode",K5=["Node"],eD=q(Ji,K5,t=>{var{Node:e}=t;class n extends e{constructor(r){super(),this.value=r}get type(){return Ji}get isConstantNode(){return!0}_compile(r,s){var i=this.value;return function(){return i}}forEach(r){}map(r){return this.clone()}clone(){return new n(this.value)}_toString(r){return nt(this.value,r)}_toHTML(r){var s=this._toString(r);switch(St(this.value)){case"number":case"BigNumber":case"Fraction":return''+s+"";case"string":return''+s+"";case"boolean":return''+s+"";case"null":return''+s+"";case"undefined":return''+s+"";default:return''+s+""}}toJSON(){return{mathjs:Ji,value:this.value}}static fromJSON(r){return new n(r.value)}_toTex(r){var s=this._toString(r),i=St(this.value);switch(i){case"string":return"\\mathtt{"+Pl(s)+"}";case"number":case"BigNumber":{var p=i==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!p)return this.value.valueOf()<0?"-\\infty":"\\infty";var m=s.toLowerCase().indexOf("e");return m!==-1?s.substring(0,m)+"\\cdot10^{"+s.substring(m+1)+"}":s}case"Fraction":return this.value.toLatex();default:return s}}}return Vt(n,"name",Ji),n},{isClass:!0,isNode:!0}),Zi="FunctionAssignmentNode",tD=["typed","Node"],aD=q(Zi,tD,t=>{var{typed:e,Node:n}=t;function a(s,i,p){var m=Mt(s,i,p),o=Mt(s.expr,i,p);return i==="all"||o!==null&&o<=m}class r extends n{constructor(i,p,m){if(super(),typeof i!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(p))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!wt(m))throw new TypeError('Node expected for parameter "expr"');if(Sg.has(i))throw new Error('Illegal function name, "'+i+'" is a reserved keyword');var o=new Set;for(var l of p){var u=typeof l=="string"?l:l.name;if(o.has(u))throw new Error('Duplicate parameter name "'.concat(u,'"'));o.add(u)}this.name=i,this.params=p.map(function(c){return c&&c.name||c}),this.types=p.map(function(c){return c&&c.type||"any"}),this.expr=m}get type(){return Zi}get isFunctionAssignmentNode(){return!0}_compile(i,p){var m=Object.create(p);Po(this.params,function(v){m[v]=!0});var o=this.expr._compile(i,m),l=this.name,u=this.params,c=Qm(this.types,","),f=l+"("+Qm(this.params,", ")+")";return function(h,w,d){var N={};N[c]=function(){for(var x=Object.create(w),b=0;b'+Pa(this.params[o])+"");var l=this.expr.toHTML(i);return a(this,p,i&&i.implicit)&&(l='('+l+')'),''+Pa(this.name)+'('+m.join(',')+')='+l}_toTex(i){var p=i&&i.parenthesis?i.parenthesis:"keep",m=this.expr.toTex(i);return a(this,p,i&&i.implicit)&&(m="\\left(".concat(m,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(Tg).join(",")+"\\right)="+m}}return Vt(r,"name",Zi),r},{isClass:!0,isNode:!0}),Wi="IndexNode",rD=["Node","size"],nD=q(Wi,rD,t=>{var{Node:e,size:n}=t;class a extends e{constructor(s,i){if(super(),this.dimensions=s,this.dotNotation=i||!1,!Array.isArray(s)||!s.every(wt))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return Wi}get isIndexNode(){return!0}_compile(s,i){var p=_r(this.dimensions,function(o,l){var u=o.filter(v=>v.isSymbolNode&&v.name==="end").length>0;if(u){var c=Object.create(i);c.end=!0;var f=o._compile(s,c);return function(h,w,d){if(!Ve(d)&&!vt(d)&&!sa(d))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+St(d));var N=n(d).valueOf(),g=Object.create(w);return g.end=N[l],f(h,g,d)}}else return o._compile(s,i)}),m=fa(s,"index");return function(l,u,c){var f=_r(p,function(v){return v(l,u,c)});return m(...f)}}forEach(s){for(var i=0;i.'+Pa(this.getObjectProperty())+"":'['+i.join(',')+']'}_toTex(s){var i=this.dimensions.map(function(p){return p.toTex(s)});return this.dotNotation?"."+this.getObjectProperty():"_{"+i.join(",")+"}"}}return Vt(a,"name",Wi),a},{isClass:!0,isNode:!0}),Yi="ObjectNode",sD=["Node"],iD=q(Yi,sD,t=>{var{Node:e}=t;class n extends e{constructor(r){if(super(),this.properties=r||{},r&&(typeof r!="object"||!Object.keys(r).every(function(s){return wt(r[s])})))throw new TypeError("Object containing Nodes expected")}get type(){return Yi}get isObjectNode(){return!0}_compile(r,s){var i={};for(var p in this.properties)if(ze(this.properties,p)){var m=ss(p),o=JSON.parse(m),l=fa(this.properties,p);i[o]=l._compile(r,s)}return function(c,f,v){var h={};for(var w in i)ze(i,w)&&(h[w]=i[w](c,f,v));return h}}forEach(r){for(var s in this.properties)ze(this.properties,s)&&r(this.properties[s],"properties["+ss(s)+"]",this)}map(r){var s={};for(var i in this.properties)ze(this.properties,i)&&(s[i]=this._ifNode(r(this.properties[i],"properties["+ss(i)+"]",this)));return new n(s)}clone(){var r={};for(var s in this.properties)ze(this.properties,s)&&(r[s]=this.properties[s]);return new n(r)}_toString(r){var s=[];for(var i in this.properties)ze(this.properties,i)&&s.push(ss(i)+": "+this.properties[i].toString(r));return"{"+s.join(", ")+"}"}toJSON(){return{mathjs:Yi,properties:this.properties}}static fromJSON(r){return new n(r.properties)}_toHTML(r){var s=[];for(var i in this.properties)ze(this.properties,i)&&s.push(''+Pa(i)+':'+this.properties[i].toHTML(r));return'{'+s.join(',')+'}'}_toTex(r){var s=[];for(var i in this.properties)ze(this.properties,i)&&s.push("\\mathbf{"+i+":} & "+this.properties[i].toTex(r)+"\\\\");var p="\\left\\{\\begin{array}{ll}"+s.join(` -`)+"\\end{array}\\right\\}";return p}}return Vt(n,"name",Yi),n},{isClass:!0,isNode:!0});function ri(t,e){return new Wh(t,new zo(e),new Set(Object.keys(e)))}var Xi="OperatorNode",oD=["Node"],lD=q(Xi,oD,t=>{var{Node:e}=t;function n(s,i){var p=s;if(i==="auto")for(;Br(p);)p=p.content;return ut(p)?!0:It(p)?n(p.args[0],i):!1}function a(s,i,p,m,o){var l=Mt(s,i,p),u=ti(s,i);if(i==="all"||m.length>2&&s.getIdentifier()!=="OperatorNode:add"&&s.getIdentifier()!=="OperatorNode:multiply")return m.map(function(M){switch(M.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var c;switch(m.length){case 0:c=[];break;case 1:{var f=Mt(m[0],i,p,s);if(o&&f!==null){var v,h;if(i==="keep"?(v=m[0].getIdentifier(),h=s.getIdentifier()):(v=m[0].getContent().getIdentifier(),h=s.getContent().getIdentifier()),Ua[l][h].latexLeftParens===!1){c=[!1];break}if(Ua[f][v].latexParens===!1){c=[!1];break}}if(f===null){c=[!1];break}if(f<=l){c=[!0];break}c=[!1]}break;case 2:{var w,d=Mt(m[0],i,p,s),N=hl(s,m[0],i);d===null?w=!1:d===l&&u==="right"&&!N||d=2&&s.getIdentifier()==="OperatorNode:multiply"&&s.implicit&&i!=="all"&&p==="hide")for(var E=1;E2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var w=o.map(function(d,N){return d=d.toString(i),l[N]&&(d="("+d+")"),d});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&m==="hide"?w.join(" "):w.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:Xi,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(i){return new r(i.op,i.fn,i.args,i.implicit,i.isPercentage)}_toHTML(i){var p=i&&i.parenthesis?i.parenthesis:"keep",m=i&&i.implicit?i.implicit:"hide",o=this.args,l=a(this,p,m,o,!1);if(o.length===1){var u=ti(this,p),c=o[0].toHTML(i);return l[0]&&(c='('+c+')'),u==="right"?''+Pa(this.op)+""+c:c+''+Pa(this.op)+""}else if(o.length===2){var f=o[0].toHTML(i),v=o[1].toHTML(i);return l[0]&&(f='('+f+')'),l[1]&&(v='('+v+')'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&m==="hide"?f+''+v:f+''+Pa(this.op)+""+v}else{var h=o.map(function(w,d){return w=w.toHTML(i),l[d]&&(w='('+w+')'),w});return o.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&m==="hide"?h.join(''):h.join(''+Pa(this.op)+""):''+Pa(this.fn)+'('+h.join(',')+')'}}_toTex(i){var p=i&&i.parenthesis?i.parenthesis:"keep",m=i&&i.implicit?i.implicit:"hide",o=this.args,l=a(this,p,m,o,!0),u=ct[this.fn];if(u=typeof u>"u"?this.op:u,o.length===1){var c=ti(this,p),f=o[0].toTex(i);return l[0]&&(f="\\left(".concat(f,"\\right)")),c==="right"?u+f:f+u}else if(o.length===2){var v=o[0],h=v.toTex(i);l[0]&&(h="\\left(".concat(h,"\\right)"));var w=o[1],d=w.toTex(i);l[1]&&(d="\\left(".concat(d,"\\right)"));var N;switch(p==="keep"?N=v.getIdentifier():N=v.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return u+"{"+h+"}{"+d+"}";case"OperatorNode:pow":switch(h="{"+h+"}",d="{"+d+"}",N){case"ConditionalNode":case"OperatorNode:divide":h="\\left(".concat(h,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&m==="hide")return h+"~"+d}return h+u+d}else if(o.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var g=o.map(function(x,b){return x=x.toTex(i),l[b]&&(x="\\left(".concat(x,"\\right)")),x});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&m==="hide"?g.join("~"):g.join(u)}else return"\\mathrm{"+this.fn+"}\\left("+o.map(function(x){return x.toTex(i)}).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return Vt(r,"name",Xi),r},{isClass:!0,isNode:!0}),Qi="ParenthesisNode",mD=["Node"],uD=q(Qi,mD,t=>{var{Node:e}=t;class n extends e{constructor(r){if(super(),!wt(r))throw new TypeError('Node expected for parameter "content"');this.content=r}get type(){return Qi}get isParenthesisNode(){return!0}_compile(r,s){return this.content._compile(r,s)}getContent(){return this.content.getContent()}forEach(r){r(this.content,"content",this)}map(r){var s=r(this.content,"content",this);return new n(s)}clone(){return new n(this.content)}_toString(r){return!r||r&&!r.parenthesis||r&&r.parenthesis==="keep"?"("+this.content.toString(r)+")":this.content.toString(r)}toJSON(){return{mathjs:Qi,content:this.content}}static fromJSON(r){return new n(r.content)}_toHTML(r){return!r||r&&!r.parenthesis||r&&r.parenthesis==="keep"?'('+this.content.toHTML(r)+')':this.content.toHTML(r)}_toTex(r){return!r||r&&!r.parenthesis||r&&r.parenthesis==="keep"?"\\left(".concat(this.content.toTex(r),"\\right)"):this.content.toTex(r)}}return Vt(n,"name",Qi),n},{isClass:!0,isNode:!0}),ji="RangeNode",pD=["Node"],cD=q(ji,pD,t=>{var{Node:e}=t;function n(r,s,i){var p=Mt(r,s,i),m={},o=Mt(r.start,s,i);if(m.start=o!==null&&o<=p||s==="all",r.step){var l=Mt(r.step,s,i);m.step=l!==null&&l<=p||s==="all"}var u=Mt(r.end,s,i);return m.end=u!==null&&u<=p||s==="all",m}class a extends e{constructor(s,i,p){if(super(),!wt(s))throw new TypeError("Node expected");if(!wt(i))throw new TypeError("Node expected");if(p&&!wt(p))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=s,this.end=i,this.step=p||null}get type(){return ji}get isRangeNode(){return!0}needsEnd(){var s=this.filter(function(i){return Qt(i)&&i.name==="end"});return s.length>0}_compile(s,i){var p=s.range,m=this.start._compile(s,i),o=this.end._compile(s,i);if(this.step){var l=this.step._compile(s,i);return function(c,f,v){return p(m(c,f,v),o(c,f,v),l(c,f,v))}}else return function(c,f,v){return p(m(c,f,v),o(c,f,v))}}forEach(s){s(this.start,"start",this),s(this.end,"end",this),this.step&&s(this.step,"step",this)}map(s){return new a(this._ifNode(s(this.start,"start",this)),this._ifNode(s(this.end,"end",this)),this.step&&this._ifNode(s(this.step,"step",this)))}clone(){return new a(this.start,this.end,this.step&&this.step)}_toString(s){var i=s&&s.parenthesis?s.parenthesis:"keep",p=n(this,i,s&&s.implicit),m,o=this.start.toString(s);if(p.start&&(o="("+o+")"),m=o,this.step){var l=this.step.toString(s);p.step&&(l="("+l+")"),m+=":"+l}var u=this.end.toString(s);return p.end&&(u="("+u+")"),m+=":"+u,m}toJSON(){return{mathjs:ji,start:this.start,end:this.end,step:this.step}}static fromJSON(s){return new a(s.start,s.end,s.step)}_toHTML(s){var i=s&&s.parenthesis?s.parenthesis:"keep",p=n(this,i,s&&s.implicit),m,o=this.start.toHTML(s);if(p.start&&(o='('+o+')'),m=o,this.step){var l=this.step.toHTML(s);p.step&&(l='('+l+')'),m+=':'+l}var u=this.end.toHTML(s);return p.end&&(u='('+u+')'),m+=':'+u,m}_toTex(s){var i=s&&s.parenthesis?s.parenthesis:"keep",p=n(this,i,s&&s.implicit),m=this.start.toTex(s);if(p.start&&(m="\\left(".concat(m,"\\right)")),this.step){var o=this.step.toTex(s);p.step&&(o="\\left(".concat(o,"\\right)")),m+=":"+o}var l=this.end.toTex(s);return p.end&&(l="\\left(".concat(l,"\\right)")),m+=":"+l,m}}return Vt(a,"name",ji),a},{isClass:!0,isNode:!0}),Ki="RelationalNode",fD=["Node"],hD=q(Ki,fD,t=>{var{Node:e}=t,n={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class a extends e{constructor(s,i){if(super(),!Array.isArray(s))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(i))throw new TypeError("Parameter params must be an array");if(s.length!==i.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=s,this.params=i}get type(){return Ki}get isRelationalNode(){return!0}_compile(s,i){var p=this,m=this.params.map(o=>o._compile(s,i));return function(l,u,c){for(var f,v=m[0](l,u,c),h=0;hs(i,"params["+p+"]",this),this)}map(s){return new a(this.conditionals.slice(),this.params.map((i,p)=>this._ifNode(s(i,"params["+p+"]",this)),this))}clone(){return new a(this.conditionals,this.params)}_toString(s){for(var i=s&&s.parenthesis?s.parenthesis:"keep",p=Mt(this,i,s&&s.implicit),m=this.params.map(function(u,c){var f=Mt(u,i,s&&s.implicit);return i==="all"||f!==null&&f<=p?"("+u.toString(s)+")":u.toString(s)}),o=m[0],l=0;l('+u.toHTML(s)+')':u.toHTML(s)}),o=m[0],l=0;l'+Pa(n[this.conditionals[l]])+""+m[l+1];return o}_toTex(s){for(var i=s&&s.parenthesis?s.parenthesis:"keep",p=Mt(this,i,s&&s.implicit),m=this.params.map(function(u,c){var f=Mt(u,i,s&&s.implicit);return i==="all"||f!==null&&f<=p?"\\left("+u.toTex(s)+"\right)":u.toTex(s)}),o=m[0],l=0;l{var{math:e,Unit:n,Node:a}=t;function r(i){return n?n.isValuelessUnit(i):!1}class s extends a{constructor(p){if(super(),typeof p!="string")throw new TypeError('String expected for parameter "name"');this.name=p}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(p,m){var o=this.name;if(m[o]===!0)return function(u,c,f){return fa(c,o)};if(o in p)return function(u,c,f){return u.has(o)?u.get(o):fa(p,o)};var l=r(o);return function(u,c,f){return u.has(o)?u.get(o):l?new n(null,o):s.onUndefinedSymbol(o)}}forEach(p){}map(p){return this.clone()}static onUndefinedSymbol(p){throw new Error("Undefined symbol "+p)}clone(){return new s(this.name)}_toString(p){return this.name}_toHTML(p){var m=Pa(this.name);return m==="true"||m==="false"?''+m+"":m==="i"?''+m+"":m==="Infinity"?''+m+"":m==="NaN"?''+m+"":m==="null"?''+m+"":m==="undefined"?''+m+"":''+m+""}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(p){return new s(p.name)}_toTex(p){var m=!1;typeof e[this.name]>"u"&&r(this.name)&&(m=!0);var o=Tg(this.name,m);return o[0]==="\\"?o:" "+o}}return s},{isClass:!0,isNode:!0}),eo="FunctionNode",yD=["math","Node","SymbolNode"],wD=q(eo,yD,t=>{var e,{math:n,Node:a,SymbolNode:r}=t,s=m=>nt(m,{truncate:78});function i(m,o,l){for(var u="",c=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,f=0,v;(v=c.exec(m))!==null;)if(u+=m.substring(f,v.index),f=v.index,v[0]==="$$")u+="$",f++;else{f+=v[0].length;var h=o[v[1]];if(!h)throw new ReferenceError("Template: Property "+v[1]+" does not exist.");if(v[2]===void 0)switch(typeof h){case"string":u+=h;break;case"object":if(wt(h))u+=h.toTex(l);else if(Array.isArray(h))u+=h.map(function(w,d){if(wt(w))return w.toTex(l);throw new TypeError("Template: "+v[1]+"["+d+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+v[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+v[1]+" has to be a Node, String or array of Nodes")}else if(wt(h[v[2]]&&h[v[2]]))u+=h[v[2]].toTex(l);else throw new TypeError("Template: "+v[1]+"["+v[2]+"] is not a Node.")}return u+=m.slice(f),u}class p extends a{constructor(o,l){if(super(),typeof o=="string"&&(o=new r(o)),!wt(o))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(l)||!l.every(wt))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=o,this.args=l||[]}get name(){return this.fn.name||""}get type(){return eo}get isFunctionNode(){return!0}_compile(o,l){var u=this.args.map(A=>A._compile(o,l));if(Qt(this.fn)){var c=this.fn.name;if(l[c]){var d=this.args;return function(E,M,S){var C=fa(M,c);if(typeof C!="function")throw new TypeError("Argument '".concat(c,"' was not a function; received: ").concat(s(C)));if(C.rawArgs)return C(d,o,ri(E,M));var B=u.map(O=>O(E,M,S));return C.apply(C,B)}}else{var f=c in o?fa(o,c):void 0,v=typeof f=="function"&&f.rawArgs===!0,h=A=>{var E;if(A.has(c))E=A.get(c);else if(c in o)E=fa(o,c);else return p.onUndefinedFunction(c);if(typeof E=="function")return E;throw new TypeError("'".concat(c,`' is not a function; its value is: - `).concat(s(E)))};if(v){var w=this.args;return function(E,M,S){var C=h(E);return C(w,o,ri(E,M))}}else switch(u.length){case 0:return function(E,M,S){var C=h(E);return C()};case 1:return function(E,M,S){var C=h(E),B=u[0];return C(B(E,M,S))};case 2:return function(E,M,S){var C=h(E),B=u[0],O=u[1];return C(B(E,M,S),O(E,M,S))};default:return function(E,M,S){var C=h(E),B=u.map(O=>O(E,M,S));return C(...B)}}}}else if(xn(this.fn)&&Ms(this.fn.index)&&this.fn.index.isObjectProperty()){var N=this.fn.object._compile(o,l),g=this.fn.index.getObjectProperty(),x=this.args;return function(E,M,S){var C=N(E,M,S),B=H0(C,g);if(B!=null&&B.rawArgs)return B(x,o,ri(E,M));var O=u.map(P=>P(E,M,S));return B.apply(C,O)}}else{var b=this.fn.toString(),y=this.fn._compile(o,l),D=this.args;return function(E,M,S){var C=y(E,M,S);if(typeof C!="function")throw new TypeError("Expression '".concat(b,"' did not evaluate to a function; value is:")+` - `.concat(s(C)));if(C.rawArgs)return C(D,o,ri(E,M));var B=u.map(O=>O(E,M,S));return C.apply(C,B)}}}forEach(o){o(this.fn,"fn",this);for(var l=0;l'+Pa(this.fn)+'('+l.join(',')+')'}toTex(o){var l;return o&&typeof o.handler=="object"&&ze(o.handler,this.name)&&(l=o.handler[this.name](this,o)),typeof l<"u"?l:super.toTex(o)}_toTex(o){var l=this.args.map(function(f){return f.toTex(o)}),u;Kc[this.name]&&(u=Kc[this.name]),n[this.name]&&(typeof n[this.name].toTex=="function"||typeof n[this.name].toTex=="object"||typeof n[this.name].toTex=="string")&&(u=n[this.name].toTex);var c;switch(typeof u){case"function":c=u(this,o);break;case"string":c=i(u,this,o);break;case"object":switch(typeof u[l.length]){case"function":c=u[l.length](this,o);break;case"string":c=i(u[l.length],this,o);break}}return typeof c<"u"?c:i(j5,this,o)}getIdentifier(){return this.type+":"+this.name}}return e=p,Vt(p,"name",eo),Vt(p,"onUndefinedFunction",function(m){throw new Error("Undefined function "+m)}),Vt(p,"fromJSON",function(m){return new e(m.fn,m.args)}),p},{isClass:!0,isNode:!0}),tf="parse",xD=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],bD=q(tf,xD,t=>{var{typed:e,numeric:n,config:a,AccessorNode:r,ArrayNode:s,AssignmentNode:i,BlockNode:p,ConditionalNode:m,ConstantNode:o,FunctionAssignmentNode:l,FunctionNode:u,IndexNode:c,ObjectNode:f,OperatorNode:v,ParenthesisNode:h,RangeNode:w,RelationalNode:d,SymbolNode:N}=t,g=e(tf,{string:function(Q){return K(Q,{})},"Array | Matrix":function(Q){return x(Q,{})},"string, Object":function(Q,ye){var Ce=ye.nodes!==void 0?ye.nodes:{};return K(Q,Ce)},"Array | Matrix, Object":x});function x(F){var Q=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ye=Q.nodes!==void 0?Q.nodes:{};return it(F,function(Ce){if(typeof Ce!="string")throw new TypeError("String expected");return K(Ce,ye)})}var b={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},y={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},D={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},A={true:!0,false:!1,null:null,undefined:void 0},E=["NaN","Infinity"],M={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:` -`,r:"\r",t:" "};function S(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:b.NULL,nestingLevel:0,conditionalLevel:null}}function C(F,Q){return F.expression.substr(F.index,Q)}function B(F){return C(F,1)}function O(F){F.index++}function P(F){return F.expression.charAt(F.index-1)}function $(F){return F.expression.charAt(F.index+1)}function T(F){for(F.tokenType=b.NULL,F.token="",F.comment="";;){if(B(F)==="#")for(;B(F)!==` -`&&B(F)!=="";)F.comment+=B(F),O(F);if(g.isWhitespace(B(F),F.nestingLevel))O(F);else break}if(B(F)===""){F.tokenType=b.DELIMITER;return}if(B(F)===` -`&&!F.nestingLevel){F.tokenType=b.DELIMITER,F.token=B(F),O(F);return}var Q=B(F),ye=C(F,2),Ce=C(F,3);if(Ce.length===3&&y[Ce]){F.tokenType=b.DELIMITER,F.token=Ce,O(F),O(F),O(F);return}if(ye.length===2&&y[ye]){F.tokenType=b.DELIMITER,F.token=ye,O(F),O(F);return}if(y[Q]){F.tokenType=b.DELIMITER,F.token=Q,O(F);return}if(g.isDigitDot(Q)){F.tokenType=b.NUMBER;var ke=C(F,2);if(ke==="0b"||ke==="0o"||ke==="0x"){for(F.token+=B(F),O(F),F.token+=B(F),O(F);g.isHexDigit(B(F));)F.token+=B(F),O(F);if(B(F)===".")for(F.token+=".",O(F);g.isHexDigit(B(F));)F.token+=B(F),O(F);else if(B(F)==="i")for(F.token+="i",O(F);g.isDigit(B(F));)F.token+=B(F),O(F);return}if(B(F)==="."){if(F.token+=B(F),O(F),!g.isDigit(B(F))){F.tokenType=b.DELIMITER;return}}else{for(;g.isDigit(B(F));)F.token+=B(F),O(F);g.isDecimalMark(B(F),$(F))&&(F.token+=B(F),O(F))}for(;g.isDigit(B(F));)F.token+=B(F),O(F);if(B(F)==="E"||B(F)==="e"){if(g.isDigit($(F))||$(F)==="-"||$(F)==="+"){if(F.token+=B(F),O(F),(B(F)==="+"||B(F)==="-")&&(F.token+=B(F),O(F)),!g.isDigit(B(F)))throw Re(F,'Digit expected, got "'+B(F)+'"');for(;g.isDigit(B(F));)F.token+=B(F),O(F);if(g.isDecimalMark(B(F),$(F)))throw Re(F,'Digit expected, got "'+B(F)+'"')}else if($(F)===".")throw O(F),Re(F,'Digit expected, got "'+B(F)+'"')}return}if(g.isAlpha(B(F),P(F),$(F))){for(;g.isAlpha(B(F),P(F),$(F))||g.isDigit(B(F));)F.token+=B(F),O(F);ze(D,F.token)?F.tokenType=b.DELIMITER:F.tokenType=b.SYMBOL;return}for(F.tokenType=b.UNKNOWN;B(F)!=="";)F.token+=B(F),O(F);throw Re(F,'Syntax error in part "'+F.token+'"')}function I(F){do T(F);while(F.token===` -`)}function _(F){F.nestingLevel++}function W(F){F.nestingLevel--}g.isAlpha=function(Q,ye,Ce){return g.isValidLatinOrGreek(Q)||g.isValidMathSymbol(Q,Ce)||g.isValidMathSymbol(ye,Q)},g.isValidLatinOrGreek=function(Q){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(Q)},g.isValidMathSymbol=function(Q,ye){return/^[\uD835]$/.test(Q)&&/^[\uDC00-\uDFFF]$/.test(ye)&&/^[^\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]$/.test(ye)},g.isWhitespace=function(Q,ye){return Q===" "||Q===" "||Q===` -`&&ye>0},g.isDecimalMark=function(Q,ye){return Q==="."&&ye!=="/"&&ye!=="*"&&ye!=="^"},g.isDigitDot=function(Q){return Q>="0"&&Q<="9"||Q==="."},g.isDigit=function(Q){return Q>="0"&&Q<="9"},g.isHexDigit=function(Q){return Q>="0"&&Q<="9"||Q>="a"&&Q<="f"||Q>="A"&&Q<="F"};function K(F,Q){var ye=S();Gt(ye,{expression:F,extraNodes:Q}),T(ye);var Ce=Y(ye);if(ye.token!=="")throw ye.tokenType===b.DELIMITER?ht(ye,"Unexpected operator "+ye.token):Re(ye,'Unexpected part "'+ye.token+'"');return Ce}function Y(F){var Q,ye=[],Ce;for(F.token!==""&&F.token!==` -`&&F.token!==";"&&(Q=z(F),F.comment&&(Q.comment=F.comment));F.token===` -`||F.token===";";)ye.length===0&&Q&&(Ce=F.token!==";",ye.push({node:Q,visible:Ce})),T(F),F.token!==` -`&&F.token!==";"&&F.token!==""&&(Q=z(F),F.comment&&(Q.comment=F.comment),Ce=F.token!==";",ye.push({node:Q,visible:Ce}));return ye.length>0?new p(ye):(Q||(Q=new o(void 0),F.comment&&(Q.comment=F.comment)),Q)}function z(F){var Q,ye,Ce,ke,Je=j(F);if(F.token==="="){if(Qt(Je))return Q=Je.name,I(F),Ce=z(F),new i(new N(Q),Ce);if(xn(Je))return I(F),Ce=z(F),new i(Je.object,Je.index,Ce);if(Kr(Je)&&Qt(Je.fn)&&(ke=!0,ye=[],Q=Je.name,Je.args.forEach(function(Wt,$a){Qt(Wt)?ye[$a]=Wt.name:ke=!1}),ke))return I(F),Ce=z(F),new l(Q,ye,Ce);throw Re(F,"Invalid left hand side of assignment operator =")}return Je}function j(F){for(var Q=ge(F);F.token==="?";){var ye=F.conditionalLevel;F.conditionalLevel=F.nestingLevel,I(F);var Ce=Q,ke=z(F);if(F.token!==":")throw Re(F,"False part of conditional expression expected");F.conditionalLevel=null,I(F);var Je=z(F);Q=new m(Ce,ke,Je),F.conditionalLevel=ye}return Q}function ge(F){for(var Q=te(F);F.token==="or";)I(F),Q=new v("or","or",[Q,te(F)]);return Q}function te(F){for(var Q=re(F);F.token==="xor";)I(F),Q=new v("xor","xor",[Q,re(F)]);return Q}function re(F){for(var Q=me(F);F.token==="and";)I(F),Q=new v("and","and",[Q,me(F)]);return Q}function me(F){for(var Q=oe(F);F.token==="|";)I(F),Q=new v("|","bitOr",[Q,oe(F)]);return Q}function oe(F){for(var Q=ue(F);F.token==="^|";)I(F),Q=new v("^|","bitXor",[Q,ue(F)]);return Q}function ue(F){for(var Q=we(F);F.token==="&";)I(F),Q=new v("&","bitAnd",[Q,we(F)]);return Q}function we(F){for(var Q=[be(F)],ye=[],Ce={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};ze(Ce,F.token);){var ke={name:F.token,fn:Ce[F.token]};ye.push(ke),I(F),Q.push(be(F))}return Q.length===1?Q[0]:Q.length===2?new v(ye[0].name,ye[0].fn,Q):new d(ye.map(Je=>Je.fn),Q)}function be(F){var Q,ye,Ce,ke;Q=Ae(F);for(var Je={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};ze(Je,F.token);)ye=F.token,Ce=Je[ye],I(F),ke=[Q,Ae(F)],Q=new v(ye,Ce,ke);return Q}function Ae(F){var Q,ye,Ce,ke;Q=_e(F);for(var Je={to:"to",in:"to"};ze(Je,F.token);)ye=F.token,Ce=Je[ye],I(F),ye==="in"&&F.token===""?Q=new v("*","multiply",[Q,new N("in")],!0):(ke=[Q,_e(F)],Q=new v(ye,Ce,ke));return Q}function _e(F){var Q,ye=[];if(F.token===":"?Q=new o(1):Q=L(F),F.token===":"&&F.conditionalLevel!==F.nestingLevel){for(ye.push(Q);F.token===":"&&ye.length<3;)I(F),F.token===")"||F.token==="]"||F.token===","||F.token===""?ye.push(new N("end")):ye.push(L(F));ye.length===3?Q=new w(ye[0],ye[2],ye[1]):Q=new w(ye[0],ye[1])}return Q}function L(F){var Q,ye,Ce,ke;Q=J(F);for(var Je={"+":"add","-":"subtract"};ze(Je,F.token);){ye=F.token,Ce=Je[ye],I(F);var Wt=J(F);Wt.isPercentage?ke=[Q,new v("*","multiply",[Q,Wt])]:ke=[Q,Wt],Q=new v(ye,Ce,ke)}return Q}function J(F){var Q,ye,Ce,ke;Q=le(F),ye=Q;for(var Je={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};ze(Je,F.token);)Ce=F.token,ke=Je[Ce],I(F),ye=le(F),Q=new v(Ce,ke,[Q,ye]);return Q}function le(F){var Q,ye;for(Q=V(F),ye=Q;F.tokenType===b.SYMBOL||F.token==="in"&&ut(Q)||F.tokenType===b.NUMBER&&!ut(ye)&&(!It(ye)||ye.op==="!")||F.token==="(";)ye=V(F),Q=new v("*","multiply",[Q,ye],!0);return Q}function V(F){for(var Q=X(F),ye=Q,Ce=[];F.token==="/"&&bl(ye);)if(Ce.push(Gt({},F)),I(F),F.tokenType===b.NUMBER)if(Ce.push(Gt({},F)),I(F),F.tokenType===b.SYMBOL||F.token==="(")Gt(F,Ce.pop()),Ce.pop(),ye=X(F),Q=new v("/","divide",[Q,ye]);else{Ce.pop(),Gt(F,Ce.pop());break}else{Gt(F,Ce.pop());break}return Q}function X(F){var Q,ye,Ce,ke;Q=ee(F);for(var Je={"%":"mod",mod:"mod"};ze(Je,F.token);)ye=F.token,Ce=Je[ye],I(F),ye==="%"&&F.tokenType===b.DELIMITER&&F.token!=="("?Q=new v("/","divide",[Q,new o(100)],!1,!0):(ke=[Q,ee(F)],Q=new v(ye,Ce,ke));return Q}function ee(F){var Q,ye,Ce,ke={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return ze(ke,F.token)?(Ce=ke[F.token],Q=F.token,I(F),ye=[ee(F)],new v(Q,Ce,ye)):de(F)}function de(F){var Q,ye,Ce,ke;return Q=xe(F),(F.token==="^"||F.token===".^")&&(ye=F.token,Ce=ye==="^"?"pow":"dotPow",I(F),ke=[Q,ee(F)],Q=new v(ye,Ce,ke)),Q}function xe(F){var Q,ye,Ce,ke;Q=R(F);for(var Je={"!":"factorial","'":"ctranspose"};ze(Je,F.token);)ye=F.token,Ce=Je[ye],T(F),ke=[Q],Q=new v(ye,Ce,ke),Q=ae(F,Q);return Q}function R(F){var Q=[];if(F.tokenType===b.SYMBOL&&ze(F.extraNodes,F.token)){var ye=F.extraNodes[F.token];if(T(F),F.token==="("){if(Q=[],_(F),T(F),F.token!==")")for(Q.push(z(F));F.token===",";)T(F),Q.push(z(F));if(F.token!==")")throw Re(F,"Parenthesis ) expected");W(F),T(F)}return new ye(Q)}return U(F)}function U(F){var Q,ye;return F.tokenType===b.SYMBOL||F.tokenType===b.DELIMITER&&F.token in D?(ye=F.token,T(F),ze(A,ye)?Q=new o(A[ye]):E.indexOf(ye)!==-1?Q=new o(n(ye,"number")):Q=new N(ye),Q=ae(F,Q),Q):he(F)}function ae(F,Q,ye){for(var Ce;(F.token==="("||F.token==="["||F.token===".")&&(!ye||ye.indexOf(F.token)!==-1);)if(Ce=[],F.token==="(")if(Qt(Q)||xn(Q)){if(_(F),T(F),F.token!==")")for(Ce.push(z(F));F.token===",";)T(F),Ce.push(z(F));if(F.token!==")")throw Re(F,"Parenthesis ) expected");W(F),T(F),Q=new u(Q,Ce)}else return Q;else if(F.token==="["){if(_(F),T(F),F.token!=="]")for(Ce.push(z(F));F.token===",";)T(F),Ce.push(z(F));if(F.token!=="]")throw Re(F,"Parenthesis ] expected");W(F),T(F),Q=new r(Q,new c(Ce))}else{T(F);var ke=F.tokenType===b.SYMBOL||F.tokenType===b.DELIMITER&&F.token in D;if(!ke)throw Re(F,"Property name expected after dot");Ce.push(new o(F.token)),T(F);var Je=!0;Q=new r(Q,new c(Ce,Je))}return Q}function he(F){var Q,ye;return F.token==='"'||F.token==="'"?(ye=fe(F,F.token),Q=new o(ye),Q=ae(F,Q),Q):Ne(F)}function fe(F,Q){for(var ye="";B(F)!==""&&B(F)!==Q;)if(B(F)==="\\"){O(F);var Ce=B(F),ke=M[Ce];if(ke!==void 0)ye+=ke,F.index+=1;else if(Ce==="u"){var Je=F.expression.slice(F.index+1,F.index+5);if(/^[0-9A-Fa-f]{4}$/.test(Je))ye+=String.fromCharCode(parseInt(Je,16)),F.index+=5;else throw Re(F,"Invalid unicode character \\u".concat(Je))}else throw Re(F,"Bad escape character \\".concat(Ce))}else ye+=B(F),O(F);if(T(F),F.token!==Q)throw Re(F,"End of string ".concat(Q," expected"));return T(F),ye}function Ne(F){var Q,ye,Ce,ke;if(F.token==="["){if(_(F),T(F),F.token!=="]"){var Je=Te(F);if(F.token===";"){for(Ce=1,ye=[Je];F.token===";";)T(F),F.token!=="]"&&(ye[Ce]=Te(F),Ce++);if(F.token!=="]")throw Re(F,"End of matrix ] expected");W(F),T(F),ke=ye[0].items.length;for(var Wt=1;Wt{var{typed:e,parse:n}=t;return e(af,{string:function(r){return n(r).compile()},"Array | Matrix":function(r){return it(r,function(s){return n(s).compile()})}})}),rf="evaluate",DD=["typed","parse"],AD=q(rf,DD,t=>{var{typed:e,parse:n}=t;return e(rf,{string:function(r){var s=si();return n(r).compile().evaluate(s)},"string, Map | Object":function(r,s){return n(r).compile().evaluate(s)},"Array | Matrix":function(r){var s=si();return it(r,function(i){return n(i).compile().evaluate(s)})},"Array | Matrix, Map | Object":function(r,s){return it(r,function(i){return n(i).compile().evaluate(s)})}})}),MD="Parser",SD=["evaluate"],CD=q(MD,SD,t=>{var{evaluate:e}=t;function n(){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:si(),writable:!1})}return n.prototype.type="Parser",n.prototype.isParser=!0,n.prototype.evaluate=function(a){return e(a,this.scope)},n.prototype.get=function(a){if(this.scope.has(a))return this.scope.get(a)},n.prototype.getAll=function(){return Z0(this.scope)},n.prototype.getAllAsMap=function(){return this.scope},n.prototype.set=function(a,r){return this.scope.set(a,r),r},n.prototype.remove=function(a){this.scope.delete(a)},n.prototype.clear=function(){this.scope.clear()},n},{isClass:!0}),nf="parser",TD=["typed","Parser"],$D=q(nf,TD,t=>{var{typed:e,Parser:n}=t;return e(nf,{"":function(){return new n}})}),sf="lup",FD=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],_D=q(sf,FD,t=>{var{typed:e,matrix:n,abs:a,addScalar:r,divideScalar:s,multiplyScalar:i,subtractScalar:p,larger:m,equalScalar:o,unaryMinus:l,DenseMatrix:u,SparseMatrix:c,Spa:f}=t;return e(sf,{DenseMatrix:function(d){return v(d)},SparseMatrix:function(d){return h(d)},Array:function(d){var N=n(d),g=v(N);return{L:g.L.valueOf(),U:g.U.valueOf(),p:g.p}}});function v(w){var d=w._size[0],N=w._size[1],g=Math.min(d,N),x=Xe(w._data),b=[],y=[d,g],D=[],A=[g,N],E,M,S,C=[];for(E=0;E0)for(E=0;E0&&z.forEach(0,$-1,function(oe,ue){c._forEachRow(oe,D,A,E,function(we,be){we>oe&&z.accumulate(we,l(i(be,ue)))})});var te=$,re=z.get($),me=a(re);z.forEach($+1,d-1,function(oe,ue){var we=a(ue);m(we,me)&&(te=oe,me=we,re=ue)}),$!==te&&(c._swapRows($,te,M[1],D,A,E),c._swapRows($,te,O[1],S,C,B),z.swap($,te),W($,te)),z.forEach(0,d-1,function(oe,ue){oe<=$?(S.push(ue),C.push(oe)):(ue=s(ue,re),o(ue,0)||(D.push(ue),A.push(oe)))})};for($=0;${var{typed:e,matrix:n,zeros:a,identity:r,isZero:s,equal:i,sign:p,sqrt:m,conj:o,unaryMinus:l,addScalar:u,divideScalar:c,multiplyScalar:f,subtractScalar:v,complex:h}=t;return Gt(e(of,{DenseMatrix:function(x){return d(x)},SparseMatrix:function(x){return N()},Array:function(x){var b=n(x),y=d(b);return{Q:y.Q.valueOf(),R:y.R.valueOf()}}}),{_denseQRimpl:w});function w(g){var x=g._size[0],b=g._size[1],y=r([x],"dense"),D=y._data,A=g.clone(),E=A._data,M,S,C,B=a([x],"");for(C=0;C0)for(var y=b[0][0].type==="Complex"?h(0):0,D=0;D=0;){var m=n[i+p],o=n[a+m];o===-1?(p--,s[e++]=m):(n[a+m]=n[r+o],++p,n[i+p]=o)}return e}function zD(t,e){if(!t)return null;var n=0,a,r=[],s=[],i=0,p=e,m=2*e;for(a=0;a=0;a--)t[a]!==-1&&(s[p+a]=s[i+t[a]],s[i+t[a]]=a);for(a=0;a{var{add:e,multiply:n,transpose:a}=t;return function(l,u){if(!u||l<=0||l>3)return null;var c=u._size,f=c[0],v=c[1],h=0,w=Math.max(16,10*Math.sqrt(v));w=Math.min(v-2,w);var d=r(l,u,f,v,w);ID(d,m,null);for(var N=d._index,g=d._ptr,x=g[v],b=[],y=[],D=0,A=v+1,E=2*(v+1),M=3*(v+1),S=4*(v+1),C=5*(v+1),B=6*(v+1),O=7*(v+1),P=b,$=s(v,g,y,D,M,P,E,O,A,B,S,C),T=i(v,g,y,C,S,B,w,A,M,P,E),I=0,_,W,K,Y,z,j,ge,te,re,me,oe,ue,we,be,Ae,_e;TL?(j=K,ge=V,te=y[D+K]-L):(j=N[V++],ge=g[j],te=y[D+j]),z=1;z<=te;z++)_=N[ge++],!((re=y[A+_])<=0)&&(le+=re,y[A+_]=-re,N[ee++]=_,y[E+_]!==-1&&(P[y[E+_]]=P[_]),P[_]!==-1?y[E+P[_]]=y[E+_]:y[M+y[C+_]]=y[E+_]);j!==K&&(g[j]=kr(K),y[B+j]=0)}for(L!==0&&(x=ee),y[C+K]=le,g[K]=X,y[D+K]=ee-X,y[S+K]=-2,$=p($,h,y,B,v),me=X;me=$?y[B+j]-=re:y[B+j]!==0&&(y[B+j]=y[C+j]+de)}for(me=X;me0?(_e+=xe,N[be++]=j,Ae+=j):(g[j]=kr(K),y[B+j]=0)}y[S+_]=be-ue+1;var R=be,U=ue+y[D+_];for(V=we+1;V=0))for(Ae=P[_],_=y[O+Ae],y[O+Ae]=-1;_!==-1&&y[E+_]!==-1;_=y[E+_],$++){for(te=y[D+_],oe=y[S+_],V=g[_]+1;V<=g[_]+te-1;V++)y[B+N[V]]=$;var he=_;for(W=y[E+_];W!==-1;){var fe=y[D+W]===te&&y[S+W]===oe;for(V=g[W]+1;fe&&V<=g[W]+te-1;V++)y[B+N[V]]!==$&&(fe=0);fe?(g[W]=kr(_),y[A+_]+=y[A+W],y[A+W]=0,y[S+W]=-1,W=y[E+W],y[E+he]=W):(he=W,W=y[E+W])}}for(V=X,me=X;me=0;W--)y[A+W]>0||(y[E+W]=y[M+g[W]],y[M+g[W]]=W);for(j=v;j>=0;j--)y[A+j]<=0||g[j]!==-1&&(y[E+j]=y[M+g[j]],y[M+g[j]]=j);for(K=0,_=0;_<=v;_++)g[_]===-1&&(K=$g(_,K,y,M,E,b,B));return b.splice(b.length-1,1),b};function r(o,l,u,c,f){var v=a(l);if(o===1&&c===u)return e(l,v);if(o===2){for(var h=v._index,w=v._ptr,d=0,N=0;Nf))for(var x=w[N+1];gh)u[w+b]=0,u[f+b]=-1,x++,l[b]=kr(o),u[w+o]++;else{var D=u[d+y];D!==-1&&(N[D]=b),u[g+b]=u[d+y],u[d+y]=b}}return x}function p(o,l,u,c,f){if(o<2||o+l<0){for(var v=0;v{var{transpose:e}=t;return function(n,a,r,s){if(!n||!a||!r)return null;var i=n._size,p=i[0],m=i[1],o,l,u,c,f,v,h,w=4*m+(s?m+p+1:0),d=[],N=0,g=m,x=2*m,b=3*m,y=4*m,D=5*m+1;for(u=0;u=1&&A[l]++,C.jleaf===2&&A[C.q]--}a[l]!==-1&&(d[N+l]=a[l])}for(l=0;l{var{add:e,multiply:n,transpose:a}=t,r=kD({add:e,multiply:n,transpose:a}),s=VD({transpose:a});return function(m,o,l){var u=o._ptr,c=o._size,f=c[1],v,h={};if(h.q=r(m,o),m&&!h.q)return null;if(l){var w=m?PD(o,null,h.q,0):o;h.parent=RD(w,1);var d=zD(h.parent,f);if(h.cp=s(w,h.parent,d,1),w&&h.parent&&h.cp&&i(w,h))for(h.unz=0,v=0;v=0;D--)for(E=o[D],M=o[D+1],A=E;A=0;y--)h[y]=-1,D=w[y],D!==-1&&(d[b+D]++===0&&(d[x+D]=y),d[N+y]=d[g+D],d[g+D]=y);for(m.lnz=0,m.m2=c,D=0;D=0;){t=a[c];var f=r?r[t]:t;zl(i,t)||(Fg(i,t),a[m+c]=f<0?0:lf(i[f]));var v=1;for(l=a[m+c],u=f<0?0:lf(i[f+1]);l{var{divideScalar:e,multiply:n,subtract:a}=t;return function(s,i,p,m,o,l,u){var c=s._values,f=s._index,v=s._ptr,h=s._size,w=h[1],d=i._values,N=i._index,g=i._ptr,x,b,y,D,A=XD(s,i,p,m,l);for(x=A;x{var{abs:e,divideScalar:n,multiply:a,subtract:r,larger:s,largerEq:i,SparseMatrix:p}=t,m=KD({divideScalar:n,multiply:a,subtract:r});return function(l,u,c){if(!l)return null;var f=l._size,v=f[1],h,w=100,d=100;u&&(h=u.q,w=u.lnz||w,d=u.unz||d);var N=[],g=[],x=[],b=new p({values:N,index:g,ptr:x,size:[v,v]}),y=[],D=[],A=[],E=new p({values:y,index:D,ptr:A,size:[v,v]}),M=[],S,C,B=[],O=[];for(S=0;S{var{typed:e,abs:n,add:a,multiply:r,transpose:s,divideScalar:i,subtract:p,larger:m,largerEq:o,SparseMatrix:l}=t,u=WD({add:a,multiply:r,transpose:s}),c=aA({abs:n,divideScalar:i,multiply:r,subtract:p,larger:m,largerEq:o,SparseMatrix:l});return e(mf,{"SparseMatrix, number, number":function(v,h,w){if(!qe(h)||h<0||h>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(w<0||w>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var d=u(h,v,!1),N=c(v,d,w);return{L:N.L,U:N.U,p:N.pinv,q:d.q,toString:function(){return"L: "+this.L.toString()+` -U: `+this.U.toString()+` -p: `+this.p.toString()+(this.q?` -q: `+this.q.toString():"")+` -`}}}})});function uf(t,e){var n,a=e.length,r=[];if(t)for(n=0;n{var{typed:e,matrix:n,lup:a,slu:r,usolve:s,lsolve:i,DenseMatrix:p}=t,m=yi({DenseMatrix:p});return e(pf,{"Array, Array | Matrix":function(c,f){c=n(c);var v=a(c),h=l(v.L,v.U,v.p,null,f);return h.valueOf()},"DenseMatrix, Array | Matrix":function(c,f){var v=a(c);return l(v.L,v.U,v.p,null,f)},"SparseMatrix, Array | Matrix":function(c,f){var v=a(c);return l(v.L,v.U,v.p,null,f)},"SparseMatrix, Array | Matrix, number, number":function(c,f,v,h){var w=r(c,v,h);return l(w.L,w.U,w.p,w.q,f)},"Object, Array | Matrix":function(c,f){return l(c.L,c.U,c.p,c.q,f)}});function o(u){if(Ve(u))return u;if(vt(u))return n(u);throw new TypeError("Invalid Matrix LU decomposition")}function l(u,c,f,v,h){u=o(u),c=o(c),f&&(h=m(u,h,!0),h._data=uf(f,h._data));var w=i(u,h),d=s(c,w);return v&&(d._data=uf(v,d._data)),d}}),cf="polynomialRoot",oA=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],lA=q(cf,oA,t=>{var{typed:e,isZero:n,equalScalar:a,add:r,subtract:s,multiply:i,divide:p,sqrt:m,unaryMinus:o,cbrt:l,typeOf:u,im:c,re:f}=t;return e(cf,{"number|Complex, ...number|Complex":(v,h)=>{for(var w=[v,...h];w.length>0&&n(w[w.length-1]);)w.pop();if(w.length<2)throw new RangeError("Polynomial [".concat(v,", ").concat(h,"] must have a non-zero non-constant coefficient"));switch(w.length){case 2:return[o(p(w[0],w[1]))];case 3:{var[d,N,g]=w,x=i(2,g),b=i(N,N),y=i(4,g,d);if(a(b,y))return[p(o(N),x)];var D=m(s(b,y));return[p(s(D,N),x),p(s(o(D),N),x)]}case 4:{var[A,E,M,S]=w,C=o(i(3,S)),B=i(M,M),O=i(3,S,E),P=r(i(2,M,M,M),i(27,S,S,A)),$=i(9,S,M,E);if(a(B,O)&&a(P,$))return[p(M,C)];var T=s(B,O),I=s(P,$),_=r(i(18,S,M,E,A),i(M,M,E,E)),W=r(i(4,M,M,M,A),i(4,S,E,E,E),i(27,S,S,A,A));if(a(_,W))return[p(s(i(4,S,M,E),r(i(9,S,S,A),i(M,M,M))),i(S,T)),p(s(i(9,S,A),i(M,E)),i(2,T))];var K;a(B,O)?K=I:K=p(r(I,m(s(i(I,I),i(4,T,T,T)))),2);var Y=!0,z=l(K,Y).toArray().map(j=>p(r(M,j,p(T,j)),C));return z.map(j=>u(j)==="Complex"&&a(f(j),f(j)+c(j))?f(j):j)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(w))}}})}),mA="Help",uA=["evaluate"],pA=q(mA,uA,t=>{var{evaluate:e}=t;function n(a){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!a)throw new Error('Argument "doc" missing');this.doc=a}return n.prototype.type="Help",n.prototype.isHelp=!0,n.prototype.toString=function(){var a=this.doc||{},r=` -`;if(a.name&&(r+="Name: "+a.name+` - -`),a.category&&(r+="Category: "+a.category+` - -`),a.description&&(r+=`Description: - `+a.description+` - -`),a.syntax&&(r+=`Syntax: - `+a.syntax.join(` - `)+` - -`),a.examples){r+=`Examples: -`;for(var s=!1,i=e("config()"),p={config:u=>(s=!0,e("config(newConfig)",{newConfig:u}))},m=0;ms!=="mathjs").forEach(s=>{r[s]=a[s]}),new n(r)},n.prototype.valueOf=n.prototype.toString,n},{isClass:!0}),cA="Chain",fA=["?on","math","typed"],hA=q(cA,fA,t=>{var{on:e,math:n,typed:a}=t;function r(o){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");Fh(o)?this.value=o.value:this.value=o}r.prototype.type="Chain",r.prototype.isChain=!0,r.prototype.done=function(){return this.value},r.prototype.valueOf=function(){return this.value},r.prototype.toString=function(){return nt(this.value)},r.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},r.fromJSON=function(o){return new r(o.value)};function s(o,l){typeof l=="function"&&(r.prototype[o]=p(l))}function i(o,l){u0(r.prototype,o,function(){var c=l();if(typeof c=="function")return p(c)})}function p(o){return function(){if(arguments.length===0)return new r(o(this.value));for(var l=[this.value],u=0;uo[v])};for(var c in o)u(c)}};var m={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return r.createProxy(n),e&&e("import",function(o,l,u){u||i(o,l)}),r},{isClass:!0}),ff={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]},vA={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]},gA={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]},dA={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]},yA={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},wA={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},xA={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]},bA={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]},NA={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},EA={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},DA={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:["phi"],seealso:[]},hf={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]},AA={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]},MA={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]},SA={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]},CA={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]},TA={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]},$A={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","complex","fraction","index","matrix","string","unit"]},FA={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]},_A={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]},BA={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]},OA={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]},PA={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]},zA={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]},RA={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","boolean","complex","fraction","index","matrix","string","unit"]},IA={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]},qA={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]},LA={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]},kA={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]},UA={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]},GA={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]},HA={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]},VA={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]},JA={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]},ZA={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]},WA={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]},YA={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]},XA={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]},QA={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]},jA={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]},KA={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]},e8={name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]},t8={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]},a8={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]},r8={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]},n8={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]},s8={name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]},i8={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]},o8={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]},l8={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]},m8={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]},u8={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]},p8={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]},c8={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]},f8={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]},h8={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]},v8={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]},g8={name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]},d8={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]},y8={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]},w8={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]},x8={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]},b8={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]},N8={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]},E8={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenusa of a list with values. ",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]},D8={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]},A8={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]},M8={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]},S8={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]},C8={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a `value+1`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]},T8={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]},$8={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]},F8={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]},_8={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']},B8={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]},O8={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]},P8={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]},z8={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]},R8={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]},I8={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]},q8={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]},L8={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]},k8={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]},U8={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]},G8={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]},H8={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]},V8={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]},J8={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]},Z8={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]},W8={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},Y8={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},X8={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]},Q8={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]},j8={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]},K8={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]},eM={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]},tM={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]},aM={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]},rM={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]},nM={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]},sM={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]},iM={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]},oM={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]},lM={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]},mM={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]},uM={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]},pM={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]},cM={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]},fM={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]},hM={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]},vM={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]},gM={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]},dM={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]},yM={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},wM={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]},xM={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]},bM={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},NM={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},EM={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},DM={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicant the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]},AM={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]},MM={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]},SM={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]},CM={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]},TM={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]},$M={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]},FM={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},_M={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]},BM={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore–Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]},OM={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]},PM={name:"map",category:"Matrix",syntax:["map(x, callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array.",examples:["map([1, 2, 3], square)"],seealso:["filter","forEach"]},zM={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]},RM={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]},IM={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]},qM={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]},LM={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]},kM={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]},UM={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]},GM={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]},HM={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]},VM={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]},JM={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]},ZM={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]},WM={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]},YM={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]},XM={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]},QM={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]},jM={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},KM={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]},e7={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]},t7={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]},a7={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]},r7={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]},n7={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]},s7={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]},i7={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]},o7={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]},l7={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]},m7={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]},u7={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]},p7={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]},c7={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]},f7={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]},h7={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]},v7={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]},g7={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]},d7={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]},y7={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]},w7={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]},x7={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]},b7={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]},N7={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]},E7={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]},D7={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]},A7={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]},M7={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]},S7={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]},C7={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]},T7={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]},$7={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]},F7={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]},_7={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]},B7={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]},O7={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]},P7={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]},z7={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]},R7={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemanns Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]},I7={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]},q7={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]},L7={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]},k7={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]},U7={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]},G7={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]},H7={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]},V7={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probablity are: Number, BigNumber. - -In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]},J7={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]},Z7={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]},W7={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]},Y7={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]},X7={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]},Q7={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]},j7={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]},K7={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]},e4={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the hyperbolic arccotangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]},t4={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]},a4={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the hyperbolic arccosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},r4={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]},n4={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},s4={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]},i4={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]},o4={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]},l4={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]},m4={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]},u4={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]},p4={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},c4={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]},f4={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]},h4={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]},v4={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]},g4={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]},d4={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]},y4={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]},w4={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},x4={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]},b4={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]},N4={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]},E4={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]},D4={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables,and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]},A4={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]},M4={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]},S4={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]},C4={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]},T4={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]},$4={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]},F4={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]},_4={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},B4={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},O4={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]},P4={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","fraction","bignumber","string","format"]},z4={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]},R4={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]},I4={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]},q4={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]},L4={bignumber:$A,boolean:FA,complex:_A,createUnit:BA,fraction:OA,index:PA,matrix:zA,number:RA,sparse:IA,splitUnit:qA,string:LA,unit:kA,e:ff,E:ff,false:vA,i:gA,Infinity:dA,LN2:wA,LN10:yA,LOG2E:bA,LOG10E:xA,NaN:NA,null:EA,pi:hf,PI:hf,phi:DA,SQRT1_2:AA,SQRT2:MA,tau:SA,true:CA,version:TA,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Borh magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Borh radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:VA,lsolve:ZA,lsolveAll:WA,lup:YA,lusolve:XA,leafCount:JA,polynomialRoot:QA,resolve:e8,simplify:t8,simplifyConstant:a8,simplifyCore:r8,symbolicEqual:s8,rationalize:KA,slu:n8,usolve:i8,usolveAll:o8,qr:jA,abs:l8,add:m8,cbrt:u8,ceil:p8,cube:c8,divide:f8,dotDivide:h8,dotMultiply:v8,dotPow:g8,exp:d8,expm:y8,expm1:w8,fix:x8,floor:b8,gcd:N8,hypot:E8,lcm:A8,log:M8,log2:T8,log1p:C8,log10:S8,mod:$8,multiply:F8,norm:_8,nthRoot:B8,nthRoots:O8,pow:P8,round:z8,sign:R8,sqrt:I8,sqrtm:q8,square:G8,subtract:H8,unaryMinus:V8,unaryPlus:J8,xgcd:Z8,invmod:D8,bitAnd:W8,bitNot:Y8,bitOr:X8,bitXor:Q8,leftShift:j8,rightArithShift:K8,rightLogShift:eM,bellNumbers:tM,catalan:aM,composition:rM,stirlingS2:nM,config:UA,import:GA,typed:HA,arg:sM,conj:iM,re:lM,im:oM,evaluate:mM,help:uM,distance:pM,intersect:cM,and:fM,not:hM,or:vM,xor:gM,concat:yM,count:wM,cross:xM,column:dM,ctranspose:bM,det:NM,diag:EM,diff:DM,dot:AM,getMatrixDataType:$M,identity:FM,filter:SM,flatten:CM,forEach:TM,inv:_M,pinv:BM,eigs:MM,kron:OM,matrixFromFunction:RM,matrixFromRows:IM,matrixFromColumns:zM,map:PM,ones:qM,partitionSelect:LM,range:kM,resize:GM,reshape:UM,rotate:HM,rotationMatrix:VM,row:JM,size:ZM,sort:WM,squeeze:YM,subset:XM,trace:QM,transpose:jM,zeros:KM,fft:e7,ifft:t7,sylvester:L8,schur:k8,lyap:U8,solveODE:q4,combinations:a7,combinationsWithRep:r7,factorial:n7,gamma:s7,kldivergence:o7,lgamma:i7,multinomial:l7,permutations:m7,pickRandom:u7,random:p7,randomInt:c7,compare:f7,compareNatural:h7,compareText:v7,deepEqual:g7,equal:d7,equalText:y7,larger:w7,largerEq:x7,smaller:b7,smallerEq:N7,unequal:E7,setCartesian:D7,setDifference:A7,setDistinct:M7,setIntersect:S7,setIsSubset:C7,setMultiplicity:T7,setPowerset:$7,setSize:F7,setSymDifference:_7,setUnion:B7,zpk2tf:O7,freqz:P7,erf:z7,zeta:R7,cumsum:Z7,mad:I7,max:q7,mean:L7,median:k7,min:U7,mode:G7,prod:H7,quantileSeq:V7,std:J7,sum:W7,variance:Y7,corr:X7,acos:Q7,acosh:j7,acot:K7,acoth:e4,acsc:t4,acsch:a4,asec:r4,asech:n4,asin:s4,asinh:i4,atan:o4,atanh:m4,atan2:l4,cos:u4,cosh:p4,cot:c4,coth:f4,csc:h4,csch:v4,sec:g4,sech:d4,sin:y4,sinh:w4,tan:x4,tanh:b4,to:N4,clone:D4,format:A4,bin:E4,oct:z4,hex:S4,isNaN:T4,isInteger:C4,isNegative:$4,isNumeric:F4,hasNumericValue:M4,isPositive:_4,isPrime:B4,isZero:O4,print:R4,typeOf:I4,numeric:P4},vf="help",k4=["typed","mathWithTransform","Help"],U4=q(vf,k4,t=>{var{typed:e,mathWithTransform:n,Help:a}=t;return e(vf,{any:function(s){var i,p=s;if(typeof s!="string"){for(i in n)if(ze(n,i)&&s===n[i]){p=i;break}}var m=fa(L4,p);if(!m){var o=typeof p=="function"?p.name:p;throw new Error('No documentation found on "'+o+'"')}return new a(m)}})}),gf="chain",G4=["typed","Chain"],H4=q(gf,G4,t=>{var{typed:e,Chain:n}=t;return e(gf,{"":function(){return new n},any:function(r){return new n(r)}})}),df="det",V4=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],J4=q(df,V4,t=>{var{typed:e,matrix:n,subtractScalar:a,multiply:r,divideScalar:s,isZero:i,unaryMinus:p}=t;return e(df,{any:function(l){return Xe(l)},"Array | Matrix":function(l){var u;switch(Ve(l)?u=l.size():Array.isArray(l)?(l=n(l),u=l.size()):u=[],u.length){case 0:return Xe(l);case 1:if(u[0]===1)return Xe(l.valueOf()[0]);if(u[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+nt(u)+")");case 2:{var c=u[0],f=u[1];if(c===f)return m(l.clone().valueOf(),c);if(f===0)return 1;throw new RangeError("Matrix must be square (size: "+nt(u)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+nt(u)+")")}}});function m(o,l,u){if(l===1)return Xe(o[0][0]);if(l===2)return a(r(o[0][0],o[1][1]),r(o[1][0],o[0][1]));for(var c=!1,f=new Array(l).fill(0).map((D,A)=>A),v=0;v{var{typed:e,matrix:n,divideScalar:a,addScalar:r,multiply:s,unaryMinus:i,det:p,identity:m,abs:o}=t;return e(yf,{"Array | Matrix":function(c){var f=Ve(c)?c.size():et(c);switch(f.length){case 1:if(f[0]===1)return Ve(c)?n([a(1,c.valueOf()[0])]):[a(1,c[0])];throw new RangeError("Matrix must be square (size: "+nt(f)+")");case 2:{var v=f[0],h=f[1];if(v===h)return Ve(c)?n(l(c.valueOf(),v,h),c.storage()):l(c,v,h);throw new RangeError("Matrix must be square (size: "+nt(f)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+nt(f)+")")}},any:function(c){return a(1,c)}});function l(u,c,f){var v,h,w,d,N;if(c===1){if(d=u[0][0],d===0)throw Error("Cannot calculate inverse, determinant is zero");return[[a(1,d)]]}else if(c===2){var g=p(u);if(g===0)throw Error("Cannot calculate inverse, determinant is zero");return[[a(u[1][1],g),a(i(u[0][1]),g)],[a(i(u[1][0]),g),a(u[0][0],g)]]}else{var x=u.concat();for(v=0;vD&&(D=o(x[v][y]),A=v),v++;if(D===0)throw Error("Cannot calculate inverse, determinant is zero");v=A,v!==y&&(N=x[y],x[y]=x[v],x[v]=N,N=b[y],b[y]=b[v],b[v]=N);var E=x[y],M=b[y];for(v=0;v{var{typed:e,matrix:n,inv:a,deepEqual:r,equal:s,dotDivide:i,dot:p,ctranspose:m,divideScalar:o,multiply:l,add:u,Complex:c}=t;return e(wf,{"Array | Matrix":function(g){var x=Ve(g)?g.size():et(g);switch(x.length){case 1:return d(g)?m(g):x[0]===1?a(g):i(m(g),p(g,g));case 2:{if(d(g))return m(g);var b=x[0],y=x[1];if(b===y)try{return a(g)}catch(D){if(!(D instanceof Error&&D.message.match(/Cannot calculate inverse, determinant is zero/)))throw D}return Ve(g)?n(f(g.valueOf(),b,y),g.storage()):f(g,b,y)}default:throw new RangeError("Matrix must be two dimensional (size: "+nt(x)+")")}},any:function(g){return s(g,0)?Xe(g):o(1,g)}});function f(N,g,x){var{C:b,F:y}=h(N,g,x),D=l(a(l(m(b),b)),m(b)),A=l(m(y),a(l(y,m(y))));return l(A,D)}function v(N,g,x){for(var b=Xe(N),y=0,D=0;DA.filter((M,S)=>S!w(p(b[E],b[E])));return{C:y,F:D}}function w(N){return s(u(N,c(1,1)),u(0,c(1,1)))}function d(N){return r(u(N,c(1,1)),u(l(N,0),c(1,1)))}});function Q4(t){var{addScalar:e,subtract:n,flatten:a,multiply:r,multiplyScalar:s,divideScalar:i,sqrt:p,abs:m,bignumber:o,diag:l,size:u,reshape:c,inv:f,qr:v,usolve:h,usolveAll:w,equal:d,complex:N,larger:g,smaller:x,matrixFromColumns:b,dot:y}=t;function D(Y,z,j,ge){var te=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,re=A(Y,z,j,ge,te);E(Y,z,j,ge,te,re);var{values:me,C:oe}=M(Y,z,j,ge,te);if(te){var ue=S(Y,z,oe,re,me,j,ge);return{values:me,eigenvectors:ue}}return{values:me}}function A(Y,z,j,ge,te){var re=ge==="BigNumber",me=ge==="Complex",oe=re?o(0):0,ue=re?o(1):me?N(1):1,we=re?o(1):1,be=re?o(10):2,Ae=s(be,be),_e;te&&(_e=Array(z).fill(ue));for(var L=!1;!L;){L=!0;for(var J=0;J1&&(L=l(Array(be-1).fill(oe)))),be-=1,ue.pop();for(var xe=0;xe2&&(L=l(Array(be-2).fill(oe)))),be-=2,ue.pop(),ue.pop();for(var U=0;U+n(m(fe),m(Ne))),J>100){var ae=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+we.join(", "));throw ae.values=we,ae.vectors=[],ae}var he=te?r(_e,P(Ae,z)):void 0;return{values:we,C:he}}function S(Y,z,j,ge,te,re,me){var oe=f(j),ue=r(oe,Y,j),we=me==="BigNumber",be=me==="Complex",Ae=we?o(0):be?N(0):0,_e=we?o(1):be?N(1):1,L=[],J=[];for(var le of te){var V=$(L,le,d);V===-1?(L.push(le),J.push(1)):J[V]+=1}for(var X=[],ee=L.length,de=Array(z).fill(Ae),xe=l(Array(z).fill(_e)),R=function(){var he=L[U],fe=n(ue,r(he,xe)),Ne=w(fe,de);for(Ne.shift();Ne.lengthr(Se,Oe)),X.push(...Ne.map(Oe=>({value:he,vector:a(Oe)})))},U=0;U=5)return null;for(oe=0;;){var ue=h(Y,me);if(x(W(_(me,[ue])),ge))break;if(++oe>=10)return null;me=K(ue)}return me}function I(Y,z,j){var ge=j==="BigNumber",te=j==="Complex",re=Array(Y).fill(0).map(me=>2*Math.random()-1);return ge&&(re=re.map(me=>o(me))),te&&(re=re.map(me=>N(me))),re=_(re,z),K(re,j)}function _(Y,z){var j=u(Y);for(var ge of z)ge=c(ge,j),Y=n(Y,r(i(y(ge,Y),y(ge,ge)),ge));return Y}function W(Y){return m(p(y(Y,Y)))}function K(Y,z){var j=z==="BigNumber",ge=z==="Complex",te=j?o(1):ge?N(1):1;return r(i(te,W(Y)),Y)}return D}function j4(t){var{config:e,addScalar:n,subtract:a,abs:r,atan:s,cos:i,sin:p,multiplyScalar:m,inv:o,bignumber:l,multiply:u,add:c}=t;function f(E,M){var S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.epsilon,C=arguments.length>3?arguments[3]:void 0,B=arguments.length>4?arguments[4]:void 0;if(C==="number")return v(E,S,B);if(C==="BigNumber")return h(E,S,B);throw TypeError("Unsupported data type: "+C)}function v(E,M,S){var C=E.length,B=Math.abs(M/C),O,P;if(S){P=new Array(C);for(var $=0;$=Math.abs(B);){var I=T[0][0],_=T[0][1];O=w(E[I][I],E[_][_],E[I][_]),E=b(E,O,I,_),S&&(P=N(P,O,I,_)),T=y(E)}for(var W=Array(C).fill(0),K=0;K=r(B);){var I=T[0][0],_=T[0][1];O=d(E[I][I],E[_][_],E[I][_]),E=x(E,O,I,_),S&&(P=g(P,O,I,_)),T=D(E)}for(var W=Array(C).fill(0),K=0;K({value:B[z],vector:Y}));return{values:B,eigenvectors:K}}return f}var K4="eigs",eS=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],tS=q(K4,eS,t=>{var{config:e,typed:n,matrix:a,addScalar:r,subtract:s,equal:i,abs:p,atan:m,cos:o,sin:l,multiplyScalar:u,divideScalar:c,inv:f,bignumber:v,multiply:h,add:w,larger:d,column:N,flatten:g,number:x,complex:b,sqrt:y,diag:D,size:A,reshape:E,qr:M,usolve:S,usolveAll:C,im:B,re:O,smaller:P,matrixFromColumns:$,dot:T}=t,I=j4({config:e,addScalar:r,subtract:s,column:N,flatten:g,equal:i,abs:p,atan:m,cos:o,sin:l,multiplyScalar:u,inv:f,bignumber:v,complex:b,multiply:h,add:w}),_=Q4({config:e,addScalar:r,subtract:s,multiply:h,multiplyScalar:u,flatten:g,divideScalar:c,sqrt:y,abs:p,bignumber:v,diag:D,size:A,reshape:E,qr:M,inv:f,usolve:S,usolveAll:C,equal:i,complex:b,larger:d,smaller:P,matrixFromColumns:$,dot:T});return n("eigs",{Array:function(re){return W(a(re))},"Array, number|BigNumber":function(re,me){return W(a(re),{precision:me})},"Array, Object"(te,re){return W(a(te),re)},Matrix:function(re){return W(re,{matricize:!0})},"Matrix, number|BigNumber":function(re,me){return W(re,{precision:me,matricize:!0})},"Matrix, Object":function(re,me){var oe={matricize:!0};return Gt(oe,me),W(re,oe)}});function W(te){var re,me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},oe="eigenvectors"in me?me.eigenvectors:!0,ue=(re=me.precision)!==null&&re!==void 0?re:e.epsilon,we=K(te,ue,oe);return me.matricize&&(we.values=a(we.values),oe&&(we.eigenvectors=we.eigenvectors.map(be=>{var{value:Ae,vector:_e}=be;return{value:Ae,vector:a(_e)}}))),oe&&Object.defineProperty(we,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),we}function K(te,re,me){var oe=te.toArray(),ue=te.size();if(ue.length!==2||ue[0]!==ue[1])throw new RangeError("Matrix must be square (size: ".concat(nt(ue),")"));var we=ue[0];if(z(oe,we,re)&&(j(oe,we),Y(oe,we,re))){var be=ge(te,oe,we);return I(oe,we,re,be,me)}var Ae=ge(te,oe,we);return _(oe,we,re,Ae,me)}function Y(te,re,me){for(var oe=0;oe{var{typed:e,abs:n,add:a,identity:r,inv:s,multiply:i}=t;return e(xf,{Matrix:function(u){var c=u.size();if(c.length!==2||c[0]!==c[1])throw new RangeError("Matrix must be square (size: "+nt(c)+")");for(var f=c[0],v=1e-15,h=p(u),w=m(h,v),d=w.q,N=w.j,g=i(u,Math.pow(2,-N)),x=r(f),b=r(f),y=1,D=g,A=-1,E=1;E<=d;E++)E>1&&(D=i(D,g),A=-A),y=y*(d-E+1)/((2*d-E+1)*E),x=a(x,i(y,D)),b=a(b,i(y*A,D));for(var M=i(s(b),x),S=0;S{var{typed:e,abs:n,add:a,multiply:r,map:s,sqrt:i,subtract:p,inv:m,size:o,max:l,identity:u}=t,c=1e3,f=1e-6;function v(h){var w,d=0,N=h,g=u(o(h));do{var x=N;if(N=r(.5,a(x,m(g))),g=r(.5,a(g,m(x))),w=l(n(p(N,x))),w>f&&++d>c)throw new Error("computing square root of matrix: iterative method could not converge")}while(w>f);return N}return e(bf,{"Array | Matrix":function(w){var d=Ve(w)?w.size():et(w);switch(d.length){case 1:if(d[0]===1)return s(w,i);throw new RangeError("Matrix must be square (size: "+nt(d)+")");case 2:{var N=d[0],g=d[1];if(N===g)return v(w);throw new RangeError("Matrix must be square (size: "+nt(d)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+nt(d)+")")}}})}),Nf="sylvester",iS=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],oS=q(Nf,iS,t=>{var{typed:e,schur:n,matrixFromColumns:a,matrix:r,multiply:s,range:i,concat:p,transpose:m,index:o,subset:l,add:u,subtract:c,identity:f,lusolve:v,abs:h}=t;return e(Nf,{"Matrix, Matrix, Matrix":w,"Array, Matrix, Matrix":function(N,g,x){return w(r(N),g,x)},"Array, Array, Matrix":function(N,g,x){return w(r(N),r(g),x)},"Array, Matrix, Array":function(N,g,x){return w(r(N),g,r(x))},"Matrix, Array, Matrix":function(N,g,x){return w(N,r(g),x)},"Matrix, Array, Array":function(N,g,x){return w(N,r(g),r(x))},"Matrix, Matrix, Array":function(N,g,x){return w(N,g,r(x))},"Array, Array, Array":function(N,g,x){return w(r(N),r(g),r(x)).toArray()}});function w(d,N,g){for(var x=N.size()[0],b=d.size()[0],y=n(d),D=y.T,A=y.U,E=n(s(-1,N)),M=E.T,S=E.U,C=s(s(m(A),g),S),B=i(0,b),O=[],P=(be,Ae)=>p(be,Ae,1),$=(be,Ae)=>p(be,Ae,0),T=0;T1e-5){for(var I=$(l(C,o(B,T)),l(C,o(B,T+1))),_=0;_{var{typed:e,matrix:n,identity:a,multiply:r,qr:s,norm:i,subtract:p}=t;return e(Ef,{Array:function(l){var u=m(n(l));return{U:u.U.valueOf(),T:u.T.valueOf()}},Matrix:function(l){return m(l)}});function m(o){var l=o.size()[0],u=o,c=a(l),f=0,v;do{v=u;var h=s(u),w=h.Q,d=h.R;if(u=r(d,w),c=r(c,w),f++>100)break}while(i(p(u,v))>1e-4);return{U:c,T:u}}}),Df="lyap",uS=["typed","matrix","sylvester","multiply","transpose"],pS=q(Df,uS,t=>{var{typed:e,matrix:n,sylvester:a,multiply:r,transpose:s}=t;return e(Df,{"Matrix, Matrix":function(p,m){return a(p,s(p),r(-1,m))},"Array, Matrix":function(p,m){return a(n(p),s(n(p)),r(-1,m))},"Matrix, Array":function(p,m){return a(p,s(n(p)),n(r(-1,m)))},"Array, Array":function(p,m){return a(n(p),s(n(p)),n(r(-1,m))).toArray()}})}),cS="divide",fS=["typed","matrix","multiply","equalScalar","divideScalar","inv"],hS=q(cS,fS,t=>{var{typed:e,matrix:n,multiply:a,equalScalar:r,divideScalar:s,inv:i}=t,p=aa({typed:e,equalScalar:r}),m=Xa({typed:e});return e("divide",_h({"Array | Matrix, Array | Matrix":function(l,u){return a(l,i(u))},"DenseMatrix, any":function(l,u){return m(l,u,s,!1)},"SparseMatrix, any":function(l,u){return p(l,u,s,!1)},"Array, any":function(l,u){return m(n(l),u,s,!1).valueOf()},"any, Array | Matrix":function(l,u){return a(l,i(u))}},s.signatures))}),Af="distance",vS=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],gS=q(Af,vS,t=>{var{typed:e,addScalar:n,subtractScalar:a,multiplyScalar:r,divideScalar:s,deepEqual:i,sqrt:p,abs:m}=t;return e(Af,{"Array, Array, Array":function(b,y,D){if(b.length===2&&y.length===2&&D.length===2){if(!l(b))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!l(y))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!l(D))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(i(y,D))throw new TypeError("LinePoint1 should not be same with LinePoint2");var A=a(D[1],y[1]),E=a(y[0],D[0]),M=a(r(D[0],y[1]),r(y[0],D[1]));return w(b[0],b[1],A,E,M)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(b,y,D){if(Object.keys(b).length===2&&Object.keys(y).length===2&&Object.keys(D).length===2){if(!l(b))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!l(y))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!l(D))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(i(v(y),v(D)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in b&&"pointY"in b&&"lineOnePtX"in y&&"lineOnePtY"in y&&"lineTwoPtX"in D&&"lineTwoPtY"in D){var A=a(D.lineTwoPtY,y.lineOnePtY),E=a(y.lineOnePtX,D.lineTwoPtX),M=a(r(D.lineTwoPtX,y.lineOnePtY),r(y.lineOnePtX,D.lineTwoPtY));return w(b.pointX,b.pointY,A,E,M)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(b,y){if(b.length===2&&y.length===3){if(!l(b))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!u(y))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return w(b[0],b[1],y[0],y[1],y[2])}else if(b.length===3&&y.length===6){if(!u(b))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!f(y))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return d(b[0],b[1],b[2],y[0],y[1],y[2],y[3],y[4],y[5])}else if(b.length===y.length&&b.length>0){if(!c(b))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!c(y))throw new TypeError("All values of an array should be numbers or BigNumbers");return N(b,y)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(b,y){if(Object.keys(b).length===2&&Object.keys(y).length===3){if(!l(b))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!u(y))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in b&&"pointY"in b&&"xCoeffLine"in y&&"yCoeffLine"in y&&"constant"in y)return w(b.pointX,b.pointY,y.xCoeffLine,y.yCoeffLine,y.constant);throw new TypeError("Key names do not match")}else if(Object.keys(b).length===3&&Object.keys(y).length===6){if(!u(b))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!f(y))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in b&&"pointY"in b&&"x0"in y&&"y0"in y&&"z0"in y&&"a"in y&&"b"in y&&"c"in y)return d(b.pointX,b.pointY,b.pointZ,y.x0,y.y0,y.z0,y.a,y.b,y.c);throw new TypeError("Key names do not match")}else if(Object.keys(b).length===2&&Object.keys(y).length===2){if(!l(b))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!l(y))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in b&&"pointOneY"in b&&"pointTwoX"in y&&"pointTwoY"in y)return N([b.pointOneX,b.pointOneY],[y.pointTwoX,y.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(b).length===3&&Object.keys(y).length===3){if(!u(b))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!u(y))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in b&&"pointOneY"in b&&"pointOneZ"in b&&"pointTwoX"in y&&"pointTwoY"in y&&"pointTwoZ"in y)return N([b.pointOneX,b.pointOneY,b.pointOneZ],[y.pointTwoX,y.pointTwoY,y.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(b){if(!h(b))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return g(b)}});function o(x){return typeof x=="number"||at(x)}function l(x){return x.constructor!==Array&&(x=v(x)),o(x[0])&&o(x[1])}function u(x){return x.constructor!==Array&&(x=v(x)),o(x[0])&&o(x[1])&&o(x[2])}function c(x){return Array.isArray(x)||(x=v(x)),x.every(o)}function f(x){return x.constructor!==Array&&(x=v(x)),o(x[0])&&o(x[1])&&o(x[2])&&o(x[3])&&o(x[4])&&o(x[5])}function v(x){for(var b=Object.keys(x),y=[],D=0;Db.length!==2||!o(b[0])||!o(b[1])))return!1}else if(x[0].length===3&&o(x[0][0])&&o(x[0][1])&&o(x[0][2])){if(x.some(b=>b.length!==3||!o(b[0])||!o(b[1])||!o(b[2])))return!1}else return!1;return!0}function w(x,b,y,D,A){var E=m(n(n(r(y,x),r(D,b)),A)),M=p(n(r(y,y),r(D,D)));return s(E,M)}function d(x,b,y,D,A,E,M,S,C){var B=[a(r(a(A,b),C),r(a(E,y),S)),a(r(a(E,y),M),r(a(D,x),C)),a(r(a(D,x),S),r(a(A,b),M))];B=p(n(n(r(B[0],B[0]),r(B[1],B[1])),r(B[2],B[2])));var O=p(n(n(r(M,M),r(S,S)),r(C,C)));return s(B,O)}function N(x,b){for(var y=x.length,D=0,A=0,E=0;E{var{typed:e,config:n,abs:a,add:r,addScalar:s,matrix:i,multiply:p,multiplyScalar:m,divideScalar:o,subtract:l,smaller:u,equalScalar:c,flatten:f,isZero:v,isNumeric:h}=t;return e("intersect",{"Array, Array, Array":w,"Array, Array, Array, Array":d,"Matrix, Matrix, Matrix":function(S,C,B){var O=w(S.valueOf(),C.valueOf(),B.valueOf());return O===null?null:i(O)},"Matrix, Matrix, Matrix, Matrix":function(S,C,B,O){var P=d(S.valueOf(),C.valueOf(),B.valueOf(),O.valueOf());return P===null?null:i(P)}});function w(M,S,C){if(M=N(M),S=N(S),C=N(C),!x(M))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!x(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!b(C))throw new TypeError("Array with 4 numbers expected as third argument");return E(M[0],M[1],M[2],S[0],S[1],S[2],C[0],C[1],C[2],C[3])}function d(M,S,C,B){if(M=N(M),S=N(S),C=N(C),B=N(B),M.length===2){if(!g(M))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!g(S))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!g(C))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!g(B))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return y(M,S,C,B)}else if(M.length===3){if(!x(M))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!x(S))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!x(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!x(B))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return A(M[0],M[1],M[2],S[0],S[1],S[2],C[0],C[1],C[2],B[0],B[1],B[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function N(M){return M.length===1?M[0]:M.length>1&&Array.isArray(M[0])&&M.every(S=>Array.isArray(S)&&S.length===1)?f(M):M}function g(M){return M.length===2&&h(M[0])&&h(M[1])}function x(M){return M.length===3&&h(M[0])&&h(M[1])&&h(M[2])}function b(M){return M.length===4&&h(M[0])&&h(M[1])&&h(M[2])&&h(M[3])}function y(M,S,C,B){var O=M,P=C,$=l(O,S),T=l(P,B),I=l(m($[0],T[1]),m(T[0],$[1]));if(v(I)||u(a(I),n.epsilon))return null;var _=m(T[0],O[1]),W=m(T[1],O[0]),K=m(T[0],P[1]),Y=m(T[1],P[0]),z=o(s(l(l(_,W),K),Y),I);return r(p($,z),O)}function D(M,S,C,B,O,P,$,T,I,_,W,K){var Y=m(l(M,S),l(C,B)),z=m(l(O,P),l($,T)),j=m(l(I,_),l(W,K));return s(s(Y,z),j)}function A(M,S,C,B,O,P,$,T,I,_,W,K){var Y=D(M,$,_,$,S,T,W,T,C,I,K,I),z=D(_,$,B,M,W,T,O,S,K,I,P,C),j=D(M,$,B,M,S,T,O,S,C,I,P,C),ge=D(_,$,_,$,W,T,W,T,K,I,K,I),te=D(B,M,B,M,O,S,O,S,P,C,P,C),re=l(m(Y,z),m(j,ge)),me=l(m(te,ge),m(z,z));if(v(me))return null;var oe=o(re,me),ue=o(s(Y,m(oe,z)),ge),we=s(M,m(oe,l(B,M))),be=s(S,m(oe,l(O,S))),Ae=s(C,m(oe,l(P,C))),_e=s($,m(ue,l(_,$))),L=s(T,m(ue,l(W,T))),J=s(I,m(ue,l(K,I)));return c(we,_e)&&c(be,L)&&c(Ae,J)?[we,be,Ae]:null}function E(M,S,C,B,O,P,$,T,I,_){var W=m(M,$),K=m(B,$),Y=m(S,T),z=m(O,T),j=m(C,I),ge=m(P,I),te=l(l(l(_,W),Y),j),re=l(l(l(s(s(K,z),ge),W),Y),j),me=o(te,re),oe=s(M,m(me,l(B,M))),ue=s(S,m(me,l(O,S))),we=s(C,m(me,l(P,C)));return[oe,ue,we]}}),Mf="sum",xS=["typed","config","add","numeric"],_g=q(Mf,xS,t=>{var{typed:e,config:n,add:a,numeric:r}=t;return e(Mf,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":i,"...":function(m){if(Ss(m))throw new TypeError("Scalar values expected in function sum");return s(m)}});function s(p){var m;return Or(p,function(o){try{m=m===void 0?o:a(m,o)}catch(l){throw da(l,"sum",o)}}),m===void 0&&(m=r(0,n.number)),typeof m=="string"&&(m=r(m,n.number)),m}function i(p,m){try{var o=Lo(p,m,a);return o}catch(l){throw da(l,"sum")}}}),to="cumsum",bS=["typed","add","unaryPlus"],Bg=q(to,bS,t=>{var{typed:e,add:n,unaryPlus:a}=t;return e(to,{Array:r,Matrix:function(o){return o.create(r(o.valueOf()))},"Array, number | BigNumber":i,"Matrix, number | BigNumber":function(o,l){return o.create(i(o.valueOf(),l))},"...":function(o){if(Ss(o))throw new TypeError("All values expected to be scalar in function cumsum");return r(o)}});function r(m){try{return s(m)}catch(o){throw da(o,to)}}function s(m){if(m.length===0)return[];for(var o=[a(m[0])],l=1;l=l.length)throw new Wa(o,l.length);try{return p(m,o)}catch(u){throw da(u,to)}}function p(m,o){var l,u,c;if(o<=0){var f=m[0][0];if(Array.isArray(f)){for(c=cv(m),u=[],l=0;l{var{typed:e,add:n,divide:a}=t;return e(Sf,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":r,"...":function(p){if(Ss(p))throw new TypeError("Scalar values expected in function mean");return s(p)}});function r(i,p){try{var m=Lo(i,p,n),o=Array.isArray(i)?et(i):i.size();return a(m,o[p])}catch(l){throw da(l,"mean")}}function s(i){var p,m=0;if(Or(i,function(o){try{p=p===void 0?o:n(p,o),m++}catch(l){throw da(l,"mean",o)}}),m===0)throw new Error("Cannot calculate the mean of an empty array");return a(p,m)}}),Cf="median",ES=["typed","add","divide","compare","partitionSelect"],DS=q(Cf,ES,t=>{var{typed:e,add:n,divide:a,compare:r,partitionSelect:s}=t;function i(o){try{o=ft(o.valueOf());var l=o.length;if(l===0)throw new Error("Cannot calculate median of an empty array");if(l%2===0){for(var u=l/2-1,c=s(o,u+1),f=o[u],v=0;v0&&(f=o[v]);return m(f,c)}else{var h=s(o,(l-1)/2);return p(h)}}catch(w){throw da(w,"median")}}var p=e({"number | BigNumber | Complex | Unit":function(l){return l}}),m=e({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(l,u){return a(n(l,u),2)}});return e(Cf,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(l,u){throw new Error("median(A, dim) is not yet supported")},"...":function(l){if(Ss(l))throw new TypeError("Scalar values expected in function median");return i(l)}})}),Tf="mad",AS=["typed","abs","map","median","subtract"],MS=q(Tf,AS,t=>{var{typed:e,abs:n,map:a,median:r,subtract:s}=t;return e(Tf,{"Array | Matrix":i,"...":function(m){return i(m)}});function i(p){if(p=ft(p.valueOf()),p.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var m=r(p);return r(a(p,function(o){return n(s(o,m))}))}catch(o){throw o instanceof TypeError&&o.message.indexOf("median")!==-1?new TypeError(o.message.replace("median","mad")):da(o,"mad")}}}),vl="unbiased",$f="variance",SS=["typed","add","subtract","multiply","divide","apply","isNaN"],Pg=q($f,SS,t=>{var{typed:e,add:n,subtract:a,multiply:r,divide:s,apply:i,isNaN:p}=t;return e($f,{"Array | Matrix":function(u){return m(u,vl)},"Array | Matrix, string":m,"Array | Matrix, number | BigNumber":function(u,c){return o(u,c,vl)},"Array | Matrix, number | BigNumber, string":o,"...":function(u){return m(u,vl)}});function m(l,u){var c,f=0;if(l.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Or(l,function(w){try{c=c===void 0?w:n(c,w),f++}catch(d){throw da(d,"variance",w)}}),f===0)throw new Error("Cannot calculate variance of an empty array");var v=s(c,f);if(c=void 0,Or(l,function(w){var d=a(w,v);c=c===void 0?r(d,d):n(c,r(d,d))}),p(c))return c;switch(u){case"uncorrected":return s(c,f);case"biased":return s(c,f+1);case"unbiased":{var h=at(c)?c.mul(0):0;return f===1?h:s(c,f-1)}default:throw new Error('Unknown normalization "'+u+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function o(l,u,c){try{if(l.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return i(l,u,f=>m(f,c))}catch(f){throw da(f,"variance")}}}),Ff="quantileSeq",CS=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],zg=q(Ff,CS,t=>{var{typed:e,bignumber:n,add:a,subtract:r,divide:s,multiply:i,partitionSelect:p,compare:m,isInteger:o,smaller:l,smallerEq:u,larger:c}=t,f=Xl({typed:e,isInteger:o});return e(Ff,{"Array | Matrix, number | BigNumber":(N,g)=>h(N,g,!1),"Array | Matrix, number | BigNumber, number":(N,g,x)=>v(N,g,!1,x,h),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(N,g,x,b)=>v(N,g,x,b,h),"Array | Matrix, Array | Matrix":(N,g)=>w(N,g,!1),"Array | Matrix, Array | Matrix, number":(N,g,x)=>v(N,g,!1,x,w),"Array | Matrix, Array | Matrix, boolean":w,"Array | Matrix, Array | Matrix, boolean, number":(N,g,x,b)=>v(N,g,x,b,w)});function v(N,g,x,b,y){return f(N,b,D=>y(D,g,x))}function h(N,g,x){var b,y=N.valueOf();if(l(g,0))throw new Error("N/prob must be non-negative");if(u(g,1))return tt(g)?d(y,g,x):n(d(y,g,x));if(c(g,1)){if(!o(g))throw new Error("N must be a positive integer");if(c(g,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var D=a(g,1);b=[];for(var A=0;l(A,g);A++){var E=s(A+1,D);b.push(d(y,E,x))}return tt(g)?b:n(b)}}function w(N,g,x){for(var b=N.valueOf(),y=g.valueOf(),D=[],A=0;A0&&(M=b[C])}return a(i(M,r(1,E)),i(S,E))}}),_f="std",TS=["typed","map","sqrt","variance"],Rg=q(_f,TS,t=>{var{typed:e,map:n,sqrt:a,variance:r}=t;return e(_f,{"Array | Matrix":s,"Array | Matrix, string":s,"Array | Matrix, number | BigNumber":s,"Array | Matrix, number | BigNumber, string":s,"...":function(p){return s(p)}});function s(i,p){if(i.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var m=r.apply(null,arguments);return Ra(m)?n(m,a):a(m)}catch(o){throw o instanceof TypeError&&o.message.indexOf(" variance")!==-1?new TypeError(o.message.replace(" variance"," std")):o}}}),Bf="corr",$S=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],FS=q(Bf,$S,t=>{var{typed:e,matrix:n,sqrt:a,sum:r,add:s,subtract:i,multiply:p,pow:m,divide:o}=t;return e(Bf,{"Array, Array":function(f,v){return l(f,v)},"Matrix, Matrix":function(f,v){var h=l(f.toArray(),v.toArray());return Array.isArray(h)?n(h):h}});function l(c,f){var v=[];if(Array.isArray(c[0])&&Array.isArray(f[0])){if(c.length!==f.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var h=0;hs(y,p(D,f[A])),0),N=r(c.map(y=>m(y,2))),g=r(f.map(y=>m(y,2))),x=i(p(v,d),p(h,w)),b=a(p(i(p(v,N),m(h,2)),i(p(v,g),m(w,2))));return o(x,b)}}),Of="combinations",_S=["typed"],BS=q(Of,_S,t=>{var{typed:e}=t;return e(Of,{"number, number":Pv,"BigNumber, BigNumber":function(a,r){var s=a.constructor,i,p,m=a.minus(r),o=new s(1);if(!Pf(a)||!Pf(r))throw new TypeError("Positive integer value expected in function combinations");if(r.gt(a))throw new TypeError("k must be less than n in function combinations");if(i=o,r.lt(m))for(p=o;p.lte(m);p=p.plus(o))i=i.times(r.plus(p)).dividedBy(p);else for(p=o;p.lte(r);p=p.plus(o))i=i.times(m.plus(p)).dividedBy(p);return i}})});function Pf(t){return t.isInteger()&&t.gte(0)}var zf="combinationsWithRep",OS=["typed"],PS=q(zf,OS,t=>{var{typed:e}=t;return e(zf,{"number, number":function(a,r){if(!qe(a)||a<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!qe(r)||r<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(a<1)throw new TypeError("k must be less than or equal to n + k - 1");if(r{var{typed:e,config:n,multiplyScalar:a,pow:r,BigNumber:s,Complex:i}=t;function p(o){if(o.im===0)return go(o.re);if(o.re<.5){var l=new i(1-o.re,-o.im),u=new i(Math.PI*o.re,Math.PI*o.im);return new i(Math.PI).div(u.sin()).div(p(l))}o=new i(o.re-1,o.im);for(var c=new i(cs[0],0),f=1;f2;)c-=2,v+=c,f=f.times(v);return new s(f.toPrecision(s.precision))}}),qf="lgamma",IS=["Complex","typed"],qS=q(qf,IS,t=>{var{Complex:e,typed:n}=t,a=7,r=7,s=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return n(qf,{number:yo,Complex:i,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function i(o){var l=6.283185307179586,u=1.1447298858494002,c=.1;if(o.isNaN())return new e(NaN,NaN);if(o.im===0)return new e(yo(o.re),0);if(o.re>=a||Math.abs(o.im)>=r)return p(o);if(o.re<=c){var f=T0(l,o.im)*Math.floor(.5*o.re+.25),v=o.mul(Math.PI).sin().log(),h=i(new e(1-o.re,-o.im));return new e(u,f).sub(v).sub(h)}else return o.im>=0?m(o):m(o.conjugate()).conjugate()}function p(o){for(var l=o.sub(.5).mul(o.log()).sub(o).add(kv),u=new e(1,0).div(o),c=u.div(o),f=s[0],v=s[1],h=2*c.re,w=c.re*c.re+c.im*c.im,d=2;d<8;d++){var N=v;v=-w*f+s[d],f=h*f+N}var g=u.mul(c.mul(f).add(v));return l.add(g)}function m(o){var l=0,u=0,c=o;for(o=o.add(1);o.re<=a;){c=c.mul(o);var f=c.im<0?1:0;f!==0&&u===0&&l++,u=f,o=o.add(1)}return p(o).sub(c.log()).sub(new e(0,l*2*Math.PI*1))}}),Lf="factorial",LS=["typed","gamma"],kS=q(Lf,LS,t=>{var{typed:e,gamma:n}=t;return e(Lf,{number:function(r){if(r<0)throw new Error("Value must be non-negative");return n(r+1)},BigNumber:function(r){if(r.isNegative())throw new Error("Value must be non-negative");return n(r.plus(1))},"Array | Matrix":e.referToSelf(a=>r=>it(r,a))})}),kf="kldivergence",US=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],GS=q(kf,US,t=>{var{typed:e,matrix:n,divide:a,sum:r,multiply:s,map:i,dotDivide:p,log:m,isNumeric:o}=t;return e(kf,{"Array, Array":function(c,f){return l(n(c),n(f))},"Matrix, Array":function(c,f){return l(c,n(f))},"Array, Matrix":function(c,f){return l(n(c),f)},"Matrix, Matrix":function(c,f){return l(c,f)}});function l(u,c){var f=c.size().length,v=u.size().length;if(f>1)throw new Error("first object must be one dimensional");if(v>1)throw new Error("second object must be one dimensional");if(f!==v)throw new Error("Length of two vectors must be equal");var h=r(u);if(h===0)throw new Error("Sum of elements in first object must be non zero");var w=r(c);if(w===0)throw new Error("Sum of elements in second object must be non zero");var d=a(u,r(u)),N=a(c,r(c)),g=r(s(d,i(p(d,N),x=>m(x))));return o(g)?g:Number.NaN}}),Uf="multinomial",HS=["typed","add","divide","multiply","factorial","isInteger","isPositive"],VS=q(Uf,HS,t=>{var{typed:e,add:n,divide:a,multiply:r,factorial:s,isInteger:i,isPositive:p}=t;return e(Uf,{"Array | Matrix":function(o){var l=0,u=1;return Or(o,function(c){if(!i(c)||!p(c))throw new TypeError("Positive integer value expected in function multinomial");l=n(l,c),u=r(u,s(c))}),a(s(l),u)}})}),Gf="permutations",JS=["typed","factorial"],ZS=q(Gf,JS,t=>{var{typed:e,factorial:n}=t;return e(Gf,{"number | BigNumber":n,"number, number":function(r,s){if(!qe(r)||r<0)throw new TypeError("Positive integer value expected in function permutations");if(!qe(s)||s<0)throw new TypeError("Positive integer value expected in function permutations");if(s>r)throw new TypeError("second argument k must be less than or equal to first argument n");return $r(r-s+1,r)},"BigNumber, BigNumber":function(r,s){var i,p;if(!Hf(r)||!Hf(s))throw new TypeError("Positive integer value expected in function permutations");if(s.gt(r))throw new TypeError("second argument k must be less than or equal to first argument n");var m=r.mul(0).add(1);for(i=m,p=r.minus(s).plus(1);p.lte(r);p=p.plus(1))i=i.times(p);return i}})});function Hf(t){return t.isInteger()&&t.gte(0)}var rm={exports:{}};rm.exports;(function(t){(function(e,n,a){function r(m){var o=this,l=p();o.next=function(){var u=2091639*o.s0+o.c*23283064365386963e-26;return o.s0=o.s1,o.s1=o.s2,o.s2=u-(o.c=u|0)},o.c=1,o.s0=l(" "),o.s1=l(" "),o.s2=l(" "),o.s0-=l(m),o.s0<0&&(o.s0+=1),o.s1-=l(m),o.s1<0&&(o.s1+=1),o.s2-=l(m),o.s2<0&&(o.s2+=1),l=null}function s(m,o){return o.c=m.c,o.s0=m.s0,o.s1=m.s1,o.s2=m.s2,o}function i(m,o){var l=new r(m),u=o&&o.state,c=l.next;return c.int32=function(){return l.next()*4294967296|0},c.double=function(){return c()+(c()*2097152|0)*11102230246251565e-32},c.quick=c,u&&(typeof u=="object"&&s(u,l),c.state=function(){return s(l,{})}),c}function p(){var m=4022871197,o=function(l){l=String(l);for(var u=0;u>>0,c-=m,c*=m,m=c>>>0,c-=m,m+=c*4294967296}return(m>>>0)*23283064365386963e-26};return o}n&&n.exports?n.exports=i:a&&a.amd?a(function(){return i}):this.alea=i})(Nn,t,!1)})(rm);var WS=rm.exports,nm={exports:{}};nm.exports;(function(t){(function(e,n,a){function r(p){var m=this,o="";m.x=0,m.y=0,m.z=0,m.w=0,m.next=function(){var u=m.x^m.x<<11;return m.x=m.y,m.y=m.z,m.z=m.w,m.w^=m.w>>>19^u^u>>>8},p===(p|0)?m.x=p:o+=p;for(var l=0;l>>0)/4294967296};return u.double=function(){do var c=o.next()>>>11,f=(o.next()>>>0)/4294967296,v=(c+f)/(1<<21);while(v===0);return v},u.int32=o.next,u.quick=u,l&&(typeof l=="object"&&s(l,o),u.state=function(){return s(o,{})}),u}n&&n.exports?n.exports=i:a&&a.amd?a(function(){return i}):this.xor128=i})(Nn,t,!1)})(nm);var YS=nm.exports,sm={exports:{}};sm.exports;(function(t){(function(e,n,a){function r(p){var m=this,o="";m.next=function(){var u=m.x^m.x>>>2;return m.x=m.y,m.y=m.z,m.z=m.w,m.w=m.v,(m.d=m.d+362437|0)+(m.v=m.v^m.v<<4^(u^u<<1))|0},m.x=0,m.y=0,m.z=0,m.w=0,m.v=0,p===(p|0)?m.x=p:o+=p;for(var l=0;l>>4),m.next()}function s(p,m){return m.x=p.x,m.y=p.y,m.z=p.z,m.w=p.w,m.v=p.v,m.d=p.d,m}function i(p,m){var o=new r(p),l=m&&m.state,u=function(){return(o.next()>>>0)/4294967296};return u.double=function(){do var c=o.next()>>>11,f=(o.next()>>>0)/4294967296,v=(c+f)/(1<<21);while(v===0);return v},u.int32=o.next,u.quick=u,l&&(typeof l=="object"&&s(l,o),u.state=function(){return s(o,{})}),u}n&&n.exports?n.exports=i:a&&a.amd?a(function(){return i}):this.xorwow=i})(Nn,t,!1)})(sm);var XS=sm.exports,im={exports:{}};im.exports;(function(t){(function(e,n,a){function r(p){var m=this;m.next=function(){var l=m.x,u=m.i,c,f;return c=l[u],c^=c>>>7,f=c^c<<24,c=l[u+1&7],f^=c^c>>>10,c=l[u+3&7],f^=c^c>>>3,c=l[u+4&7],f^=c^c<<7,c=l[u+7&7],c=c^c<<13,f^=c^c<<9,l[u]=f,m.i=u+1&7,f};function o(l,u){var c,f=[];if(u===(u|0))f[0]=u;else for(u=""+u,c=0;c0;--c)l.next()}o(m,p)}function s(p,m){return m.x=p.x.slice(),m.i=p.i,m}function i(p,m){p==null&&(p=+new Date);var o=new r(p),l=m&&m.state,u=function(){return(o.next()>>>0)/4294967296};return u.double=function(){do var c=o.next()>>>11,f=(o.next()>>>0)/4294967296,v=(c+f)/(1<<21);while(v===0);return v},u.int32=o.next,u.quick=u,l&&(l.x&&s(l,o),u.state=function(){return s(o,{})}),u}n&&n.exports?n.exports=i:a&&a.amd?a(function(){return i}):this.xorshift7=i})(Nn,t,!1)})(im);var QS=im.exports,om={exports:{}};om.exports;(function(t){(function(e,n,a){function r(p){var m=this;m.next=function(){var l=m.w,u=m.X,c=m.i,f,v;return m.w=l=l+1640531527|0,v=u[c+34&127],f=u[c=c+1&127],v^=v<<13,f^=f<<17,v^=v>>>15,f^=f>>>12,v=u[c]=v^f,m.i=c,v+(l^l>>>16)|0};function o(l,u){var c,f,v,h,w,d=[],N=128;for(u===(u|0)?(f=u,u=null):(u=u+"\0",f=0,N=Math.max(N,u.length)),v=0,h=-32;h>>15,f^=f<<4,f^=f>>>13,h>=0&&(w=w+1640531527|0,c=d[h&127]^=f+w,v=c==0?v+1:0);for(v>=128&&(d[(u&&u.length||0)&127]=-1),v=127,h=4*128;h>0;--h)f=d[v+34&127],c=d[v=v+1&127],f^=f<<13,c^=c<<17,f^=f>>>15,c^=c>>>12,d[v]=f^c;l.w=w,l.X=d,l.i=v}o(m,p)}function s(p,m){return m.i=p.i,m.w=p.w,m.X=p.X.slice(),m}function i(p,m){p==null&&(p=+new Date);var o=new r(p),l=m&&m.state,u=function(){return(o.next()>>>0)/4294967296};return u.double=function(){do var c=o.next()>>>11,f=(o.next()>>>0)/4294967296,v=(c+f)/(1<<21);while(v===0);return v},u.int32=o.next,u.quick=u,l&&(l.X&&s(l,o),u.state=function(){return s(o,{})}),u}n&&n.exports?n.exports=i:a&&a.amd?a(function(){return i}):this.xor4096=i})(Nn,t,!1)})(om);var jS=om.exports,lm={exports:{}};lm.exports;(function(t){(function(e,n,a){function r(p){var m=this,o="";m.next=function(){var u=m.b,c=m.c,f=m.d,v=m.a;return u=u<<25^u>>>7^c,c=c-f|0,f=f<<24^f>>>8^v,v=v-u|0,m.b=u=u<<20^u>>>12^c,m.c=c=c-f|0,m.d=f<<16^c>>>16^v,m.a=v-u|0},m.a=0,m.b=0,m.c=-1640531527,m.d=1367130551,p===Math.floor(p)?(m.a=p/4294967296|0,m.b=p|0):o+=p;for(var l=0;l>>0)/4294967296};return u.double=function(){do var c=o.next()>>>11,f=(o.next()>>>0)/4294967296,v=(c+f)/(1<<21);while(v===0);return v},u.int32=o.next,u.quick=u,l&&(typeof l=="object"&&s(l,o),u.state=function(){return s(o,{})}),u}n&&n.exports?n.exports=i:a&&a.amd?a(function(){return i}):this.tychei=i})(Nn,t,!1)})(lm);var KS=lm.exports,Ig={exports:{}};const e6={},t6=Object.freeze(Object.defineProperty({__proto__:null,default:e6},Symbol.toStringTag,{value:"Module"})),a6=X1(t6);(function(t){(function(e,n,a){var r=256,s=6,i=52,p="random",m=a.pow(r,s),o=a.pow(2,i),l=o*2,u=r-1,c;function f(x,b,y){var D=[];b=b==!0?{entropy:!0}:b||{};var A=d(w(b.entropy?[x,g(n)]:x??N(),3),D),E=new v(D),M=function(){for(var S=E.g(s),C=m,B=0;S=l;)S/=2,C/=2,B>>>=1;return(S+B)/C};return M.int32=function(){return E.g(4)|0},M.quick=function(){return E.g(4)/4294967296},M.double=M,d(g(E.S),n),(b.pass||y||function(S,C,B,O){return O&&(O.S&&h(O,E),S.state=function(){return h(E,{})}),B?(a[p]=S,C):S})(M,A,"global"in b?b.global:this==a,b.state)}function v(x){var b,y=x.length,D=this,A=0,E=D.i=D.j=0,M=D.S=[];for(y||(x=[y++]);A{var{typed:e,config:n,on:a}=t,r=Es(n.randomSeed);return a&&a("config",function(i,p){i.randomSeed!==p.randomSeed&&(r=Es(i.randomSeed))}),e(Vf,{"Array | Matrix":function(p){return s(p,{})},"Array | Matrix, Object":function(p,m){return s(p,m)},"Array | Matrix, number":function(p,m){return s(p,{number:m})},"Array | Matrix, Array | Matrix":function(p,m){return s(p,{weights:m})},"Array | Matrix, Array | Matrix, number":function(p,m,o){return s(p,{number:o,weights:m})},"Array | Matrix, number, Array | Matrix":function(p,m,o){return s(p,{number:m,weights:o})}});function s(i,p){var{number:m,weights:o,elementWise:l=!0}=p,u=typeof m>"u";u&&(m=1);var c=Ve(i)?i.create:Ve(o)?o.create:null;i=i.valueOf(),o&&(o=o.valueOf()),l===!0&&(i=ft(i),o=ft(o));var f=0;if(typeof o<"u"){if(o.length!==i.length)throw new Error("Weights must have the same length as possibles");for(var v=0,h=o.length;v"u")N=i[Math.floor(r()*w)];else for(var g=r()*f,x=0,b=i.length;x1)for(var a=0,r=t.shift();a{var{typed:e,config:n,on:a}=t,r=Es(n.randomSeed);return a&&a("config",function(p,m){p.randomSeed!==m.randomSeed&&(r=Es(p.randomSeed))}),e(Jf,{"":()=>i(0,1),number:p=>i(0,p),"number, number":(p,m)=>i(p,m),"Array | Matrix":p=>s(p,0,1),"Array | Matrix, number":(p,m)=>s(p,0,m),"Array | Matrix, number, number":(p,m,o)=>s(p,m,o)});function s(p,m,o){var l=mm(p.valueOf(),()=>i(m,o));return Ve(p)?p.create(l):l}function i(p,m){return p+r()*(m-p)}}),Zf="randomInt",g6=["typed","config","?on"],d6=q(Zf,g6,t=>{var{typed:e,config:n,on:a}=t,r=Es(n.randomSeed);return a&&a("config",function(p,m){p.randomSeed!==m.randomSeed&&(r=Es(p.randomSeed))}),e(Zf,{"":()=>i(0,1),number:p=>i(0,p),"number, number":(p,m)=>i(p,m),"Array | Matrix":p=>s(p,0,1),"Array | Matrix, number":(p,m)=>s(p,0,m),"Array | Matrix, number, number":(p,m,o)=>s(p,m,o)});function s(p,m,o){var l=mm(p.valueOf(),()=>i(m,o));return Ve(p)?p.create(l):l}function i(p,m){return Math.floor(p+r()*(m-p))}}),Wf="stirlingS2",y6=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],w6=q(Wf,y6,t=>{var{typed:e,addScalar:n,subtractScalar:a,multiplyScalar:r,divideScalar:s,pow:i,factorial:p,combinations:m,isNegative:o,isInteger:l,number:u,bignumber:c,larger:f}=t,v=[],h=[];return e(Wf,{"number | BigNumber, number | BigNumber":function(d,N){if(!l(d)||o(d)||!l(N)||o(N))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(f(N,d))throw new TypeError("k must be less than or equal to n in function stirlingS2");var g=!(tt(d)&&tt(N)),x=g?h:v,b=g?c:u,y=u(d),D=u(N);if(x[y]&&x[y].length>D)return x[y][D];for(var A=0;A<=y;++A)if(x[A]||(x[A]=[b(A===0?1:0)]),A!==0)for(var E=x[A],M=x[A-1],S=E.length;S<=A&&S<=D;++S)S===A?E[S]=1:E[S]=n(r(b(S),M[S]),M[S-1]);return x[y][D]}})}),Yf="bellNumbers",x6=["typed","addScalar","isNegative","isInteger","stirlingS2"],b6=q(Yf,x6,t=>{var{typed:e,addScalar:n,isNegative:a,isInteger:r,stirlingS2:s}=t;return e(Yf,{"number | BigNumber":function(p){if(!r(p)||a(p))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var m=0,o=0;o<=p;o++)m=n(m,s(p,o));return m}})}),Xf="catalan",N6=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],E6=q(Xf,N6,t=>{var{typed:e,addScalar:n,divideScalar:a,multiplyScalar:r,combinations:s,isNegative:i,isInteger:p}=t;return e(Xf,{"number | BigNumber":function(o){if(!p(o)||i(o))throw new TypeError("Non-negative integer value expected in function catalan");return a(s(r(o,2),o),n(o,1))}})}),Qf="composition",D6=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],A6=q(Qf,D6,t=>{var{typed:e,addScalar:n,combinations:a,isPositive:r,isNegative:s,isInteger:i,larger:p}=t;return e(Qf,{"number | BigNumber, number | BigNumber":function(o,l){if(!i(o)||!r(o)||!i(l)||!r(l))throw new TypeError("Positive integer value expected in function composition");if(p(l,o))throw new TypeError("k must be less than or equal to n in function composition");return a(n(o,-1),n(l,-1))}})}),jf="leafCount",M6=["parse","typed"],S6=q(jf,M6,t=>{var{parse:e,typed:n}=t;function a(r){var s=0;return r.forEach(i=>{s+=a(i)}),s||1}return n(jf,{Node:function(s){return a(s)}})});function Kf(t){return ut(t)||It(t)&&t.isUnary()&&ut(t.args[0])}function Co(t){return!!(ut(t)||(Kr(t)||It(t))&&t.args.every(Co)||Br(t)&&Co(t.content))}function eh(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),n.push.apply(n,a)}return n}function gl(t){for(var e=1;e{var{FunctionNode:e,OperatorNode:n,SymbolNode:a}=t,r=!0,s=!1,i="defaultF",p={add:{trivial:r,total:r,commutative:r,associative:r},unaryPlus:{trivial:r,total:r,commutative:r,associative:r},subtract:{trivial:s,total:r,commutative:s,associative:s},multiply:{trivial:r,total:r,commutative:r,associative:r},divide:{trivial:s,total:r,commutative:s,associative:s},paren:{trivial:r,total:r,commutative:r,associative:s},defaultF:{trivial:s,total:r,commutative:s,associative:s}},m={divide:{total:s},log:{total:s}},o={subtract:{total:s},abs:{trivial:r},log:{total:r}};function l(g,x){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:p,y=i;if(typeof g=="string"?y=g:It(g)?y=g.fn.toString():Kr(g)?y=g.name:Br(g)&&(y="paren"),ze(b,y)){var D=b[y];if(ze(D,x))return D[x];if(ze(p,y))return p[y][x]}if(ze(b,i)){var A=b[i];return ze(A,x)?A[x]:p[i][x]}if(ze(p,y)){var E=p[y];if(ze(E,x))return E[x]}return p[i][x]}function u(g){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p;return l(g,"commutative",x)}function c(g){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p;return l(g,"associative",x)}function f(g,x){var b=gl({},g);for(var y in x)ze(g,y)?b[y]=gl(gl({},x[y]),g[y]):b[y]=x[y];return b}function v(g,x){if(!g.args||g.args.length===0)return g;g.args=h(g,x);for(var b=0;b2&&c(g,x)){for(var A=g.args.pop();g.args.length>0;)A=b([g.args.pop(),A]);g.args=A.args}}}function d(g,x){if(!(!g.args||g.args.length===0)){for(var b=N(g),y=g.args.length,D=0;D2&&c(g,x)){for(var A=g.args.shift();g.args.length>0;)A=b([A,g.args.shift()]);g.args=A.args}}}function N(g){return It(g)?function(x){try{return new n(g.op,g.fn,x,g.implicit)}catch(b){return console.error(b),[]}}:function(x){return new e(new a(g.name),x)}}return{createMakeNodeFunction:N,hasProperty:l,isCommutative:u,isAssociative:c,mergeContext:f,flatten:v,allChildren:h,unflattenr:w,unflattenl:d,defaultContext:p,realContext:m,positiveContext:o}}),$6="simplify",F6=["config","typed","parse","add","subtract","multiply","divide","pow","isZero","equal","resolve","simplifyConstant","simplifyCore","?fraction","?bignumber","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],_6=q($6,F6,t=>{var{config:e,typed:n,parse:a,add:r,subtract:s,multiply:i,divide:p,pow:m,isZero:o,equal:l,resolve:u,simplifyConstant:c,simplifyCore:f,fraction:v,bignumber:h,mathWithTransform:w,matrix:d,AccessorNode:N,ArrayNode:g,ConstantNode:x,FunctionNode:b,IndexNode:y,ObjectNode:D,OperatorNode:A,ParenthesisNode:E,SymbolNode:M}=t,{hasProperty:S,isCommutative:C,isAssociative:B,mergeContext:O,flatten:P,unflattenr:$,unflattenl:T,createMakeNodeFunction:I,defaultContext:_,realContext:W,positiveContext:K}=um({FunctionNode:b,OperatorNode:A,SymbolNode:M});n.addConversion({from:"Object",to:"Map",convert:ps});var Y=n("simplify",{Node:oe,"Node, Map":(V,X)=>oe(V,!1,X),"Node, Map, Object":(V,X,ee)=>oe(V,!1,X,ee),"Node, Array":oe,"Node, Array, Map":oe,"Node, Array, Map, Object":oe});n.removeConversion({from:"Object",to:"Map",convert:ps}),Y.defaultContext=_,Y.realContext=W,Y.positiveContext=K;function z(V){return V.transform(function(X,ee,de){return Br(X)?z(X.content):X})}var j={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};Y.rules=[f,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},c,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},c,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function ge(V,X){var ee={};if(V.s){var de=V.s.split("->");if(de.length===2)ee.l=de[0],ee.r=de[1];else throw SyntaxError("Could not parse rule: "+V.s)}else ee.l=V.l,ee.r=V.r;ee.l=z(a(ee.l)),ee.r=z(a(ee.r));for(var xe of["imposeContext","repeat","assuming"])xe in V&&(ee[xe]=V[xe]);if(V.evaluate&&(ee.evaluate=a(V.evaluate)),B(ee.l,X)){var R=!C(ee.l,X),U;R&&(U=me());var ae=I(ee.l),he=me();ee.expanded={},ee.expanded.l=ae([ee.l,he]),P(ee.expanded.l,X),$(ee.expanded.l,X),ee.expanded.r=ae([ee.r,he]),R&&(ee.expandedNC1={},ee.expandedNC1.l=ae([U,ee.l]),ee.expandedNC1.r=ae([U,ee.r]),ee.expandedNC2={},ee.expandedNC2.l=ae([U,ee.expanded.l]),ee.expandedNC2.r=ae([U,ee.expanded.r]))}return ee}function te(V,X){for(var ee=[],de=0;de2&&arguments[2]!==void 0?arguments[2]:si(),de=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},xe=de.consoleDebug;X=te(X||Y.rules,de.context);var R=u(V,ee);R=z(R);for(var U={},ae=R.toString({parenthesis:"all"});!U[ae];){U[ae]=!0,re=0;var he=ae;xe&&console.log("Working on: ",ae);for(var fe=0;fe ").concat(X[fe].r.toString()))),xe){var Te=R.toString({parenthesis:"all"});Te!==he&&(console.log("Applying",Ne,"produced",Te),he=Te)}T(R,de.context)}ae=R.toString({parenthesis:"all"})}return R}function ue(V,X,ee){var de=V;if(V)for(var xe=0;xe1&&(he=R(V.args.slice(0,ae))),xe=V.args.slice(ae),de=xe.length===1?xe[0]:R(xe),ee.push(R([he,de]))}return ee}function Ae(V,X){var ee={placeholders:{}};if(!V.placeholders&&!X.placeholders)return ee;if(V.placeholders){if(!X.placeholders)return V}else return X;for(var de in V.placeholders)if(ze(V.placeholders,de)&&(ee.placeholders[de]=V.placeholders[de],ze(X.placeholders,de)&&!le(V.placeholders[de],X.placeholders[de])))return null;for(var xe in X.placeholders)ze(X.placeholders,xe)&&(ee.placeholders[xe]=X.placeholders[xe]);return ee}function _e(V,X){var ee=[];if(V.length===0||X.length===0)return ee;for(var de,xe=0;xe2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var he=J(V.args[0],X.args[1],ee);if(he.length===0)return[];var fe=J(V.args[1],X.args[0],ee);if(fe.length===0)return[];R=[he,fe]}xe=L(R)}else if(X.args.length>=2&&V.args.length===2){for(var Ne=be(X,ee),Te=[],Se=0;Se2)throw Error("Unexpected non-binary associative function: "+V.toString());return[]}}else if(V instanceof M){if(V.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(j[V.name]){if(V.name!==X.name)return[]}else switch(V.name[1]>="a"&&V.name[1]<="z"?V.name.substring(0,2):V.name[0]){case"n":case"_p":xe[0].placeholders[V.name]=X;break;case"c":case"cl":if(ut(X))xe[0].placeholders[V.name]=X;else return[];break;case"v":if(!ut(X))xe[0].placeholders[V.name]=X;else return[];break;case"vl":if(Qt(X))xe[0].placeholders[V.name]=X;else return[];break;case"cd":if(Kf(X))xe[0].placeholders[V.name]=X;else return[];break;case"vd":if(!Kf(X))xe[0].placeholders[V.name]=X;else return[];break;case"ce":if(Co(X))xe[0].placeholders[V.name]=X;else return[];break;case"ve":if(!Co(X))xe[0].placeholders[V.name]=X;else return[];break;default:throw new Error("Invalid symbol in rule: "+V.name)}}else if(V instanceof x){if(!l(V.value,X.value))return[]}else return[];return xe}function le(V,X){if(V instanceof x&&X instanceof x){if(!l(V.value,X.value))return!1}else if(V instanceof M&&X instanceof M){if(V.name!==X.name)return!1}else if(V instanceof A&&X instanceof A||V instanceof b&&X instanceof b){if(V instanceof A){if(V.op!==X.op||V.fn!==X.fn)return!1}else if(V instanceof b&&V.name!==X.name)return!1;if(V.args.length!==X.args.length)return!1;for(var ee=0;ee{var{typed:e,config:n,mathWithTransform:a,matrix:r,fraction:s,bignumber:i,AccessorNode:p,ArrayNode:m,ConstantNode:o,FunctionNode:l,IndexNode:u,ObjectNode:c,OperatorNode:f,SymbolNode:v}=t,{isCommutative:h,isAssociative:w,allChildren:d,createMakeNodeFunction:N}=um({FunctionNode:l,OperatorNode:f,SymbolNode:v}),g=e("simplifyConstant",{Node:P=>D(O(P,{})),"Node, Object":function($,T){return D(O($,T))}});function x(P){return hi(P)?P.valueOf():P instanceof Array?P.map(x):Ve(P)?r(x(P.valueOf())):P}function b(P,$,T){try{return a[P].apply(null,$)}catch{return $=$.map(x),E(a[P].apply(null,$),T)}}var y=e({Fraction:S,number:function($){return $<0?M(new o(-$)):new o($)},BigNumber:function($){return $<0?M(new o(-$)):new o($)},Complex:function($){throw new Error("Cannot convert Complex number to Node")},string:function($){return new o($)},Matrix:function($){return new m($.valueOf().map(T=>y(T)))}});function D(P){return wt(P)?P:y(P)}function A(P,$){var T=$&&$.exactFractions!==!1;if(T&&isFinite(P)&&s){var I=s(P),_=$&&typeof $.fractionsLimit=="number"?$.fractionsLimit:1/0;if(I.valueOf()===P&&I.n<_&&I.d<_)return I}return P}var E=e({"string, Object":function($,T){if(n.number==="BigNumber")return i===void 0&&Kl(),i($);if(n.number==="Fraction")return s===void 0&&dg(),s($);var I=parseFloat($);return A(I,T)},"Fraction, Object":function($,T){return $},"BigNumber, Object":function($,T){return $},"number, Object":function($,T){return A($,T)},"Complex, Object":function($,T){return $.im!==0?$:A($.re,T)},"Matrix, Object":function($,T){return r(A($.valueOf()))},"Array, Object":function($,T){return $.map(A)}});function M(P){return new f("-","unaryMinus",[P])}function S(P){var $,T=P.s*P.n;return T<0?$=new f("-","unaryMinus",[new o(-T)]):$=new o(T),P.d===1?$:new f("/","divide",[$,new o(P.d)])}function C(P,$,T){if(!Ms($))return new p(D(P),D($));if(Ba(P)||Ve(P)){for(var I=Array.from($.dimensions);I.length>0;)if(ut(I[0])&&typeof I[0].value!="string"){var _=E(I.shift().value,T);Ba(P)?P=P.items[_-1]:(P=P.valueOf()[_-1],P instanceof Array&&(P=r(P)))}else if(I.length>1&&ut(I[1])&&typeof I[1].value!="string"){var W=E(I[1].value,T),K=[],Y=Ba(P)?P.items:P.valueOf();for(var z of Y)if(Ba(z))K.push(z.items[W-1]);else if(Ve(P))K.push(z[W-1]);else break;if(K.length===Y.length)Ba(P)?P=new m(K):P=r(K),I.splice(1,1);else break}else break;return I.length===$.dimensions.length?new p(D(P),$):I.length>0?($=new u(I),new p(D(P),$)):P}if(Bo(P)&&$.dimensions.length===1&&ut($.dimensions[0])){var j=$.dimensions[0].value;return j in P.properties?P.properties[j]:new o}return new p(D(P),$)}function B(P,$,T,I){var _=$.shift(),W=$.reduce((K,Y)=>{if(!wt(Y)){var z=K.pop();if(wt(z))return[z,Y];try{return K.push(b(P,[z,Y],I)),K}catch{K.push(z)}}K.push(D(K.pop()));var j=K.length===1?K[0]:T(K);return[T([j,D(Y)])]},[_]);return W.length===1?W[0]:T([W[0],y(W[1])])}function O(P,$){switch(P.type){case"SymbolNode":return P;case"ConstantNode":switch(typeof P.value){case"number":return E(P.value,$);case"string":return P.value;default:if(!isNaN(P.value))return E(P.value,$)}return P;case"FunctionNode":if(a[P.name]&&a[P.name].rawArgs)return P;{var T=["add","multiply"];if(T.indexOf(P.name)===-1){var I=P.args.map(we=>O(we,$));if(!I.some(wt))try{return b(P.name,I,$)}catch{}if(P.name==="size"&&I.length===1&&Ba(I[0])){for(var _=[],W=I[0];Ba(W);)_.push(W.items.length),W=W.items[0];return r(_)}return new l(P.name,I.map(D))}}case"OperatorNode":{var K=P.fn.toString(),Y,z,j=N(P);if(It(P)&&P.isUnary())Y=[O(P.args[0],$)],wt(Y[0])?z=j(Y):z=b(K,Y,$);else if(w(P,$.context))if(Y=d(P,$.context),Y=Y.map(we=>O(we,$)),h(K,$.context)){for(var ge=[],te=[],re=0;re1?(z=B(K,ge,j,$),te.unshift(z),z=B(K,te,j,$)):z=B(K,Y,j,$)}else z=B(K,Y,j,$);else Y=P.args.map(we=>O(we,$)),z=B(K,Y,j,$);return z}case"ParenthesisNode":return O(P.content,$);case"AccessorNode":return C(O(P.object,$),O(P.index,$),$);case"ArrayNode":{var me=P.items.map(we=>O(we,$));return me.some(wt)?new m(me.map(D)):r(me)}case"IndexNode":return new u(P.dimensions.map(we=>g(we,$)));case"ObjectNode":{var oe={};for(var ue in P.properties)oe[ue]=g(P.properties[ue],$);return new c(oe)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(P.type))}}return g}),th="simplifyCore",z6=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],R6=q(th,z6,t=>{var{typed:e,parse:n,equal:a,isZero:r,add:s,subtract:i,multiply:p,divide:m,pow:o,AccessorNode:l,ArrayNode:u,ConstantNode:c,FunctionNode:f,IndexNode:v,ObjectNode:h,OperatorNode:w,ParenthesisNode:d,SymbolNode:N}=t,g=new c(0),x=new c(1),b=new c(!0),y=new c(!1);function D(S){return It(S)&&["and","not","or"].includes(S.op)}var{hasProperty:A,isCommutative:E}=um({FunctionNode:f,OperatorNode:w,SymbolNode:N});function M(S){var C=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},B=C?C.context:void 0;if(A(S,"trivial",B)){if(Kr(S)&&S.args.length===1)return M(S.args[0],C);var O=!1,P=0;if(S.forEach(te=>{++P,P===1&&(O=M(te,C))}),P===1)return O}var $=S;if(Kr($)){var T=L5($.name);if(T){if($.args.length>2&&A($,"associative",B))for(;$.args.length>2;){var I=$.args.pop(),_=$.args.pop();$.args.push(new w(T,$.name,[I,_]))}$=new w(T,$.name,$.args)}else return new f(M($.fn),$.args.map(te=>M(te,C)))}if(It($)&&$.isUnary()){var W=M($.args[0],C);if($.op==="~"&&It(W)&&W.isUnary()&&W.op==="~"||$.op==="not"&&It(W)&&W.isUnary()&&W.op==="not"&&D(W.args[0]))return W.args[0];var K=!0;if($.op==="-"&&It(W)&&(W.isBinary()&&W.fn==="subtract"&&($=new w("-","subtract",[W.args[1],W.args[0]]),K=!1),W.isUnary()&&W.op==="-"))return W.args[0];if(K)return new w($.op,$.fn,[W])}if(It($)&&$.isBinary()){var Y=M($.args[0],C),z=M($.args[1],C);if($.op==="+"){if(ut(Y)&&r(Y.value))return z;if(ut(z)&&r(z.value))return Y;It(z)&&z.isUnary()&&z.op==="-"&&(z=z.args[0],$=new w("-","subtract",[Y,z]))}if($.op==="-")return It(z)&&z.isUnary()&&z.op==="-"?M(new w("+","add",[Y,z.args[0]]),C):ut(Y)&&r(Y.value)?M(new w("-","unaryMinus",[z])):ut(z)&&r(z.value)?Y:new w($.op,$.fn,[Y,z]);if($.op==="*"){if(ut(Y)){if(r(Y.value))return g;if(a(Y.value,1))return z}if(ut(z)){if(r(z.value))return g;if(a(z.value,1))return Y;if(E($,B))return new w($.op,$.fn,[z,Y],$.implicit)}return new w($.op,$.fn,[Y,z],$.implicit)}if($.op==="/")return ut(Y)&&r(Y.value)?g:ut(z)&&a(z.value,1)?Y:new w($.op,$.fn,[Y,z]);if($.op==="^"&&ut(z)){if(r(z.value))return x;if(a(z.value,1))return Y}if($.op==="and"){if(ut(Y))if(Y.value){if(D(z))return z;if(ut(z))return z.value?b:y}else return y;if(ut(z))if(z.value){if(D(Y))return Y}else return y}if($.op==="or"){if(ut(Y)){if(Y.value)return b;if(D(z))return z}if(ut(z)){if(z.value)return b;if(D(Y))return Y}}return new w($.op,$.fn,[Y,z])}if(It($))return new w($.op,$.fn,$.args.map(te=>M(te,C)));if(Ba($))return new u($.items.map(te=>M(te,C)));if(xn($))return new l(M($.object,C),M($.index,C));if(Ms($))return new v($.dimensions.map(te=>M(te,C)));if(Bo($)){var j={};for(var ge in $.properties)j[ge]=M($.properties[ge],C);return new h(j)}return $}return e(th,{Node:M,"Node,Object":M})}),I6="resolve",q6=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],L6=q(I6,q6,t=>{var{typed:e,parse:n,ConstantNode:a,FunctionNode:r,OperatorNode:s,ParenthesisNode:i}=t;function p(m,o){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!o)return m;if(Qt(m)){if(l.has(m.name)){var u=Array.from(l).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(u,"}"))}var c=o.get(m.name);if(wt(c)){var f=new Set(l);return f.add(m.name),p(c,o,f)}else return typeof c=="number"?n(String(c)):c!==void 0?new a(c):m}else if(It(m)){var v=m.args.map(function(w){return p(w,o,l)});return new s(m.op,m.fn,v,m.implicit)}else{if(Br(m))return new i(p(m.content,o,l));if(Kr(m)){var h=m.args.map(function(w){return p(w,o,l)});return new r(m.name,h)}}return m.map(w=>p(w,o,l))}return e("resolve",{Node:p,"Node, Map | null | undefined":p,"Node, Object":(m,o)=>p(m,ps(o)),"Array | Matrix":e.referToSelf(m=>o=>o.map(l=>m(l))),"Array | Matrix, null | undefined":e.referToSelf(m=>o=>o.map(l=>m(l))),"Array, Object":e.referTo("Array,Map",m=>(o,l)=>m(o,ps(l))),"Matrix, Object":e.referTo("Matrix,Map",m=>(o,l)=>m(o,ps(l))),"Array | Matrix, Map":e.referToSelf(m=>(o,l)=>o.map(u=>m(u,l)))})}),ah="symbolicEqual",k6=["parse","simplify","typed","OperatorNode"],U6=q(ah,k6,t=>{var{parse:e,simplify:n,typed:a,OperatorNode:r}=t;function s(i,p){var m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=new r("-","subtract",[i,p]),l=n(o,{},m);return ut(l)&&!l.value}return a(ah,{"Node, Node":s,"Node, Node, Object":s})}),rh="derivative",G6=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],H6=q(rh,G6,t=>{var{typed:e,config:n,parse:a,simplify:r,equal:s,isZero:i,numeric:p,ConstantNode:m,FunctionNode:o,OperatorNode:l,ParenthesisNode:u,SymbolNode:c}=t;function f(g,x){var b=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},y={};w(y,g,x.name);var D=d(g,y);return b.simplify?r(D):D}e.addConversion({from:"identifier",to:"SymbolNode",convert:a});var v=e(rh,{"Node, SymbolNode":f,"Node, SymbolNode, Object":f});e.removeConversion({from:"identifier",to:"SymbolNode",convert:a}),v._simplify=!0,v.toTex=function(g){return h.apply(null,g.args)};var h=e("_derivTex",{"Node, SymbolNode":function(x,b){return ut(x)&&St(x.value)==="string"?h(a(x.value).toString(),b.toString(),1):h(x.toTex(),b.toString(),1)},"Node, ConstantNode":function(x,b){if(St(b.value)==="string")return h(x,a(b.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(x,b,y){return h(x.toString(),b.name,y.value)},"string, string, number":function(x,b,y){var D;return y===1?D="{d\\over d"+b+"}":D="{d^{"+y+"}\\over d"+b+"^{"+y+"}}",D+"\\left[".concat(x,"\\right]")}}),w=e("constTag",{"Object, ConstantNode, string":function(x,b){return x[b]=!0,!0},"Object, SymbolNode, string":function(x,b,y){return b.name!==y?(x[b]=!0,!0):!1},"Object, ParenthesisNode, string":function(x,b,y){return w(x,b.content,y)},"Object, FunctionAssignmentNode, string":function(x,b,y){return b.params.indexOf(y)===-1?(x[b]=!0,!0):w(x,b.expr,y)},"Object, FunctionNode | OperatorNode, string":function(x,b,y){if(b.args.length>0){for(var D=w(x,b.args[0],y),A=1;A0){var D=x.args.filter(function(P){return b[P]===void 0}),A=D.length===1?D[0]:new l("*","multiply",D),E=y.concat(d(A,b));return new l("*","multiply",E)}return new l("+","add",x.args.map(function(P){return new l("*","multiply",x.args.map(function($){return $===P?d($,b):$.clone()}))}))}if(x.op==="/"&&x.isBinary()){var M=x.args[0],S=x.args[1];return b[S]!==void 0?new l("/","divide",[d(M,b),S]):b[M]!==void 0?new l("*","multiply",[new l("-","unaryMinus",[M]),new l("/","divide",[d(S,b),new l("^","pow",[S.clone(),N(2)])])]):new l("/","divide",[new l("-","subtract",[new l("*","multiply",[d(M,b),S.clone()]),new l("*","multiply",[M.clone(),d(S,b)])]),new l("^","pow",[S.clone(),N(2)])])}if(x.op==="^"&&x.isBinary()){var C=x.args[0],B=x.args[1];if(b[C]!==void 0)return ut(C)&&(i(C.value)||s(C.value,1))?N(0):new l("*","multiply",[x,new l("*","multiply",[new o("log",[C.clone()]),d(B.clone(),b)])]);if(b[B]!==void 0){if(ut(B)){if(i(B.value))return N(0);if(s(B.value,1))return d(C,b)}var O=new l("^","pow",[C.clone(),new l("-","subtract",[B,N(1)])]);return new l("*","multiply",[B.clone(),new l("*","multiply",[d(C,b),O])])}return new l("*","multiply",[new l("^","pow",[C.clone(),B.clone()]),new l("+","add",[new l("*","multiply",[d(C,b),new l("/","divide",[B.clone(),C.clone()])]),new l("*","multiply",[d(B,b),new o("log",[C.clone()])])])])}throw new Error('Cannot process operator "'+x.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function N(g,x){return new m(p(g,x||n.number))}return v}),nh="rationalize",V6=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],J6=q(nh,V6,t=>{var{config:e,typed:n,equal:a,isZero:r,add:s,subtract:i,multiply:p,divide:m,pow:o,parse:l,simplifyConstant:u,simplifyCore:c,simplify:f,fraction:v,bignumber:h,mathWithTransform:w,matrix:d,AccessorNode:N,ArrayNode:g,ConstantNode:x,FunctionNode:b,IndexNode:y,ObjectNode:D,OperatorNode:A,SymbolNode:E,ParenthesisNode:M}=t;function S($){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,_=B(),W=C($,T,!0,_.firstRules),K=W.variables.length,Y={exactFractions:!1},z={exactFractions:!0};if($=W.expression,K>=1){$=O($);var j,ge,te=!0,re=!1;$=f($,_.firstRules,{},Y);for(var me;ge=te?_.distrDivRules:_.sucDivRules,$=f($,ge,{},z),te=!te,me=$.toString(),me!==j;)re=!0,j=me;re&&($=f($,_.firstRulesAgain,{},Y)),$=f($,_.finalRules,{},Y)}var oe=[],ue={};return $.type==="OperatorNode"&&$.isBinary()&&$.op==="/"?(K===1&&($.args[0]=P($.args[0],oe),$.args[1]=P($.args[1])),I&&(ue.numerator=$.args[0],ue.denominator=$.args[1])):(K===1&&($=P($,oe)),I&&(ue.numerator=$,ue.denominator=null)),I?(ue.coefficients=oe,ue.variables=W.variables,ue.expression=$,ue):$}return n(nh,{Node:S,"Node, boolean":($,T)=>S($,{},T),"Node, Object":S,"Node, Object, boolean":S});function C($,T,I,_){var W=[],K=f($,_,T,{exactFractions:!1});I=!!I;var Y="+-*"+(I?"/":"");j(K);var z={};return z.expression=K,z.variables=W,z;function j(ge){var te=ge.type;if(te==="FunctionNode")throw new Error("There is an unsolved function call");if(te==="OperatorNode")if(ge.op==="^"){if(ge.args[1].type!=="ConstantNode"||!qe(parseFloat(ge.args[1].value)))throw new Error("There is a non-integer exponent");j(ge.args[0])}else{if(Y.indexOf(ge.op)===-1)throw new Error("Operator "+ge.op+" invalid in polynomial expression");for(var re=0;re1;if(_==="OperatorNode"&&$.isBinary()){var K=!1,Y;if($.op==="^"&&($.args[0].type==="ParenthesisNode"||$.args[0].type==="OperatorNode")&&$.args[1].type==="ConstantNode"&&(Y=parseFloat($.args[1].value),K=Y>=2&&qe(Y)),K){if(Y>2){var z=$.args[0],j=new A("^","pow",[$.args[0].cloneDeep(),new x(Y-1)]);$=new A("*","multiply",[z,j])}else $=new A("*","multiply",[$.args[0],$.args[0].cloneDeep()]);W&&(I==="content"?T.content=$:T.args[I]=$)}}if(_==="ParenthesisNode")O($.content,$,"content");else if(_!=="ConstantNode"&&_!=="SymbolNode")for(var ge=0;ge<$.args.length;ge++)O($.args[ge],$,ge);if(!W)return $}function P($,T){T===void 0&&(T=[]),T[0]=0;var I={};I.cte=1,I.oper="+",I.fire="";var _=0,W="";me($,null,I),_=T.length-1;for(var K=!0,Y,z=_;z>=0;z--)if(T[z]!==0){var j=new x(K?T[z]:Math.abs(T[z])),ge=T[z]<0?"-":"+";if(z>0){var te=new E(W);if(z>1){var re=new x(z);te=new A("^","pow",[te,re])}T[z]===-1&&K?j=new A("-","unaryMinus",[te]):Math.abs(T[z])===1?j=te:j=new A("*","multiply",[j,te])}K?Y=j:ge==="+"?Y=new A("+","add",[Y,j]):Y=new A("-","subtract",[Y,j]),K=!1}if(K)return new x(0);return Y;function me(oe,ue,we){var be=oe.type;if(be==="FunctionNode")throw new Error("There is an unsolved function call");if(be==="OperatorNode"){if("+-*^".indexOf(oe.op)===-1)throw new Error("Operator "+oe.op+" invalid");if(ue!==null){if((oe.fn==="unaryMinus"||oe.fn==="pow")&&ue.fn!=="add"&&ue.fn!=="subtract"&&ue.fn!=="multiply")throw new Error("Invalid "+oe.op+" placing");if((oe.fn==="subtract"||oe.fn==="add"||oe.fn==="multiply")&&ue.fn!=="add"&&ue.fn!=="subtract")throw new Error("Invalid "+oe.op+" placing");if((oe.fn==="subtract"||oe.fn==="add"||oe.fn==="unaryMinus")&&we.noFil!==0)throw new Error("Invalid "+oe.op+" placing")}(oe.op==="^"||oe.op==="*")&&(we.fire=oe.op);for(var Ae=0;Ae_&&(T[_e]=0),T[_e]+=we.cte*(we.oper==="+"?1:-1),_=Math.max(_e,_);return}we.cte=_e,we.fire===""&&(T[0]+=we.cte*(we.oper==="+"?1:-1))}else throw new Error("Type "+be+" is not allowed")}}}),sh="zpk2tf",Z6=["typed","add","multiply","Complex","number"],W6=q(sh,Z6,t=>{var{typed:e,add:n,multiply:a,Complex:r,number:s}=t;return e(sh,{"Array,Array,number":function(o,l,u){return i(o,l,u)},"Array,Array":function(o,l){return i(o,l,1)},"Matrix,Matrix,number":function(o,l,u){return i(o.valueOf(),l.valueOf(),u)},"Matrix,Matrix":function(o,l){return i(o.valueOf(),l.valueOf(),1)}});function i(m,o,l){m.some(N=>N.type==="BigNumber")&&(m=m.map(N=>s(N))),o.some(N=>N.type==="BigNumber")&&(o=o.map(N=>s(N)));for(var u=[r(1,0)],c=[r(1,0)],f=0;f=0&&u-c{var{typed:e,add:n,multiply:a,Complex:r,divide:s,matrix:i}=t;return e(ih,{"Array, Array":function(l,u){var c=m(512);return p(l,u,c)},"Array, Array, Array":function(l,u,c){return p(l,u,c)},"Array, Array, number":function(l,u,c){if(c<0)throw new Error("w must be a positive number");var f=m(c);return p(l,u,f)},"Matrix, Matrix":function(l,u){var c=m(512),{w:f,h:v}=p(l.valueOf(),u.valueOf(),c);return{w:i(f),h:i(v)}},"Matrix, Matrix, Matrix":function(l,u,c){var{h:f}=p(l.valueOf(),u.valueOf(),c.valueOf());return{h:i(f),w:i(c)}},"Matrix, Matrix, number":function(l,u,c){if(c<0)throw new Error("w must be a positive number");var f=m(c),{h:v}=p(l.valueOf(),u.valueOf(),f);return{h:i(v),w:i(f)}}});function p(o,l,u){for(var c=[],f=[],v=0;v{var{classes:e}=t;return function(a,r){var s=e[r&&r.mathjs];return s&&typeof s.fromJSON=="function"?s.fromJSON(r):r}}),eC="replacer",tC=[],aC=q(eC,tC,()=>function(e,n){return typeof n=="number"&&(!isFinite(n)||isNaN(n))?{mathjs:"number",value:String(n)}:n}),rC="12.4.2",nC=q("true",[],()=>!0),sC=q("false",[],()=>!1),iC=q("null",[],()=>null),oC=Ca("Infinity",["config","?BigNumber"],t=>{var{config:e,BigNumber:n}=t;return e.number==="BigNumber"?new n(1/0):1/0}),lC=Ca("NaN",["config","?BigNumber"],t=>{var{config:e,BigNumber:n}=t;return e.number==="BigNumber"?new n(NaN):NaN}),mC=Ca("pi",["config","?BigNumber"],t=>{var{config:e,BigNumber:n}=t;return e.number==="BigNumber"?am(n):by}),uC=Ca("tau",["config","?BigNumber"],t=>{var{config:e,BigNumber:n}=t;return e.number==="BigNumber"?HN(n):Ny}),pC=Ca("e",["config","?BigNumber"],t=>{var{config:e,BigNumber:n}=t;return e.number==="BigNumber"?UN(n):Ey}),cC=Ca("phi",["config","?BigNumber"],t=>{var{config:e,BigNumber:n}=t;return e.number==="BigNumber"?GN(n):Dy}),fC=Ca("LN2",["config","?BigNumber"],t=>{var{config:e,BigNumber:n}=t;return e.number==="BigNumber"?new n(2).ln():Math.LN2}),hC=Ca("LN10",["config","?BigNumber"],t=>{var{config:e,BigNumber:n}=t;return e.number==="BigNumber"?new n(10).ln():Math.LN10}),vC=Ca("LOG2E",["config","?BigNumber"],t=>{var{config:e,BigNumber:n}=t;return e.number==="BigNumber"?new n(1).div(new n(2).ln()):Math.LOG2E}),gC=Ca("LOG10E",["config","?BigNumber"],t=>{var{config:e,BigNumber:n}=t;return e.number==="BigNumber"?new n(1).div(new n(10).ln()):Math.LOG10E}),dC=Ca("SQRT1_2",["config","?BigNumber"],t=>{var{config:e,BigNumber:n}=t;return e.number==="BigNumber"?new n("0.5").sqrt():Math.SQRT1_2}),yC=Ca("SQRT2",["config","?BigNumber"],t=>{var{config:e,BigNumber:n}=t;return e.number==="BigNumber"?new n(2).sqrt():Math.SQRT2}),wC=Ca("i",["Complex"],t=>{var{Complex:e}=t;return e.I}),xC=q("version",[],()=>rC);function Ca(t,e,n){return q(t,e,n,{recreateOnConfigChange:!0})}var bC=Ke("speedOfLight","299792458","m s^-1"),NC=Ke("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),EC=Ke("planckConstant","6.62607015e-34","J s"),DC=Ke("reducedPlanckConstant","1.0545718176461565e-34","J s"),AC=Ke("magneticConstant","1.25663706212e-6","N A^-2"),MC=Ke("electricConstant","8.8541878128e-12","F m^-1"),SC=Ke("vacuumImpedance","376.730313667","ohm"),CC=Ke("coulomb","8.987551792261171e9","N m^2 C^-2"),TC=Ke("elementaryCharge","1.602176634e-19","C"),$C=Ke("bohrMagneton","9.2740100783e-24","J T^-1"),FC=Ke("conductanceQuantum","7.748091729863649e-5","S"),_C=Ke("inverseConductanceQuantum","12906.403729652257","ohm"),BC=Ke("magneticFluxQuantum","2.0678338484619295e-15","Wb"),OC=Ke("nuclearMagneton","5.0507837461e-27","J T^-1"),PC=Ke("klitzing","25812.807459304513","ohm"),zC=Ke("bohrRadius","5.29177210903e-11","m"),RC=Ke("classicalElectronRadius","2.8179403262e-15","m"),IC=Ke("electronMass","9.1093837015e-31","kg"),qC=Ke("fermiCoupling","1.1663787e-5","GeV^-2"),LC=Vo("fineStructure",.0072973525693),kC=Ke("hartreeEnergy","4.3597447222071e-18","J"),UC=Ke("protonMass","1.67262192369e-27","kg"),GC=Ke("deuteronMass","3.3435830926e-27","kg"),HC=Ke("neutronMass","1.6749271613e-27","kg"),VC=Ke("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),JC=Ke("rydberg","10973731.568160","m^-1"),ZC=Ke("thomsonCrossSection","6.6524587321e-29","m^2"),WC=Vo("weakMixingAngle",.2229),YC=Vo("efimovFactor",22.7),XC=Ke("atomicMass","1.66053906660e-27","kg"),QC=Ke("avogadro","6.02214076e23","mol^-1"),jC=Ke("boltzmann","1.380649e-23","J K^-1"),KC=Ke("faraday","96485.33212331001","C mol^-1"),e9=Ke("firstRadiation","3.7417718521927573e-16","W m^2"),t9=Ke("loschmidt","2.686780111798444e25","m^-3"),a9=Ke("gasConstant","8.31446261815324","J K^-1 mol^-1"),r9=Ke("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),n9=Ke("molarVolume","0.022413969545014137","m^3 mol^-1"),s9=Vo("sackurTetrode",-1.16487052358),i9=Ke("secondRadiation","0.014387768775039337","m K"),o9=Ke("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),l9=Ke("wienDisplacement","2.897771955e-3","m K"),m9=Ke("molarMass","0.99999999965e-3","kg mol^-1"),u9=Ke("molarMassC12","11.9999999958e-3","kg mol^-1"),p9=Ke("gravity","9.80665","m s^-2"),c9=Ke("planckLength","1.616255e-35","m"),f9=Ke("planckMass","2.176435e-8","kg"),h9=Ke("planckTime","5.391245e-44","s"),v9=Ke("planckCharge","1.87554603778e-18","C"),g9=Ke("planckTemperature","1.416785e+32","K");function Ke(t,e,n){var a=["config","Unit","BigNumber"];return q(t,a,r=>{var{config:s,Unit:i,BigNumber:p}=r,m=s.number==="BigNumber"?new p(e):parseFloat(e),o=new i(m,n);return o.fixPrefix=!0,o})}function Vo(t,e){var n=["config","BigNumber"];return q(t,n,a=>{var{config:r,BigNumber:s}=a;return r.number==="BigNumber"?new s(e):e})}var d9="apply",y9=["typed","isInteger"],w9=q(d9,y9,t=>{var{typed:e,isInteger:n}=t,a=Xl({typed:e,isInteger:n});return e("apply",{"...any":function(s){var i=s[1];tt(i)?s[1]=i-1:at(i)&&(s[1]=i.minus(1));try{return a.apply(null,s)}catch(p){throw wa(p)}}})},{isTransformFunction:!0}),x9="column",b9=["typed","Index","matrix","range"],N9=q(x9,b9,t=>{var{typed:e,Index:n,matrix:a,range:r}=t,s=vg({typed:e,Index:n,matrix:a,range:r});return e("column",{"...any":function(p){var m=p.length-1,o=p[m];tt(o)&&(p[m]=o-1);try{return s.apply(null,p)}catch(l){throw wa(l)}}})},{isTransformFunction:!0});function pm(t,e,n){var a=t.filter(function(m){return Qt(m)&&!(m.name in e)&&!n.has(m.name)})[0];if(!a)throw new Error('No undefined variable found in inline expression "'+t+'"');var r=a.name,s=new Map,i=new Wh(n,s,new Set([r])),p=t.compile();return function(o){return s.set(r,o),p.evaluate(i)}}var E9="filter",D9=["typed"],A9=q(E9,D9,t=>{var{typed:e}=t;function n(r,s,i){var p,m;return r[0]&&(p=r[0].compile().evaluate(i)),r[1]&&(Qt(r[1])||vi(r[1])?m=r[1].compile().evaluate(i):m=pm(r[1],s,i)),a(p,m)}n.rawArgs=!0;var a=e("filter",{"Array, function":oh,"Matrix, function":function(s,i){return s.create(oh(s.toArray(),i))},"Array, RegExp":mo,"Matrix, RegExp":function(s,i){return s.create(mo(s.toArray(),i))}});return n},{isTransformFunction:!0});function oh(t,e){return Gh(t,function(n,a,r){return Fs(e,n,[a+1],r,"filter")})}var M9="forEach",S9=["typed"],C9=q(M9,S9,t=>{var{typed:e}=t;function n(r,s,i){var p,m;return r[0]&&(p=r[0].compile().evaluate(i)),r[1]&&(Qt(r[1])||vi(r[1])?m=r[1].compile().evaluate(i):m=pm(r[1],s,i)),a(p,m)}n.rawArgs=!0;var a=e("forEach",{"Array | Matrix, function":function(s,i){var p=function m(o,l){if(Array.isArray(o))Po(o,function(u,c){m(u,l.concat(c+1))});else return Fs(i,o,l,s,"forEach")};p(s.valueOf(),[])}});return n},{isTransformFunction:!0}),T9="index",$9=["Index","getMatrixDataType"],F9=q(T9,$9,t=>{var{Index:e,getMatrixDataType:n}=t;return function(){for(var r=[],s=0,i=arguments.length;s0?0:2;else if(p&&p.isSet===!0)p=p.map(function(o){return o-1});else if(vt(p)||Ve(p))n(p)!=="boolean"&&(p=p.map(function(o){return o-1}));else if(tt(p))p--;else if(at(p))p=p.toNumber()-1;else if(typeof p!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");r[s]=p}var m=new e;return e.apply(m,r),m}},{isTransformFunction:!0}),_9="map",B9=["typed"],O9=q(_9,B9,t=>{var{typed:e}=t;function n(r,s,i){var p,m;return r[0]&&(p=r[0].compile().evaluate(i)),r[1]&&(Qt(r[1])||vi(r[1])?m=r[1].compile().evaluate(i):m=pm(r[1],s,i)),a(p,m)}n.rawArgs=!0;var a=e("map",{"Array, function":function(s,i){return lh(s,i,s)},"Matrix, function":function(s,i){return s.create(lh(s.valueOf(),i,s))}});return n},{isTransformFunction:!0});function lh(t,e,n){function a(r,s){return Array.isArray(r)?_r(r,function(i,p){return a(i,s.concat(p+1))}):Fs(e,r,s,n,"map")}return a(t,[])}function nn(t){if(t.length===2&&Ra(t[0])){t=t.slice();var e=t[1];tt(e)?t[1]=e-1:at(e)&&(t[1]=e.minus(1))}return t}var P9="max",z9=["typed","config","numeric","larger"],R9=q(P9,z9,t=>{var{typed:e,config:n,numeric:a,larger:r}=t,s=Ag({typed:e,config:n,numeric:a,larger:r});return e("max",{"...any":function(p){p=nn(p);try{return s.apply(null,p)}catch(m){throw wa(m)}}})},{isTransformFunction:!0}),I9="mean",q9=["typed","add","divide"],L9=q(I9,q9,t=>{var{typed:e,add:n,divide:a}=t,r=Og({typed:e,add:n,divide:a});return e("mean",{"...any":function(i){i=nn(i);try{return r.apply(null,i)}catch(p){throw wa(p)}}})},{isTransformFunction:!0}),k9="min",U9=["typed","config","numeric","smaller"],G9=q(k9,U9,t=>{var{typed:e,config:n,numeric:a,smaller:r}=t,s=Mg({typed:e,config:n,numeric:a,smaller:r});return e("min",{"...any":function(p){p=nn(p);try{return s.apply(null,p)}catch(m){throw wa(m)}}})},{isTransformFunction:!0}),H9="range",V9=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],J9=q(H9,V9,t=>{var{typed:e,config:n,matrix:a,bignumber:r,smaller:s,smallerEq:i,larger:p,largerEq:m,add:o,isPositive:l}=t,u=wg({typed:e,config:n,matrix:a,bignumber:r,smaller:s,smallerEq:i,larger:p,largerEq:m,add:o,isPositive:l});return e("range",{"...any":function(f){var v=f.length-1,h=f[v];return typeof h!="boolean"&&f.push(!0),u.apply(null,f)}})},{isTransformFunction:!0}),Z9="row",W9=["typed","Index","matrix","range"],Y9=q(Z9,W9,t=>{var{typed:e,Index:n,matrix:a,range:r}=t,s=xg({typed:e,Index:n,matrix:a,range:r});return e("row",{"...any":function(p){var m=p.length-1,o=p[m];tt(o)&&(p[m]=o-1);try{return s.apply(null,p)}catch(l){throw wa(l)}}})},{isTransformFunction:!0}),X9="subset",Q9=["typed","matrix","zeros","add"],j9=q(X9,Q9,t=>{var{typed:e,matrix:n,zeros:a,add:r}=t,s=bg({typed:e,matrix:n,zeros:a,add:r});return e("subset",{"...any":function(p){try{return s.apply(null,p)}catch(m){throw wa(m)}}})},{isTransformFunction:!0}),K9="concat",eT=["typed","matrix","isInteger"],tT=q(K9,eT,t=>{var{typed:e,matrix:n,isInteger:a}=t,r=hg({typed:e,matrix:n,isInteger:a});return e("concat",{"...any":function(i){var p=i.length-1,m=i[p];tt(m)?i[p]=m-1:at(m)&&(i[p]=m.minus(1));try{return r.apply(null,i)}catch(o){throw wa(o)}}})},{isTransformFunction:!0}),mh="diff",aT=["typed","matrix","subtract","number","bignumber"],rT=q(mh,aT,t=>{var{typed:e,matrix:n,subtract:a,number:r,bignumber:s}=t,i=gg({typed:e,matrix:n,subtract:a,number:r,bignumber:s});return e(mh,{"...any":function(m){m=nn(m);try{return i.apply(null,m)}catch(o){throw wa(o)}}})},{isTransformFunction:!0}),nT="std",sT=["typed","map","sqrt","variance"],iT=q(nT,sT,t=>{var{typed:e,map:n,sqrt:a,variance:r}=t,s=Rg({typed:e,map:n,sqrt:a,variance:r});return e("std",{"...any":function(p){p=nn(p);try{return s.apply(null,p)}catch(m){throw wa(m)}}})},{isTransformFunction:!0}),uh="sum",oT=["typed","config","add","numeric"],lT=q(uh,oT,t=>{var{typed:e,config:n,add:a,numeric:r}=t,s=_g({typed:e,config:n,add:a,numeric:r});return e(uh,{"...any":function(p){p=nn(p);try{return s.apply(null,p)}catch(m){throw wa(m)}}})},{isTransformFunction:!0}),mT="quantileSeq",uT=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],pT=q(mT,uT,t=>{var{typed:e,bignumber:n,add:a,subtract:r,divide:s,multiply:i,partitionSelect:p,compare:m,isInteger:o,smaller:l,smallerEq:u,larger:c}=t,f=zg({typed:e,bignumber:n,add:a,subtract:r,divide:s,multiply:i,partitionSelect:p,compare:m,isInteger:o,smaller:l,smallerEq:u,larger:c});return e("quantileSeq",{"Array | Matrix, number | BigNumber":f,"Array | Matrix, number | BigNumber, number":(h,w,d)=>f(h,w,v(d)),"Array | Matrix, number | BigNumber, boolean":f,"Array | Matrix, number | BigNumber, boolean, number":(h,w,d,N)=>f(h,w,d,v(N)),"Array | Matrix, Array | Matrix":f,"Array | Matrix, Array | Matrix, number":(h,w,d)=>f(h,w,v(d)),"Array | Matrix, Array | Matrix, boolean":f,"Array | Matrix, Array | Matrix, boolean, number":(h,w,d,N)=>f(h,w,d,v(N))});function v(h){return nn([[],h])[1]}},{isTransformFunction:!0}),ph="cumsum",cT=["typed","add","unaryPlus"],fT=q(ph,cT,t=>{var{typed:e,add:n,unaryPlus:a}=t,r=Bg({typed:e,add:n,unaryPlus:a});return e(ph,{"...any":function(i){if(i.length===2&&Ra(i[0])){var p=i[1];tt(p)?i[1]=p-1:at(p)&&(i[1]=p.minus(1))}try{return r.apply(null,i)}catch(m){throw wa(m)}}})},{isTransformFunction:!0}),ch="variance",hT=["typed","add","subtract","multiply","divide","apply","isNaN"],vT=q(ch,hT,t=>{var{typed:e,add:n,subtract:a,multiply:r,divide:s,apply:i,isNaN:p}=t,m=Pg({typed:e,add:n,subtract:a,multiply:r,divide:s,apply:i,isNaN:p});return e(ch,{"...any":function(l){l=nn(l);try{return m.apply(null,l)}catch(u){throw wa(u)}}})},{isTransformFunction:!0}),fh="print",gT=["typed","matrix","zeros","add"],dT=q(fh,gT,t=>{var{typed:e,matrix:n,zeros:a,add:r}=t,s=Eg({typed:e,matrix:n,zeros:a,add:r});return e(fh,{"string, Object | Array":function(m,o){return s(i(m),o)},"string, Object | Array, number | Object":function(m,o,l){return s(i(m),o,l)}});function i(p){return p.replace(Ng,m=>{var o=m.slice(1).split("."),l=o.map(function(u){return!isNaN(u)&&u.length>0?parseInt(u)-1:u});return"$"+l.join(".")})}},{isTransformFunction:!0}),yT="and",wT=["typed","matrix","zeros","add","equalScalar","not","concat"],xT=q(yT,wT,t=>{var{typed:e,matrix:n,equalScalar:a,zeros:r,not:s,concat:i}=t,p=Dg({typed:e,matrix:n,equalScalar:a,zeros:r,not:s,concat:i});function m(o,l,u){var c=o[0].compile().evaluate(u);if(!Ra(c)&&!p(c,!0))return!1;var f=o[1].compile().evaluate(u);return p(c,f)}return m.rawArgs=!0,m},{isTransformFunction:!0}),bT="or",NT=["typed","matrix","equalScalar","DenseMatrix","concat"],ET=q(bT,NT,t=>{var{typed:e,matrix:n,equalScalar:a,DenseMatrix:r,concat:s}=t,i=fg({typed:e,matrix:n,equalScalar:a,DenseMatrix:r,concat:s});function p(m,o,l){var u=m[0].compile().evaluate(l);if(!Ra(u)&&i(u,!1))return!0;var c=m[1].compile().evaluate(l);return i(u,c)}return p.rawArgs=!0,p},{isTransformFunction:!0}),DT="bitAnd",AT=["typed","matrix","zeros","add","equalScalar","not","concat"],MT=q(DT,AT,t=>{var{typed:e,matrix:n,equalScalar:a,zeros:r,not:s,concat:i}=t,p=pg({typed:e,matrix:n,equalScalar:a,zeros:r,not:s,concat:i});function m(o,l,u){var c=o[0].compile().evaluate(u);if(!Ra(c)){if(isNaN(c))return NaN;if(c===0||c===!1)return 0}var f=o[1].compile().evaluate(u);return p(c,f)}return m.rawArgs=!0,m},{isTransformFunction:!0}),ST="bitOr",CT=["typed","matrix","equalScalar","DenseMatrix","concat"],TT=q(ST,CT,t=>{var{typed:e,matrix:n,equalScalar:a,DenseMatrix:r,concat:s}=t,i=cg({typed:e,matrix:n,equalScalar:a,DenseMatrix:r,concat:s});function p(m,o,l){var u=m[0].compile().evaluate(l);if(!Ra(u)){if(isNaN(u))return NaN;if(u===-1)return-1;if(u===!0)return 1}var c=m[1].compile().evaluate(l);return i(u,c)}return p.rawArgs=!0,p},{isTransformFunction:!0}),Pe=Y1({config:Ee}),Ct=ey({}),hh=pC({BigNumber:Pe,config:Ee}),$T=sC({}),FT=LC({BigNumber:Pe,config:Ee}),Sn=ny({}),Lg=wC({Complex:Ct}),_T=oC({BigNumber:Pe,config:Ee}),BT=hC({BigNumber:Pe,config:Ee}),OT=gC({BigNumber:Pe,config:Ee}),Jo=uy({}),PT=lC({BigNumber:Pe,config:Ee}),zT=iC({}),RT=cC({BigNumber:Pe,config:Ee}),IT=oy({}),kg=K0({}),qT=dC({BigNumber:Pe,config:Ee}),LT=s9({BigNumber:Pe,config:Ee}),Ug=uC({BigNumber:Pe,config:Ee}),kT=nC({}),UT=xC({}),rt=hy({Matrix:Jo}),GT=YC({BigNumber:Pe,config:Ee}),HT=fC({BigNumber:Pe,config:Ee}),Rl=mC({BigNumber:Pe,config:Ee}),VT=aC({}),JT=yC({BigNumber:Pe,config:Ee}),Z=Y0({BigNumber:Pe,Complex:Ct,DenseMatrix:rt,Fraction:Sn}),cm=Aw({BigNumber:Pe,config:Ee,typed:Z}),ZT=WC({BigNumber:Pe,config:Ee}),xa=Sw({typed:Z}),WT=tE({Complex:Ct,config:Ee,typed:Z}),YT=sE({BigNumber:Pe,typed:Z}),XT=mE({BigNumber:Pe,Complex:Ct,config:Ee,typed:Z}),Zt=Fw({typed:Z}),QT=yb({typed:Z}),jT=vE({BigNumber:Pe,Complex:Ct,config:Ee,typed:Z}),KT=xE({typed:Z}),Gg=EE({typed:Z}),e$=SE({Complex:Ct,config:Ee,typed:Z}),Sa=sw({BigNumber:Pe,typed:Z}),t$=pb({typed:Z}),a$=aw({typed:Z}),r$=gy({typed:Z}),Zo=BS({typed:Z}),Wo=lw({Complex:Ct,typed:Z}),Cn=xb({typed:Z}),fm=TE({typed:Z}),n$=BE({BigNumber:Pe,typed:Z}),s$=RE({BigNumber:Pe,typed:Z}),i$=Jw({typed:Z}),ot=Hy({config:Ee,typed:Z}),o$=U2({typed:Z}),Hg=Ww({typed:Z}),l$=Xw({Complex:Ct,typed:Z}),m$=Lb({typed:Z}),u$=Hb({typed:Z}),wi=K2({typed:Z}),hm=Zb({typed:Z}),p$=s3({format:wi,typed:Z}),vm=Nb({typed:Z}),Da=yy({typed:Z}),sn=Ty({typed:Z}),Tn=Py({typed:Z}),ja=Ry({typed:Z}),c$=vC({BigNumber:Pe,config:Ee}),f$=qS({Complex:Ct,typed:Z}),h$=Fx({Complex:Ct,config:Ee,typed:Z}),Vg=Bx({Complex:Ct,config:Ee,typed:Z}),$n=Kb({typed:Z}),zt=zx({typed:Z}),To=Mb({typed:Z}),Pr=jy({typed:Z}),v$=r3({format:wi,typed:Z}),g$=f6({config:Ee,typed:Z}),d$=Eg({typed:Z}),y$=v6({config:Ee,typed:Z}),gm=Db({typed:Z}),w$=kE({BigNumber:Pe,typed:Z}),Jg=Ux({BigNumber:Pe,Fraction:Sn,complex:Wo,typed:Z}),Yo=VE({typed:Z}),zr=Zy({Matrix:Jo,equalScalar:ot,typed:Z}),x$=bw({typed:Z}),b$=Zx({typed:Z}),N$=ew({typed:Z}),qa=Bw({typed:Z}),E$=YE({typed:Z}),Zg=ky({typed:Z}),D$=rE({Complex:Ct,config:Ee,typed:Z}),A$=pE({BigNumber:Pe,typed:Z}),dm=Xl({isInteger:Da,typed:Z}),M$=fE({BigNumber:Pe,Complex:Ct,config:Ee,typed:Z}),S$=t3({format:wi,typed:Z}),C$=PS({typed:Z}),T$=FE({typed:Z}),$$=qE({BigNumber:Pe,typed:Z}),xi=qy({typed:Z}),F$=u3({typed:Z}),_$=d6({config:Ee,typed:Z}),B$=GE({BigNumber:Pe,typed:Z}),O$=ZE({typed:Z}),P$=QN({SparseMatrix:zr,typed:Z}),Ka=Vx({Complex:Ct,config:Ee,typed:Z}),z$=jE({typed:Z}),wr=Ew({typed:Z}),R$=oE({BigNumber:Pe,Complex:Ct,config:Ee,typed:Z}),I$=PE({BigNumber:Pe,typed:Z}),Bs=pw({Fraction:Sn,typed:Z}),Fn=Fy({typed:Z}),Be=fw({DenseMatrix:rt,Matrix:Jo,SparseMatrix:zr,typed:Z}),q$=vw({isZero:ja,matrix:Be,typed:Z}),L$=Y2({isNaN:xi,isNumeric:Fn,typed:Z}),Ja=f3({bignumber:Sa,fraction:Bs,number:Pr}),Wg=Q2({config:Ee,multiplyScalar:zt,numeric:Ja,typed:Z}),Yg=o2({isInteger:Da,matrix:Be,typed:Z}),ra=d2({matrix:Be,config:Ee,typed:Z}),k$=w2({matrix:Be,typed:Z}),bi=A2({matrix:Be,typed:Z}),Xg=Qx({BigNumber:Pe,config:Ee,matrix:Be,typed:Z}),ta=T2({BigNumber:Pe,config:Ee,matrix:Be,typed:Z}),U$=dE({Complex:Ct,config:Ee,typed:Z}),Qg=Pw({BigNumber:Pe,Complex:Ct,Fraction:Sn,config:Ee,isNegative:sn,matrix:Be,typed:Z,unaryMinus:wr}),pt=hg({isInteger:Da,matrix:Be,typed:Z}),G$=Bb({prod:Wg,size:ra,typed:Z}),ym=S2({conj:Cn,transpose:bi,typed:Z}),jg=Rb({DenseMatrix:rt,SparseMatrix:zr,matrix:Be,typed:Z}),Bt=v3({numeric:Ja,typed:Z}),Ni=T3({DenseMatrix:rt,concat:pt,divideScalar:Bt,equalScalar:ot,matrix:Be,typed:Z}),La=rN({DenseMatrix:rt,concat:pt,equalScalar:ot,matrix:Be,typed:Z}),Ei=Ub({matrix:Be,typed:Z}),H$=By({isNumeric:Fn,typed:Z}),on=Yb({BigNumber:Pe,DenseMatrix:rt,SparseMatrix:zr,config:Ee,matrix:Be,typed:Z}),V$=Qb({matrix:Be,multiplyScalar:zt,typed:Z}),Xo=dN({DenseMatrix:rt,concat:pt,config:Ee,matrix:Be,typed:Z}),J$=k3({DenseMatrix:rt,concat:pt,equalScalar:ot,matrix:Be,typed:Z,zeros:ta}),Kg=F3({DenseMatrix:rt,divideScalar:Bt,equalScalar:ot,matrix:Be,multiplyScalar:zt,subtractScalar:qa,typed:Z}),wm=ww({flatten:Ei,matrix:Be,size:ra,typed:Z}),Z$=Lx({BigNumber:Pe,concat:pt,equalScalar:ot,matrix:Be,typed:Z}),W$=n2({BigNumber:Pe,config:Ee,matrix:Be,typed:Z}),xm=OD({addScalar:Zt,complex:Wo,conj:Cn,divideScalar:Bt,equal:La,identity:on,isZero:ja,matrix:Be,multiplyScalar:zt,sign:Jg,sqrt:Ka,subtractScalar:qa,typed:Z,unaryMinus:wr,zeros:ta}),Y$=u2({config:Ee,matrix:Be}),X$=G3({DenseMatrix:rt,concat:pt,equalScalar:ot,matrix:Be,typed:Z,zeros:ta}),Os=w3({BigNumber:Pe,DenseMatrix:rt,config:Ee,equalScalar:ot,matrix:Be,typed:Z,zeros:ta}),ha=lN({DenseMatrix:rt,concat:pt,config:Ee,matrix:Be,typed:Z}),Pt=Yx({DenseMatrix:rt,concat:pt,equalScalar:ot,matrix:Be,subtractScalar:qa,typed:Z,unaryMinus:wr}),Q$=l3({concat:pt,matrix:Be,typed:Z}),j$=NN({DenseMatrix:rt,concat:pt,config:Ee,equalScalar:ot,matrix:Be,typed:Z}),bm=B3({DenseMatrix:rt,divideScalar:Bt,equalScalar:ot,matrix:Be,multiplyScalar:zt,subtractScalar:qa,typed:Z}),K$=Tb({DenseMatrix:rt,concat:pt,matrix:Be,typed:Z}),lt=x5({DenseMatrix:rt,SparseMatrix:zr,addScalar:Zt,concat:pt,equalScalar:ot,matrix:Be,typed:Z}),eF=AE({BigNumber:Pe,DenseMatrix:rt,concat:pt,equalScalar:ot,matrix:Be,typed:Z}),tF=pg({concat:pt,equalScalar:ot,matrix:Be,typed:Z}),aF=cg({DenseMatrix:rt,concat:pt,equalScalar:ot,matrix:Be,typed:Z}),rF=gb({DenseMatrix:rt,concat:pt,matrix:Be,typed:Z}),nF=E6({addScalar:Zt,combinations:Zo,divideScalar:Bt,isInteger:Da,isNegative:sn,multiplyScalar:zt,typed:Z}),_n=W3({BigNumber:Pe,DenseMatrix:rt,Fraction:Sn,concat:pt,config:Ee,equalScalar:ot,matrix:Be,typed:Z}),ed=tN({concat:pt,matrix:Be,typed:Z}),sF=Bg({add:lt,typed:Z,unaryPlus:cm}),Nm=xN({equal:La,typed:Z}),iF=gg({matrix:Be,number:Pr,subtract:Pt,typed:Z}),oF=gS({abs:xa,addScalar:Zt,deepEqual:Nm,divideScalar:Bt,multiplyScalar:zt,sqrt:Ka,subtractScalar:qa,typed:Z}),Qo=M5({addScalar:Zt,conj:Cn,multiplyScalar:zt,size:ra,typed:Z}),lF=iN({compareText:ed,isZero:ja,typed:Z}),td=lg({DenseMatrix:rt,config:Ee,equalScalar:ot,matrix:Be,round:Os,typed:Z,zeros:ta}),mF=Ax({BigNumber:Pe,DenseMatrix:rt,concat:pt,config:Ee,equalScalar:ot,matrix:Be,round:Os,typed:Z,zeros:ta}),uF=N5({abs:xa,addScalar:Zt,divideScalar:Bt,isPositive:Tn,multiplyScalar:zt,smaller:ha,sqrt:Ka,typed:Z}),ad=_N({DenseMatrix:rt,smaller:ha}),ia=PN({ImmutableDenseMatrix:ad,getMatrixDataType:hm}),va=hN({DenseMatrix:rt,concat:pt,config:Ee,matrix:Be,typed:Z}),Em=b3({Complex:Ct,config:Ee,divideScalar:Bt,typed:Z}),pF=P3({DenseMatrix:rt,divideScalar:Bt,equalScalar:ot,matrix:Be,multiplyScalar:zt,subtractScalar:qa,typed:Z}),cF=dw({flatten:Ei,matrix:Be,size:ra,typed:Z}),fF=Mg({config:Ee,numeric:Ja,smaller:ha,typed:Z}),rd=mg({DenseMatrix:rt,concat:pt,config:Ee,equalScalar:ot,matrix:Be,round:Os,typed:Z,zeros:ta}),gt=Ix({addScalar:Zt,dot:Qo,equalScalar:ot,matrix:Be,multiplyScalar:zt,typed:Z}),hF=A3({Complex:Ct,config:Ee,divideScalar:Bt,typed:Z}),vF=fg({DenseMatrix:rt,concat:pt,equalScalar:ot,matrix:Be,typed:Z}),jo=AN({compare:_n,isNaN:xi,isNumeric:Fn,typed:Z}),gF=V3({DenseMatrix:rt,concat:pt,equalScalar:ot,matrix:Be,typed:Z,zeros:ta}),nd=nA({SparseMatrix:zr,abs:xa,add:lt,divideScalar:Bt,larger:va,largerEq:Xo,multiply:gt,subtract:Pt,transpose:bi,typed:Z}),Ta=bg({add:lt,matrix:Be,typed:Z,zeros:ta}),Dm=_g({add:lt,config:Ee,numeric:Ja,typed:Z}),dF=T5({add:lt,matrix:Be,typed:Z}),sd=R3({DenseMatrix:rt,divideScalar:Bt,equalScalar:ot,matrix:Be,multiplyScalar:zt,subtractScalar:qa,typed:Z}),yF=W6({Complex:Ct,add:lt,multiply:gt,number:Pr,typed:Z}),Am=Hw({DenseMatrix:rt,config:Ee,equalScalar:ot,matrix:Be,round:Os,typed:Z,zeros:ta}),xr=j3({compare:_n,typed:Z}),wF=A6({addScalar:Zt,combinations:Zo,isInteger:Da,isNegative:sn,isPositive:Tn,larger:va,typed:Z}),xF=Pb({matrix:Be,multiply:gt,subtract:Pt,typed:Z}),id=J4({divideScalar:Bt,isZero:ja,matrix:Be,multiply:gt,subtractScalar:qa,typed:Z,unaryMinus:wr}),bF=rb({concat:pt,equalScalar:ot,matrix:Be,multiplyScalar:zt,typed:Z}),od=IN({larger:va,smaller:ha}),ld=Kw({Complex:Ct,DenseMatrix:rt,ceil:Am,equalScalar:ot,floor:td,matrix:Be,typed:Z,zeros:ta}),md=F5({Index:ia,typed:Z}),NF=wS({abs:xa,add:lt,addScalar:Zt,config:Ee,divideScalar:Bt,equalScalar:ot,flatten:Ei,isNumeric:Fn,isZero:ja,matrix:Be,multiply:gt,multiplyScalar:zt,smaller:ha,subtract:Pt,typed:Z}),EF=Kx({BigNumber:Pe,add:lt,config:Ee,equal:La,isInteger:Da,mod:rd,smaller:ha,typed:Z,xgcd:Xg}),DF=Tx({concat:pt,equalScalar:ot,matrix:Be,typed:Z}),AF=E3({Complex:Ct,config:Ee,divideScalar:Bt,log:Em,typed:Z}),Mm=Ag({config:Ee,larger:va,numeric:Ja,typed:Z}),MF=e5({DenseMatrix:rt,Index:ia,compareNatural:xr,size:ra,subset:Ta,typed:Z}),SF=n5({DenseMatrix:rt,Index:ia,compareNatural:xr,size:ra,subset:Ta,typed:Z}),CF=l5({Index:ia,compareNatural:xr,size:ra,subset:Ta,typed:Z}),TF=c5({Index:ia,compareNatural:xr,size:ra,subset:Ta,typed:Z}),Ds=pN({DenseMatrix:rt,concat:pt,config:Ee,matrix:Be,typed:Z}),$F=SN({compare:_n,compareNatural:xr,matrix:Be,typed:Z}),FF=Dg({concat:pt,equalScalar:ot,matrix:Be,not:To,typed:Z,zeros:ta}),As=wg({bignumber:Sa,matrix:Be,add:lt,config:Ee,isPositive:Tn,larger:va,largerEq:Xo,smaller:ha,smallerEq:Ds,typed:Z}),_F=xg({Index:ia,matrix:Be,range:As,typed:Z}),ud=a5({DenseMatrix:rt,Index:ia,compareNatural:xr,size:ra,subset:Ta,typed:Z}),BF=u5({Index:ia,compareNatural:xr,size:ra,subset:Ta,typed:Z}),pd=g5({Index:ia,concat:pt,setDifference:ud,size:ra,subset:Ta,typed:Z}),cd=kN({FibonacciHeap:od,addScalar:Zt,equalScalar:ot}),fd=vg({Index:ia,matrix:Be,range:As,typed:Z}),Bn=W4({abs:xa,addScalar:Zt,det:id,divideScalar:Bt,identity:on,matrix:Be,multiply:gt,typed:Z,unaryMinus:wr}),hd=_D({DenseMatrix:rt,Spa:cd,SparseMatrix:zr,abs:xa,addScalar:Zt,divideScalar:Bt,equalScalar:ot,larger:va,matrix:Be,multiplyScalar:zt,subtractScalar:qa,typed:Z,unaryMinus:wr}),OF=X4({Complex:Ct,add:lt,ctranspose:ym,deepEqual:Nm,divideScalar:Bt,dot:Qo,dotDivide:Ni,equal:La,inv:Bn,matrix:Be,multiply:gt,typed:Z}),ka=d3({Complex:Ct,config:Ee,fraction:Bs,identity:on,inv:Bn,matrix:Be,multiply:gt,number:Pr,typed:Z}),vd=i5({DenseMatrix:rt,Index:ia,compareNatural:xr,size:ra,subset:Ta,typed:Z}),PF=y5({Index:ia,concat:pt,setIntersect:vd,setSymDifference:pd,size:ra,subset:Ta,typed:Z}),zF=sS({abs:xa,add:lt,identity:on,inv:Bn,map:$n,max:Mm,multiply:gt,size:ra,sqrt:Ka,subtract:Pt,typed:Z}),We=ZN({BigNumber:Pe,Complex:Ct,Fraction:Sn,abs:xa,addScalar:Zt,config:Ee,divideScalar:Bt,equal:La,fix:ld,format:wi,isNumeric:Fn,multiplyScalar:zt,number:Pr,pow:ka,round:Os,subtractScalar:qa}),RF=SC({BigNumber:Pe,Unit:We,config:Ee}),IF=l9({BigNumber:Pe,Unit:We,config:Ee}),qF=XC({BigNumber:Pe,Unit:We,config:Ee}),LF=$C({BigNumber:Pe,Unit:We,config:Ee}),kF=jC({BigNumber:Pe,Unit:We,config:Ee}),UF=FC({BigNumber:Pe,Unit:We,config:Ee}),GF=CC({BigNumber:Pe,Unit:We,config:Ee}),HF=GC({BigNumber:Pe,Unit:We,config:Ee}),VF=S3({DenseMatrix:rt,concat:pt,equalScalar:ot,matrix:Be,pow:ka,typed:Z}),JF=MC({BigNumber:Pe,Unit:We,config:Ee}),ZF=TC({BigNumber:Pe,Unit:We,config:Ee}),WF=rS({abs:xa,add:lt,identity:on,inv:Bn,multiply:gt,typed:Z}),YF=KC({BigNumber:Pe,Unit:We,config:Ee}),gd=F2({addScalar:Zt,ceil:Am,conj:Cn,divideScalar:Bt,dotDivide:Ni,exp:Hg,i:Lg,log2:Vg,matrix:Be,multiplyScalar:zt,pow:ka,tau:Ug,typed:Z}),Sm=RS({BigNumber:Pe,Complex:Ct,config:Ee,multiplyScalar:zt,pow:ka,typed:Z}),XF=NC({BigNumber:Pe,Unit:We,config:Ee}),QF=kC({BigNumber:Pe,Unit:We,config:Ee}),jF=B2({conj:Cn,dotDivide:Ni,fft:gd,typed:Z}),KF=PC({BigNumber:Pe,Unit:We,config:Ee}),e_=t9({BigNumber:Pe,Unit:We,config:Ee}),t_=AC({BigNumber:Pe,Unit:We,config:Ee}),a_=m9({BigNumber:Pe,Unit:We,config:Ee}),r_=r9({BigNumber:Pe,Unit:We,config:Ee}),n_=HC({BigNumber:Pe,Unit:We,config:Ee}),s_=OC({BigNumber:Pe,Unit:We,config:Ee}),i_=v9({BigNumber:Pe,Unit:We,config:Ee}),o_=c9({BigNumber:Pe,Unit:We,config:Ee}),l_=g9({BigNumber:Pe,Unit:We,config:Ee}),m_=UC({BigNumber:Pe,Unit:We,config:Ee}),u_=VC({BigNumber:Pe,Unit:We,config:Ee}),p_=DC({BigNumber:Pe,Unit:We,config:Ee}),c_=JC({BigNumber:Pe,Unit:We,config:Ee}),f_=i9({BigNumber:Pe,Unit:We,config:Ee}),h_=bC({BigNumber:Pe,Unit:We,config:Ee}),v_=o9({BigNumber:Pe,Unit:We,config:Ee}),g_=ZC({BigNumber:Pe,Unit:We,config:Ee}),d_=QC({BigNumber:Pe,Unit:We,config:Ee}),y_=zC({BigNumber:Pe,Unit:We,config:Ee}),w_=KN({Unit:We,typed:Z}),jt=hS({divideScalar:Bt,equalScalar:ot,inv:Bn,matrix:Be,multiply:gt,typed:Z}),x_=IC({BigNumber:Pe,Unit:We,config:Ee}),Di=kS({gamma:Sm,typed:Z}),b_=e9({BigNumber:Pe,Unit:We,config:Ee}),N_=p9({BigNumber:Pe,Unit:We,config:Ee}),E_=_C({BigNumber:Pe,Unit:We,config:Ee}),dd=iA({DenseMatrix:rt,lsolve:Kg,lup:hd,matrix:Be,slu:nd,typed:Z,usolve:bm}),D_=BC({BigNumber:Pe,Unit:We,config:Ee}),A_=u9({BigNumber:Pe,Unit:We,config:Ee}),M_=VS({add:lt,divide:jt,factorial:Di,isInteger:Da,isPositive:Tn,multiply:gt,typed:Z}),S_=ZS({factorial:Di,typed:Z}),C_=f9({BigNumber:Pe,Unit:We,config:Ee}),T_=lA({add:lt,cbrt:Qg,divide:jt,equalScalar:ot,im:vm,isZero:ja,multiply:gt,re:gm,sqrt:Ka,subtract:Pt,typeOf:Zg,typed:Z,unaryMinus:wr}),$_=h5({compareNatural:xr,typed:Z}),F_=q2({abs:xa,add:lt,bignumber:Sa,divide:jt,isNegative:sn,isPositive:Tn,larger:va,map:$n,matrix:Be,max:Mm,multiply:gt,smaller:ha,subtract:Pt,typed:Z,unaryMinus:wr}),yd=w6({bignumber:Sa,addScalar:Zt,combinations:Zo,divideScalar:Bt,factorial:Di,isInteger:Da,isNegative:sn,larger:va,multiplyScalar:zt,number:Pr,pow:ka,subtractScalar:qa,typed:Z}),__=YN({Unit:We,typed:Z}),B_=b6({addScalar:Zt,isInteger:Da,isNegative:sn,stirlingS2:yd,typed:Z}),wd=tS({abs:xa,add:lt,addScalar:Zt,atan:Gg,bignumber:Sa,column:fd,complex:Wo,config:Ee,cos:fm,diag:jg,divideScalar:Bt,dot:Qo,equal:La,flatten:Ei,im:vm,inv:Bn,larger:va,matrix:Be,matrixFromColumns:wm,multiply:gt,multiplyScalar:zt,number:Pr,qr:xm,re:gm,reshape:Yg,sin:Yo,size:ra,smaller:ha,sqrt:Ka,subtract:Pt,typed:Z,usolve:bm,usolveAll:sd}),O_=qC({BigNumber:Pe,Unit:We,config:Ee}),P_=a9({BigNumber:Pe,Unit:We,config:Ee}),z_=GS({divide:jt,dotDivide:Ni,isNumeric:Fn,log:Em,map:$n,matrix:Be,multiply:gt,sum:Dm,typed:Z}),xd=Og({add:lt,divide:jt,typed:Z}),R_=n9({BigNumber:Pe,Unit:We,config:Ee}),I_=EC({BigNumber:Pe,Unit:We,config:Ee}),q_=zg({bignumber:Sa,add:lt,compare:_n,divide:jt,isInteger:Da,larger:va,multiply:gt,partitionSelect:jo,smaller:ha,smallerEq:Ds,subtract:Pt,typed:Z}),Cm=Pg({add:lt,apply:dm,divide:jt,isNaN:xi,multiply:gt,subtract:Pt,typed:Z}),L_=RC({BigNumber:Pe,Unit:We,config:Ee}),bd=DS({add:lt,compare:_n,divide:jt,partitionSelect:jo,typed:Z}),k_=FS({add:lt,divide:jt,matrix:Be,mean:xd,multiply:gt,pow:ka,sqrt:Ka,subtract:Pt,sum:Dm,typed:Z}),U_=X6({Complex:Ct,add:lt,divide:jt,matrix:Be,multiply:gt,typed:Z}),G_=MS({abs:xa,map:$n,median:bd,subtract:Pt,typed:Z}),H_=Rg({map:$n,sqrt:Ka,typed:Z,variance:Cm}),V_=Z2({BigNumber:Pe,Complex:Ct,add:lt,config:Ee,divide:jt,equal:La,factorial:Di,gamma:Sm,isNegative:sn,multiply:gt,pi:Rl,pow:ka,sin:Yo,smallerEq:Ds,subtract:Pt,typed:Z}),Tm=D5({abs:xa,add:lt,conj:Cn,ctranspose:ym,eigs:wd,equalScalar:ot,larger:va,matrix:Be,multiply:gt,pow:ka,smaller:ha,sqrt:Ka,typed:Z}),Nd=h2({BigNumber:Pe,DenseMatrix:rt,SparseMatrix:zr,addScalar:Zt,config:Ee,cos:fm,matrix:Be,multiplyScalar:zt,norm:Tm,sin:Yo,typed:Z,unaryMinus:wr}),J_=h9({BigNumber:Pe,Unit:We,config:Ee}),Ed=mS({identity:on,matrix:Be,multiply:gt,norm:Tm,qr:xm,subtract:Pt,typed:Z}),Z_=c2({multiply:gt,rotationMatrix:Nd,typed:Z}),Dd=oS({abs:xa,add:lt,concat:pt,identity:on,index:md,lusolve:dd,matrix:Be,matrixFromColumns:wm,multiply:gt,range:As,schur:Ed,subset:Ta,subtract:Pt,transpose:bi,typed:Z}),W_=pS({matrix:Be,multiply:gt,sylvester:Dd,transpose:bi,typed:Z}),Ps={},zs={},Ad={},ma=O5({mathWithTransform:zs}),Rs=iD({Node:ma}),Rr=lD({Node:ma}),On=uD({Node:ma}),Md=hD({Node:ma}),Is=I5({Node:ma}),Sd=H5({Node:ma,ResultSet:kg}),Cd=J5({Node:ma}),ln=eD({Node:ma}),Td=cD({Node:ma}),Y_=K6({classes:Ad}),$m=hA({math:Ps,typed:Z}),$d=aD({Node:ma,typed:Z}),X_=H4({Chain:$m,typed:Z}),qs=nD({Node:ma,size:ra}),Ls=z5({Node:ma,subset:Ta}),Fd=U5({matrix:Be,Node:ma,subset:Ta}),mn=dD({Unit:We,Node:ma,math:Ps}),un=wD({Node:ma,SymbolNode:mn,math:Ps}),br=bD({AccessorNode:Ls,ArrayNode:Is,AssignmentNode:Fd,BlockNode:Sd,ConditionalNode:Cd,ConstantNode:ln,FunctionAssignmentNode:$d,FunctionNode:un,IndexNode:qs,ObjectNode:Rs,OperatorNode:Rr,ParenthesisNode:On,RangeNode:Td,RelationalNode:Md,SymbolNode:mn,config:Ee,numeric:Ja,typed:Z}),_d=L6({ConstantNode:ln,FunctionNode:un,OperatorNode:Rr,ParenthesisNode:On,parse:br,typed:Z}),Fm=P6({bignumber:Sa,fraction:Bs,AccessorNode:Ls,ArrayNode:Is,ConstantNode:ln,FunctionNode:un,IndexNode:qs,ObjectNode:Rs,OperatorNode:Rr,SymbolNode:mn,config:Ee,mathWithTransform:zs,matrix:Be,typed:Z}),Q_=ED({parse:br,typed:Z}),_m=R6({AccessorNode:Ls,ArrayNode:Is,ConstantNode:ln,FunctionNode:un,IndexNode:qs,ObjectNode:Rs,OperatorNode:Rr,ParenthesisNode:On,SymbolNode:mn,add:lt,divide:jt,equal:La,isZero:ja,multiply:gt,parse:br,pow:ka,subtract:Pt,typed:Z}),Ko=AD({parse:br,typed:Z}),Bd=pA({evaluate:Ko}),Od=CD({evaluate:Ko}),el=_6({bignumber:Sa,fraction:Bs,AccessorNode:Ls,ArrayNode:Is,ConstantNode:ln,FunctionNode:un,IndexNode:qs,ObjectNode:Rs,OperatorNode:Rr,ParenthesisNode:On,SymbolNode:mn,add:lt,config:Ee,divide:jt,equal:La,isZero:ja,mathWithTransform:zs,matrix:Be,multiply:gt,parse:br,pow:ka,resolve:_d,simplifyConstant:Fm,simplifyCore:_m,subtract:Pt,typed:Z}),j_=U6({OperatorNode:Rr,parse:br,simplify:el,typed:Z}),K_=S6({parse:br,typed:Z}),eB=$D({Parser:Od,typed:Z}),tB=J6({bignumber:Sa,fraction:Bs,AccessorNode:Ls,ArrayNode:Is,ConstantNode:ln,FunctionNode:un,IndexNode:qs,ObjectNode:Rs,OperatorNode:Rr,ParenthesisNode:On,SymbolNode:mn,add:lt,config:Ee,divide:jt,equal:La,isZero:ja,mathWithTransform:zs,matrix:Be,multiply:gt,parse:br,pow:ka,simplify:el,simplifyConstant:Fm,simplifyCore:_m,subtract:Pt,typed:Z}),aB=H6({ConstantNode:ln,FunctionNode:un,OperatorNode:Rr,ParenthesisNode:On,SymbolNode:mn,config:Ee,equal:La,isZero:ja,numeric:Ja,parse:br,simplify:el,typed:Z}),rB=U4({Help:Bd,mathWithTransform:zs,typed:Z});Gt(Ps,{e:hh,false:$T,fineStructure:FT,i:Lg,Infinity:_T,LN10:BT,LOG10E:OT,NaN:PT,null:zT,phi:RT,SQRT1_2:qT,sackurTetrode:LT,tau:Ug,true:kT,E:hh,version:UT,efimovFactor:GT,LN2:HT,pi:Rl,replacer:VT,reviver:Y_,SQRT2:JT,typed:Z,unaryPlus:cm,PI:Rl,weakMixingAngle:ZT,abs:xa,acos:WT,acot:YT,acsc:XT,addScalar:Zt,arg:QT,asech:jT,asinh:KT,atan:Gg,atanh:e$,bignumber:Sa,bitNot:t$,boolean:a$,clone:r$,combinations:Zo,complex:Wo,conj:Cn,cos:fm,cot:n$,csc:s$,cube:i$,equalScalar:ot,erf:o$,exp:Hg,expm1:l$,filter:m$,forEach:u$,format:wi,getMatrixDataType:hm,hex:p$,im:vm,isInteger:Da,isNegative:sn,isPositive:Tn,isZero:ja,LOG2E:c$,lgamma:f$,log10:h$,log2:Vg,map:$n,multiplyScalar:zt,not:To,number:Pr,oct:v$,pickRandom:g$,print:d$,random:y$,re:gm,sec:w$,sign:Jg,sin:Yo,splitUnit:x$,square:b$,string:N$,subtractScalar:qa,tan:E$,typeOf:Zg,acosh:D$,acsch:A$,apply:dm,asec:M$,bin:S$,chain:X_,combinationsWithRep:C$,cosh:T$,csch:$$,isNaN:xi,isPrime:F$,randomInt:_$,sech:B$,sinh:O$,sparse:P$,sqrt:Ka,tanh:z$,unaryMinus:wr,acoth:R$,coth:I$,fraction:Bs,isNumeric:Fn,matrix:Be,matrixFromFunction:q$,mode:L$,numeric:Ja,prod:Wg,reshape:Yg,size:ra,squeeze:k$,transpose:bi,xgcd:Xg,zeros:ta,asin:U$,cbrt:Qg,concat:pt,count:G$,ctranspose:ym,diag:jg,divideScalar:Bt,dotDivide:Ni,equal:La,flatten:Ei,hasNumericValue:H$,identity:on,kron:V$,largerEq:Xo,leftShift:J$,lsolve:Kg,matrixFromColumns:wm,nthRoot:Z$,ones:W$,qr:xm,resize:Y$,rightArithShift:X$,round:Os,smaller:ha,subtract:Pt,to:Q$,unequal:j$,usolve:bm,xor:K$,add:lt,atan2:eF,bitAnd:tF,bitOr:aF,bitXor:rF,catalan:nF,compare:_n,compareText:ed,cumsum:sF,deepEqual:Nm,diff:iF,distance:oF,dot:Qo,equalText:lF,floor:td,gcd:mF,hypot:uF,larger:va,log:Em,lsolveAll:pF,matrixFromRows:cF,min:fF,mod:rd,multiply:gt,nthRoots:hF,or:vF,partitionSelect:jo,rightLogShift:gF,slu:nd,subset:Ta,sum:Dm,trace:dF,usolveAll:sd,zpk2tf:yF,ceil:Am,compareNatural:xr,composition:wF,cross:xF,det:id,dotMultiply:bF,fix:ld,index:md,intersect:NF,invmod:EF,lcm:DF,log1p:AF,max:Mm,setCartesian:MF,setDistinct:SF,setIsSubset:CF,setPowerset:TF,smallerEq:Ds,sort:$F,and:FF,range:As,row:_F,setDifference:ud,setMultiplicity:BF,setSymDifference:pd,column:fd,inv:Bn,lup:hd,pinv:OF,pow:ka,setIntersect:vd,setUnion:PF,sqrtm:zF,vacuumImpedance:RF,wienDisplacement:IF,atomicMass:qF,bohrMagneton:LF,boltzmann:kF,conductanceQuantum:UF,coulomb:GF,deuteronMass:HF,dotPow:VF,electricConstant:JF,elementaryCharge:ZF,expm:WF,faraday:YF,fft:gd,gamma:Sm,gravitationConstant:XF,hartreeEnergy:QF,ifft:jF,klitzing:KF,loschmidt:e_,magneticConstant:t_,molarMass:a_,molarPlanckConstant:r_,neutronMass:n_,nuclearMagneton:s_,planckCharge:i_,planckLength:o_,planckTemperature:l_,protonMass:m_,quantumOfCirculation:u_,reducedPlanckConstant:p_,rydberg:c_,secondRadiation:f_,speedOfLight:h_,stefanBoltzmann:v_,thomsonCrossSection:g_,avogadro:d_,bohrRadius:y_,createUnit:w_,divide:jt,electronMass:x_,factorial:Di,firstRadiation:b_,gravity:N_,inverseConductanceQuantum:E_,lusolve:dd,magneticFluxQuantum:D_,molarMassC12:A_,multinomial:M_,parse:br,permutations:S_,planckMass:C_,polynomialRoot:T_,resolve:_d,setSize:$_,simplifyConstant:Fm,solveODE:F_,stirlingS2:yd,unit:__,bellNumbers:B_,compile:Q_,eigs:wd,fermiCoupling:O_,gasConstant:P_,kldivergence:z_,mean:xd,molarVolume:R_,planckConstant:I_,quantileSeq:q_,simplifyCore:_m,variance:Cm,classicalElectronRadius:L_,evaluate:Ko,median:bd,simplify:el,symbolicEqual:j_,corr:k_,freqz:U_,leafCount:K_,mad:G_,parser:eB,rationalize:tB,std:H_,zeta:V_,derivative:aB,norm:Tm,rotationMatrix:Nd,help:rB,planckTime:J_,schur:Ed,rotate:Z_,sylvester:Dd,lyap:W_,config:Ee});Gt(zs,Ps,{filter:A9({typed:Z}),forEach:C9({typed:Z}),map:O9({typed:Z}),apply:w9({isInteger:Da,typed:Z}),or:ET({DenseMatrix:rt,concat:pt,equalScalar:ot,matrix:Be,typed:Z}),and:xT({add:lt,concat:pt,equalScalar:ot,matrix:Be,not:To,typed:Z,zeros:ta}),concat:tT({isInteger:Da,matrix:Be,typed:Z}),max:R9({config:Ee,larger:va,numeric:Ja,typed:Z}),print:dT({add:lt,matrix:Be,typed:Z,zeros:ta}),bitAnd:MT({add:lt,concat:pt,equalScalar:ot,matrix:Be,not:To,typed:Z,zeros:ta}),diff:rT({bignumber:Sa,matrix:Be,number:Pr,subtract:Pt,typed:Z}),min:G9({config:Ee,numeric:Ja,smaller:ha,typed:Z}),subset:j9({add:lt,matrix:Be,typed:Z,zeros:ta}),bitOr:TT({DenseMatrix:rt,concat:pt,equalScalar:ot,matrix:Be,typed:Z}),cumsum:fT({add:lt,typed:Z,unaryPlus:cm}),index:F9({Index:ia,getMatrixDataType:hm}),sum:lT({add:lt,config:Ee,numeric:Ja,typed:Z}),range:J9({bignumber:Sa,matrix:Be,add:lt,config:Ee,isPositive:Tn,larger:va,largerEq:Xo,smaller:ha,smallerEq:Ds,typed:Z}),row:Y9({Index:ia,matrix:Be,range:As,typed:Z}),column:N9({Index:ia,matrix:Be,range:As,typed:Z}),mean:L9({add:lt,divide:jt,typed:Z}),quantileSeq:pT({add:lt,bignumber:Sa,compare:_n,divide:jt,isInteger:Da,larger:va,multiply:gt,partitionSelect:jo,smaller:ha,smallerEq:Ds,subtract:Pt,typed:Z}),variance:vT({add:lt,apply:dm,divide:jt,isNaN:xi,multiply:gt,subtract:Pt,typed:Z}),std:iT({map:$n,sqrt:Ka,typed:Z,variance:Cm})});Gt(Ad,{BigNumber:Pe,Complex:Ct,Fraction:Sn,Matrix:Jo,Node:ma,ObjectNode:Rs,OperatorNode:Rr,ParenthesisNode:On,Range:IT,RelationalNode:Md,ResultSet:kg,ArrayNode:Is,BlockNode:Sd,ConditionalNode:Cd,ConstantNode:ln,DenseMatrix:rt,RangeNode:Td,Chain:$m,FunctionAssignmentNode:$d,SparseMatrix:zr,IndexNode:qs,ImmutableDenseMatrix:ad,Index:ia,AccessorNode:Ls,AssignmentNode:Fd,FibonacciHeap:od,Spa:cd,Unit:We,SymbolNode:mn,FunctionNode:un,Help:Bd,Parser:Od});$m.createProxy(Ps);function nB(t){if(typeof t=="number")return[t,0];if(typeof t.re=="number"&&typeof t.im=="number")return[t.re,t.im];if(typeof t[0]=="number"&&typeof t[1]=="number")return[t[0],t[1]];throw new Error("Not a valid complex number representation for point")}function sB(t,e,n){let a=[],r=[];function s(m,o,l,u){let[c,f]=nB(o),v={x:c,y:f,label:l==null?void 0:l.toString(),class:u};return a.push(v),m[l]===void 0&&(m[l]=v),v}function i(m,o,l,u,c){if(c!==void 0&&typeof c!="number")throw new Error("Control point must be a number");let f={u:o,v:l,label:u==null?void 0:u.toString(),control:c};return r.push(f),u!==""&&m[u]===void 0&&(m[u]=f),f}let p={width:e,height:n};return p.vertex=(m,o,l)=>s(p,m,o,l),p.node=p.vertex,p.edge=(m,o,l,u)=>i(p,m,o,l,u),Ko(t,p),[a,r]}const Ue=(t,e,n)=>`Invalid argument ${e} = ${n} for ${t}`,iB=(t,e,n,a)=>`Illegal argument for ${t}: ${e} = ${n} must be a ${a}`,no=(t,e)=>`Illegal argument for ${t}: array ${e} is empty`,oB=(t,e,n)=>`Not enough arguments for ${t}: received ${n} instead of ${e}`,lB=(t,e,n=1)=>`Illegal argument for ${t}: the dimension index must be an integer between 0 and ${n-1}, instead ${e} was passed`,rs=(t,e,n,a)=>`Illegal argument for ${t}: ${e} = ${n} must be a ${a}`,Pd=(t,e)=>`Illegal argument for ${t}: a = ${e} must be a SafeInteger`,zd=(t,e)=>`Illegal argument for ${t}: b = ${e} must be a SafeInteger`,mB=(t,e)=>`Illegal argument for ${t}: step = ${e} must be a positive SafeInteger`,Rd=(t,e,n)=>`Illegal argument for ${t}: must be a <[=] b, but ${e} >[=] ${n}`,uB=(t,e,n)=>`Illegal argument for ${t}: range [${e}, ${n}] is too large to be allocated`,so=(t,e,n,a="point")=>`Illegal argument for ${t}: ${a} = ${e} must be of class Point`,pB=(t,e)=>`Invalid name in method ${t}: ${e}. Only strings and numbers are allowed.`,Id=(t,e)=>`Invalid data in method ${t}: ${e} is not JSON-serializable`,Bm=(t,e)=>`Invalid label in method ${t}: ${e}. Labels must be strings.`,fs=(t,e)=>`Illegal parameter for ${t}: Edge ${e} not in graph`,Na=(t,e)=>`Illegal parameter for ${t}: Vertex ${e} not in graph`,vh=(t,e)=>`Illegal argument for ${t}: v = ${e}: is already in the graph.`;function Ft(t){return!Number.isNaN(parseFloat(t))}function za(t){return Ft(t)?parseFloat(t):null}function pa(t,e,n=1){if(!Number.isSafeInteger(t))throw new TypeError(Pd("range",t));if(!Number.isSafeInteger(e))throw new TypeError(zd("range",e));if(!Number.isSafeInteger(n)||n<=0)throw new TypeError(mB("range",n));if(t>e)throw new TypeError(Rd("range",t,e));let a=1+Math.floor((e-t-1)/n);try{return Array.from({length:a},(r,s)=>t+s*n)}catch(r){throw r instanceof RangeError?new RangeError(uB("range",t,e)):r}}function gh(t=Number.MIN_SAFE_INTEGER,e=Number.MAX_SAFE_INTEGER){if(!Number.isFinite(t))throw new TypeError(Pd("randomDouble",t));if(!Number.isFinite(e))throw new TypeError(zd("randomDouble",e));if(t>=e)throw new TypeError(Rd("randomDouble",t,e));return t+Math.random()*(e-t)}function ks(t){return typeof t=="object"&&t!==null}function mi(t){return ks(t)&&t.constructor===Object}function qd(t){return typeof t=="function"}function Za(t){return t===void 0&&hB(arguments,1,"isUndefined")}function At(t){return t!==null&&!Za(t)}function dh(t){return(ks(t)||qd(t))&&typeof t[Symbol.iterator]=="function"}function cB(t){return t===!0||t===!1}function fB(t){return At(t)?(t==null?void 0:t.size)??(t==null?void 0:t.length)??0:0}let hB=(t,e,n)=>{if(t.length>=e)return!0;throw new TypeError(oB(n,e,t.length))};const Om=t=>ks(t)&&qd(t.toJson)&&t.toJson.length===0;function ui(t){if(Za(t))return JSON.stringify(null);if(ks(t)){if(Array.isArray(t))return JSON.stringify(t.map(e=>yh(e)));if(Om(t))return t.toJson();if(mi(t)){let e={};return Object.keys(t).sort().forEach(n=>e[n]=yh(t[n])),JSON.stringify(e)}else throw new Error("Impossible to convert to JSON")}else return JSON.stringify(t)}function yh(t){if(t===void 0&&(t=null),tl(t)||!ks(t)||mi(t)||Array.isArray(t))return t;if(Om(t))return t.toJson();throw new Error("Impossible to convert to JSON")}function Il(t){return Za(t)?!0:ks(t)?Array.isArray(t)?t.every(e=>Il(e)):Om(t)?!0:mi(t)?Object.values(t).every(Il):!1:!0}function tl(t){return typeof t=="string"}function $o(t){return tl(t)&&t.length>0}function vB(t){if(!Array.isArray(t)||!t.every(n=>Ft(n)))throw new TypeError(iB("mean","values",t,"Array"));let e=t.length;if(e===0)throw new TypeError(no("mean","values"));return t.reduce((n,a)=>n+a)/e}function wh(t="validateCoordinates",...e){if(!(e.length>0&&e.every(a=>Ft(a))))throw new TypeError(rs(t,"coordinates",e,"sequence of numbers"))}var Hr,pi;const Lt=class Lt{constructor(...e){Rt(this,Hr,void 0);Rt(this,pi,void 0);wh("constructor",...e),$t(this,pi,e.length),$t(this,Hr,e.map(za))}static fromJson(e){return new Lt(...JSON.parse(e))}static validatePoint(e,n=e==null?void 0:e.dimensionality,a="validatePoint"){let r=!0;if(e instanceof Lt)if(Number.isSafeInteger(n)&&n>0)n===e.dimensionality&&(wh(a,...e.coordinates()),r=!1);else throw new TypeError(rs(a,"dimensionality",n,"positive integer"));if(r)throw new Error(so(a,e))}static validatePointArray(e,n,a="validatePointArray"){if(Array.isArray(e)){if(Za(n))try{n=e[0].dimensionality}catch{}else if(!Number.isSafeInteger(n)||n<=0)throw new TypeError(rs(a,"dimensionality",n,"positive integer"));e.forEach(r=>Lt.validatePoint(r,n,a))}else throw new TypeError(rs(a,"maybePointsArray",e,"array"))}static centroid(e,n="centroid"){if(Lt.validatePointArray(e,void 0,n),e.length===0)throw new TypeError(no(n,"pointsArray"));let a=pa(0,e[0].dimensionality).map(r=>vB(e.map(s=>s.coordinate(r))));return new Lt(...a)}static random(e,n="random"){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(rs(n,"dimensionality",e,"positive integer"));let a=pa(0,e).map(r=>(Math.random()-.5)*2*Number.MAX_SAFE_INTEGER);return new Lt(...a)}static zero(e,n="zero"){if(!Number.isSafeInteger(e)||e<=0)throw new TypeError(rs(n,"dimensionality",e,"positive integer"));let a=pa(0,e).map(r=>0);return new Lt(...a)}coordinates(){return Ie(this,Hr).slice()}coordinate(e){if(!Number.isSafeInteger(e)||e<0||e>=this.dimensionality)throw new TypeError(lB("coordinate",e,this.dimensionality));return this.coordinates()[e]}get dimensionality(){return Ie(this,pi)}clone(){return new Lt(...this.coordinates())}distanceTo(e){Lt.validatePoint(e,this.dimensionality,"distanceTo");let n=this.coordinates(),a=e.coordinates(),r=n.map((s,i)=>{let p=s-a[i];return p*p});return Math.sqrt(r.reduce((s,i)=>s+i))}maxDistance(e){if(Lt.validatePointArray(e,this.dimensionality,"maxDistance"),e.length===0)throw new TypeError(no("maxDistance","pointsArray"));return e.reduce(([n,a],r)=>{let s=this.distanceTo(r);return s>a&&(a=s,n=r),[n,a]},[null,-1])}minDistance(e){if(Lt.validatePointArray(e,this.dimensionality,"minDistance"),e.length===0)throw new TypeError(no("minDistance","pointsArray"));return e.reduce(([n,a],r)=>{let s=this.distanceTo(r);return sa+r*n[s],0)}equals(e){let n=!1;if(e instanceof Lt&&e.dimensionality===this.dimensionality){let a=this.coordinates(),r=e.coordinates();n=a.every((s,i)=>s===r[i])}return n}toString(){return`(${this.coordinates().map(e=>e.toString()).join(",")})`}toJson(){return JSON.stringify(this.coordinates())}};Hr=new WeakMap,pi=new WeakMap;let ql=Lt;class Ut extends ql{static fromJson(e){return new Ut(...JSON.parse(e))}constructor(e,n){super(e,n)}static validatePoint(e,n="validatePoint"){super.validatePoint(e,2,n)}static random({width:e,height:n}={}){return new Ut(gh(0,e),gh(0,n))}get x(){return this.coordinates()[0]}get y(){return this.coordinates()[1]}add(e){if(!(e instanceof Ut))throw new Error(so("add",e));return new Ut(this.x+e.x,this.y+e.y)}subtract(e){if(!(e instanceof Ut))throw new Error(so("subtract",e));return new Ut(this.x-e.x,this.y-e.y)}dotProduct(e){if(!(e instanceof Ut))throw new Error(so("dotProduct",e));return this.x*e.x+this.y*e.y}clone(){return new Ut(this.x,this.y)}}var gB=dB;function hs(t){return t instanceof Buffer?Buffer.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function dB(t){if(t=t||{},t.circles)return yB(t);return t.proto?a:n;function e(r,s){for(var i=Object.keys(r),p=new Array(i.length),m=0;m]/,bB=NB;function NB(t){var e=""+t,n=xB.exec(e);if(!n)return e;var a,r="",s=0,i=0;for(s=n.index;s ${Ie(this,Cr).toString()}`}equals(e){return e instanceof Ur&&this.toJson()===e.toJson()}clone(){return new Ur(this.source.clone(),this.destination.clone(),{weight:this.weight,label:this.label})}};Sr=new WeakMap,Cr=new WeakMap,vn=new WeakMap,Jr=new WeakMap;let ca=Ur;var ds,gn;class EB{constructor(e,n){Rt(this,ds,void 0);Rt(this,gn,void 0);$t(this,ds,{...e}),$t(this,gn,{...n}),Object.freeze(Ie(this,ds)),Object.freeze(Ie(this,gn))}get distance(){return Ie(this,ds)}get predecessor(){return Ie(this,gn)}reconstructPathTo(e){let n=[];for(;At(e);)n.push(e),e=Ie(this,gn)[e];return e===null?n.reverse():[]}}ds=new WeakMap,gn=new WeakMap;var ci,dn,Zr;class DB{constructor(e,n,a){Rt(this,ci,void 0);Rt(this,dn,void 0);Rt(this,Zr,void 0);$t(this,ci,a),$t(this,dn,{...e}),$t(this,Zr,{...n}),Object.freeze(Ie(this,dn)),Object.freeze(Ie(this,Zr))}get timeDiscovered(){return Ie(this,dn)}get timeVisited(){return Ie(this,Zr)}isAcyclic(){return Ie(this,ci)}verticesByVisitOrder(){return Object.keys(Ie(this,dn)).sort((e,n)=>Ie(this,Zr)[n]-Ie(this,Zr)[e])}}ci=new WeakMap,dn=new WeakMap,Zr=new WeakMap;const cn=new WeakMap;class Ea{static fromJson(e){return Ea.fromJsonObject(JSON.parse(e))}static fromJsonObject({vertices:e,edges:n}){let a=new Ea;return e.forEach(r=>a.addVertex(os.fromJsonObject(r))),n.forEach(r=>a.addEdge(ca.fromJsonObject(r))),a}static completeGraph(e){if(!Ft(e)||e<2)throw new Error(Ue("Graph.completeGraph","n",e));let n=new Ea,a=[];const r=pa(1,e+1);return r.forEach(s=>a[s]=n.createVertex(s)),r.forEach(s=>pa(s+1,e+1).forEach(i=>{n.createEdge(a[s],a[i]),n.createEdge(a[i],a[s])})),n}static completeBipartiteGraph(e,n){if(!Ft(e)||e<1)throw new Error(Ue("Graph.completeBipartiteGraph","n",e));if(!Ft(n)||n<1)throw new Error(Ue("Graph.completeBipartiteGraph","m",n));let a=new Ea,r=[];const s=pa(1,e+1),i=pa(e+1,e+n+1);return s.forEach(p=>r[p]=a.createVertex(p)),i.forEach(p=>r[p]=a.createVertex(p)),s.forEach(p=>i.forEach(m=>{a.createEdge(r[p],r[m]),a.createEdge(r[m],r[p])})),a}constructor(){cn.set(this,new Map)}get id(){return`${this.vertices.map(e=>`{${e.id}}`).sort().join("")}|${this.edges.map(e=>e.id).sort().join("")}`}get vertices(){return[...wn(this)]}get edges(){return[...Gr(this)]}get simpleEdges(){return[...Gr(this)].filter(e=>e.source.id!==e.destination.id)}isDirected(){return!0}isEmpty(){return this.vertices.length===0}createVertex(e,{weight:n,label:a,data:r}={}){if(this.hasVertex(Ht.idFromName(e)))throw new Error(vh("Graph.createVertex",e));const s=new os(e,{weight:n,label:a,data:r});let i=cn.get(this);return i.set(s.id,s),cn.set(this,i),s.id}addVertex(e){if(!(e instanceof Ht))throw new Error(Ue("Graph.addVertex",e));let n=cn.get(this);if(this.hasVertex(e.id))throw new Error(vh("Graph.addVertex",e));const a=new os(e.name,{weight:e.weight,label:e.label??void 0,data:e.data??void 0});return n.set(e.id,a),cn.set(this,n),a.id}hasVertex(e){const n=Xt(this,e);return At(n)&&n instanceof os}getVertex(e){return Xt(this,e)}getVertexOutDegree(e){const n=Xt(this,e);return n==null?void 0:n.outDegree()}getVertexWeight(e){const n=Xt(this,e);return(n==null?void 0:n.weight)??yl("Graph.getVertexWeight",e)}setVertexWeight(e,n){if(!Ft(n))throw new TypeError(Ue("Graph.setVertexWeight","weight",n));let a=Xt(this,e);if(At(a))a.weight=n;else throw new Error(Na("Graph.setVertexWeight",e))}getVertexLabel(e){const n=Xt(this,e);return(n==null?void 0:n.label)??yl("Graph.getVertexLabel",e)}setVertexLabel(e,n){if(!Ht.isValidLabel(n))throw new TypeError(Bm("Graph.setVertexLabel",n));let a=Xt(this,e);if(At(a))a.label=n;else throw new Error(Na("Graph.setVertexLabel",e))}getVertexData(e){const n=Xt(this,e);return(n==null?void 0:n.data)??yl("Graph.getVertexData",e)}setVertexData(e,n){if(!Ht.isValidData(n))throw new TypeError(Id("Graph.setVertexData",n));let a=Xt(this,e);if(At(a))a.data=n;else throw new Error(Na("Graph.setVertexData",e))}createEdge(e,n,{weight:a,label:r}={}){if(!this.hasVertex(e))throw new Error(Na("Graph.createEdge",e));if(!this.hasVertex(n))throw new Error(Na("Graph.createEdge",n));const s=Xt(this,e),i=Xt(this,n);return s.addEdgeTo(i,{edgeWeight:a,edgeLabel:r}).id}addEdge(e){if(!(e instanceof ca))throw new Error(Ue("Graph.addEdge",e));if(!this.hasVertex(e.source))throw new Error(Na("Graph.addEdge",e.source));if(!this.hasVertex(e.destination))throw new Error(Na("Graph.addEdge",e.destination));const n=Xt(this,e.source),a=Xt(this,e.destination);return n.addEdgeTo(a,{edgeWeight:e.weight,edgeLabel:e.label}).id}hasEdge(e){return At(this.getEdge(e))}hasEdgeBetween(e,n){const a=ao(this,e,n);return At(a)&&a instanceof ca}getEdgeBetween(e,n){return ao(this,e,n)}getEdge(e){e=AB(e);for(const n of Gr(this))if(n.id===e)return n}*getEdgesFrom(e){const n=Xt(this,e);if(Za(n))throw new Error(Na("Graph.getEdgesFrom",e));yield*n.outgoingEdges()}getEdgesInPath(e){if(!Array.isArray(e))throw new TypeError(Ue("Graph.getEdgesInPath","verticesSequence",e));const n=e.length,a=[];for(let r=0;r${i}`));a.push(p)}return a}setEdgeWeight(e,n){if(!Ft(n))throw new TypeError(Ue("Graph.setEdgeWeight","weight",n));const a=this.getEdge(e);if(At(a))a.weight=n;else throw new Error(fs("Graph.setEdgeWeight",e))}getEdgeWeight(e,n){const a=ao(this,e,n);if(At(a))return a.weight;throw new Error(fs("Graph.getEdgeWeight",`${e} -> ${n}`))}getEdgeLabel(e,n){const a=ao(this,e,n);return a==null?void 0:a.label}inducedSubGraph(e){return MB(this,e)}clone(){const e=new Ea;for(const n of wn(this))e.addVertex(n.clone());for(const n of Gr(this))e.addEdge(n.clone());return e}toString(){return[...this.edges].map(e=>e.toString()).sort().join(", ")}toJson(){return ui(this.toJsonObject())}toJsonObject(){return{vertices:[...wn(this)].sort().map(e=>e.toJsonObject()),edges:[...Gr(this)].sort(ca.compareEdges).map(e=>e.toJsonObject())}}equals(e){return e instanceof Ea&&this.toJson()===e.toJson()}isConnected(){return this.symmetricClosure().isConnected()}isStronglyConnected(){return this.stronglyConnectedComponents().size===1}isAcyclic(){return this.dfs().isAcyclic()}isBipartite(){return this.symmetricClosure().isBipartite()}isComplete(){const e=this.vertices.length;return this.simpleEdges.length===e*(e-1)}isCompleteBipartite(){const[e,n,a]=this.isBipartite(),r=this.simpleEdges.length;return e&&r===2*n.size*a.size}symmetricClosure(){let e=new Ga;for(const n of this.vertices)e.addVertex(n);for(const n of this.edges)if(!e.hasEdge(n)){const a=this.getEdgeBetween(n.destination,n.source);let r=n.weight+((a==null?void 0:a.weight)??0);e.createEdge(n.source,n.destination,{weight:r})}return e}transpose(){let e=new Ea;for(const n of this.vertices)e.addVertex(n);for(const n of this.edges)e.addEdge(n.transpose());return e}transitiveClosure(){throw new Error("Unimplemented")}bfs(e){const n=this.getVertex(e);if(!At(n))throw new Error(Na("Graph.bfs",e));let a={},r={};for(const i of this.vertices)a[i.id]=1/0;a[n.id]=0,r[n.id]=null;let s=[n];for(;s.length>0;){const i=s.pop(0),p=i.outgoingEdges();for(const m of p){const o=m.destination;a[o.id]===1/0&&(r[o.id]=i.id,a[o.id]=a[i.id]+1,s.push(o))}}return new EB(a,r)}dfs(){let e={},n={},a=0,r=!0;return this.vertices.forEach(s=>{e[s.id]||(e[s.id]=++a,[a,r]=Ul(this,s,e,n,r,a))}),new DB(e,n,r)}connectedComponents(){return this.symmetricClosure().connectedComponents()}topologicalOrdering(){const e=this.dfs();return e.isAcyclic()?e.verticesByVisitOrder():null}stronglyConnectedComponents(){const e=this.transpose().dfs().verticesByVisitOrder();let n={},a=0,r=new Set;return e.forEach(s=>{if(!n[s]){let i={},p=!0;n[s]=++a,[a,p]=Ul(this,this.getVertex(s),n,i,p,a),r.add(new Set(Object.keys(i)))}}),r}}class Ga extends Ea{static completeGraph(e){if(!Ft(e)||e<2)throw new Error(Ue("UndirectedGraph.completeGraph","n",e));let n=new Ga,a=[];const r=pa(1,e+1);return r.forEach(s=>a[s]=n.createVertex(s)),r.forEach(s=>pa(s+1,e+1).forEach(i=>{n.createEdge(a[s],a[i])})),n}static completeBipartiteGraph(e,n){if(!Ft(e)||e<1)throw new Error(Ue("UndirectedGraph.completeBipartiteGraph","n",e));if(!Ft(n)||n<1)throw new Error(Ue("UndirectedGraph.completeBipartiteGraph","m",n));let a=new Ga,r=[];const s=pa(1,e+1),i=pa(e+1,e+n+1);return s.forEach(p=>r[p]=a.createVertex(p)),i.forEach(p=>r[p]=a.createVertex(p)),s.forEach(p=>i.forEach(m=>{a.createEdge(r[p],r[m])})),a}static squareGrid(e){if(!Ft(e)||e<1)throw new Error(Ue("UndirectedGraph.squareGrid","n",e));let n=new Ga;return pa(1,e+1).forEach(a=>{pa(1,e+1).forEach(r=>{const s=`<${a}><${r}>`,i=n.createVertex(s);if(a>1){const p=Ht.idFromName(`<${a-1}><${r}>`);n.createEdge(p,i)}if(r>1){const p=Ht.idFromName(`<${a}><${r-1}>`);n.createEdge(p,i)}})}),n}static triangularGrid(e){if(!Ft(e)||e<1)throw new Error(Ue("UndirectedGraph.squareGrid","n",e));let n=new Ga;return pa(1,e+1).forEach(a=>{pa(1,e-a+2).forEach(r=>{const s=`<${a}><${r}>`,i=n.createVertex(s);if(a>1){let p=Ht.idFromName(`<${a-1}><${r}>`);n.createEdge(p,i),p=Ht.idFromName(`<${a-1}><${r+1}>`),n.createEdge(p,i)}if(r>1){const p=Ht.idFromName(`<${a}><${r-1}>`);n.createEdge(p,i)}})}),n}get edges(){return[...Gr(this)].filter(e=>e.source.id<=e.destination.id)}get simpleEdges(){return[...Gr(this)].filter(e=>e.source.id{if(!e[r.id]){let s={},i=!0;e[r.id]=++n,[n,i]=Ul(this,r,e,s,i,n),a.add(new Set(Object.keys(s)))}}),a}isConnected(){return this.connectedComponents().size===1}isBipartite(){if(this.vertices.length<2||!this.isConnected())return[!1,null,null];const e=wn(this).next().value;let n={};n[e.id]=!0;let a=[e];for(;a.length>0;){const i=a.pop(0),p=n[i.id];for(const m of i.outgoingEdges()){const o=m.destination;if(Za(n[o.id]))n[o.id]=!p,a.push(o);else if(n[o.id]===p)return[!1,null,null]}}let r=[],s=[];for(const i of wn(this))n[i.id]?r.push(i.id):s.push(i.id);return[!0,new Set(r),new Set(s)]}isComplete(){const e=this.vertices.length;return this.simpleEdges.length===e*(e-1)/2}isCompleteBipartite(){const[e,n,a]=this.isBipartite(),r=this.simpleEdges.length;return e&&r===n.size*a.size}symmetricClosure(){return this.clone()}transpose(){return this.clone()}topologicalOrdering(){return null}stronglyConnectedComponents(){return this.connectedComponents()}}var gr;const ms=class ms extends Ht{constructor(n,{weight:a,label:r,data:s,outgoingEdges:i=[]}={}){super(n,{weight:a,label:r,data:s});Rt(this,gr,void 0);if(!Array.isArray(i))throw new TypeError(Ue("GVertex constructor","outgoingEdges",i));$t(this,gr,new Map),i.forEach(p=>{if(!(p instanceof ca)||this.id!==p.source.id)throw new TypeError(Ue("GVertex constructor","outgoingEdges",i));this.addEdge(p)})}*outgoingEdges(){for(const n of Ie(this,gr).values()){const a=n.length;a>0&&(yield n[a-1])}}outDegree(){let n=0;for(const a of Ie(this,gr).values())a.length>0&&++n;return n}edgeTo(n){if(!(n instanceof ms))throw new TypeError(Ue("GVertex.edgeTo","v",n));const a=Ie(this,gr).get(n.id)??[],r=a.length;return r>0?a[r-1]:void 0}addEdge(n){if(!(n instanceof ca)||this.id!==n.source.id)throw new TypeError(Ue("GVertex.addEdge","edge",n));return dl(Ie(this,gr),n.destination,n)}addEdgeTo(n,{edgeWeight:a,edgeLabel:r}={}){if(!(n instanceof ms))throw new TypeError(Ue("GVertex.addEdgeTo","v",n));const s=new ca(this,n,{weight:a,label:r});return this.addEdge(s),s}removeEdge(n){if(!(n instanceof ca)||this.id!==n.source.id)throw new TypeError(Ue("GVertex.removeEdge","edge",n));return dl(Ie(this,gr),n.destination)}removeEdgeTo(n){if(!(n instanceof ms))throw new TypeError(Ue("GVertex.removeEdgeTo","v",n));return dl(Ie(this,gr),n)}clone(){return new ms(this.name,{weight:this.weight})}toString(){return`{${this.id}}`}};gr=new WeakMap;let os=ms;function dl(t,e,n=null){let a=[];At(n)&&a.push(n),t.set(e.id,a)}function Xt(t,e){let n=cn.get(t);return n==null?void 0:n.get(kl(e))}function ao(t,e,n){let a=Xt(t,e),r=Xt(t,n);if(!Za(r))return a==null?void 0:a.edgeTo(r)}function*wn(t){yield*cn.get(t).values()}function*Gr(t){for(const e of wn(t))yield*e.outgoingEdges()}function kl(t){return t instanceof Ht?t.id:t}function AB(t){return t instanceof ca?t.id:t}function Ul(t,e,n,a,r,s){let i={},p=[e],m=[];do{const o=p.pop();if(i[o.id])a[o.id]=++s,m.pop();else{i[o.id]=!0,p.push(o),m.push(o.id);for(const l of t.getEdgesFrom(o.id)){const u=l.destination;Za(n[u.id])?(n[u.id]=++s,p.push(u)):(l.isLoop()||!a[u.id]&&(t.isDirected()||m[m.length-1]!==u.id)&&m.indexOf(u.id)>=0)&&(r=!1)}}}while(p.length>0);return[s,r]}function MB(t,e){if(!At(e)||fB(e)===0)throw new Error(Ue("Graph.inducedSubGraph","vertices",e));let n=t.isDirected()?new Ea:new Ga;return e instanceof Set||(e=new Set(e)),e.forEach(a=>{const r=t.getVertex(a);if(!At(r))throw new Error(Na("Graph.inducedSubGraph",a));n.addVertex(r)}),t.edges.forEach(a=>{e.has(a.source.id)&&e.has(a.destination.id)&&n.addEdge(a)}),n}function yl(t,e){throw new Error(Na(t,e))}const fn=class fn extends Ht{constructor(n,a,{weight:r,label:s,data:i}={}){super(n,{weight:r,label:s,data:i});js(this,"_center");if(!(a instanceof Ut)||a.dimensionality<2)throw new Error(Ue("EmbeddedVertex()","vertexPosition",a));this._center=a.clone()}static fromJson(n){return fn.fromJsonObject(JSON.parse(n))}static fromJsonObject({name:n,position:a,weight:r=null,label:s,data:i}){return new fn(n,Ut.fromJson(a),{weight:r,label:s??void 0,data:i??void 0})}get position(){return this._center.clone()}set position(n){if(!(n instanceof Ut))throw new TypeError(Ue("EmbeddedVertex.setPosition","center",n));this._center=n.clone()}radius(){return fn.DEFAULT_VERTEX_RADIUS*this.weight}clone(){return new fn(this.name,this.position,{weight:this.weight,label:this.label,data:this.data})}toJsonObject(){let n=super.toJsonObject();return n.position=this._center.toJson(),n}toString(){return`EmbeddedVertex: ${this.toJson()}`}toSvg(n=[]){let[a,r]=this.position.coordinates();return` - - - ${this.escapedName} - `}};js(fn,"DEFAULT_VERTEX_RADIUS",15);let na=fn;const SB="/";var fi,Wr;const vr=class vr extends ca{constructor(n,a,{weight:r,label:s,isDirected:i=!1,arcControlDistance:p=void 0}={}){if(!(n instanceof na))throw new Error(Ue("EmbeddedEdge()","source",n));if(!(a instanceof na))throw new Error(Ue("EmbeddedEdge()","destination",a));super(n,a,{weight:r,label:s});Rt(this,fi,void 0);Rt(this,Wr,void 0);if(!cB(i))throw new Error(Ue("EmbeddedEdge()","isDirected",i));if($t(this,fi,i),Za(p))$t(this,Wr,super.isLoop()?vr.DEFAULT_EDGE_LOOP_RADIUS:vr.DEFAULT_EDGE_BEZIER_CONTROL_DISTANCE);else if(Ft(p))$t(this,Wr,za(p));else throw new Error(Ue("EmbeddedEdge()","arcControlDistance",p))}static fromJson(n){return vr.fromJsonObject(JSON.parse(n))}static fromJsonObject({source:n,destination:a,weight:r,label:s,isDirected:i,arcControlDistance:p}){return new vr(na.fromJsonObject(n),na.fromJsonObject(a),{weight:r,label:s??void 0,isDirected:i,arcControlDistance:p})}get arcControlDistance(){return Ie(this,Wr)}set arcControlDistance(n){if(!Ft(n))throw new Error(Ue("EmbeddedEdge.arcControlDistance=","arcControlDistance",n));$t(this,Wr,za(n))}isDirected(){return Ie(this,fi)}isCrossing(n,a=!0){if(!(n instanceof vr))throw new Error(Ue("isCrossing","other",n));if(!a)throw new Error("Not yet implemented");const r=this.source.position,s=this.destination.position,i=n.source.position,p=n.destination.position,m=Eh(r,s,i,p),o=Eh(i,p,r,s);return 0-Number.EPSILON<=m&&m<=1+Number.EPSILON&&0-Number.EPSILON<=o&&o<=1+Number.EPSILON}clone(){return new vr(this.source.clone(),this.destination.clone(),{weight:this.weight,label:this.label,arcControlDistance:this.arcControlDistance,isDirected:this.isDirected()})}toJsonObject(){return{source:this.source.toJsonObject(),destination:this.destination.toJsonObject(),weight:this.weight,label:this.label,isDirected:this.isDirected(),arcControlDistance:this.arcControlDistance}}toString(){return`EmbeddedEdge: ${this.toJson()}`}toSvg({cssClasses:n=[],drawAsArc:a=!1,displayLabel:r=!0,displayWeight:s=!0}={}){return this.isLoop()?$B(this,n,r,s):this.isDirected&&a?TB(this,n,r,s,Ie(this,Wr)):CB(this,n,r,s)}};fi=new WeakMap,Wr=new WeakMap,js(vr,"DEFAULT_EDGE_BEZIER_CONTROL_DISTANCE",40),js(vr,"DEFAULT_EDGE_LOOP_RADIUS",25);let ls=vr;function CB(t,e,n,a){const[r,s]=t.source.position.coordinates(),[i,p]=t.destination.position.coordinates(),m=t.source.radius(),o=t.destination.radius(),l=Math.atan2(i-r,p-s),[u,c]=[o*Math.sin(l),o*Math.cos(l)],[f,v]=[m*Math.sin(l),m*Math.cos(l)],[h,w]=[(i-r-u+f)/2,(p-s-c+v)/2];return` - - - ${Pm(t,h,w,n,a)} - `}function TB(t,e,n,a,r){const[s,i]=t.source.position.coordinates(),[p,m]=t.destination.position.coordinates(),o=t.source.radius(),l=t.destination.radius(),u=Math.atan2(p-s,m-i),[c,f]=[o*Math.sin(u),o*Math.cos(u)],[v,h]=[l*Math.sin(u),l*Math.cos(u)],[w,d]=[(p-s)/2+r*Math.sin(Math.PI/2+u),(m-i)/2+r*Math.cos(Math.PI/2+u)],[N,g]=[(p-s-v+c)/2+r/2*Math.sin(Math.PI/2+u),(m-i-h+f)/2+r/2*Math.cos(Math.PI/2+u)],[x,b]=[p-s-(t.isDirected()?v:0),m-i-(t.isDirected()?h:0)];return` - - - ${Pm(t,N,g,n,a)} - `}function $B(t,e,n,a){const[r,s]=t.source.position.coordinates(),i=Math.round(Math.sqrt(t.source.weight)*t.arcControlDistance),p=t.source.radius()*Math.cos(Math.PI/4),[m,o]=[p,-p],[l,u]=[p+i,-p-i];return` - - - ${Pm(t,l,u,n,a)} - `}function Pm(t,e,n,a,r){let s=[a?t.escapedLabel:"",r?t.weight.toString():""].filter($o).join(SB);return $o(s)?` ${s} `:""}function Eh(t,e,n,a){const r=e.subtract(t),s=a.subtract(n),i=new Ut(-r.y,r.x);return t.subtract(n).dotProduct(i)/s.dotProduct(i)}var Yr,Xr;const Ar=class Ar{constructor(e,n){Rt(this,Yr,void 0);Rt(this,Xr,void 0);if(!(Array.isArray(e)||dh(e)))throw new Error(Ue("Embedding()","vertices",e));if(!(Array.isArray(n)||dh(n)))throw new Error(Ue("Embedding()","edges",n));$t(this,Yr,new Map),$t(this,Xr,new Map);for(const a of e){if(!(a instanceof na))throw new Error(Ue("Embedding()","vertices",e));Ie(this,Yr).set(a.id,a.clone())}for(const a of n){if(!(a instanceof ls))throw new Error(Ue("Embedding()","edges",n));Ie(this,Xr).set(a.id,new ls(this.getVertex(a.source),this.getVertex(a.destination),{weight:a.weight,label:a.label,isDirected:a.isDirected(),arcControlDistance:a.arcControlDistance}))}}static fromJson(e){return Ar.fromJsonObject(JSON.parse(e))}static fromJsonObject({vertices:e,edges:n}){return new Ar(e.map(a=>na.fromJson(a)),n.map(a=>ls.fromJson(a)))}static forGraph(e,{width:n,height:a,vertexCoordinates:r={},edgeArcControlDistances:s={}}={}){if(!(e instanceof Ea))throw new Error(Ue("Embedding:fromGraph","graph",e));if(!mi(r))throw new Error(Ue("Embedding:fromGraph","coordinates",r));if(!mi(s))throw new Error(Ue("Embedding:fromGraph","edgesArcControlDistance",s));let i=new Map,p=new Map;for(const m of e.vertices){let o=r[wl(m)];o instanceof Ut||(o=Ut.random({width:n,height:a}));let l=new na(m.name,o,{weight:m.weight});i.set(l.id,l)}for(const m of e.edges){const o=new ls(i.get(m.source.id),i.get(m.destination.id),{weight:m.weight,label:m.label,isDirected:e.isDirected(),arcControlDistance:s[m.id]});p.set(o.id,o)}return new Ar(i.values(),p.values())}static completeGraph(e,n,a=!1){if(!Ft(e)||e<2)throw new Error(Ue("Embedding.completeGraph","n",e));if(!Ft(n)||n<=0)throw new Error(Ue("Embedding.completeGraph","canvasSize",n));[e,n]=[e,n].map(za);const r=a?Ea.completeGraph(e):Ga.completeGraph(e);let s={};for(const i of r.vertices){const p=za(i.name)-1,m=2*Math.PI/e,o=n/2,l=o-na.DEFAULT_VERTEX_RADIUS;s[i.id]=new Ut(o+l*Math.cos(p*m),o+l*Math.sin(p*m))}return Ar.forGraph(r,{vertexCoordinates:s})}static completeBipartiteGraph(e,n,a,r=!1){if(!Ft(e)||e<2)throw new Error(Ue("Embedding.completeBipartiteGraph","n",e));if(!Ft(n)||n<2)throw new Error(Ue("Embedding.completeBipartiteGraph","m",n));if(!Ft(a)||a<=0)throw new Error(Ue("Embedding.completeBipartiteGraph","canvasSize",a));[e,n,a]=[e,n,a].map(za);const s=r?Ea.completeBipartiteGraph(e,n):Ga.completeBipartiteGraph(e,n),i=(a-2*na.DEFAULT_VERTEX_RADIUS)/(e-1),p=(a-2*na.DEFAULT_VERTEX_RADIUS)/(n-1);let m={},o,l;for(const u of s.vertices){const c=za(u.name);c<=e?(o=2*na.DEFAULT_VERTEX_RADIUS,l=na.DEFAULT_VERTEX_RADIUS+(c-1)*i):(o=a-2*na.DEFAULT_VERTEX_RADIUS,l=na.DEFAULT_VERTEX_RADIUS+(c-e-1)*p),m[u.id]=new Ut(o,l)}return Ar.forGraph(s,{vertexCoordinates:m})}get vertices(){return Ie(this,Yr).values()}get edges(){return Ie(this,Xr).values()}getVertex(e){return Ie(this,Yr).get(wl(e))}getEdge(e){return Ie(this,Xr).get(Dh(e))}setVertexPosition(e,n){const a=Ie(this,Yr).get(wl(e));if(Za(a))throw new Error(Na("Embedding.setVertexPosition",e));if(!(n instanceof Ut))throw new TypeError(Ue("Embedding.setVertexPosition","position",n));a.position=n}setEdgeControlPoint(e,n){const a=Ie(this,Xr).get(Dh(e));if(Za(a))throw new Error(fs("Embedding.setEdgeControlPoint",e));if(!Ft(n))throw new TypeError(Ue("Embedding.setEdgeControlPoint","arcControlDistance",n));a.arcControlDistance=za(n)}intersections(e=!0){const n=[...this.edges],a=n.length;let r=0;for(let s=0;se.toJson()),edges:[...this.edges].sort(ca.compareEdges).map(e=>e.toJson())}}toSvg(e,n,{drawEdgesAsArcs:a=!1,displayEdgesLabel:r=!0,displayEdgesWeight:s=!0,graphCss:i=[],verticesCss:p={},edgesCss:m={}}={}){return` - - ${_B()} - - ${[...this.edges].map(o=>o.toSvg({cssClasses:m[o.id],drawAsArc:a,displayLabel:r,displayWeight:s})).join("")} - - ${[...this.vertices].map(o=>o.toSvg(p[o.id])).join("")} - -`}};Yr=new WeakMap,Xr=new WeakMap;let Gl=Ar;function wl(t){return t instanceof Ht?t.id:t}function Dh(t){return t instanceof ca?t.id:t}function FB(t,e){return t.source.id===e.source.id||t.source.id===e.destination.id||t.destination.id===e.source.id||t.destination.id===e.destination.id}function _B(){return` - - - - - - - - - - - - - - - `}function BB(t){let e,n,a;const r=t[4].default,s=Ud(r,t,t[3],null);return{c(){e=ie("div"),n=Gd("div","graph-inner"),s&&s.c(),this.h()},l(i){e=ne(i,"DIV",{class:!0});var p=se(e);n=ne(p,"DIV",{class:!0,is:!0,directed:!0,height:!0,width:!0});var m=se(n);s&&s.l(m),m.forEach(G),p.forEach(G),this.h()},h(){ve(n,"class","inner svelte-js2387"),ve(n,"is","graph-inner"),ve(n,"directed",t[0]),ve(n,"height",t[1]),ve(n,"width",t[2]),ve(e,"class","graph-container")},m(i,p){Fe(i,e,p),k(e,n),s&&s.m(n,null),a=!0},p(i,[p]){s&&s.p&&(!a||p&8)&&Hd(s,r,i,i[3],a?Jd(r,i[3],p,null):Vd(i[3]),null),(!a||p&1)&&ve(n,"directed",i[0]),(!a||p&2)&&ve(n,"height",i[1]),(!a||p&4)&&ve(n,"width",i[2])},i(i){a||(dt(s,i),a=!0)},o(i){yt(s,i),a=!1},d(i){i&&G(e),s&&s.d(i)}}}const OB=``,PB=` - `;if(typeof HTMLDivElement<"u"){class t extends HTMLDivElement{constructor(){super(),this.root=this.attachShadow({mode:"closed"})}connectedCallback(){this.recompile(),new MutationObserver(()=>this.recompile()).observe(this,{childList:!0,subtree:!0}),new ResizeObserver(()=>this.recompile()).observe(this)}get directed(){return this.hasAttribute("directed")&&this.getAttribute("directed")!=="false"}get height(){return Number(this.getAttribute("height"))}get width(){return Math.min(this.getAttribute("width"),this.clientWidth)}recompile(){if(this.pending||(this.pending=!0,this.textContent===this.prevCode&&this.width===this.prevWidth&&this.height===this.prevWidth&&this.directed===this.prevDirected))return;this.prevCode=this.textContent||"",this.prevWidth=this.width,this.prevHeight=this.height,this.prevDirected=this.directed;let n=this.directed?new Ea:new Ga,[a,r]=sB(this.prevCode,this.prevWidth,this.prevHeight),s=1;for(let l of a)l.label=l.label||`${s++}`,l._inner=n.createVertex(l.label);for(let l of r)l.label?l._inner=n.createEdge(l.u._inner,l.v._inner,{label:l.label}):l._inner=n.createEdge(l.u._inner,l.v._inner);let i=Gl.forGraph(n);for(let l of a)i.setVertexPosition(l._inner,new Ut(l.x,l.y));for(let l of r)i.setEdgeControlPoint(l._inner,l.control??0);let p={};for(let l of a)p[l._inner]=l.class?[l.class]:[];this.root.innerHTML=i.toSvg(this.prevWidth,this.prevHeight,{graphCss:[],verticesCss:p,displayEdgesWeight:!1,displayEdgesLabel:!0,drawEdgesAsArcs:!0})+OB+PB;let m=this.root.querySelectorAll(".double circle");for(let l of[...m]){let u=l.cloneNode();u.setAttribute("r",Number(l.getAttribute("r"))+2),l.parentNode.insertBefore(u,l)}let o=this.root.querySelectorAll("text");for(let l of[...o]){const u=w=>{let d=document.createElement("div");d.style.display="inline-block",d.innerHTML=w,this.root.appendChild(d);let N=d.getBoundingClientRect(),g={width:N.width,height:N.height};return this.root.removeChild(d),g};let c=document.createElementNS("http://www.w3.org/2000/svg","foreignObject"),f=Yd.renderToString(l.textContent.replaceAll("'","\\").replaceAll("$","")),{width:v,height:h}=u(f);c.setAttribute("x",l.getAttribute("x")-v/2),c.setAttribute("y",l.getAttribute("y")-h/2),c.setAttribute("width",v),c.setAttribute("height",h),c.setAttribute("text-anchor",l.getAttribute("text-anchor")),c.setAttribute("dominant-baseline",l.getAttribute("dominant-baseline")),c.innerHTML=`${f}`,l.parentNode.replaceChild(c,l)}this.pending=!1}}customElements.define("graph-inner",t,{extends:"div"})}function zB(t,e,n){let{$$slots:a={},$$scope:r}=e,{directed:s=!1}=e,{height:i=300}=e,{width:p=500}=e;return t.$$set=m=>{"directed"in m&&n(0,s=m.directed),"height"in m&&n(1,i=m.height),"width"in m&&n(2,p=m.width),"$$scope"in m&&n(3,r=m.$$scope)},[s,i,p,r,a]}class al extends Mh{constructor(e){super(),Sh(this,e,zB,BB,Ch,{directed:0,height:1,width:2})}}function RB(t){let e,n,a,r,s,i,p='G=(V,E)G = (V, E)',m,o,l='EE',u,c,f='c:ER+c: E \\to \\mathbb{R}^+',v,h,w='ss',d,N,g='tt',x;return{c(){e=ie("p"),n=pe("A "),a=ie("strong"),r=pe("network"),s=pe(" is a simple directed graph "),i=ie("span"),m=pe(", where "),o=ie("span"),u=pe(" is anti-symmetric, with a capacity function "),c=ie("span"),v=pe(" and two distinguished vertices, the source "),h=ie("span"),d=pe(" and the sink "),N=ie("span"),x=pe("."),this.h()},l(b){e=ne(b,"P",{});var y=se(e);n=ce(y,"A "),a=ne(y,"STRONG",{});var D=se(a);r=ce(D,"network"),D.forEach(G),s=ce(y," is a simple directed graph "),i=ne(y,"SPAN",{class:!0});var A=se(i);A.forEach(G),m=ce(y,", where "),o=ne(y,"SPAN",{class:!0});var E=se(o);E.forEach(G),u=ce(y," is anti-symmetric, with a capacity function "),c=ne(y,"SPAN",{class:!0});var M=se(c);M.forEach(G),v=ce(y," and two distinguished vertices, the source "),h=ne(y,"SPAN",{class:!0});var S=se(h);S.forEach(G),d=ce(y," and the sink "),N=ne(y,"SPAN",{class:!0});var C=se(N);C.forEach(G),x=ce(y,"."),y.forEach(G),this.h()},h(){ve(i,"class","math math-inline"),ve(o,"class","math math-inline"),ve(c,"class","math math-inline"),ve(h,"class","math math-inline"),ve(N,"class","math math-inline")},m(b,y){Fe(b,e,y),k(e,n),k(e,a),k(a,r),k(e,s),k(e,i),i.innerHTML=p,k(e,m),k(e,o),o.innerHTML=l,k(e,u),k(e,c),c.innerHTML=f,k(e,v),k(e,h),h.innerHTML=w,k(e,d),k(e,N),N.innerHTML=g,k(e,x)},p:Ot,d(b){b&&G(e)}}}function IB(t){let e,n=`node(50 + 150i, "s"); -node(400 + 150i, "t"); -node(150 + 150i, "v_1"); -node(300 + 150i, "v_2"); -node(200 + 250i, "v_3"); -node(200 + 50i, "v_4"); -edge(s, v_1, 10); -edge(s, v_3, 5); -edge(v_1, v_2, 5); -edge(v_1, v_3, 15); -edge(v_1, v_4, 10); -edge(v_3, v_2, 5); -edge(v_2, t, 10); -edge(v_3, t, 10); -edge(v_4, t, 10);`;return{c(){e=ie("pre"),this.h()},l(a){e=ne(a,"PRE",{class:!0});var r=se(e);r.forEach(G),this.h()},h(){ve(e,"class","language-undefined")},m(a,r){Fe(a,e,r),e.innerHTML=n},p:Ot,d(a){a&&G(e)}}}function qB(t){let e,n;return e=new al({props:{directed:!0,$$slots:{default:[IB]},$$scope:{ctx:t}}}),{c(){xt(e.$$.fragment)},l(a){bt(e.$$.fragment,a)},m(a,r){Nt(e,a,r),n=!0},p(a,r){const s={};r&2&&(s.$$scope={dirty:r,ctx:a}),e.$set(s)},i(a){n||(dt(e.$$.fragment,a),n=!0)},o(a){yt(e.$$.fragment,a),n=!1},d(a){Et(e,a)}}}function LB(t){let e,n,a,r,s,i,p='(V,E)(V, E)',m,o,l='f:ER+f: E \\to \\mathbb{R}^+',u,c,f,v,h,w,d='0f(e)c(e)0 \\leq f(e) \\leq c(e)',N,g,x='eEe \\in E',b,y,D,A,E,M='(u,v)Ef(u,v)=(v,w)Ef(v,w)\\sum_{(u, v) \\in E} f(u, v) = \\sum_{(v, w) \\in E} f(v, w)',S,C,B='v(V{s,t})v \\in (V - \\{s, t\\})',O;return{c(){e=ie("p"),n=pe("A "),a=ie("strong"),r=pe("flow"),s=pe(" in a graph "),i=ie("span"),m=pe(" is defined as a real-valued function "),o=ie("span"),u=pe(" that satisfies the following conditions:"),c=Ge(),f=ie("ul"),v=ie("li"),h=pe("Capacity Contraint: "),w=ie("span"),N=pe(" for all "),g=ie("span"),b=pe("."),y=Ge(),D=ie("li"),A=pe("Flow conservation: "),E=ie("span"),S=pe(" for all "),C=ie("span"),O=pe("."),this.h()},l(P){e=ne(P,"P",{});var $=se(e);n=ce($,"A "),a=ne($,"STRONG",{});var T=se(a);r=ce(T,"flow"),T.forEach(G),s=ce($," in a graph "),i=ne($,"SPAN",{class:!0});var I=se(i);I.forEach(G),m=ce($," is defined as a real-valued function "),o=ne($,"SPAN",{class:!0});var _=se(o);_.forEach(G),u=ce($," that satisfies the following conditions:"),$.forEach(G),c=He(P),f=ne(P,"UL",{});var W=se(f);v=ne(W,"LI",{});var K=se(v);h=ce(K,"Capacity Contraint: "),w=ne(K,"SPAN",{class:!0});var Y=se(w);Y.forEach(G),N=ce(K," for all "),g=ne(K,"SPAN",{class:!0});var z=se(g);z.forEach(G),b=ce(K,"."),K.forEach(G),y=He(W),D=ne(W,"LI",{});var j=se(D);A=ce(j,"Flow conservation: "),E=ne(j,"SPAN",{class:!0});var ge=se(E);ge.forEach(G),S=ce(j," for all "),C=ne(j,"SPAN",{class:!0});var te=se(C);te.forEach(G),O=ce(j,"."),j.forEach(G),W.forEach(G),this.h()},h(){ve(i,"class","math math-inline"),ve(o,"class","math math-inline"),ve(w,"class","math math-inline"),ve(g,"class","math math-inline"),ve(E,"class","math math-inline"),ve(C,"class","math math-inline")},m(P,$){Fe(P,e,$),k(e,n),k(e,a),k(a,r),k(e,s),k(e,i),i.innerHTML=p,k(e,m),k(e,o),o.innerHTML=l,k(e,u),Fe(P,c,$),Fe(P,f,$),k(f,v),k(v,h),k(v,w),w.innerHTML=d,k(v,N),k(v,g),g.innerHTML=x,k(v,b),k(f,y),k(f,D),k(D,A),k(D,E),E.innerHTML=M,k(D,S),k(D,C),C.innerHTML=B,k(D,O)},p:Ot,d(P){P&&G(e),P&&G(c),P&&G(f)}}}function kB(t){let e,n,a,r,s,i,p='ff',m,o,l='ss',u,c,f='ss',v,h,w='f=(s,v)Ef(s,v)(v,s)Ef(v,s)|f| = \\sum_{(s, v) \\in E} f(s, v) - \\sum_{(v, s) \\in E} f(v, s)',d;return{c(){e=ie("p"),n=pe("The "),a=ie("strong"),r=pe("value"),s=pe(" of a flow "),i=ie("span"),m=pe(" is defined as the total flow out of the source "),o=ie("span"),u=pe(" minus the total flow into the source "),c=ie("span"),v=pe(", noted as "),h=ie("span"),d=pe("."),this.h()},l(N){e=ne(N,"P",{});var g=se(e);n=ce(g,"The "),a=ne(g,"STRONG",{});var x=se(a);r=ce(x,"value"),x.forEach(G),s=ce(g," of a flow "),i=ne(g,"SPAN",{class:!0});var b=se(i);b.forEach(G),m=ce(g," is defined as the total flow out of the source "),o=ne(g,"SPAN",{class:!0});var y=se(o);y.forEach(G),u=ce(g," minus the total flow into the source "),c=ne(g,"SPAN",{class:!0});var D=se(c);D.forEach(G),v=ce(g,", noted as "),h=ne(g,"SPAN",{class:!0});var A=se(h);A.forEach(G),d=ce(g,"."),g.forEach(G),this.h()},h(){ve(i,"class","math math-inline"),ve(o,"class","math math-inline"),ve(c,"class","math math-inline"),ve(h,"class","math math-inline")},m(N,g){Fe(N,e,g),k(e,n),k(e,a),k(a,r),k(e,s),k(e,i),i.innerHTML=p,k(e,m),k(e,o),o.innerHTML=l,k(e,u),k(e,c),c.innerHTML=f,k(e,v),k(e,h),h.innerHTML=w,k(e,d)},p:Ot,d(N){N&&G(e)}}}function UB(t){let e,n,a,r='P=(v0,v1,,vn)P = (v_0, v_1, \\dots, v_n)',s,i,p='GG',m,o,l='e=(u,v)Ge = (u, v) \\in G',u,c,f,v,h,w='PP',d,N,g='u=viu = v_i',x,b,y='v=vi+1v = v_{i + 1}',D,A,E='ii',M,S,C,B,O,P='u=vi+1u = v_{i + 1}',$,T,I='v=viv = v_i',_,W,K='ii',Y;return{c(){e=ie("p"),n=pe("Consider there is path "),a=ie("span"),s=pe(" in the undirected copy of the netwrok "),i=ie("span"),m=pe(", an edge "),o=ie("span"),u=pe(" is called "),c=ie("strong"),f=pe("properly oriented"),v=pe(" with respect to "),h=ie("span"),d=pe(" if "),N=ie("span"),x=pe(" and "),b=ie("span"),D=pe(" for some "),A=ie("span"),M=pe(" and "),S=ie("strong"),C=pe("improperly oriented"),B=pe(" if "),O=ie("span"),$=pe(" and "),T=ie("span"),_=pe(" for some "),W=ie("span"),Y=pe("."),this.h()},l(z){e=ne(z,"P",{});var j=se(e);n=ce(j,"Consider there is path "),a=ne(j,"SPAN",{class:!0});var ge=se(a);ge.forEach(G),s=ce(j," in the undirected copy of the netwrok "),i=ne(j,"SPAN",{class:!0});var te=se(i);te.forEach(G),m=ce(j,", an edge "),o=ne(j,"SPAN",{class:!0});var re=se(o);re.forEach(G),u=ce(j," is called "),c=ne(j,"STRONG",{});var me=se(c);f=ce(me,"properly oriented"),me.forEach(G),v=ce(j," with respect to "),h=ne(j,"SPAN",{class:!0});var oe=se(h);oe.forEach(G),d=ce(j," if "),N=ne(j,"SPAN",{class:!0});var ue=se(N);ue.forEach(G),x=ce(j," and "),b=ne(j,"SPAN",{class:!0});var we=se(b);we.forEach(G),D=ce(j," for some "),A=ne(j,"SPAN",{class:!0});var be=se(A);be.forEach(G),M=ce(j," and "),S=ne(j,"STRONG",{});var Ae=se(S);C=ce(Ae,"improperly oriented"),Ae.forEach(G),B=ce(j," if "),O=ne(j,"SPAN",{class:!0});var _e=se(O);_e.forEach(G),$=ce(j," and "),T=ne(j,"SPAN",{class:!0});var L=se(T);L.forEach(G),_=ce(j," for some "),W=ne(j,"SPAN",{class:!0});var J=se(W);J.forEach(G),Y=ce(j,"."),j.forEach(G),this.h()},h(){ve(a,"class","math math-inline"),ve(i,"class","math math-inline"),ve(o,"class","math math-inline"),ve(h,"class","math math-inline"),ve(N,"class","math math-inline"),ve(b,"class","math math-inline"),ve(A,"class","math math-inline"),ve(O,"class","math math-inline"),ve(T,"class","math math-inline"),ve(W,"class","math math-inline")},m(z,j){Fe(z,e,j),k(e,n),k(e,a),a.innerHTML=r,k(e,s),k(e,i),i.innerHTML=p,k(e,m),k(e,o),o.innerHTML=l,k(e,u),k(e,c),k(c,f),k(e,v),k(e,h),h.innerHTML=w,k(e,d),k(e,N),N.innerHTML=g,k(e,x),k(e,b),b.innerHTML=y,k(e,D),k(e,A),A.innerHTML=E,k(e,M),k(e,S),k(S,C),k(e,B),k(e,O),O.innerHTML=P,k(e,$),k(e,T),T.innerHTML=I,k(e,_),k(e,W),W.innerHTML=K,k(e,Y)},p:Ot,d(z){z&&G(e)}}}function GB(t){let e,n=`node(50 + 150i, "s"); -node(225 + 150i, "v_1"); -node(137 + 225i, "'text{properly oriented}", "text"); -node(400 + 150i, "t"); -node(317 + 225i, "'text{improperly oriented}", "text"); -node(225 + 75i, "P = (s, v_1, t)", "text"); -edge(s, v_1, 10); -edge(t, v_1, 10);`;return{c(){e=ie("pre"),this.h()},l(a){e=ne(a,"PRE",{class:!0});var r=se(e);r.forEach(G),this.h()},h(){ve(e,"class","language-undefined")},m(a,r){Fe(a,e,r),e.innerHTML=n},p:Ot,d(a){a&&G(e)}}}function HB(t){let e,n;return e=new al({props:{directed:!0,$$slots:{default:[GB]},$$scope:{ctx:t}}}),{c(){xt(e.$$.fragment)},l(a){bt(e.$$.fragment,a)},m(a,r){Nt(e,a,r),n=!0},p(a,r){const s={};r&2&&(s.$$scope={dirty:r,ctx:a}),e.$set(s)},i(a){n||(dt(e.$$.fragment,a),n=!0)},o(a){yt(e.$$.fragment,a),n=!1},d(a){Et(e,a)}}}function VB(t){let e,n,a,r='GG',s,i,p='ff',m,o,l,u,c,f='P=(s,v0,v1,,vn,t)P = (s, v_0, v_1, \\dots, v_n, t)',v,h,w='GG',d,N,g,x,b,y,D='ee',A,E,M='PP',S,C,B='f(e)<c(e)f(e) < c(e)',O,P,$,T,I,_='ee',W,K,Y='PP',z,j,ge='f(e)>0f(e) > 0',te;return{c(){e=ie("p"),n=pe("Consider a network "),a=ie("span"),s=pe(" with a flow "),i=ie("span"),m=pe(". An "),o=ie("strong"),l=pe("argumenting path"),u=pe(" is a simple path "),c=ie("span"),v=pe(" in the undirected copy of the network "),h=ie("span"),d=pe(" satisfying the following conditions:"),N=Ge(),g=ie("ul"),x=ie("li"),b=pe("For all edges "),y=ie("span"),A=pe(" properly oriented with respect to "),E=ie("span"),S=pe(", "),C=ie("span"),O=pe("."),P=Ge(),$=ie("li"),T=pe("For all edges "),I=ie("span"),W=pe(" improperly oriented with respect to "),K=ie("span"),z=pe(", "),j=ie("span"),te=pe("."),this.h()},l(re){e=ne(re,"P",{});var me=se(e);n=ce(me,"Consider a network "),a=ne(me,"SPAN",{class:!0});var oe=se(a);oe.forEach(G),s=ce(me," with a flow "),i=ne(me,"SPAN",{class:!0});var ue=se(i);ue.forEach(G),m=ce(me,". An "),o=ne(me,"STRONG",{});var we=se(o);l=ce(we,"argumenting path"),we.forEach(G),u=ce(me," is a simple path "),c=ne(me,"SPAN",{class:!0});var be=se(c);be.forEach(G),v=ce(me," in the undirected copy of the network "),h=ne(me,"SPAN",{class:!0});var Ae=se(h);Ae.forEach(G),d=ce(me," satisfying the following conditions:"),me.forEach(G),N=He(re),g=ne(re,"UL",{});var _e=se(g);x=ne(_e,"LI",{});var L=se(x);b=ce(L,"For all edges "),y=ne(L,"SPAN",{class:!0});var J=se(y);J.forEach(G),A=ce(L," properly oriented with respect to "),E=ne(L,"SPAN",{class:!0});var le=se(E);le.forEach(G),S=ce(L,", "),C=ne(L,"SPAN",{class:!0});var V=se(C);V.forEach(G),O=ce(L,"."),L.forEach(G),P=He(_e),$=ne(_e,"LI",{});var X=se($);T=ce(X,"For all edges "),I=ne(X,"SPAN",{class:!0});var ee=se(I);ee.forEach(G),W=ce(X," improperly oriented with respect to "),K=ne(X,"SPAN",{class:!0});var de=se(K);de.forEach(G),z=ce(X,", "),j=ne(X,"SPAN",{class:!0});var xe=se(j);xe.forEach(G),te=ce(X,"."),X.forEach(G),_e.forEach(G),this.h()},h(){ve(a,"class","math math-inline"),ve(i,"class","math math-inline"),ve(c,"class","math math-inline"),ve(h,"class","math math-inline"),ve(y,"class","math math-inline"),ve(E,"class","math math-inline"),ve(C,"class","math math-inline"),ve(I,"class","math math-inline"),ve(K,"class","math math-inline"),ve(j,"class","math math-inline")},m(re,me){Fe(re,e,me),k(e,n),k(e,a),a.innerHTML=r,k(e,s),k(e,i),i.innerHTML=p,k(e,m),k(e,o),k(o,l),k(e,u),k(e,c),c.innerHTML=f,k(e,v),k(e,h),h.innerHTML=w,k(e,d),Fe(re,N,me),Fe(re,g,me),k(g,x),k(x,b),k(x,y),y.innerHTML=D,k(x,A),k(x,E),E.innerHTML=M,k(x,S),k(x,C),C.innerHTML=B,k(x,O),k(g,P),k(g,$),k($,T),k($,I),I.innerHTML=_,k($,W),k($,K),K.innerHTML=Y,k($,z),k($,j),j.innerHTML=ge,k($,te)},p:Ot,d(re){re&&G(e),re&&G(N),re&&G(g)}}}function JB(t){let e,n,a,r='PP',s,i,p='GG',m,o,l='ff',u,c,f,v=`d=mineE{c(e)f(e)if e is properly oriented with respect to Pf(e)if e is improperly oriented with respect to P+otherwised = \\min_{e \\in E} \\begin{cases} -c(e) - f(e) & \\text{if } e \\text{ is properly oriented with respect to }P\\\\ -f(e) & \\text{if } e \\text{ is improperly oriented with respect to }P\\\\ -+\\infty & \\text{otherwise} -\\end{cases}`,h,w,d,N,g='ff^*',x,b,y='f=f+d|f^*| = |f| + d',D,A,E,M=`f(e)={f(e)+dif e is properly oriented with respect to Pf(e)dif e is improperly oriented with respect to Pf(e)otherwisef^*(e) = \\begin{cases} -f(e) + d & \\text{if } e \\text{ is properly oriented with respect to }P\\\\ -f(e) - d & \\text{if } e \\text{ is improperly oriented with respect to }P\\\\ -f(e) & \\text{otherwise} -\\end{cases}`;return{c(){e=ie("p"),n=pe("Suppose there is an argumenting path "),a=ie("span"),s=pe(" in the network "),i=ie("span"),m=pe(" with respect to the flow "),o=ie("span"),u=pe("."),c=Ge(),f=ie("div"),h=Ge(),w=ie("p"),d=pe("Then we can construct a new flow "),N=ie("span"),x=pe(" with value "),b=ie("span"),D=pe("."),A=Ge(),E=ie("div"),this.h()},l(S){e=ne(S,"P",{});var C=se(e);n=ce(C,"Suppose there is an argumenting path "),a=ne(C,"SPAN",{class:!0});var B=se(a);B.forEach(G),s=ce(C," in the network "),i=ne(C,"SPAN",{class:!0});var O=se(i);O.forEach(G),m=ce(C," with respect to the flow "),o=ne(C,"SPAN",{class:!0});var P=se(o);P.forEach(G),u=ce(C,"."),C.forEach(G),c=He(S),f=ne(S,"DIV",{class:!0});var $=se(f);$.forEach(G),h=He(S),w=ne(S,"P",{});var T=se(w);d=ce(T,"Then we can construct a new flow "),N=ne(T,"SPAN",{class:!0});var I=se(N);I.forEach(G),x=ce(T," with value "),b=ne(T,"SPAN",{class:!0});var _=se(b);_.forEach(G),D=ce(T,"."),T.forEach(G),A=He(S),E=ne(S,"DIV",{class:!0});var W=se(E);W.forEach(G),this.h()},h(){ve(a,"class","math math-inline"),ve(i,"class","math math-inline"),ve(o,"class","math math-inline"),ve(f,"class","math math-display"),ve(N,"class","math math-inline"),ve(b,"class","math math-inline"),ve(E,"class","math math-display")},m(S,C){Fe(S,e,C),k(e,n),k(e,a),a.innerHTML=r,k(e,s),k(e,i),i.innerHTML=p,k(e,m),k(e,o),o.innerHTML=l,k(e,u),Fe(S,c,C),Fe(S,f,C),f.innerHTML=v,Fe(S,h,C),Fe(S,w,C),k(w,d),k(w,N),N.innerHTML=g,k(w,x),k(w,b),b.innerHTML=y,k(w,D),Fe(S,A,C),Fe(S,E,C),E.innerHTML=M},p:Ot,d(S){S&&G(e),S&&G(c),S&&G(f),S&&G(h),S&&G(w),S&&G(A),S&&G(E)}}}function ZB(t){let e,n,a,r='d>0d > 0',s,i,p,m,o,l='dd',u,c,f='f(e)=f(e)d>0f^*(e) = f(e) - d > 0',v,h,w='f(e)=f(e)+d<c(e)f^*(e) = f(e) + d < c(e)',d,N,g='ff^*',x,b,y,D,A,E='ss',M,S,C='tt',B,O,P='f=f+d|f^*| = |f| + d',$;return{c(){e=ie("p"),n=pe("First by the definition of argumenting path, we have "),a=ie("span"),s=pe("."),i=Ge(),p=ie("p"),m=pe("And by the formula of "),o=ie("span"),u=pe(", for improperly oriented edges, "),c=ie("span"),v=pe(". For properly oriented edges, "),h=ie("span"),d=pe(". Other edges are unchanged. Therefore the adjusted flow "),N=ie("span"),x=pe(" is a valid flow."),b=Ge(),y=ie("p"),D=pe("The since the argument path must pass through the source "),A=ie("span"),M=pe(" and sink "),S=ie("span"),B=pe(", the value of the new flow "),O=ie("span"),$=pe("."),this.h()},l(T){e=ne(T,"P",{});var I=se(e);n=ce(I,"First by the definition of argumenting path, we have "),a=ne(I,"SPAN",{class:!0});var _=se(a);_.forEach(G),s=ce(I,"."),I.forEach(G),i=He(T),p=ne(T,"P",{});var W=se(p);m=ce(W,"And by the formula of "),o=ne(W,"SPAN",{class:!0});var K=se(o);K.forEach(G),u=ce(W,", for improperly oriented edges, "),c=ne(W,"SPAN",{class:!0});var Y=se(c);Y.forEach(G),v=ce(W,". For properly oriented edges, "),h=ne(W,"SPAN",{class:!0});var z=se(h);z.forEach(G),d=ce(W,". Other edges are unchanged. Therefore the adjusted flow "),N=ne(W,"SPAN",{class:!0});var j=se(N);j.forEach(G),x=ce(W," is a valid flow."),W.forEach(G),b=He(T),y=ne(T,"P",{});var ge=se(y);D=ce(ge,"The since the argument path must pass through the source "),A=ne(ge,"SPAN",{class:!0});var te=se(A);te.forEach(G),M=ce(ge," and sink "),S=ne(ge,"SPAN",{class:!0});var re=se(S);re.forEach(G),B=ce(ge,", the value of the new flow "),O=ne(ge,"SPAN",{class:!0});var me=se(O);me.forEach(G),$=ce(ge,"."),ge.forEach(G),this.h()},h(){ve(a,"class","math math-inline"),ve(o,"class","math math-inline"),ve(c,"class","math math-inline"),ve(h,"class","math math-inline"),ve(N,"class","math math-inline"),ve(A,"class","math math-inline"),ve(S,"class","math math-inline"),ve(O,"class","math math-inline")},m(T,I){Fe(T,e,I),k(e,n),k(e,a),a.innerHTML=r,k(e,s),Fe(T,i,I),Fe(T,p,I),k(p,m),k(p,o),o.innerHTML=l,k(p,u),k(p,c),c.innerHTML=f,k(p,v),k(p,h),h.innerHTML=w,k(p,d),k(p,N),N.innerHTML=g,k(p,x),Fe(T,b,I),Fe(T,y,I),k(y,D),k(y,A),A.innerHTML=E,k(y,M),k(y,S),S.innerHTML=C,k(y,B),k(y,O),O.innerHTML=P,k(y,$)},p:Ot,d(T){T&&G(e),T&&G(i),T&&G(p),T&&G(b),T&&G(y)}}}function WB(t){let e,n=`node(225 + 20i, "a/b'text{ stands for flow } a 'text{ out of capacity } b", "text"); -node(10 + 100i, "f", "text"); -node(50 + 150i, "s"); -node(175 + 150i, "v_1"); -node(300 + 150i, "v_2"); -node(425 + 150i, "t"); -node(225 + 125i, "'dots", "text"); -node(225 + 175i, "'dots$", "text"); -edge(s, v_1, "5/10"); -edge(v_2, v_1, "3/5"); -edge(v_2, t, "0/5"); -node(225 + 250i, "d = 3", "text"); -node(10 + 300i, "f^*", "text"); -node(50 + 350i, "s$"); -node(175 + 350i, "v_1$"); -node(300 + 350i, "v_2$"); -node(425 + 350i, "t$"); -node(225 + 325i, "'dots$$", "text"); -node(225 + 375i, "'dots$$$", "text"); -edge(s$, v_1$, "8/10"); -edge(v_2$, v_1$, "0/5"); -edge(v_2$, t$, "3/5");`;return{c(){e=ie("pre"),this.h()},l(a){e=ne(a,"PRE",{class:!0});var r=se(e);r.forEach(G),this.h()},h(){ve(e,"class","language-undefined")},m(a,r){Fe(a,e,r),e.innerHTML=n},p:Ot,d(a){a&&G(e)}}}function YB(t){let e,n;return e=new al({props:{directed:!0,height:400,$$slots:{default:[WB]},$$scope:{ctx:t}}}),{c(){xt(e.$$.fragment)},l(a){bt(e.$$.fragment,a)},m(a,r){Nt(e,a,r),n=!0},p(a,r){const s={};r&2&&(s.$$scope={dirty:r,ctx:a}),e.$set(s)},i(a){n||(dt(e.$$.fragment,a),n=!0)},o(a){yt(e.$$.fragment,a),n=!1},d(a){Et(e,a)}}}function XB(t){let e,n,a,r,s,i,p='VV',m,o,l='PP',u,c,f='P=VP\\overline{P} = V - P',v,h,w='sSs \\in S',d,N,g='tTt \\in T',x;return{c(){e=ie("p"),n=pe("A "),a=ie("strong"),r=pe("cut"),s=pe(" is a partition of the vertices "),i=ie("span"),m=pe(" into two sets "),o=ie("span"),u=pe(" and "),c=ie("span"),v=pe(" such that "),h=ie("span"),d=pe(" and "),N=ie("span"),x=pe("."),this.h()},l(b){e=ne(b,"P",{});var y=se(e);n=ce(y,"A "),a=ne(y,"STRONG",{});var D=se(a);r=ce(D,"cut"),D.forEach(G),s=ce(y," is a partition of the vertices "),i=ne(y,"SPAN",{class:!0});var A=se(i);A.forEach(G),m=ce(y," into two sets "),o=ne(y,"SPAN",{class:!0});var E=se(o);E.forEach(G),u=ce(y," and "),c=ne(y,"SPAN",{class:!0});var M=se(c);M.forEach(G),v=ce(y," such that "),h=ne(y,"SPAN",{class:!0});var S=se(h);S.forEach(G),d=ce(y," and "),N=ne(y,"SPAN",{class:!0});var C=se(N);C.forEach(G),x=ce(y,"."),y.forEach(G),this.h()},h(){ve(i,"class","math math-inline"),ve(o,"class","math math-inline"),ve(c,"class","math math-inline"),ve(h,"class","math math-inline"),ve(N,"class","math math-inline")},m(b,y){Fe(b,e,y),k(e,n),k(e,a),k(a,r),k(e,s),k(e,i),i.innerHTML=p,k(e,m),k(e,o),o.innerHTML=l,k(e,u),k(e,c),c.innerHTML=f,k(e,v),k(e,h),h.innerHTML=w,k(e,d),k(e,N),N.innerHTML=g,k(e,x)},p:Ot,d(b){b&&G(e)}}}function QB(t){let e,n,a,r,s,i,p='(P,P)(P, \\overline{P})',m,o,l='PP',u,c,f='P\\overline{P}',v,h,w='C(P,P)=(u,v)E,uP,vPc(u,v)C(P, \\overline{P}) = \\sum_{(u, v) \\in E, u \\in P, v \\in \\overline{P}} c(u, v)',d;return{c(){e=ie("p"),n=pe("The "),a=ie("strong"),r=pe("capacity"),s=pe(" of a cut "),i=ie("span"),m=pe(" is defined as the sum of the capacities of the edges from "),o=ie("span"),u=pe(" to "),c=ie("span"),v=pe(", denoted as "),h=ie("span"),d=pe("."),this.h()},l(N){e=ne(N,"P",{});var g=se(e);n=ce(g,"The "),a=ne(g,"STRONG",{});var x=se(a);r=ce(x,"capacity"),x.forEach(G),s=ce(g," of a cut "),i=ne(g,"SPAN",{class:!0});var b=se(i);b.forEach(G),m=ce(g," is defined as the sum of the capacities of the edges from "),o=ne(g,"SPAN",{class:!0});var y=se(o);y.forEach(G),u=ce(g," to "),c=ne(g,"SPAN",{class:!0});var D=se(c);D.forEach(G),v=ce(g,", denoted as "),h=ne(g,"SPAN",{class:!0});var A=se(h);A.forEach(G),d=ce(g,"."),g.forEach(G),this.h()},h(){ve(i,"class","math math-inline"),ve(o,"class","math math-inline"),ve(c,"class","math math-inline"),ve(h,"class","math math-inline")},m(N,g){Fe(N,e,g),k(e,n),k(e,a),k(a,r),k(e,s),k(e,i),i.innerHTML=p,k(e,m),k(e,o),o.innerHTML=l,k(e,u),k(e,c),c.innerHTML=f,k(e,v),k(e,h),h.innerHTML=w,k(e,d)},p:Ot,d(N){N&&G(e)}}}function jB(t){let e,n=`node(50 + 150i, "s"); -node(400 + 150i, "t", "light"); -node(150 + 150i, "v_1"); -node(300 + 150i, "v_2", "light"); -node(200 + 250i, "v_3", "light"); -node(200 + 50i, "v_4"); -edge(s, v_1, 10); -edge(s, v_3, 5); -edge(v_1, v_2, 5); -edge(v_1, v_3, 15); -edge(v_1, v_4, 10); -edge(v_3, v_2, 5); -edge(v_2, t, 10); -edge(v_3, t, 10); -edge(v_4, t, 10); -node(200 + 290i, "C(P, 'overline{P}) = 35", "text");`;return{c(){e=ie("pre"),this.h()},l(a){e=ne(a,"PRE",{class:!0});var r=se(e);r.forEach(G),this.h()},h(){ve(e,"class","language-undefined")},m(a,r){Fe(a,e,r),e.innerHTML=n},p:Ot,d(a){a&&G(e)}}}function KB(t){let e,n;return e=new al({props:{directed:!0,$$slots:{default:[jB]},$$scope:{ctx:t}}}),{c(){xt(e.$$.fragment)},l(a){bt(e.$$.fragment,a)},m(a,r){Nt(e,a,r),n=!0},p(a,r){const s={};r&2&&(s.$$scope={dirty:r,ctx:a}),e.$set(s)},i(a){n||(dt(e.$$.fragment,a),n=!0)},o(a){yt(e.$$.fragment,a),n=!1},d(a){Et(e,a)}}}function eO(t){let e,n,a,r='ff',s,i,p='GG',m,o,l='(P,P)(P, \\overline{P})',u,c,f,v='fC(P,P)|f| \\leq C(P, \\overline{P})';return{c(){e=ie("p"),n=pe("For any flow "),a=ie("span"),s=pe(" in the network "),i=ie("span"),m=pe(", and any cut "),o=ie("span"),u=pe(", we have"),c=Ge(),f=ie("div"),this.h()},l(h){e=ne(h,"P",{});var w=se(e);n=ce(w,"For any flow "),a=ne(w,"SPAN",{class:!0});var d=se(a);d.forEach(G),s=ce(w," in the network "),i=ne(w,"SPAN",{class:!0});var N=se(i);N.forEach(G),m=ce(w,", and any cut "),o=ne(w,"SPAN",{class:!0});var g=se(o);g.forEach(G),u=ce(w,", we have"),w.forEach(G),c=He(h),f=ne(h,"DIV",{class:!0});var x=se(f);x.forEach(G),this.h()},h(){ve(a,"class","math math-inline"),ve(i,"class","math math-inline"),ve(o,"class","math math-inline"),ve(f,"class","math math-display")},m(h,w){Fe(h,e,w),k(e,n),k(e,a),a.innerHTML=r,k(e,s),k(e,i),i.innerHTML=p,k(e,m),k(e,o),o.innerHTML=l,k(e,u),Fe(h,c,w),Fe(h,f,w),f.innerHTML=v},p:Ot,d(h){h&&G(e),h&&G(c),h&&G(f)}}}function tO(t){let e,n,a,r='P{s}P - \\{s\\}',s,i,p='P{s}\\overline{P} - \\{s\\}',m,o,l,u=`0=u(Ps)0=u(Ps)(vV,(u,v)Ef(u,v)vV,(v,u)Ef(v,u))=u(Ps)(vP,(u,v)Ef(u,v)vP,(v,u)Ef(v,u)+vP,(u,v)Ef(u,v)vP,(v,u)Ef(v,u))=u(Ps)(vP,(u,v)Ef(u,v)vP,(v,u)Ef(v,u))+u(Ps)(vP,(u,v)Ef(u,v)vP,(v,u)Ef(v,u))=uP,vP,(u,v)Ef(u,v)uP,vP,(v,u)Ef(v,u)+u(Ps)(vP,(u,v)Ef(u,v)vP,(v,u)Ef(v,u))(Note: Simple graph.)=u(Ps)(vP,(u,v)Ef(u,v)vP,(v,u)Ef(v,u))(Note: First 2 summations have same region.)=(uP,vP,(u,v)Ef(u,v)uP,vP,(v,u)Ef(v,u))(vP,(s,v)Ef(s,v)vP,(v,s)Ef(v,s))(uP,vP,(u,v)Ef(u,v)uP,vP,(v,u)Ef(v,u))(vV,(s,v)Ef(s,v)vV,(v,s)Ef(v,s))=uP,vP,(u,v)Ef(u,v)uP,vP,(v,u)Ef(v,u)fuP,vP,(u,v)Ec(u,v)uP,vP,(v,u)Ec(v,u)f=C(P,P)f0\\\\ -= \\sum_{u \\in (P - {s})} 0\\\\ -= \\sum_{u \\in (P - {s})} \\left(\\sum_{v \\in V, (u, v) \\in E} f(u, v) - \\sum_{v \\in V, (v, u) \\in E} f(v, u)\\right)\\\\ -= \\sum_{u \\in (P - {s})} \\left(\\sum_{v \\in P, (u, v) \\in E} f(u, v) - \\sum_{v \\in P, (v, u) \\in E} f(v, u) + \\sum_{v \\in \\overline{P}, (u, v) \\in E} f(u, v) - \\sum_{v \\in \\overline{P}, (v, u) \\in E} f(v, u)\\right)\\\\ -= \\sum_{u \\in (P - {s})} \\left(\\sum_{v \\in P, (u, v) \\in E} f(u, v) - \\sum_{v \\in P, (v, u) \\in E} f(v, u)\\right) + \\sum_{u \\in (P - {s})}\\left(\\sum_{v \\in \\overline{P}, (u, v) \\in E} f(u, v) - \\sum_{v \\in \\overline{P}, (v, u) \\in E} f(v, u)\\right)\\\\ -= \\sum_{u \\in P, v \\in P, (u, v) \\in E} f(u, v) - \\sum_{u \\in P, v \\in P, (v, u) \\in E} f(v, u) + \\sum_{u \\in (P - {s})}\\left(\\sum_{v \\in \\overline{P}, (u, v) \\in E} f(u, v) - \\sum_{v \\in \\overline{P}, (v, u) \\in E} f(v, u)\\right) \\text{(Note: Simple graph.)}\\\\ -= \\sum_{u \\in (P - {s})}\\left(\\sum_{v \\in \\overline{P}, (u, v) \\in E} f(u, v) - \\sum_{v \\in \\overline{P}, (v, u) \\in E} f(v, u)\\right) \\text{(Note: First 2 summations have same region.)}\\\\ -= \\left(\\sum_{u \\in P, v \\in \\overline{P}, (u, v) \\in E} f(u, v) - \\sum_{u \\in P, v \\in \\overline{P}, (v, u) \\in E} f(v, u)\\right) - \\left(\\sum_{v \\in \\overline{P}, (s, v) \\in E} f(s, v) - \\sum_{v \\in \\overline{P}, (v, s) \\in E} f(v, s)\\right)\\\\ -\\le \\left(\\sum_{u \\in P, v \\in \\overline{P}, (u, v) \\in E} f(u, v) - \\sum_{u \\in P, v \\in \\overline{P}, (v, u) \\in E} f(v, u)\\right) - \\left(\\sum_{v \\in V, (s, v) \\in E} f(s, v) - \\sum_{v \\in V, (v, s) \\in E} f(v, s)\\right) \\\\ -= \\sum_{u \\in P, v \\in \\overline{P}, (u, v) \\in E} f(u, v) - \\sum_{u \\in P, v \\in \\overline{P}, (v, u) \\in E} f(v, u) - |f|\\\\ -\\le \\sum_{u \\in P, v \\in \\overline{P}, (u, v) \\in E} c(u, v) - \\sum_{u \\in P, v \\in \\overline{P}, (v, u) \\in E} c(v, u) - |f|\\\\ -= C(P, \\overline{P}) - |f|`,c,f,v,h,w='f|f|',d,N,g='fC(P,P)|f| \\leq C(P, \\overline{P})',x;return{c(){e=ie("p"),n=pe("Consider flows enter "),a=ie("span"),s=pe(" and leave "),i=ie("span"),m=pe(", we have"),o=Ge(),l=ie("div"),c=Ge(),f=ie("p"),v=pe("And move the "),h=ie("span"),d=pe(" to the left side, we have "),N=ie("span"),x=pe("."),this.h()},l(b){e=ne(b,"P",{});var y=se(e);n=ce(y,"Consider flows enter "),a=ne(y,"SPAN",{class:!0});var D=se(a);D.forEach(G),s=ce(y," and leave "),i=ne(y,"SPAN",{class:!0});var A=se(i);A.forEach(G),m=ce(y,", we have"),y.forEach(G),o=He(b),l=ne(b,"DIV",{class:!0});var E=se(l);E.forEach(G),c=He(b),f=ne(b,"P",{});var M=se(f);v=ce(M,"And move the "),h=ne(M,"SPAN",{class:!0});var S=se(h);S.forEach(G),d=ce(M," to the left side, we have "),N=ne(M,"SPAN",{class:!0});var C=se(N);C.forEach(G),x=ce(M,"."),M.forEach(G),this.h()},h(){ve(a,"class","math math-inline"),ve(i,"class","math math-inline"),ve(l,"class","math math-display"),ve(h,"class","math math-inline"),ve(N,"class","math math-inline")},m(b,y){Fe(b,e,y),k(e,n),k(e,a),a.innerHTML=r,k(e,s),k(e,i),i.innerHTML=p,k(e,m),Fe(b,o,y),Fe(b,l,y),l.innerHTML=u,Fe(b,c,y),Fe(b,f,y),k(f,v),k(f,h),h.innerHTML=w,k(f,d),k(f,N),N.innerHTML=g,k(f,x)},p:Ot,d(b){b&&G(e),b&&G(o),b&&G(l),b&&G(c),b&&G(f)}}}function aO(t){let e,n,a,r='f=C(P,P)|f| = C(P, \\overline{P})',s,i,p='ff',m,o,l='(P,P)(P, \\overline{P})',u,c,f='ff',v,h,w='(P,P)(P, \\overline{P})',d,N,g='f(i,j)=c(i,j)f(i, j) = c(i, j)',x,b,y='(i,j)E(i, j) \\in E',D,A,E='iPi \\in P',M,S,C='jPj \\in \\overline{P}',B,O,P='f(i,j)=0f(i, j) = 0',$;return{c(){e=ie("p"),n=pe("If the equality "),a=ie("span"),s=pe(" holds for some flow "),i=ie("span"),m=pe(" and cut "),o=ie("span"),u=pe(", then the flow "),c=ie("span"),v=pe(" is a maximum flow and the cut "),h=ie("span"),d=pe(" is a minimum cut. And the equality hold if and only if "),N=ie("span"),x=pe(" for all "),b=ie("span"),D=pe(" with "),A=ie("span"),M=pe(" and "),S=ie("span"),B=pe(" and "),O=ie("span"),$=pe(" otherwise."),this.h()},l(T){e=ne(T,"P",{});var I=se(e);n=ce(I,"If the equality "),a=ne(I,"SPAN",{class:!0});var _=se(a);_.forEach(G),s=ce(I," holds for some flow "),i=ne(I,"SPAN",{class:!0});var W=se(i);W.forEach(G),m=ce(I," and cut "),o=ne(I,"SPAN",{class:!0});var K=se(o);K.forEach(G),u=ce(I,", then the flow "),c=ne(I,"SPAN",{class:!0});var Y=se(c);Y.forEach(G),v=ce(I," is a maximum flow and the cut "),h=ne(I,"SPAN",{class:!0});var z=se(h);z.forEach(G),d=ce(I," is a minimum cut. And the equality hold if and only if "),N=ne(I,"SPAN",{class:!0});var j=se(N);j.forEach(G),x=ce(I," for all "),b=ne(I,"SPAN",{class:!0});var ge=se(b);ge.forEach(G),D=ce(I," with "),A=ne(I,"SPAN",{class:!0});var te=se(A);te.forEach(G),M=ce(I," and "),S=ne(I,"SPAN",{class:!0});var re=se(S);re.forEach(G),B=ce(I," and "),O=ne(I,"SPAN",{class:!0});var me=se(O);me.forEach(G),$=ce(I," otherwise."),I.forEach(G),this.h()},h(){ve(a,"class","math math-inline"),ve(i,"class","math math-inline"),ve(o,"class","math math-inline"),ve(c,"class","math math-inline"),ve(h,"class","math math-inline"),ve(N,"class","math math-inline"),ve(b,"class","math math-inline"),ve(A,"class","math math-inline"),ve(S,"class","math math-inline"),ve(O,"class","math math-inline")},m(T,I){Fe(T,e,I),k(e,n),k(e,a),a.innerHTML=r,k(e,s),k(e,i),i.innerHTML=p,k(e,m),k(e,o),o.innerHTML=l,k(e,u),k(e,c),c.innerHTML=f,k(e,v),k(e,h),h.innerHTML=w,k(e,d),k(e,N),N.innerHTML=g,k(e,x),k(e,b),b.innerHTML=y,k(e,D),k(e,A),A.innerHTML=E,k(e,M),k(e,S),S.innerHTML=C,k(e,B),k(e,O),O.innerHTML=P,k(e,$)},p:Ot,d(T){T&&G(e)}}}function rO(t){let e,n,a,r='\\le',s;return{c(){e=ie("p"),n=pe("Obtained from the above reduction when two "),a=ie("span"),s=pe(" is used in the proof."),this.h()},l(i){e=ne(i,"P",{});var p=se(e);n=ce(p,"Obtained from the above reduction when two "),a=ne(p,"SPAN",{class:!0});var m=se(a);m.forEach(G),s=ce(p," is used in the proof."),p.forEach(G),this.h()},h(){ve(a,"class","math math-inline")},m(i,p){Fe(i,e,p),k(e,n),k(e,a),a.innerHTML=r,k(e,s)},p:Ot,d(i){i&&G(e)}}}function nO(t){let e,n,a,r,s,i='GfG_f',p,m,o='GG',l,u,c='ff',f,v,h='GG',w,d,N='cf:ER+c_f: E \\to \\mathbb{R}^+',g,x,b,y=`cf(u,v)={c(u,v)f(u,v)if (u,v)Ef(v,u)if (v,u)E0otherwisec_f(u, v) = \\begin{cases} -c(u, v) - f(u, v) & \\text{if } (u, v) \\in E\\\\ -f(v, u) & \\text{if } (v, u) \\in E\\\\ -0 & \\text{otherwise} -\\end{cases}`;return{c(){e=ie("p"),n=ie("strong"),a=pe("Resiual Network"),r=Ge(),s=ie("span"),p=pe(" of a network "),m=ie("span"),l=pe(" with respect to a flow "),u=ie("span"),f=pe(" is defined as the graph with the same vertices and edges as "),v=ie("span"),w=pe(" and the capacity function "),d=ie("span"),g=pe(" defined as"),x=Ge(),b=ie("div"),this.h()},l(D){e=ne(D,"P",{});var A=se(e);n=ne(A,"STRONG",{});var E=se(n);a=ce(E,"Resiual Network"),E.forEach(G),r=He(A),s=ne(A,"SPAN",{class:!0});var M=se(s);M.forEach(G),p=ce(A," of a network "),m=ne(A,"SPAN",{class:!0});var S=se(m);S.forEach(G),l=ce(A," with respect to a flow "),u=ne(A,"SPAN",{class:!0});var C=se(u);C.forEach(G),f=ce(A," is defined as the graph with the same vertices and edges as "),v=ne(A,"SPAN",{class:!0});var B=se(v);B.forEach(G),w=ce(A," and the capacity function "),d=ne(A,"SPAN",{class:!0});var O=se(d);O.forEach(G),g=ce(A," defined as"),A.forEach(G),x=He(D),b=ne(D,"DIV",{class:!0});var P=se(b);P.forEach(G),this.h()},h(){ve(s,"class","math math-inline"),ve(m,"class","math math-inline"),ve(u,"class","math math-inline"),ve(v,"class","math math-inline"),ve(d,"class","math math-inline"),ve(b,"class","math math-display")},m(D,A){Fe(D,e,A),k(e,n),k(n,a),k(e,r),k(e,s),s.innerHTML=i,k(e,p),k(e,m),m.innerHTML=o,k(e,l),k(e,u),u.innerHTML=c,k(e,f),k(e,v),v.innerHTML=h,k(e,w),k(e,d),d.innerHTML=N,k(e,g),Fe(D,x,A),Fe(D,b,A),b.innerHTML=y},p:Ot,d(D){D&&G(e),D&&G(x),D&&G(b)}}}function sO(t){let e,n,a,r='GfG_f',s,i,p='ff',m;return{c(){e=ie("p"),n=pe("Coninuously find an argumenting path in the residual network "),a=ie("span"),s=pe(" and adjust the flow "),i=ie("span"),m=pe(" until no argumenting path can be found."),this.h()},l(o){e=ne(o,"P",{});var l=se(e);n=ce(l,"Coninuously find an argumenting path in the residual network "),a=ne(l,"SPAN",{class:!0});var u=se(a);u.forEach(G),s=ce(l," and adjust the flow "),i=ne(l,"SPAN",{class:!0});var c=se(i);c.forEach(G),m=ce(l," until no argumenting path can be found."),l.forEach(G),this.h()},h(){ve(a,"class","math math-inline"),ve(i,"class","math math-inline")},m(o,l){Fe(o,e,l),k(e,n),k(e,a),a.innerHTML=r,k(e,s),k(e,i),i.innerHTML=p,k(e,m)},p:Ot,d(o){o&&G(e)}}}function iO(t){let e,n,a,r='ff',s;return{c(){e=ie("p"),n=pe("After the Ford-Fulkerson Method, the flow "),a=ie("span"),s=pe(" is a maximum flow."),this.h()},l(i){e=ne(i,"P",{});var p=se(e);n=ce(p,"After the Ford-Fulkerson Method, the flow "),a=ne(p,"SPAN",{class:!0});var m=se(a);m.forEach(G),s=ce(p," is a maximum flow."),p.forEach(G),this.h()},h(){ve(a,"class","math math-inline")},m(i,p){Fe(i,e,p),k(e,n),k(e,a),a.innerHTML=r,k(e,s)},p:Ot,d(i){i&&G(e)}}}function oO(t){let e,n,a,r='tt',s,i,p='ss',m,o,l='GfG_f',u,c,f='GfG_f',v,h,w,d,N,g='ss',x,b,y='GfG_f',D,A,E='(P,P)(P, \\overline{P})',M,S,C='sPs \\in P',B,O,P='tPt \\in \\overline{P}',$,T,I='PP',_,W,K='P\\overline{P}',Y,z,j='GfG_f',ge,te,re='P\\overline{P}',me,oe,ue='ss',we,be,Ae,_e,L,J='ff',le,V,X,ee;return{c(){e=ie("p"),n=pe("First, after the Ford-Fulkerson Method, the sink "),a=ie("span"),s=pe(" should not be reachable from the source "),i=ie("span"),m=pe(" in the residual network "),o=ie("span"),u=pe(". Otherwise, there is an argumenting path in the residual network "),c=ie("span"),v=pe("."),h=Ge(),w=ie("p"),d=pe("Therefore, the vertices reachable from the source "),N=ie("span"),x=pe(" in the residual network "),b=ie("span"),D=pe(" form a cut "),A=ie("span"),M=pe(" with "),S=ie("span"),B=pe(" and "),O=ie("span"),$=pe(". There shouldn’t be a edge from "),T=ie("span"),_=pe(" to "),W=ie("span"),Y=pe(" in the residual network "),z=ie("span"),ge=pe(", otherwise there exists a vertex in "),te=ie("span"),me=pe(" reachable from the source "),oe=ie("span"),we=pe(", which leads to a contradiction."),be=Ge(),Ae=ie("p"),_e=pe("Therefore, the flow "),L=ie("span"),le=pe(" is a maximum flow."),V=Ge(),X=ie("p"),ee=pe("But this does not guarantee the termination of the algorithm. If the capacities are integers, the algorithm obviously terminates since the flow value increases and bounded. But if it is not, the algorithm may not terminate since we know there are some infinate increasing sequences in real numbers."),this.h()},l(de){e=ne(de,"P",{});var xe=se(e);n=ce(xe,"First, after the Ford-Fulkerson Method, the sink "),a=ne(xe,"SPAN",{class:!0});var R=se(a);R.forEach(G),s=ce(xe," should not be reachable from the source "),i=ne(xe,"SPAN",{class:!0});var U=se(i);U.forEach(G),m=ce(xe," in the residual network "),o=ne(xe,"SPAN",{class:!0});var ae=se(o);ae.forEach(G),u=ce(xe,". Otherwise, there is an argumenting path in the residual network "),c=ne(xe,"SPAN",{class:!0});var he=se(c);he.forEach(G),v=ce(xe,"."),xe.forEach(G),h=He(de),w=ne(de,"P",{});var fe=se(w);d=ce(fe,"Therefore, the vertices reachable from the source "),N=ne(fe,"SPAN",{class:!0});var Ne=se(N);Ne.forEach(G),x=ce(fe," in the residual network "),b=ne(fe,"SPAN",{class:!0});var Te=se(b);Te.forEach(G),D=ce(fe," form a cut "),A=ne(fe,"SPAN",{class:!0});var Se=se(A);Se.forEach(G),M=ce(fe," with "),S=ne(fe,"SPAN",{class:!0});var Oe=se(S);Oe.forEach(G),B=ce(fe," and "),O=ne(fe,"SPAN",{class:!0});var Me=se(O);Me.forEach(G),$=ce(fe,". There shouldn’t be a edge from "),T=ne(fe,"SPAN",{class:!0});var Qe=se(T);Qe.forEach(G),_=ce(fe," to "),W=ne(fe,"SPAN",{class:!0});var Ye=se(W);Ye.forEach(G),Y=ce(fe," in the residual network "),z=ne(fe,"SPAN",{class:!0});var Re=se(z);Re.forEach(G),ge=ce(fe,", otherwise there exists a vertex in "),te=ne(fe,"SPAN",{class:!0});var ht=se(te);ht.forEach(G),me=ce(fe," reachable from the source "),oe=ne(fe,"SPAN",{class:!0});var F=se(oe);F.forEach(G),we=ce(fe,", which leads to a contradiction."),fe.forEach(G),be=He(de),Ae=ne(de,"P",{});var Q=se(Ae);_e=ce(Q,"Therefore, the flow "),L=ne(Q,"SPAN",{class:!0});var ye=se(L);ye.forEach(G),le=ce(Q," is a maximum flow."),Q.forEach(G),V=He(de),X=ne(de,"P",{});var Ce=se(X);ee=ce(Ce,"But this does not guarantee the termination of the algorithm. If the capacities are integers, the algorithm obviously terminates since the flow value increases and bounded. But if it is not, the algorithm may not terminate since we know there are some infinate increasing sequences in real numbers."),Ce.forEach(G),this.h()},h(){ve(a,"class","math math-inline"),ve(i,"class","math math-inline"),ve(o,"class","math math-inline"),ve(c,"class","math math-inline"),ve(N,"class","math math-inline"),ve(b,"class","math math-inline"),ve(A,"class","math math-inline"),ve(S,"class","math math-inline"),ve(O,"class","math math-inline"),ve(T,"class","math math-inline"),ve(W,"class","math math-inline"),ve(z,"class","math math-inline"),ve(te,"class","math math-inline"),ve(oe,"class","math math-inline"),ve(L,"class","math math-inline")},m(de,xe){Fe(de,e,xe),k(e,n),k(e,a),a.innerHTML=r,k(e,s),k(e,i),i.innerHTML=p,k(e,m),k(e,o),o.innerHTML=l,k(e,u),k(e,c),c.innerHTML=f,k(e,v),Fe(de,h,xe),Fe(de,w,xe),k(w,d),k(w,N),N.innerHTML=g,k(w,x),k(w,b),b.innerHTML=y,k(w,D),k(w,A),A.innerHTML=E,k(w,M),k(w,S),S.innerHTML=C,k(w,B),k(w,O),O.innerHTML=P,k(w,$),k(w,T),T.innerHTML=I,k(w,_),k(w,W),W.innerHTML=K,k(w,Y),k(w,z),z.innerHTML=j,k(w,ge),k(w,te),te.innerHTML=re,k(w,me),k(w,oe),oe.innerHTML=ue,k(w,we),Fe(de,be,xe),Fe(de,Ae,xe),k(Ae,_e),k(Ae,L),L.innerHTML=J,k(Ae,le),Fe(de,V,xe),Fe(de,X,xe),k(X,ee)},p:Ot,d(de){de&&G(e),de&&G(h),de&&G(w),de&&G(be),de&&G(Ae),de&&G(V),de&&G(X)}}}function lO(t){let e,n=`$'fn{bfs}(s, t, vertices)$ [ - for $u$ in $vertices$ [ - $u.level = -1$ - ] - $q = {s}$ - $s.level = -1$ - while $'neg 'fn{QUQUE-EMPTY}(q)$ [ - $u = 'fn{QUQUE-POP}(q)$ - for $e$ in $u.edges$ [ - if $e.v.level = -1$ and $e.cap > 0$ [ - $e.v.level = u.level + 1$ - $'fn{QUQUE-PUSH}(q, e.v)$ - ] - ] - ] - return $t.level \neq -1$ -] - -$'fn{dfs}(u, f, t)$ [ - if $u = t 'lor f 'le 0$ [ - return $f$ - ] - $r = 0$ - while $u.current < |u.edges|$ [ - $e = u.edges(u.current)$ - if $e.cap > 0 'land e.v.level = u.level + 1$ [ - $delta = 'fn{dfs}(e.v, 'min(f - r, e.cap), t)$ - $e.cap -= delta$ - $e.rev.cap += delta$ - $r += delta$ - if $r = f$ [ - return $r$ - ] - ] - $u.current += 1$ - ] - return $r$ -] - -# G is the network, c is the capacity function, s is the source, t is the sink -# Return the maximum flow and the flow function -$'fn{dinic}(digraph, c, s, t)$ [ - $vertices = 'varnothing$ - $edges = 'varnothing$ - for $u$ in $digraph.vertices$ [ - $vertices(u) = $ new $'text{Vertex}'{level: -1, edges: 'varnothing, current: 0'}$ - ] - for $e$ in $digraph.edges$ [ - $u = vertices(e.u)$ - $v = vertices(e.v)$ - $proper = $ new $'text{Edge}'{v: v, cap: c(e), rev: $null$'}$ - $improper = $ new $'text{Edge}'{v: u, cap: 0, rev: proper'}$ - $proper.rev = improper$ - $u.edges(|u.edges|) = proper$ - $v.edges(|v.edges|) = improper$ - $edges(e) = proper$ - ] - $flow = 0$ - $s = vertices(s)$ - $t = vertices(t)$ - while $'fn{bfs}(s, t, vertices)$ [ - for $u$ in $vertices$ [ - $u.current = 0$ - ] - $flow += 'fn{dfs}(s, +'infty, t)$ - ] - $f = 'varnothing$ - for $e$ in $digraph.edges$ [ - $f(e) = edges(e).rev.cap$ - ] - return $flow, f$ -]`;return{c(){e=ie("pre"),this.h()},l(a){e=ne(a,"PRE",{class:!0});var r=se(e);r.forEach(G),this.h()},h(){ve(e,"class","language-undefined")},m(a,r){Fe(a,e,r),e.innerHTML=n},p:Ot,d(a){a&&G(e)}}}function mO(t){let e,n,a,r='O(V2E)O(V^2E)',s,i,p,m;return p=new Xd({props:{$$slots:{default:[lO]},$$scope:{ctx:t}}}),{c(){e=ie("p"),n=pe("This algorithm terminates. We will provide the proof later. The time complexity is "),a=ie("span"),s=pe("."),i=Ge(),xt(p.$$.fragment),this.h()},l(o){e=ne(o,"P",{});var l=se(e);n=ce(l,"This algorithm terminates. We will provide the proof later. The time complexity is "),a=ne(l,"SPAN",{class:!0});var u=se(a);u.forEach(G),s=ce(l,"."),l.forEach(G),i=He(o),bt(p.$$.fragment,o),this.h()},h(){ve(a,"class","math math-inline")},m(o,l){Fe(o,e,l),k(e,n),k(e,a),a.innerHTML=r,k(e,s),Fe(o,i,l),Nt(p,o,l),m=!0},p(o,l){const u={};l&2&&(u.$$scope={dirty:l,ctx:o}),p.$set(u)},i(o){m||(dt(p.$$.fragment,o),m=!0)},o(o){yt(p.$$.fragment,o),m=!1},d(o){o&&G(e),o&&G(i),Et(p,o)}}}function uO(t){let e,n;return{c(){e=ie("p"),n=pe("To be continued.")},l(a){e=ne(a,"P",{});var r=se(e);n=ce(r,"To be continued."),r.forEach(G)},m(a,r){Fe(a,e,r),k(e,n)},p:Ot,d(a){a&&G(e)}}}function pO(t){let e,n,a,r,s,i,p,m,o,l,u,c,f,v,h,w,d,N,g,x,b,y,D,A,E,M,S,C,B,O,P,$,T='(u,v),(v,u)(u, v), (v, u)',I,_,W='(u,v),(v,v),(v,u)(u, v'), (v', v), (v, u)',K,Y,z='vv'',j,ge,te='(u,v),(v,v)(u, v'), (v, v')',re,me,oe='(u,v)(u, v)',ue,we,be,Ae,_e,L='ss'',J,le,V='tt'',X,ee,de='ss'',xe,R,U='tt'',ae,he,fe,Ne,Te,Se,Oe,Me,Qe,Ye,Re,ht,F,Q,ye,Ce,ke,Je,Wt,$a,Pn,er,zn,tr,Rn,ar,In,rr,qn,nr,Ln,sr,kn,ir,or,pn,Us,Un,lr,Gn,mr,Hn,ur,Vn,pr,cr,mt,qt,fr,Nr,ba,hr,Gs,rl,Ai,Jn,nl,Mi,Ir,qr,Hs,sl,Si,Zn,il,Ci;return v=new Yt({props:{variant:"definition",$$slots:{default:[RB]},$$scope:{ctx:t}}}),w=new Yt({props:{variant:"example",$$slots:{default:[qB]},$$scope:{ctx:t}}}),N=new Yt({props:{variant:"definition",$$slots:{default:[LB]},$$scope:{ctx:t}}}),x=new Yt({props:{variant:"definition",$$slots:{default:[kB]},$$scope:{ctx:t}}}),Me=new Yt({props:{variant:"definition",name:"Properly Oriented Edge",$$slots:{default:[UB]},$$scope:{ctx:t}}}),Ye=new Yt({props:{variant:"example",$$slots:{default:[HB]},$$scope:{ctx:t}}}),ht=new Yt({props:{variant:"definition",name:"Argumenting Path",$$slots:{default:[VB]},$$scope:{ctx:t}}}),Q=new Yt({props:{variant:"theorem",$$slots:{default:[JB]},$$scope:{ctx:t}}}),Ce=new Ks({props:{$$slots:{default:[ZB]},$$scope:{ctx:t}}}),Je=new Yt({props:{variant:"example",$$slots:{default:[YB]},$$scope:{ctx:t}}}),$a=new Yt({props:{variant:"definition",name:"Cut",$$slots:{default:[XB]},$$scope:{ctx:t}}}),er=new Yt({props:{variant:"definition",name:"Capacity of a Cut",$$slots:{default:[QB]},$$scope:{ctx:t}}}),tr=new Yt({props:{variant:"example",$$slots:{default:[KB]},$$scope:{ctx:t}}}),ar=new Yt({props:{variant:"theorem",$$slots:{default:[eO]},$$scope:{ctx:t}}}),rr=new Ks({props:{$$slots:{default:[tO]},$$scope:{ctx:t}}}),nr=new Yt({props:{variant:"theorem",name:"Max-Flow Min-Cut Theorem",$$slots:{default:[aO]},$$scope:{ctx:t}}}),sr=new Ks({props:{$$slots:{default:[rO]},$$scope:{ctx:t}}}),lr=new Yt({props:{variant:"definition",name:"Residual Network",$$slots:{default:[nO]},$$scope:{ctx:t}}}),mr=new Yt({props:{variant:"algorithm",name:"Ford-Fulkerson Method",$$slots:{default:[sO]},$$scope:{ctx:t}}}),ur=new Yt({props:{variant:"theorem",$$slots:{default:[iO]},$$scope:{ctx:t}}}),pr=new Ks({props:{$$slots:{default:[oO]},$$scope:{ctx:t}}}),mt=new Yt({props:{variant:"algorithm",name:"Dinic's Implementation of Ford-Fulkerson Method",$$slots:{default:[mO]},$$scope:{ctx:t}}}),fr=new Ks({props:{variant:"correctness",$$slots:{default:[uO]},$$scope:{ctx:t}}}),{c(){e=ie("h1"),n=ie("a"),a=ie("span"),r=pe("Network Flow"),s=Ge(),i=ie("p"),p=pe("Network flow is an interesting but difficult topic in graph theory. Most algorithm have high time complexity."),m=Ge(),o=ie("h2"),l=ie("a"),u=ie("span"),c=pe("Definition"),f=Ge(),xt(v.$$.fragment),h=Ge(),xt(w.$$.fragment),d=Ge(),xt(N.$$.fragment),g=Ge(),xt(x.$$.fragment),b=Ge(),y=ie("h2"),D=ie("a"),A=ie("span"),E=pe("Model Reduction"),M=Ge(),S=ie("p"),C=pe("For non-simple digraphs, we can merge parallel edges into a single edge with the sum of the capacities and remove self-loops."),B=Ge(),O=ie("p"),P=pe("For non-anti-symmetric digraphs, we can replace "),$=ie("span"),I=pe(" by "),_=ie("span"),K=pe(" where "),Y=ie("span"),j=pe(" is a new vertex, setting the capacity of "),ge=ie("span"),re=pe(" to be the same as "),me=ie("span"),ue=pe("."),we=Ge(),be=ie("p"),Ae=pe("For multiple sources and sinks, we can add a new source "),_e=ie("span"),J=pe(", called supersource, and sink "),le=ie("span"),X=pe(", called supersink, connecting "),ee=ie("span"),xe=pe(" to all sources and all sinks to "),R=ie("span"),ae=pe("."),he=Ge(),fe=ie("h2"),Ne=ie("a"),Te=ie("span"),Se=pe("Agumenting Path and Max-Flow Min-Cut Theorem"),Oe=Ge(),xt(Me.$$.fragment),Qe=Ge(),xt(Ye.$$.fragment),Re=Ge(),xt(ht.$$.fragment),F=Ge(),xt(Q.$$.fragment),ye=Ge(),xt(Ce.$$.fragment),ke=Ge(),xt(Je.$$.fragment),Wt=Ge(),xt($a.$$.fragment),Pn=Ge(),xt(er.$$.fragment),zn=Ge(),xt(tr.$$.fragment),Rn=Ge(),xt(ar.$$.fragment),In=Ge(),xt(rr.$$.fragment),qn=Ge(),xt(nr.$$.fragment),Ln=Ge(),xt(sr.$$.fragment),kn=Ge(),ir=ie("h2"),or=ie("a"),pn=ie("span"),Us=pe("Ford-Fulkerson Method"),Un=Ge(),xt(lr.$$.fragment),Gn=Ge(),xt(mr.$$.fragment),Hn=Ge(),xt(ur.$$.fragment),Vn=Ge(),xt(pr.$$.fragment),cr=Ge(),xt(mt.$$.fragment),qt=Ge(),xt(fr.$$.fragment),Nr=Ge(),ba=ie("h2"),hr=ie("a"),Gs=ie("span"),rl=pe("Min-Cost Flow"),Ai=Ge(),Jn=ie("p"),nl=pe("To be continued."),Mi=Ge(),Ir=ie("h2"),qr=ie("a"),Hs=ie("span"),sl=pe("Bipartite Matching"),Si=Ge(),Zn=ie("p"),il=pe("To be continued."),this.h()},l(H){e=ne(H,"H1",{id:!0});var De=se(e);n=ne(De,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Vs=se(n);a=ne(Vs,"SPAN",{class:!0}),se(a).forEach(G),Vs.forEach(G),r=ce(De,"Network Flow"),De.forEach(G),s=He(H),i=ne(H,"P",{});var Js=se(i);p=ce(Js,"Network flow is an interesting but difficult topic in graph theory. Most algorithm have high time complexity."),Js.forEach(G),m=He(H),o=ne(H,"H2",{id:!0});var Wn=se(o);l=ne(Wn,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Zs=se(l);u=ne(Zs,"SPAN",{class:!0}),se(u).forEach(G),Zs.forEach(G),c=ce(Wn,"Definition"),Wn.forEach(G),f=He(H),bt(v.$$.fragment,H),h=He(H),bt(w.$$.fragment,H),d=He(H),bt(N.$$.fragment,H),g=He(H),bt(x.$$.fragment,H),b=He(H),y=ne(H,"H2",{id:!0});var Yn=se(y);D=ne(Yn,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Ws=se(D);A=ne(Ws,"SPAN",{class:!0}),se(A).forEach(G),Ws.forEach(G),E=ce(Yn,"Model Reduction"),Yn.forEach(G),M=He(H),S=ne(H,"P",{});var Ys=se(S);C=ce(Ys,"For non-simple digraphs, we can merge parallel edges into a single edge with the sum of the capacities and remove self-loops."),Ys.forEach(G),B=He(H),O=ne(H,"P",{});var ua=se(O);P=ce(ua,"For non-anti-symmetric digraphs, we can replace "),$=ne(ua,"SPAN",{class:!0});var Ti=se($);Ti.forEach(G),I=ce(ua," by "),_=ne(ua,"SPAN",{class:!0});var $i=se(_);$i.forEach(G),K=ce(ua," where "),Y=ne(ua,"SPAN",{class:!0});var Fi=se(Y);Fi.forEach(G),j=ce(ua," is a new vertex, setting the capacity of "),ge=ne(ua,"SPAN",{class:!0});var _i=se(ge);_i.forEach(G),re=ce(ua," to be the same as "),me=ne(ua,"SPAN",{class:!0});var Bi=se(me);Bi.forEach(G),ue=ce(ua,"."),ua.forEach(G),we=He(H),be=ne(H,"P",{});var Ma=se(be);Ae=ce(Ma,"For multiple sources and sinks, we can add a new source "),_e=ne(Ma,"SPAN",{class:!0});var Oi=se(_e);Oi.forEach(G),J=ce(Ma,", called supersource, and sink "),le=ne(Ma,"SPAN",{class:!0});var Pi=se(le);Pi.forEach(G),X=ce(Ma,", called supersink, connecting "),ee=ne(Ma,"SPAN",{class:!0});var zi=se(ee);zi.forEach(G),xe=ce(Ma," to all sources and all sinks to "),R=ne(Ma,"SPAN",{class:!0});var Ri=se(R);Ri.forEach(G),ae=ce(Ma,"."),Ma.forEach(G),he=He(H),fe=ne(H,"H2",{id:!0});var Xn=se(fe);Ne=ne(Xn,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Xs=se(Ne);Te=ne(Xs,"SPAN",{class:!0}),se(Te).forEach(G),Xs.forEach(G),Se=ce(Xn,"Agumenting Path and Max-Flow Min-Cut Theorem"),Xn.forEach(G),Oe=He(H),bt(Me.$$.fragment,H),Qe=He(H),bt(Ye.$$.fragment,H),Re=He(H),bt(ht.$$.fragment,H),F=He(H),bt(Q.$$.fragment,H),ye=He(H),bt(Ce.$$.fragment,H),ke=He(H),bt(Je.$$.fragment,H),Wt=He(H),bt($a.$$.fragment,H),Pn=He(H),bt(er.$$.fragment,H),zn=He(H),bt(tr.$$.fragment,H),Rn=He(H),bt(ar.$$.fragment,H),In=He(H),bt(rr.$$.fragment,H),qn=He(H),bt(nr.$$.fragment,H),Ln=He(H),bt(sr.$$.fragment,H),kn=He(H),ir=ne(H,"H2",{id:!0});var Qn=se(ir);or=ne(Qn,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Qs=se(or);pn=ne(Qs,"SPAN",{class:!0}),se(pn).forEach(G),Qs.forEach(G),Us=ce(Qn,"Ford-Fulkerson Method"),Qn.forEach(G),Un=He(H),bt(lr.$$.fragment,H),Gn=He(H),bt(mr.$$.fragment,H),Hn=He(H),bt(ur.$$.fragment,H),Vn=He(H),bt(pr.$$.fragment,H),cr=He(H),bt(mt.$$.fragment,H),qt=He(H),bt(fr.$$.fragment,H),Nr=He(H),ba=ne(H,"H2",{id:!0});var jn=se(ba);hr=ne(jn,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var zm=se(hr);Gs=ne(zm,"SPAN",{class:!0}),se(Gs).forEach(G),zm.forEach(G),rl=ce(jn,"Min-Cost Flow"),jn.forEach(G),Ai=He(H),Jn=ne(H,"P",{});var Rm=se(Jn);nl=ce(Rm,"To be continued."),Rm.forEach(G),Mi=He(H),Ir=ne(H,"H2",{id:!0});var ol=se(Ir);qr=ne(ol,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Im=se(qr);Hs=ne(Im,"SPAN",{class:!0}),se(Hs).forEach(G),Im.forEach(G),sl=ce(ol,"Bipartite Matching"),ol.forEach(G),Si=He(H),Zn=ne(H,"P",{});var qm=se(Zn);il=ce(qm,"To be continued."),qm.forEach(G),this.h()},h(){ve(a,"class","icon icon-link"),ve(n,"aria-hidden","true"),ve(n,"tabindex","-1"),ve(n,"href","#network-flow"),ve(e,"id","network-flow"),ve(u,"class","icon icon-link"),ve(l,"aria-hidden","true"),ve(l,"tabindex","-1"),ve(l,"href","#definition"),ve(o,"id","definition"),ve(A,"class","icon icon-link"),ve(D,"aria-hidden","true"),ve(D,"tabindex","-1"),ve(D,"href","#model-reduction"),ve(y,"id","model-reduction"),ve($,"class","math math-inline"),ve(_,"class","math math-inline"),ve(Y,"class","math math-inline"),ve(ge,"class","math math-inline"),ve(me,"class","math math-inline"),ve(_e,"class","math math-inline"),ve(le,"class","math math-inline"),ve(ee,"class","math math-inline"),ve(R,"class","math math-inline"),ve(Te,"class","icon icon-link"),ve(Ne,"aria-hidden","true"),ve(Ne,"tabindex","-1"),ve(Ne,"href","#agumenting-path-and-max-flow-min-cut-theorem"),ve(fe,"id","agumenting-path-and-max-flow-min-cut-theorem"),ve(pn,"class","icon icon-link"),ve(or,"aria-hidden","true"),ve(or,"tabindex","-1"),ve(or,"href","#ford-fulkerson-method"),ve(ir,"id","ford-fulkerson-method"),ve(Gs,"class","icon icon-link"),ve(hr,"aria-hidden","true"),ve(hr,"tabindex","-1"),ve(hr,"href","#min-cost-flow"),ve(ba,"id","min-cost-flow"),ve(Hs,"class","icon icon-link"),ve(qr,"aria-hidden","true"),ve(qr,"tabindex","-1"),ve(qr,"href","#bipartite-matching"),ve(Ir,"id","bipartite-matching")},m(H,De){Fe(H,e,De),k(e,n),k(n,a),k(e,r),Fe(H,s,De),Fe(H,i,De),k(i,p),Fe(H,m,De),Fe(H,o,De),k(o,l),k(l,u),k(o,c),Fe(H,f,De),Nt(v,H,De),Fe(H,h,De),Nt(w,H,De),Fe(H,d,De),Nt(N,H,De),Fe(H,g,De),Nt(x,H,De),Fe(H,b,De),Fe(H,y,De),k(y,D),k(D,A),k(y,E),Fe(H,M,De),Fe(H,S,De),k(S,C),Fe(H,B,De),Fe(H,O,De),k(O,P),k(O,$),$.innerHTML=T,k(O,I),k(O,_),_.innerHTML=W,k(O,K),k(O,Y),Y.innerHTML=z,k(O,j),k(O,ge),ge.innerHTML=te,k(O,re),k(O,me),me.innerHTML=oe,k(O,ue),Fe(H,we,De),Fe(H,be,De),k(be,Ae),k(be,_e),_e.innerHTML=L,k(be,J),k(be,le),le.innerHTML=V,k(be,X),k(be,ee),ee.innerHTML=de,k(be,xe),k(be,R),R.innerHTML=U,k(be,ae),Fe(H,he,De),Fe(H,fe,De),k(fe,Ne),k(Ne,Te),k(fe,Se),Fe(H,Oe,De),Nt(Me,H,De),Fe(H,Qe,De),Nt(Ye,H,De),Fe(H,Re,De),Nt(ht,H,De),Fe(H,F,De),Nt(Q,H,De),Fe(H,ye,De),Nt(Ce,H,De),Fe(H,ke,De),Nt(Je,H,De),Fe(H,Wt,De),Nt($a,H,De),Fe(H,Pn,De),Nt(er,H,De),Fe(H,zn,De),Nt(tr,H,De),Fe(H,Rn,De),Nt(ar,H,De),Fe(H,In,De),Nt(rr,H,De),Fe(H,qn,De),Nt(nr,H,De),Fe(H,Ln,De),Nt(sr,H,De),Fe(H,kn,De),Fe(H,ir,De),k(ir,or),k(or,pn),k(ir,Us),Fe(H,Un,De),Nt(lr,H,De),Fe(H,Gn,De),Nt(mr,H,De),Fe(H,Hn,De),Nt(ur,H,De),Fe(H,Vn,De),Nt(pr,H,De),Fe(H,cr,De),Nt(mt,H,De),Fe(H,qt,De),Nt(fr,H,De),Fe(H,Nr,De),Fe(H,ba,De),k(ba,hr),k(hr,Gs),k(ba,rl),Fe(H,Ai,De),Fe(H,Jn,De),k(Jn,nl),Fe(H,Mi,De),Fe(H,Ir,De),k(Ir,qr),k(qr,Hs),k(Ir,sl),Fe(H,Si,De),Fe(H,Zn,De),k(Zn,il),Ci=!0},p(H,De){const Vs={};De&2&&(Vs.$$scope={dirty:De,ctx:H}),v.$set(Vs);const Js={};De&2&&(Js.$$scope={dirty:De,ctx:H}),w.$set(Js);const Wn={};De&2&&(Wn.$$scope={dirty:De,ctx:H}),N.$set(Wn);const Zs={};De&2&&(Zs.$$scope={dirty:De,ctx:H}),x.$set(Zs);const Yn={};De&2&&(Yn.$$scope={dirty:De,ctx:H}),Me.$set(Yn);const Ws={};De&2&&(Ws.$$scope={dirty:De,ctx:H}),Ye.$set(Ws);const Ys={};De&2&&(Ys.$$scope={dirty:De,ctx:H}),ht.$set(Ys);const ua={};De&2&&(ua.$$scope={dirty:De,ctx:H}),Q.$set(ua);const Ti={};De&2&&(Ti.$$scope={dirty:De,ctx:H}),Ce.$set(Ti);const $i={};De&2&&($i.$$scope={dirty:De,ctx:H}),Je.$set($i);const Fi={};De&2&&(Fi.$$scope={dirty:De,ctx:H}),$a.$set(Fi);const _i={};De&2&&(_i.$$scope={dirty:De,ctx:H}),er.$set(_i);const Bi={};De&2&&(Bi.$$scope={dirty:De,ctx:H}),tr.$set(Bi);const Ma={};De&2&&(Ma.$$scope={dirty:De,ctx:H}),ar.$set(Ma);const Oi={};De&2&&(Oi.$$scope={dirty:De,ctx:H}),rr.$set(Oi);const Pi={};De&2&&(Pi.$$scope={dirty:De,ctx:H}),nr.$set(Pi);const zi={};De&2&&(zi.$$scope={dirty:De,ctx:H}),sr.$set(zi);const Ri={};De&2&&(Ri.$$scope={dirty:De,ctx:H}),lr.$set(Ri);const Xn={};De&2&&(Xn.$$scope={dirty:De,ctx:H}),mr.$set(Xn);const Xs={};De&2&&(Xs.$$scope={dirty:De,ctx:H}),ur.$set(Xs);const Qn={};De&2&&(Qn.$$scope={dirty:De,ctx:H}),pr.$set(Qn);const Qs={};De&2&&(Qs.$$scope={dirty:De,ctx:H}),mt.$set(Qs);const jn={};De&2&&(jn.$$scope={dirty:De,ctx:H}),fr.$set(jn)},i(H){Ci||(dt(v.$$.fragment,H),dt(w.$$.fragment,H),dt(N.$$.fragment,H),dt(x.$$.fragment,H),dt(Me.$$.fragment,H),dt(Ye.$$.fragment,H),dt(ht.$$.fragment,H),dt(Q.$$.fragment,H),dt(Ce.$$.fragment,H),dt(Je.$$.fragment,H),dt($a.$$.fragment,H),dt(er.$$.fragment,H),dt(tr.$$.fragment,H),dt(ar.$$.fragment,H),dt(rr.$$.fragment,H),dt(nr.$$.fragment,H),dt(sr.$$.fragment,H),dt(lr.$$.fragment,H),dt(mr.$$.fragment,H),dt(ur.$$.fragment,H),dt(pr.$$.fragment,H),dt(mt.$$.fragment,H),dt(fr.$$.fragment,H),Ci=!0)},o(H){yt(v.$$.fragment,H),yt(w.$$.fragment,H),yt(N.$$.fragment,H),yt(x.$$.fragment,H),yt(Me.$$.fragment,H),yt(Ye.$$.fragment,H),yt(ht.$$.fragment,H),yt(Q.$$.fragment,H),yt(Ce.$$.fragment,H),yt(Je.$$.fragment,H),yt($a.$$.fragment,H),yt(er.$$.fragment,H),yt(tr.$$.fragment,H),yt(ar.$$.fragment,H),yt(rr.$$.fragment,H),yt(nr.$$.fragment,H),yt(sr.$$.fragment,H),yt(lr.$$.fragment,H),yt(mr.$$.fragment,H),yt(ur.$$.fragment,H),yt(pr.$$.fragment,H),yt(mt.$$.fragment,H),yt(fr.$$.fragment,H),Ci=!1},d(H){H&&G(e),H&&G(s),H&&G(i),H&&G(m),H&&G(o),H&&G(f),Et(v,H),H&&G(h),Et(w,H),H&&G(d),Et(N,H),H&&G(g),Et(x,H),H&&G(b),H&&G(y),H&&G(M),H&&G(S),H&&G(B),H&&G(O),H&&G(we),H&&G(be),H&&G(he),H&&G(fe),H&&G(Oe),Et(Me,H),H&&G(Qe),Et(Ye,H),H&&G(Re),Et(ht,H),H&&G(F),Et(Q,H),H&&G(ye),Et(Ce,H),H&&G(ke),Et(Je,H),H&&G(Wt),Et($a,H),H&&G(Pn),Et(er,H),H&&G(zn),Et(tr,H),H&&G(Rn),Et(ar,H),H&&G(In),Et(rr,H),H&&G(qn),Et(nr,H),H&&G(Ln),Et(sr,H),H&&G(kn),H&&G(ir),H&&G(Un),Et(lr,H),H&&G(Gn),Et(mr,H),H&&G(Hn),Et(ur,H),H&&G(Vn),Et(pr,H),H&&G(cr),Et(mt,H),H&&G(qt),Et(fr,H),H&&G(Nr),H&&G(ba),H&&G(Ai),H&&G(Jn),H&&G(Mi),H&&G(Ir),H&&G(Si),H&&G(Zn)}}}function cO(t){let e,n;const a=[t[0],Ah];let r={$$slots:{default:[pO]},$$scope:{ctx:t}};for(let s=0;s{n(0,e=xl(xl({},e),Um(a)))},e=Um(e),[e]}class xO extends Mh{constructor(e){super(),Sh(this,e,fO,cO,Ch,{})}}export{xO as component}; diff --git a/docs/_app/immutable/nodes/11.0eac5311.js b/docs/_app/immutable/nodes/11.0eac5311.js deleted file mode 100644 index d70cc55..0000000 --- a/docs/_app/immutable/nodes/11.0eac5311.js +++ /dev/null @@ -1,146 +0,0 @@ -import{S as rt,i as ot,s as ht,O as Tn,y as gt,z as yt,A as dt,P as vt,Q as Qn,g as ut,d as ft,B as wt,R as Jn,k as t,q as c,a as o,l as m,m as l,h as a,r,c as h,n as i,b as e,E as n,G as xt}from"../chunks/index.488f1ee5.js";import{L as bt}from"../chunks/layout.c8702512.js";function zt(U){let g,u,b,V,y,v,z,Vs,La,Gs,X,Ta,Fs,$,Un='f(x)=limh0f(x+h)f(x)hf'(x) = \\lim_{h \\to 0} \\frac{f(x+h) - f(x)}{h}',Ws,L,Pa,Y,Xn='ff',Ha,js,q,Yn='f(x+h)=f(x)+hf(x)+h22f(ξ)f(x+h) = f(x) + hf'(x) + {h^2 \\over 2} f''(\\xi)',Rs,w,Sa,Z,Zn='ξ\\xi',Aa,ss,sp='xx',Na,as,ap='x+hx + h',Ia,Qs,ns,Da,Js,C,np='f(x)=f(x+h)f(x)hh2f(ξ)f(x+h)f(x)hf'(x) = \\frac{f(x+h) - f(x)}{h} - {h \\over 2} f''(\\xi) \\approx \\frac{f(x+h) - f(x)}{h}',Ks,T,Ba,ps,pp='h2f(ξ)-{h \\over 2} f''(\\xi)',Oa,Us,ts,E,Va,ms,tp='O(hk)O(h^k)',$a,ls,mp='kk',qa,Xs,G,lp=`f(x+h)=f(x)+hf(x)+h22f(x)+h36f(ξ1)f(xh)=f(x)hf(x)+h22f(x)h36f(ξ2)f(x + h) = f(x) + hf'(x) + {h^2 \\over 2}f''(x) + {h^3 \\over 6}f'''(\\xi_1)\\\\ -f(x - h) = f(x) - hf'(x) + {h^2 \\over 2}f''(x) - {h^3 \\over 6}f'''(\\xi_2)`,Ys,d,Ca,es,ep='ξ1\\xi_1',Ga,is,ip='xx',Fa,cs,cp='x+hx + h',Wa,rs,rp='ξ2\\xi_2',ja,os,op='xhx - h',Ra,hs,hp='xx',Qa,Zs,gs,Ja,sa,F,gp='f(x)=f(x+h)f(xh)2hh212f(ξ1)h212f(ξ2)f(x+h)f(xh)2hf'(x) = \\frac{f(x+h) - f(x - h)}{2h} - {h^2 \\over 12} f'''(\\xi_1) - {h^2 \\over 12} f'''(\\xi_2) \\approx \\frac{f(x+h) - f(x - h)}{2h}',aa,ys,Ka,na,W,yp='f(x)=f(x+h)f(xh)2hh26f(ξ)f(x+h)f(xh)2hf'(x) = \\frac{f(x+h) - f(x - h)}{2h} - {h^2 \\over 6} f'''(\\xi) \\approx \\frac{f(x+h) - f(x - h)}{2h}',pa,x,Ua,ds,dp='f(x)f(x)',Xa,vs,vp='f(x+h)f(x+h)',Ya,us,up='f(x+2h)f(x+2h)',Za,ta,fs,sn,ma,j,fp=`f(x+2h)=f(x)+2hf(x)+2h2f(x)+4h33f(ξ1)f(x+h)=f(x)+hf(x)+h22f(x)+h36f(ξ2)\\begin{gather} -f(x + 2h) = f(x) + 2hf'(x) + 2h^2 f''(x) + {4h^3 \\over 3} f'''(\\xi_1)\\\\ -f(x + h) = f(x) + hf'(x) + {h^2 \\over 2} f''(x) + {h^3 \\over 6} f'''(\\xi_2) -\\end{gather}`,la,k,an,ws,wp='f(x)f''(x)',nn,xs,xp='44',pn,ea,R,bp=`f(x+2h)4f(x+h)=3f(x)2hf(x)+2h33f(ξ1)2h33f(ξ2)f(x)=3f(x)+4f(x+h)f(x+2h)2h+h23f(ξ1)h23f(ξ2)3f(x)+4f(x+h)f(x+2h)2hf(x + 2h) - 4 f(x + h) = -3 f(x) - 2h f'(x) + {2h^3 \\over 3} f'''(\\xi_1) - {2h^3 \\over 3} f'''(\\xi_2)\\\\ -f'(x) = \\frac{- 3 f(x) + 4 f(x + h) - f(x + 2h) }{2h} + {h^2 \\over 3} f'''(\\xi_1) - {h^2 \\over 3} f'''(\\xi_2) \\approx \\frac{- 3 f(x) + 4 f(x + h) - f(x + 2h)}{2h}`,ia,_,tn,bs,zp='O(h2)O(h^2)',mn,zs,kp='f(x2h)f(x - 2h)',ln,ca,ks,Q,en,_s,_p='hh',cn,ra,P,H,$s,rn,oa,S,A,qs,on,ha,Ms,hn,ga,Es,gn,ya,M,yn,Ls,Mp='f(x)f(x)',dn,Ts,Ep='xx',vn,da,N,un,Ps,Lp='xn=x+nhx_n = x + nh',fn,va,J,Tp=`(f(x1)f(x2)f(x3)f(x4)f(xn))12h(3410012100012100012000003)(f(x1)f(x2)f(x3)f(x4)f(xn))\\begin{pmatrix} -f'(x_1)\\\\ -f'(x_2)\\\\ -f'(x_3)\\\\ -f'(x_4)\\\\ -\\vdots\\\\ -f'(x_n) -\\end{pmatrix} -\\approx -\\dfrac{1}{2h} -\\begin{pmatrix} --3 & 4 & -1 & 0 & \\cdots & 0\\\\ -1 & -2 & 1 & 0 & \\cdots & 0\\\\ -0 & 1 & -2 & 1 & \\cdots & 0\\\\ -0 & 0 & 1 & -2 & \\cdots & 0\\\\ -\\vdots & \\vdots & \\vdots & \\vdots & \\ddots & \\vdots\\\\ -0 & 0 & 0 & 0 & \\cdots & -3 -\\end{pmatrix} -\\begin{pmatrix} -f(x_1)\\\\ -f(x_2)\\\\ -f(x_3)\\\\ -f(x_4)\\\\ -\\vdots\\\\ -f(x_n) -\\end{pmatrix}`,ua,Hs,wn,fa,K,Pp=`(f(k)(x1)f(k)(x2)f(k)(x3)f(k)(x4)f(k)(xn))(12h)k(3410012100012100012000003)k(f(x1)f(x2)f(x3)f(x4)f(xn))\\begin{pmatrix} -f^{(k)}(x_1)\\\\ -f^{(k)}(x_2)\\\\ -f^{(k)}(x_3)\\\\ -f^{(k)}(x_4)\\\\ -\\vdots\\\\ -f^{(k)}(x_n) -\\end{pmatrix} -\\approx -(\\dfrac{1}{2h})^k -\\begin{pmatrix} --3 & 4 & -1 & 0 & \\cdots & 0\\\\ -1 & -2 & 1 & 0 & \\cdots & 0\\\\ -0 & 1 & -2 & 1 & \\cdots & 0\\\\ -0 & 0 & 1 & -2 & \\cdots & 0\\\\ -\\vdots & \\vdots & \\vdots & \\vdots & \\ddots & \\vdots\\\\ -0 & 0 & 0 & 0 & \\cdots & -3 -\\end{pmatrix}^k -\\begin{pmatrix} -f(x_1)\\\\ -f(x_2)\\\\ -f(x_3)\\\\ -f(x_4)\\\\ -\\vdots\\\\ -f(x_n) -\\end{pmatrix}`,wa,I,D,Cs,xn,xa,Ss,bn,ba,As,zn,za,Ns,kn;return{c(){g=t("h1"),u=t("a"),b=t("span"),V=c("Numeric Differentiation"),y=o(),v=t("h2"),z=t("a"),Vs=t("span"),La=c("Finite Difference"),Gs=o(),X=t("p"),Ta=c("By defination of differentiation, we have"),Fs=o(),$=t("div"),Ws=o(),L=t("p"),Pa=c("By Taylor’s Theorem, if "),Y=t("span"),Ha=c(" is twice differentiable, we have"),js=o(),q=t("div"),Rs=o(),w=t("p"),Sa=c("where "),Z=t("span"),Aa=c(" is a real number between "),ss=t("span"),Na=c(" and "),as=t("span"),Ia=c("."),Qs=o(),ns=t("p"),Da=c("Then we have"),Js=o(),C=t("div"),Ks=o(),T=t("p"),Ba=c("In this case "),ps=t("span"),Oa=c(" become error."),Us=o(),ts=t("p"),E=t("strong"),Va=c("Generally, if error is "),ms=t("span"),$a=c(", we say the method is of order "),ls=t("span"),qa=c("."),Xs=o(),G=t("div"),Ys=o(),d=t("p"),Ca=c("where "),es=t("span"),Ga=c(" is a real number between "),is=t("span"),Fa=c(" and "),cs=t("span"),Wa=c(", and "),rs=t("span"),ja=c(" is a real number between "),os=t("span"),Ra=c(" and "),hs=t("span"),Qa=c("."),Zs=o(),gs=t("p"),Ja=c("Then we have"),sa=o(),F=t("div"),aa=o(),ys=t("p"),Ka=c("So we obtain a method of order 2. And obviously this can be written as"),na=o(),W=t("div"),pa=o(),x=t("p"),Ua=c("However, we wonder if we can get the derivative from "),ds=t("span"),Xa=c(", "),vs=t("span"),Ya=c(" and "),us=t("span"),Za=c("."),ta=o(),fs=t("p"),sn=c("Consider"),ma=o(),j=t("div"),la=o(),k=t("p"),an=c("We want to remove "),ws=t("span"),nn=c(" so we subtract "),xs=t("span"),pn=c(" times the second equation from the first one and get"),ea=o(),R=t("div"),ia=o(),_=t("p"),tn=c("The error is "),bs=t("span"),mn=c(". The "),zs=t("span"),ln=c(" case is symmetric, so we just skip it."),ca=o(),ks=t("p"),Q=t("strong"),en=c("Notice that since "),_s=t("span"),cn=c(" is used as denominator, we can’t make it too small."),ra=o(),P=t("h2"),H=t("a"),$s=t("span"),rn=c("Higher Order Derivatives"),oa=o(),S=t("h3"),A=t("a"),qs=t("span"),on=c("Differentiation Matrix"),ha=o(),Ms=t("p"),hn=c("While it’s possible to get higher order derivatives by Taylor’s Theorem, it’s often hard."),ga=o(),Es=t("p"),gn=c("So we apply first order derivative many times."),ya=o(),M=t("p"),yn=c("Notice that in the previous section, the first order derivative is a linear combination of "),Ls=t("span"),dn=c(" near "),Ts=t("span"),vn=c("."),da=o(),N=t("p"),un=c("The operation can be written as a matrix multiplication. Let "),Ps=t("span"),fn=c(", then we have"),va=o(),J=t("div"),ua=o(),Hs=t("p"),wn=c("So we can have a general formula"),fa=o(),K=t("div"),wa=o(),I=t("h3"),D=t("a"),Cs=t("span"),xn=c("Interpolation and Differentiation"),xa=o(),Ss=t("p"),bn=c("It’s a good idea to interpolate the function first, then differentiate the interpolation."),ba=o(),As=t("p"),zn=c("Typically, we can use Cubic Spline Interpolation for derivative less than 3, since it’s first and second order derivative converge to the original function."),za=o(),Ns=t("p"),kn=c("For higher order derivative, we can use Chebyshev Polynomial Interpolation or Lagrange Polynomial Interpolation. They are polynomials and easy to differentiate."),this.h()},l(s){g=m(s,"H1",{id:!0});var p=l(g);u=m(p,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Pn=l(u);b=m(Pn,"SPAN",{class:!0}),l(b).forEach(a),Pn.forEach(a),V=r(p,"Numeric Differentiation"),p.forEach(a),y=h(s),v=m(s,"H2",{id:!0});var _n=l(v);z=m(_n,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Hn=l(z);Vs=m(Hn,"SPAN",{class:!0}),l(Vs).forEach(a),Hn.forEach(a),La=r(_n,"Finite Difference"),_n.forEach(a),Gs=h(s),X=m(s,"P",{});var Sn=l(X);Ta=r(Sn,"By defination of differentiation, we have"),Sn.forEach(a),Fs=h(s),$=m(s,"DIV",{class:!0});var Hp=l($);Hp.forEach(a),Ws=h(s),L=m(s,"P",{});var ka=l(L);Pa=r(ka,"By Taylor’s Theorem, if "),Y=m(ka,"SPAN",{class:!0});var Sp=l(Y);Sp.forEach(a),Ha=r(ka," is twice differentiable, we have"),ka.forEach(a),js=h(s),q=m(s,"DIV",{class:!0});var Ap=l(q);Ap.forEach(a),Rs=h(s),w=m(s,"P",{});var B=l(w);Sa=r(B,"where "),Z=m(B,"SPAN",{class:!0});var Np=l(Z);Np.forEach(a),Aa=r(B," is a real number between "),ss=m(B,"SPAN",{class:!0});var Ip=l(ss);Ip.forEach(a),Na=r(B," and "),as=m(B,"SPAN",{class:!0});var Dp=l(as);Dp.forEach(a),Ia=r(B,"."),B.forEach(a),Qs=h(s),ns=m(s,"P",{});var An=l(ns);Da=r(An,"Then we have"),An.forEach(a),Js=h(s),C=m(s,"DIV",{class:!0});var Bp=l(C);Bp.forEach(a),Ks=h(s),T=m(s,"P",{});var _a=l(T);Ba=r(_a,"In this case "),ps=m(_a,"SPAN",{class:!0});var Op=l(ps);Op.forEach(a),Oa=r(_a," become error."),_a.forEach(a),Us=h(s),ts=m(s,"P",{});var Nn=l(ts);E=m(Nn,"STRONG",{});var Is=l(E);Va=r(Is,"Generally, if error is "),ms=m(Is,"SPAN",{class:!0});var Vp=l(ms);Vp.forEach(a),$a=r(Is,", we say the method is of order "),ls=m(Is,"SPAN",{class:!0});var $p=l(ls);$p.forEach(a),qa=r(Is,"."),Is.forEach(a),Nn.forEach(a),Xs=h(s),G=m(s,"DIV",{class:!0});var qp=l(G);qp.forEach(a),Ys=h(s),d=m(s,"P",{});var f=l(d);Ca=r(f,"where "),es=m(f,"SPAN",{class:!0});var Cp=l(es);Cp.forEach(a),Ga=r(f," is a real number between "),is=m(f,"SPAN",{class:!0});var Gp=l(is);Gp.forEach(a),Fa=r(f," and "),cs=m(f,"SPAN",{class:!0});var Fp=l(cs);Fp.forEach(a),Wa=r(f,", and "),rs=m(f,"SPAN",{class:!0});var Wp=l(rs);Wp.forEach(a),ja=r(f," is a real number between "),os=m(f,"SPAN",{class:!0});var jp=l(os);jp.forEach(a),Ra=r(f," and "),hs=m(f,"SPAN",{class:!0});var Rp=l(hs);Rp.forEach(a),Qa=r(f,"."),f.forEach(a),Zs=h(s),gs=m(s,"P",{});var In=l(gs);Ja=r(In,"Then we have"),In.forEach(a),sa=h(s),F=m(s,"DIV",{class:!0});var Qp=l(F);Qp.forEach(a),aa=h(s),ys=m(s,"P",{});var Dn=l(ys);Ka=r(Dn,"So we obtain a method of order 2. And obviously this can be written as"),Dn.forEach(a),na=h(s),W=m(s,"DIV",{class:!0});var Jp=l(W);Jp.forEach(a),pa=h(s),x=m(s,"P",{});var O=l(x);Ua=r(O,"However, we wonder if we can get the derivative from "),ds=m(O,"SPAN",{class:!0});var Kp=l(ds);Kp.forEach(a),Xa=r(O,", "),vs=m(O,"SPAN",{class:!0});var Up=l(vs);Up.forEach(a),Ya=r(O," and "),us=m(O,"SPAN",{class:!0});var Xp=l(us);Xp.forEach(a),Za=r(O,"."),O.forEach(a),ta=h(s),fs=m(s,"P",{});var Bn=l(fs);sn=r(Bn,"Consider"),Bn.forEach(a),ma=h(s),j=m(s,"DIV",{class:!0});var Yp=l(j);Yp.forEach(a),la=h(s),k=m(s,"P",{});var Ds=l(k);an=r(Ds,"We want to remove "),ws=m(Ds,"SPAN",{class:!0});var Zp=l(ws);Zp.forEach(a),nn=r(Ds," so we subtract "),xs=m(Ds,"SPAN",{class:!0});var st=l(xs);st.forEach(a),pn=r(Ds," times the second equation from the first one and get"),Ds.forEach(a),ea=h(s),R=m(s,"DIV",{class:!0});var at=l(R);at.forEach(a),ia=h(s),_=m(s,"P",{});var Bs=l(_);tn=r(Bs,"The error is "),bs=m(Bs,"SPAN",{class:!0});var nt=l(bs);nt.forEach(a),mn=r(Bs,". The "),zs=m(Bs,"SPAN",{class:!0});var pt=l(zs);pt.forEach(a),ln=r(Bs," case is symmetric, so we just skip it."),Bs.forEach(a),ca=h(s),ks=m(s,"P",{});var On=l(ks);Q=m(On,"STRONG",{});var Ma=l(Q);en=r(Ma,"Notice that since "),_s=m(Ma,"SPAN",{class:!0});var tt=l(_s);tt.forEach(a),cn=r(Ma," is used as denominator, we can’t make it too small."),Ma.forEach(a),On.forEach(a),ra=h(s),P=m(s,"H2",{id:!0});var Mn=l(P);H=m(Mn,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Vn=l(H);$s=m(Vn,"SPAN",{class:!0}),l($s).forEach(a),Vn.forEach(a),rn=r(Mn,"Higher Order Derivatives"),Mn.forEach(a),oa=h(s),S=m(s,"H3",{id:!0});var En=l(S);A=m(En,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var $n=l(A);qs=m($n,"SPAN",{class:!0}),l(qs).forEach(a),$n.forEach(a),on=r(En,"Differentiation Matrix"),En.forEach(a),ha=h(s),Ms=m(s,"P",{});var qn=l(Ms);hn=r(qn,"While it’s possible to get higher order derivatives by Taylor’s Theorem, it’s often hard."),qn.forEach(a),ga=h(s),Es=m(s,"P",{});var Cn=l(Es);gn=r(Cn,"So we apply first order derivative many times."),Cn.forEach(a),ya=h(s),M=m(s,"P",{});var Os=l(M);yn=r(Os,"Notice that in the previous section, the first order derivative is a linear combination of "),Ls=m(Os,"SPAN",{class:!0});var mt=l(Ls);mt.forEach(a),dn=r(Os," near "),Ts=m(Os,"SPAN",{class:!0});var lt=l(Ts);lt.forEach(a),vn=r(Os,"."),Os.forEach(a),da=h(s),N=m(s,"P",{});var Ea=l(N);un=r(Ea,"The operation can be written as a matrix multiplication. Let "),Ps=m(Ea,"SPAN",{class:!0});var et=l(Ps);et.forEach(a),fn=r(Ea,", then we have"),Ea.forEach(a),va=h(s),J=m(s,"DIV",{class:!0});var it=l(J);it.forEach(a),ua=h(s),Hs=m(s,"P",{});var Gn=l(Hs);wn=r(Gn,"So we can have a general formula"),Gn.forEach(a),fa=h(s),K=m(s,"DIV",{class:!0});var ct=l(K);ct.forEach(a),wa=h(s),I=m(s,"H3",{id:!0});var Ln=l(I);D=m(Ln,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Fn=l(D);Cs=m(Fn,"SPAN",{class:!0}),l(Cs).forEach(a),Fn.forEach(a),xn=r(Ln,"Interpolation and Differentiation"),Ln.forEach(a),xa=h(s),Ss=m(s,"P",{});var Wn=l(Ss);bn=r(Wn,"It’s a good idea to interpolate the function first, then differentiate the interpolation."),Wn.forEach(a),ba=h(s),As=m(s,"P",{});var jn=l(As);zn=r(jn,"Typically, we can use Cubic Spline Interpolation for derivative less than 3, since it’s first and second order derivative converge to the original function."),jn.forEach(a),za=h(s),Ns=m(s,"P",{});var Rn=l(Ns);kn=r(Rn,"For higher order derivative, we can use Chebyshev Polynomial Interpolation or Lagrange Polynomial Interpolation. They are polynomials and easy to differentiate."),Rn.forEach(a),this.h()},h(){i(b,"class","icon icon-link"),i(u,"aria-hidden","true"),i(u,"tabindex","-1"),i(u,"href","#numeric-differentiation"),i(g,"id","numeric-differentiation"),i(Vs,"class","icon icon-link"),i(z,"aria-hidden","true"),i(z,"tabindex","-1"),i(z,"href","#finite-difference"),i(v,"id","finite-difference"),i($,"class","math math-display"),i(Y,"class","math math-inline"),i(q,"class","math math-display"),i(Z,"class","math math-inline"),i(ss,"class","math math-inline"),i(as,"class","math math-inline"),i(C,"class","math math-display"),i(ps,"class","math math-inline"),i(ms,"class","math math-inline"),i(ls,"class","math math-inline"),i(G,"class","math math-display"),i(es,"class","math math-inline"),i(is,"class","math math-inline"),i(cs,"class","math math-inline"),i(rs,"class","math math-inline"),i(os,"class","math math-inline"),i(hs,"class","math math-inline"),i(F,"class","math math-display"),i(W,"class","math math-display"),i(ds,"class","math math-inline"),i(vs,"class","math math-inline"),i(us,"class","math math-inline"),i(j,"class","math math-display"),i(ws,"class","math math-inline"),i(xs,"class","math math-inline"),i(R,"class","math math-display"),i(bs,"class","math math-inline"),i(zs,"class","math math-inline"),i(_s,"class","math math-inline"),i($s,"class","icon icon-link"),i(H,"aria-hidden","true"),i(H,"tabindex","-1"),i(H,"href","#higher-order-derivatives"),i(P,"id","higher-order-derivatives"),i(qs,"class","icon icon-link"),i(A,"aria-hidden","true"),i(A,"tabindex","-1"),i(A,"href","#differentiation-matrix"),i(S,"id","differentiation-matrix"),i(Ls,"class","math math-inline"),i(Ts,"class","math math-inline"),i(Ps,"class","math math-inline"),i(J,"class","math math-display"),i(K,"class","math math-display"),i(Cs,"class","icon icon-link"),i(D,"aria-hidden","true"),i(D,"tabindex","-1"),i(D,"href","#interpolation-and-differentiation"),i(I,"id","interpolation-and-differentiation")},m(s,p){e(s,g,p),n(g,u),n(u,b),n(g,V),e(s,y,p),e(s,v,p),n(v,z),n(z,Vs),n(v,La),e(s,Gs,p),e(s,X,p),n(X,Ta),e(s,Fs,p),e(s,$,p),$.innerHTML=Un,e(s,Ws,p),e(s,L,p),n(L,Pa),n(L,Y),Y.innerHTML=Xn,n(L,Ha),e(s,js,p),e(s,q,p),q.innerHTML=Yn,e(s,Rs,p),e(s,w,p),n(w,Sa),n(w,Z),Z.innerHTML=Zn,n(w,Aa),n(w,ss),ss.innerHTML=sp,n(w,Na),n(w,as),as.innerHTML=ap,n(w,Ia),e(s,Qs,p),e(s,ns,p),n(ns,Da),e(s,Js,p),e(s,C,p),C.innerHTML=np,e(s,Ks,p),e(s,T,p),n(T,Ba),n(T,ps),ps.innerHTML=pp,n(T,Oa),e(s,Us,p),e(s,ts,p),n(ts,E),n(E,Va),n(E,ms),ms.innerHTML=tp,n(E,$a),n(E,ls),ls.innerHTML=mp,n(E,qa),e(s,Xs,p),e(s,G,p),G.innerHTML=lp,e(s,Ys,p),e(s,d,p),n(d,Ca),n(d,es),es.innerHTML=ep,n(d,Ga),n(d,is),is.innerHTML=ip,n(d,Fa),n(d,cs),cs.innerHTML=cp,n(d,Wa),n(d,rs),rs.innerHTML=rp,n(d,ja),n(d,os),os.innerHTML=op,n(d,Ra),n(d,hs),hs.innerHTML=hp,n(d,Qa),e(s,Zs,p),e(s,gs,p),n(gs,Ja),e(s,sa,p),e(s,F,p),F.innerHTML=gp,e(s,aa,p),e(s,ys,p),n(ys,Ka),e(s,na,p),e(s,W,p),W.innerHTML=yp,e(s,pa,p),e(s,x,p),n(x,Ua),n(x,ds),ds.innerHTML=dp,n(x,Xa),n(x,vs),vs.innerHTML=vp,n(x,Ya),n(x,us),us.innerHTML=up,n(x,Za),e(s,ta,p),e(s,fs,p),n(fs,sn),e(s,ma,p),e(s,j,p),j.innerHTML=fp,e(s,la,p),e(s,k,p),n(k,an),n(k,ws),ws.innerHTML=wp,n(k,nn),n(k,xs),xs.innerHTML=xp,n(k,pn),e(s,ea,p),e(s,R,p),R.innerHTML=bp,e(s,ia,p),e(s,_,p),n(_,tn),n(_,bs),bs.innerHTML=zp,n(_,mn),n(_,zs),zs.innerHTML=kp,n(_,ln),e(s,ca,p),e(s,ks,p),n(ks,Q),n(Q,en),n(Q,_s),_s.innerHTML=_p,n(Q,cn),e(s,ra,p),e(s,P,p),n(P,H),n(H,$s),n(P,rn),e(s,oa,p),e(s,S,p),n(S,A),n(A,qs),n(S,on),e(s,ha,p),e(s,Ms,p),n(Ms,hn),e(s,ga,p),e(s,Es,p),n(Es,gn),e(s,ya,p),e(s,M,p),n(M,yn),n(M,Ls),Ls.innerHTML=Mp,n(M,dn),n(M,Ts),Ts.innerHTML=Ep,n(M,vn),e(s,da,p),e(s,N,p),n(N,un),n(N,Ps),Ps.innerHTML=Lp,n(N,fn),e(s,va,p),e(s,J,p),J.innerHTML=Tp,e(s,ua,p),e(s,Hs,p),n(Hs,wn),e(s,fa,p),e(s,K,p),K.innerHTML=Pp,e(s,wa,p),e(s,I,p),n(I,D),n(D,Cs),n(I,xn),e(s,xa,p),e(s,Ss,p),n(Ss,bn),e(s,ba,p),e(s,As,p),n(As,zn),e(s,za,p),e(s,Ns,p),n(Ns,kn)},p:xt,d(s){s&&a(g),s&&a(y),s&&a(v),s&&a(Gs),s&&a(X),s&&a(Fs),s&&a($),s&&a(Ws),s&&a(L),s&&a(js),s&&a(q),s&&a(Rs),s&&a(w),s&&a(Qs),s&&a(ns),s&&a(Js),s&&a(C),s&&a(Ks),s&&a(T),s&&a(Us),s&&a(ts),s&&a(Xs),s&&a(G),s&&a(Ys),s&&a(d),s&&a(Zs),s&&a(gs),s&&a(sa),s&&a(F),s&&a(aa),s&&a(ys),s&&a(na),s&&a(W),s&&a(pa),s&&a(x),s&&a(ta),s&&a(fs),s&&a(ma),s&&a(j),s&&a(la),s&&a(k),s&&a(ea),s&&a(R),s&&a(ia),s&&a(_),s&&a(ca),s&&a(ks),s&&a(ra),s&&a(P),s&&a(oa),s&&a(S),s&&a(ha),s&&a(Ms),s&&a(ga),s&&a(Es),s&&a(ya),s&&a(M),s&&a(da),s&&a(N),s&&a(va),s&&a(J),s&&a(ua),s&&a(Hs),s&&a(fa),s&&a(K),s&&a(wa),s&&a(I),s&&a(xa),s&&a(Ss),s&&a(ba),s&&a(As),s&&a(za),s&&a(Ns)}}}function kt(U){let g,u;const b=[U[0],Kn];let V={$$slots:{default:[zt]},$$scope:{ctx:U}};for(let y=0;y{u(0,g=Tn(Tn({},g),Jn(b)))},g=Jn(g),[g]}class Lt extends rt{constructor(g){super(),ot(this,g,_t,kt,ht,{})}}export{Lt as component}; diff --git a/docs/_app/immutable/nodes/12.62331ccd.js b/docs/_app/immutable/nodes/12.62331ccd.js deleted file mode 100644 index 52bb616..0000000 --- a/docs/_app/immutable/nodes/12.62331ccd.js +++ /dev/null @@ -1,28 +0,0 @@ -import{S as Xl,i as se,s as ae,O as _m,y as js,z as Is,A as qs,P as ne,Q as Bm,g as Cs,d as Ds,B as Qs,R as Zm,k as p,q as r,a as u,l as t,m,h as s,r as c,c as v,n as e,b as l,E as n,G as Os}from"../chunks/index.488f1ee5.js";import{L as pe}from"../chunks/layout.c8702512.js";import{P as Xn}from"../chunks/Proof.26996d3c.js";import{S as yn}from"../chunks/State.8d241e02.js";function te(W){let i,b,d,C='nn',x,g,H='nn',P;return{c(){i=p("p"),b=r("The degree of precision of a numerical integration formula is the largest integer "),d=p("span"),x=r(" such that the formula is exact for all polynomials of degree "),g=p("span"),P=r(" or less."),this.h()},l(f){i=t(f,"P",{});var M=m(i);b=c(M,"The degree of precision of a numerical integration formula is the largest integer "),d=t(M,"SPAN",{class:!0});var A=m(d);A.forEach(s),x=c(M," such that the formula is exact for all polynomials of degree "),g=t(M,"SPAN",{class:!0});var _=m(g);_.forEach(s),P=c(M," or less."),M.forEach(s),this.h()},h(){e(d,"class","math math-inline"),e(g,"class","math math-inline")},m(f,M){l(f,i,M),n(i,b),n(i,d),d.innerHTML=C,n(i,x),n(i,g),g.innerHTML=H,n(i,P)},p:Os,d(f){f&&s(i)}}}function me(W){let i,b,d,C='nn',x,g,H='n1n-1',P;return{c(){i=p("p"),b=r("If we use "),d=p("span"),x=r(" points in Lagrange Interpolation, then the degree of precision is at least "),g=p("span"),P=r("."),this.h()},l(f){i=t(f,"P",{});var M=m(i);b=c(M,"If we use "),d=t(M,"SPAN",{class:!0});var A=m(d);A.forEach(s),x=c(M," points in Lagrange Interpolation, then the degree of precision is at least "),g=t(M,"SPAN",{class:!0});var _=m(g);_.forEach(s),P=c(M,"."),M.forEach(s),this.h()},h(){e(d,"class","math math-inline"),e(g,"class","math math-inline")},m(f,M){l(f,i,M),n(i,b),n(i,d),d.innerHTML=C,n(i,x),n(i,g),g.innerHTML=H,n(i,P)},p:Os,d(f){f&&s(i)}}}function le(W){let i,b,d,C='f(x)f(x)',x,g,H='n1n-1',P,f,M='f(x)f(x)',A,_,I='n1n-1',G;return{c(){i=p("p"),b=r("For any polynomial "),d=p("span"),x=r(" of degree "),g=p("span"),P=r(", Lagrange Interpolation restores "),f=p("span"),A=r(" exactly. So the degree of precision is at least "),_=p("span"),G=r("."),this.h()},l(L){i=t(L,"P",{});var z=m(i);b=c(z,"For any polynomial "),d=t(z,"SPAN",{class:!0});var D=m(d);D.forEach(s),x=c(z," of degree "),g=t(z,"SPAN",{class:!0});var S=m(g);S.forEach(s),P=c(z,", Lagrange Interpolation restores "),f=t(z,"SPAN",{class:!0});var j=m(f);j.forEach(s),A=c(z," exactly. So the degree of precision is at least "),_=t(z,"SPAN",{class:!0});var K=m(_);K.forEach(s),G=c(z,"."),z.forEach(s),this.h()},h(){e(d,"class","math math-inline"),e(g,"class","math math-inline"),e(f,"class","math math-inline"),e(_,"class","math math-inline")},m(L,z){l(L,i,z),n(i,b),n(i,d),d.innerHTML=C,n(i,x),n(i,g),g.innerHTML=H,n(i,P),n(i,f),f.innerHTML=M,n(i,A),n(i,_),_.innerHTML=I,n(i,G)},p:Os,d(L){L&&s(i)}}}function ee(W){let i,b,d,C='nn',x,g,H='nn',P,f,M='nn',A,_,I='n1n-1',G,L,z='nn',D;return{c(){i=p("p"),b=r("If we use "),d=p("span"),x=r(" equally spaced points, then the degree of precision is at least "),g=p("span"),P=r(" when "),f=p("span"),A=r(" is odd, and "),_=p("span"),G=r(" when "),L=p("span"),D=r(" is even."),this.h()},l(S){i=t(S,"P",{});var j=m(i);b=c(j,"If we use "),d=t(j,"SPAN",{class:!0});var K=m(d);K.forEach(s),x=c(j," equally spaced points, then the degree of precision is at least "),g=t(j,"SPAN",{class:!0});var Q=m(g);Q.forEach(s),P=c(j," when "),f=t(j,"SPAN",{class:!0});var X=m(f);X.forEach(s),A=c(j," is odd, and "),_=t(j,"SPAN",{class:!0});var ns=m(_);ns.forEach(s),G=c(j," when "),L=t(j,"SPAN",{class:!0});var V=m(L);V.forEach(s),D=c(j," is even."),j.forEach(s),this.h()},h(){e(d,"class","math math-inline"),e(g,"class","math math-inline"),e(f,"class","math math-inline"),e(_,"class","math math-inline"),e(L,"class","math math-inline")},m(S,j){l(S,i,j),n(i,b),n(i,d),d.innerHTML=C,n(i,x),n(i,g),g.innerHTML=H,n(i,P),n(i,f),f.innerHTML=M,n(i,A),n(i,_),_.innerHTML=I,n(i,G),n(i,L),L.innerHTML=z,n(i,D)},p:Os,d(S){S&&s(i)}}}function ie(W){let i,b,d,C='11',x;return{c(){i=p("p"),b=r("The degree of precision is "),d=p("span"),x=r("."),this.h()},l(g){i=t(g,"P",{});var H=m(i);b=c(H,"The degree of precision is "),d=t(H,"SPAN",{class:!0});var P=m(d);P.forEach(s),x=c(H,"."),H.forEach(s),this.h()},h(){e(d,"class","math math-inline")},m(g,H){l(g,i,H),n(i,b),n(i,d),d.innerHTML=C,n(i,x)},p:Os,d(g){g&&s(i)}}}function re(W){let i,b,d,C='f(x)=1f(x) = 1',x,g,H='abf(x)dx=ba\\int_a^b f(x) dx = b-a',P,f,M,A,_,I='f(x)=xf(x) = x',G,L,z='abf(x)dx=b2a22\\int_a^b f(x) dx = \\dfrac{b^2-a^2}{2}',D,S,j,K,Q,X='f(x)=x2f(x) = x^2',ns,V,ps='abf(x)dx=b3a33\\int_a^b f(x) dx = \\dfrac{b^3-a^3}{3}',ts;return{c(){i=p("p"),b=r("When "),d=p("span"),x=r(", "),g=p("span"),P=r(". The formula is exact."),f=u(),M=p("p"),A=r("When "),_=p("span"),G=r(", "),L=p("span"),D=r(". The formula is exact."),S=u(),j=p("p"),K=r("When "),Q=p("span"),ns=r(", "),V=p("span"),ts=r(". The formula is not exact."),this.h()},l(q){i=t(q,"P",{});var T=m(i);b=c(T,"When "),d=t(T,"SPAN",{class:!0});var ss=m(d);ss.forEach(s),x=c(T,", "),g=t(T,"SPAN",{class:!0});var U=m(g);U.forEach(s),P=c(T,". The formula is exact."),T.forEach(s),f=v(q),M=t(q,"P",{});var N=m(M);A=c(N,"When "),_=t(N,"SPAN",{class:!0});var fs=m(_);fs.forEach(s),G=c(N,", "),L=t(N,"SPAN",{class:!0});var O=m(L);O.forEach(s),D=c(N,". The formula is exact."),N.forEach(s),S=v(q),j=t(q,"P",{});var R=m(j);K=c(R,"When "),Q=t(R,"SPAN",{class:!0});var xs=m(Q);xs.forEach(s),ns=c(R,", "),V=t(R,"SPAN",{class:!0});var F=m(V);F.forEach(s),ts=c(R,". The formula is not exact."),R.forEach(s),this.h()},h(){e(d,"class","math math-inline"),e(g,"class","math math-inline"),e(_,"class","math math-inline"),e(L,"class","math math-inline"),e(Q,"class","math math-inline"),e(V,"class","math math-inline")},m(q,T){l(q,i,T),n(i,b),n(i,d),d.innerHTML=C,n(i,x),n(i,g),g.innerHTML=H,n(i,P),l(q,f,T),l(q,M,T),n(M,A),n(M,_),_.innerHTML=I,n(M,G),n(M,L),L.innerHTML=z,n(M,D),l(q,S,T),l(q,j,T),n(j,K),n(j,Q),Q.innerHTML=X,n(j,ns),n(j,V),V.innerHTML=ps,n(j,ts)},p:Os,d(q){q&&s(i),q&&s(f),q&&s(M),q&&s(S),q&&s(j)}}}function ce(W){let i,b,d,C='nn',x,g,H='2n12n-1',P;return{c(){i=p("p"),b=r("If we use "),d=p("span"),x=r(" points in Newton-Cotes formula, then the degree of precision is at most "),g=p("span"),P=r("."),this.h()},l(f){i=t(f,"P",{});var M=m(i);b=c(M,"If we use "),d=t(M,"SPAN",{class:!0});var A=m(d);A.forEach(s),x=c(M," points in Newton-Cotes formula, then the degree of precision is at most "),g=t(M,"SPAN",{class:!0});var _=m(g);_.forEach(s),P=c(M,"."),M.forEach(s),this.h()},h(){e(d,"class","math math-inline"),e(g,"class","math math-inline")},m(f,M){l(f,i,M),n(i,b),n(i,d),d.innerHTML=C,n(i,x),n(i,g),g.innerHTML=H,n(i,P)},p:Os,d(f){f&&s(i)}}}function oe(W){let i,b,d,C='xix_i',x,g,H='wiw_i',P,f,M='2n2n',A,_,I,G,L,z='f(x)=i=1n(xxi)2f(x) = \\prod_{i = 1}^n (x - x_i)^2',D,S,j='2n2n',K,Q,X='f(x)f(x)',ns,V,ps,ts,q,T,ss='abf(x)dx=i=1nwif(xi)=i=1nwi0=0\\int_a^b f(x) dx = \\sum_{i=1}^n w_i f(x_i) = \\sum_{i = 1}^n w_i \\cdot 0 = 0',U,N,fs,O,R='f(x)=0f(x) = 0',xs,F,rs='x=xix = x_i',as,B,cs='ii',bs,Z,hs='f(x)>0f(x) > 0',Ps;return{c(){i=p("p"),b=r("Proof by contradiction. Suppose that some one choose points "),d=p("span"),x=r(" and weights "),g=p("span"),P=r(" such that the degree of precision is "),f=p("span"),A=r("."),_=u(),I=p("p"),G=r("Then let "),L=p("span"),D=r(", which is a polynomial of degree "),S=p("span"),K=r(". Then the formula is exact for "),Q=p("span"),ns=r("."),V=u(),ps=p("p"),ts=r("Hence"),q=u(),T=p("div"),U=u(),N=p("p"),fs=r("However, "),O=p("span"),xs=r(" holds only when "),F=p("span"),as=r(" for all "),B=p("span"),bs=r(", and "),Z=p("span"),Ps=r(" for all other places. So the integral is positive. Contradiction."),this.h()},l($){i=t($,"P",{});var k=m(i);b=c(k,"Proof by contradiction. Suppose that some one choose points "),d=t(k,"SPAN",{class:!0});var ds=m(d);ds.forEach(s),x=c(k," and weights "),g=t(k,"SPAN",{class:!0});var ms=m(g);ms.forEach(s),P=c(k," such that the degree of precision is "),f=t(k,"SPAN",{class:!0});var ws=m(f);ws.forEach(s),A=c(k,"."),k.forEach(s),_=v($),I=t($,"P",{});var Y=m(I);G=c(Y,"Then let "),L=t(Y,"SPAN",{class:!0});var J=m(L);J.forEach(s),D=c(Y,", which is a polynomial of degree "),S=t(Y,"SPAN",{class:!0});var gs=m(S);gs.forEach(s),K=c(Y,". Then the formula is exact for "),Q=t(Y,"SPAN",{class:!0});var Ls=m(Q);Ls.forEach(s),ns=c(Y,"."),Y.forEach(s),V=v($),ps=t($,"P",{});var y=m(ps);ts=c(y,"Hence"),y.forEach(s),q=v($),T=t($,"DIV",{class:!0});var w=m(T);w.forEach(s),U=v($),N=t($,"P",{});var ls=m(N);fs=c(ls,"However, "),O=t(ls,"SPAN",{class:!0});var es=m(O);es.forEach(s),xs=c(ls," holds only when "),F=t(ls,"SPAN",{class:!0});var zs=m(F);zs.forEach(s),as=c(ls," for all "),B=t(ls,"SPAN",{class:!0});var Ss=m(B);Ss.forEach(s),bs=c(ls,", and "),Z=t(ls,"SPAN",{class:!0});var _s=m(Z);_s.forEach(s),Ps=c(ls," for all other places. So the integral is positive. Contradiction."),ls.forEach(s),this.h()},h(){e(d,"class","math math-inline"),e(g,"class","math math-inline"),e(f,"class","math math-inline"),e(L,"class","math math-inline"),e(S,"class","math math-inline"),e(Q,"class","math math-inline"),e(T,"class","math math-display"),e(O,"class","math math-inline"),e(F,"class","math math-inline"),e(B,"class","math math-inline"),e(Z,"class","math math-inline")},m($,k){l($,i,k),n(i,b),n(i,d),d.innerHTML=C,n(i,x),n(i,g),g.innerHTML=H,n(i,P),n(i,f),f.innerHTML=M,n(i,A),l($,_,k),l($,I,k),n(I,G),n(I,L),L.innerHTML=z,n(I,D),n(I,S),S.innerHTML=j,n(I,K),n(I,Q),Q.innerHTML=X,n(I,ns),l($,V,k),l($,ps,k),n(ps,ts),l($,q,k),l($,T,k),T.innerHTML=ss,l($,U,k),l($,N,k),n(N,fs),n(N,O),O.innerHTML=R,n(N,xs),n(N,F),F.innerHTML=rs,n(N,as),n(N,B),B.innerHTML=cs,n(N,bs),n(N,Z),Z.innerHTML=hs,n(N,Ps)},p:Os,d($){$&&s(i),$&&s(_),$&&s(I),$&&s(V),$&&s(ps),$&&s(q),$&&s(T),$&&s(U),$&&s(N)}}}function he(W){let i,b,d,C='nn',x,g,H='xix_i',P,f,M='wiw_i',A,_,I='2n12n-1',G;return{c(){i=p("p"),b=r("If "),d=p("span"),x=r(" points "),g=p("span"),P=r(" and weights "),f=p("span"),A=r(" satisfy the degree of precision is "),_=p("span"),G=r(", then the intergation formula is called Gaussian Quadrature."),this.h()},l(L){i=t(L,"P",{});var z=m(i);b=c(z,"If "),d=t(z,"SPAN",{class:!0});var D=m(d);D.forEach(s),x=c(z," points "),g=t(z,"SPAN",{class:!0});var S=m(g);S.forEach(s),P=c(z," and weights "),f=t(z,"SPAN",{class:!0});var j=m(f);j.forEach(s),A=c(z," satisfy the degree of precision is "),_=t(z,"SPAN",{class:!0});var K=m(_);K.forEach(s),G=c(z,", then the intergation formula is called Gaussian Quadrature."),z.forEach(s),this.h()},h(){e(d,"class","math math-inline"),e(g,"class","math math-inline"),e(f,"class","math math-inline"),e(_,"class","math math-inline")},m(L,z){l(L,i,z),n(i,b),n(i,d),d.innerHTML=C,n(i,x),n(i,g),g.innerHTML=H,n(i,P),n(i,f),f.innerHTML=M,n(i,A),n(i,_),_.innerHTML=I,n(i,G)},p:Os,d(L){L&&s(i)}}}function ge(W){let i,b,d,C='f(x)f(x)',x,g,H='2n12n-1',P,f,M='f(x)=Pn(x)g(x)+r(x)f(x) = P_n(x)g(x) + r(x)',A,_,I='g(x)g(x)',G,L,z='r(x)r(x)',D,S,j='nn',K,Q,X,ns,V,ps='g(x)g(x)',ts,q,T='P0(x),P1(x),,Pn1(x)P_0(x), P_1(x), \\cdots, P_{n-1}(x)',ss,U,N,fs,O,R,xs='11f(x)dx=11Pn(x)g(x)dx+11r(x)dx=11r(x)dx\\int_{-1}^1 f(x) dx = \\int_{-1}^1 P_n(x)g(x) dx + \\int_{-1}^1 r(x) dx = \\int_{-1}^1 r(x) dx',F,rs,as,B,cs='r(x)r(x)',bs,Z,hs='2n12n-1',Ps,$,k,ds,ms,ws='2n12n-1',Y,J,gs='2n12n-1',Ls;return{c(){i=p("p"),b=r("Let "),d=p("span"),x=r(" be a polynomial of degree "),g=p("span"),P=r(". Then "),f=p("span"),A=r(", where "),_=p("span"),G=r(", "),L=p("span"),D=r(" are two polynomial of degree less than "),S=p("span"),K=r("."),Q=u(),X=p("p"),ns=r("It’s trival that "),V=p("span"),ts=r(" can be express as a linear combination of "),q=p("span"),ss=r("."),U=u(),N=p("p"),fs=r("By the othogonality of Legendre polynomial and linearity of integration, we have"),O=u(),R=p("div"),F=u(),rs=p("p"),as=r("By the previous theorem, we know that the the integration formula is at least for "),B=p("span"),bs=r(", so the degree of precision is at least "),Z=p("span"),Ps=r("."),$=u(),k=p("p"),ds=r("Since the degree of precision is at most "),ms=p("span"),Y=r(", the degree of precision is exactly "),J=p("span"),Ls=r("."),this.h()},l(y){i=t(y,"P",{});var w=m(i);b=c(w,"Let "),d=t(w,"SPAN",{class:!0});var ls=m(d);ls.forEach(s),x=c(w," be a polynomial of degree "),g=t(w,"SPAN",{class:!0});var es=m(g);es.forEach(s),P=c(w,". Then "),f=t(w,"SPAN",{class:!0});var zs=m(f);zs.forEach(s),A=c(w,", where "),_=t(w,"SPAN",{class:!0});var Ss=m(_);Ss.forEach(s),G=c(w,", "),L=t(w,"SPAN",{class:!0});var _s=m(L);_s.forEach(s),D=c(w," are two polynomial of degree less than "),S=t(w,"SPAN",{class:!0});var Ns=m(S);Ns.forEach(s),K=c(w,"."),w.forEach(s),Q=v(y),X=t(y,"P",{});var ys=m(X);ns=c(ys,"It’s trival that "),V=t(ys,"SPAN",{class:!0});var na=m(V);na.forEach(s),ts=c(ys," can be express as a linear combination of "),q=t(ys,"SPAN",{class:!0});var is=m(q);is.forEach(s),ss=c(ys,"."),ys.forEach(s),U=v(y),N=t(y,"P",{});var Vs=m(N);fs=c(Vs,"By the othogonality of Legendre polynomial and linearity of integration, we have"),Vs.forEach(s),O=v(y),R=t(y,"DIV",{class:!0});var pa=m(R);pa.forEach(s),F=v(y),rs=t(y,"P",{});var us=m(rs);as=c(us,"By the previous theorem, we know that the the integration formula is at least for "),B=t(us,"SPAN",{class:!0});var Es=m(B);Es.forEach(s),bs=c(us,", so the degree of precision is at least "),Z=t(us,"SPAN",{class:!0});var Ms=m(Z);Ms.forEach(s),Ps=c(us,"."),us.forEach(s),$=v(y),k=t(y,"P",{});var os=m(k);ds=c(os,"Since the degree of precision is at most "),ms=t(os,"SPAN",{class:!0});var $s=m(ms);$s.forEach(s),Y=c(os,", the degree of precision is exactly "),J=t(os,"SPAN",{class:!0});var Rs=m(J);Rs.forEach(s),Ls=c(os,"."),os.forEach(s),this.h()},h(){e(d,"class","math math-inline"),e(g,"class","math math-inline"),e(f,"class","math math-inline"),e(_,"class","math math-inline"),e(L,"class","math math-inline"),e(S,"class","math math-inline"),e(V,"class","math math-inline"),e(q,"class","math math-inline"),e(R,"class","math math-display"),e(B,"class","math math-inline"),e(Z,"class","math math-inline"),e(ms,"class","math math-inline"),e(J,"class","math math-inline")},m(y,w){l(y,i,w),n(i,b),n(i,d),d.innerHTML=C,n(i,x),n(i,g),g.innerHTML=H,n(i,P),n(i,f),f.innerHTML=M,n(i,A),n(i,_),_.innerHTML=I,n(i,G),n(i,L),L.innerHTML=z,n(i,D),n(i,S),S.innerHTML=j,n(i,K),l(y,Q,w),l(y,X,w),n(X,ns),n(X,V),V.innerHTML=ps,n(X,ts),n(X,q),q.innerHTML=T,n(X,ss),l(y,U,w),l(y,N,w),n(N,fs),l(y,O,w),l(y,R,w),R.innerHTML=xs,l(y,F,w),l(y,rs,w),n(rs,as),n(rs,B),B.innerHTML=cs,n(rs,bs),n(rs,Z),Z.innerHTML=hs,n(rs,Ps),l(y,$,w),l(y,k,w),n(k,ds),n(k,ms),ms.innerHTML=ws,n(k,Y),n(k,J),J.innerHTML=gs,n(k,Ls)},p:Os,d(y){y&&s(i),y&&s(Q),y&&s(X),y&&s(U),y&&s(N),y&&s(O),y&&s(R),y&&s(F),y&&s(rs),y&&s($),y&&s(k)}}}function ye(W){let i,b,d,C='H(x)H(x)',x,g,H='f(x)f(x)',P,f,M='xix_i',A,_,I,G=`H(xi)=f(xi)H(xi)=f(xi)H(x_i) = f(x_i)\\\\ -H'(x_i) = f'(x_i)`,L,z,D,S,j='H(x)H(x)',K,Q,X='2n12n-1',ns,V,ps,ts=`f(x)=H(x)+f(2n)(ξ)(2n)!(π(x))211f(x)dx=11H(x)dx+f(2n)(ξ)(2n)!11(π(x))2dxf(x) = H(x) + \\dfrac{f^{(2n)}(\\xi)}{(2n)!}(\\pi(x))^2 \\\\ -\\int_{-1}^1 f(x) dx = \\int_{-1}^1 H(x) dx + \\dfrac{f^{(2n)}(\\xi)}{(2n)!}\\int_{-1}^1 (\\pi(x))^2 dx`,q,T,ss,U,N='H(x)H(x)',fs,O,R='2n12n-1',xs,F,rs='H(x)H(x)',as,B,cs,bs,Z,hs='H(xi)=f(xi)H(x_i) = f(x_i)',Ps,$,k,ds='11H(x)dx=i=1nwiH(xi)=i=1nwif(xi)\\int_{-1}^1 H(x) dx = \\sum_{i=1}^n w_i H(x_i) = \\sum_{i=1}^n w_i f(x_i)',ms,ws,Y,J,gs,Ls=`f(x)=H(x)+f(2n)(ξ)(2n)!(π(x))211f(x)dx=i=1nwif(xi)+f(2n)(ξ)(2n)!11(π(x))2dxf(x) = H(x) + \\dfrac{f^{(2n)}(\\xi)}{(2n)!}(\\pi(x))^2 \\\\ -\\int_{-1}^1 f(x) dx = \\sum_{i=1}^n w_i f(x_i) + \\dfrac{f^{(2n)}(\\xi)}{(2n)!}\\int_{-1}^1 (\\pi(x))^2 dx`;return{c(){i=p("p"),b=r("Consider Hermite Interpolation Polynomial "),d=p("span"),x=r(" of "),g=p("span"),P=r(" at "),f=p("span"),A=r("."),_=u(),I=p("div"),L=u(),z=p("p"),D=r("Then "),S=p("span"),K=r(" is a polynomial of degree at most "),Q=p("span"),ns=r("."),V=u(),ps=p("div"),q=u(),T=p("p"),ss=r("Since "),U=p("span"),fs=r(" is a polynomial of degree at most "),O=p("span"),xs=r(", the integration formula is exact for "),F=p("span"),as=r("."),B=u(),cs=p("p"),bs=r("By the condition of Hermite Interpolation Polynomial, we know that "),Z=p("span"),Ps=r("."),$=u(),k=p("div"),ms=u(),ws=p("p"),Y=r("Substitute it into the previous equation, we get"),J=u(),gs=p("div"),this.h()},l(y){i=t(y,"P",{});var w=m(i);b=c(w,"Consider Hermite Interpolation Polynomial "),d=t(w,"SPAN",{class:!0});var ls=m(d);ls.forEach(s),x=c(w," of "),g=t(w,"SPAN",{class:!0});var es=m(g);es.forEach(s),P=c(w," at "),f=t(w,"SPAN",{class:!0});var zs=m(f);zs.forEach(s),A=c(w,"."),w.forEach(s),_=v(y),I=t(y,"DIV",{class:!0});var Ss=m(I);Ss.forEach(s),L=v(y),z=t(y,"P",{});var _s=m(z);D=c(_s,"Then "),S=t(_s,"SPAN",{class:!0});var Ns=m(S);Ns.forEach(s),K=c(_s," is a polynomial of degree at most "),Q=t(_s,"SPAN",{class:!0});var ys=m(Q);ys.forEach(s),ns=c(_s,"."),_s.forEach(s),V=v(y),ps=t(y,"DIV",{class:!0});var na=m(ps);na.forEach(s),q=v(y),T=t(y,"P",{});var is=m(T);ss=c(is,"Since "),U=t(is,"SPAN",{class:!0});var Vs=m(U);Vs.forEach(s),fs=c(is," is a polynomial of degree at most "),O=t(is,"SPAN",{class:!0});var pa=m(O);pa.forEach(s),xs=c(is,", the integration formula is exact for "),F=t(is,"SPAN",{class:!0});var us=m(F);us.forEach(s),as=c(is,"."),is.forEach(s),B=v(y),cs=t(y,"P",{});var Es=m(cs);bs=c(Es,"By the condition of Hermite Interpolation Polynomial, we know that "),Z=t(Es,"SPAN",{class:!0});var Ms=m(Z);Ms.forEach(s),Ps=c(Es,"."),Es.forEach(s),$=v(y),k=t(y,"DIV",{class:!0});var os=m(k);os.forEach(s),ms=v(y),ws=t(y,"P",{});var $s=m(ws);Y=c($s,"Substitute it into the previous equation, we get"),$s.forEach(s),J=v(y),gs=t(y,"DIV",{class:!0});var Rs=m(gs);Rs.forEach(s),this.h()},h(){e(d,"class","math math-inline"),e(g,"class","math math-inline"),e(f,"class","math math-inline"),e(I,"class","math math-display"),e(S,"class","math math-inline"),e(Q,"class","math math-inline"),e(ps,"class","math math-display"),e(U,"class","math math-inline"),e(O,"class","math math-inline"),e(F,"class","math math-inline"),e(Z,"class","math math-inline"),e(k,"class","math math-display"),e(gs,"class","math math-display")},m(y,w){l(y,i,w),n(i,b),n(i,d),d.innerHTML=C,n(i,x),n(i,g),g.innerHTML=H,n(i,P),n(i,f),f.innerHTML=M,n(i,A),l(y,_,w),l(y,I,w),I.innerHTML=G,l(y,L,w),l(y,z,w),n(z,D),n(z,S),S.innerHTML=j,n(z,K),n(z,Q),Q.innerHTML=X,n(z,ns),l(y,V,w),l(y,ps,w),ps.innerHTML=ts,l(y,q,w),l(y,T,w),n(T,ss),n(T,U),U.innerHTML=N,n(T,fs),n(T,O),O.innerHTML=R,n(T,xs),n(T,F),F.innerHTML=rs,n(T,as),l(y,B,w),l(y,cs,w),n(cs,bs),n(cs,Z),Z.innerHTML=hs,n(cs,Ps),l(y,$,w),l(y,k,w),k.innerHTML=ds,l(y,ms,w),l(y,ws,w),n(ws,Y),l(y,J,w),l(y,gs,w),gs.innerHTML=Ls},p:Os,d(y){y&&s(i),y&&s(_),y&&s(I),y&&s(L),y&&s(z),y&&s(V),y&&s(ps),y&&s(q),y&&s(T),y&&s(B),y&&s(cs),y&&s($),y&&s(k),y&&s(ms),y&&s(ws),y&&s(J),y&&s(gs)}}}function ue(W){let i,b,d,C,x='wi=11(π(x))2=2(1xi2)[Pn(xi)]2w_i = \\int_{-1}^1 (\\pi(x))^2 = \\dfrac{2}{(1 - x_i^2)[P_n'(x_i)]^2}';return{c(){i=p("p"),b=r("The weights of Legendre-Gauss Quadrature can be calculated by the following formula."),d=u(),C=p("div"),this.h()},l(g){i=t(g,"P",{});var H=m(i);b=c(H,"The weights of Legendre-Gauss Quadrature can be calculated by the following formula."),H.forEach(s),d=v(g),C=t(g,"DIV",{class:!0});var P=m(C);P.forEach(s),this.h()},h(){e(C,"class","math math-display")},m(g,H){l(g,i,H),n(i,b),l(g,d,H),l(g,C,H),C.innerHTML=x},p:Os,d(g){g&&s(i),g&&s(d),g&&s(C)}}}function ve(W){let i,b,d,C='π(x)\\pi'(x)',x,g,H='π(xi)\\pi'(x_i)',P,f,M='i=1,2,,ni = 1, 2, \\cdots, n',A,_,I,G=`π(x)=j=1n(xxj)=(xxi)j=1,jin(xxj)π(x)=j=1,jin(xxj)+(xxi)(j=1,jin(xxj))π(xi)=j=1,jin(xixj)+(xixi)(j=1,jin(xixj))=j=1,jin(xixj)\\pi(x) = \\prod_{j=1}^n (x - x_j) = (x - x_i) \\prod_{j=1, j \\neq i}^n (x - x_j)\\\\ -\\pi'(x) = \\prod_{j=1, j \\neq i}^n (x - x_j) + (x - x_i)(\\prod_{j=1, j \\neq i}^n (x - x_j))'\\\\ -\\pi'(x_i) = \\prod_{j=1, j \\neq i}^n (x_i - x_j) + (x_i - x_i)(\\prod_{j=1, j \\neq i}^n (x_i - x_j))' = \\prod_{j=1, j \\neq i}^n (x_i - x_j)`,L,z,D,S,j='li(x)l_i(x)',K,Q,X='π(x)\\pi(x)',ns,V,ps='xix_i',ts,q,T,ss,U,N,fs='li(x)=π(x)(xxi)π(xi)=Pn(x)(xxi)Pn(xi)l_i(x) = \\dfrac{\\pi(x)}{(x - x_i)\\pi'(x_i)} = \\dfrac{P_n(x)}{(x - x_i)P_n'(x_i)}',O,R,xs,F,rs='li(x)Pn(x)l_i(x)P_n'(x)',as,B,cs='2n22n - 2',bs,Z,hs,Ps='11li(x)Pn(x)dx=j=1nwjli(xj)Pn(xj)\\int_{-1}^1 l_i(x)P_n'(x) dx = \\sum_{j=1}^n w_j l_i(x_j) P_n'(x_j)',$,k,ds,ms,ws='li(xj)=0l_i(x_j) = 0',Y,J,gs='jij \\neq i',Ls,y,w='li(xi)=1l_i(x_i) = 1',ls,es,zs,Ss='11li(x)Pn(x)dx=wili(xi)Pn(xi)=wiPn(xi)\\int_{-1}^1 l_i(x)P_n'(x) dx = w_i l_i(x_i) P_n'(x_i) = w_i P_n'(x_i)',_s,Ns,ys,na,is,Vs='11li(x)Pn(x)dx=11Pn(x)Pn(x)(xxi)Pn(xi)dx\\int_{-1}^1 l_i(x)P_n'(x) dx = \\int_{-1}^1 \\dfrac{P_n(x)P_n'(x)}{(x - x_i)P_n'(x_i)} dx',pa,us,Es,Ms,os,$s='wi=1(Pn(x))211Pn(x)Pn(x)xxjdxw_i = \\dfrac{1}{(P_n'(x))^2} \\int_{-1}^1 \\dfrac{P_n(x)P_n'(x)}{x - x_j} dx',Rs,Hs,Ma,Ks,Us,un=`11(li(x))2=11(Pn(x))2(xxi)2(Pn(xi))2dx=1(Pn(xi))211(Pn(x))2(xxi)2dx=1(Pn(xi))211(Pn(x))2d1xxi=1(Pn(xi))2(((Pn(x))2xxi)11+111xxid(Pn(x))2)=1(Pn(xi))2(((Pn(1))21xi(Pn(1))21xi)+211Pn(x)Pn(x)xxidx)=1(Pn(xi))2(11+xi+11xi)+2(Pn(xi))211Pn(x)Pn(x)xxidx=2(1xi2)(Pn(xi))2+2wi\\int_{-1}^1 (l_i(x))^2\\\\ -= \\int_{-1}^1 \\dfrac{(P_n(x))^2}{(x - x_i)^2(P_n'(x_i))^2} dx\\\\ -= \\dfrac{1}{(P_n'(x_i))^2}\\int_{-1}^1 \\dfrac{(P_n(x))^2}{(x - x_i)^2} dx\\\\ -= \\dfrac{1}{(P_n'(x_i))^2}\\int_{-1}^1 -(P_n(x))^2 d \\dfrac{1}{x - x_i}\\\\ -= \\dfrac{1}{(P_n'(x_i))^2} ((\\dfrac{-(P_n(x))^2}{x - x_i})|_{-1}^1 + \\int_{-1}^1 \\dfrac{1}{x - x_i} d(P_n(x))^2)\\\\ -= \\dfrac{1}{(P_n'(x_i))^2} ((\\dfrac{-(P_n(1))^2}{1 - x_i} - \\dfrac{-(P_n(-1))^2}{-1 - x_i}) + 2\\int_{-1}^1 \\dfrac{P_n(x)P_n'(x)}{x - x_i} dx)\\\\ -= -\\dfrac{1}{(P_n'(x_i))^2} (\\dfrac{1}{1 + x_i} + \\dfrac{1}{1 - x_i}) + \\dfrac{2}{(P_n'(x_i))^2}\\int_{-1}^1 \\dfrac{P_n(x)P_n'(x)}{x - x_i} dx\\\\ -= -\\dfrac{2}{(1 - x_i^2)(P_n'(x_i))^2} + 2w_i\\\\`,Gs,vs,da,ta,vn='(li(x))2(l_i(x))^2',ma,la,dn='2n22n - 2',Xs,fn,Bs,ea='11(li(x))2dx=j=1nwj(li(xj))2=wi(li(xi))2=wi\\int_{-1}^1 (l_i(x))^2 dx = \\sum_{j=1}^n w_j (l_i(x_j))^2 = w_i (l_i(x_i))^2 = w_i',fa,Ts,ka,Ws,ks,ln=`wi=11(li(x))2dx=2(1xi2)(Pn(xi))2+2wiwi=2(1xi2)(Pn(xi))2w_i = \\int_{-1}^1 (l_i(x))^2 dx = -\\dfrac{2}{(1 - x_i^2)(P_n'(x_i))^2} + 2w_i\\\\ -w_i = \\dfrac{2}{(1 - x_i^2)(P_n'(x_i))^2}`;return{c(){i=p("p"),b=r("We first find "),d=p("span"),x=r(" and "),g=p("span"),P=r(" for "),f=p("span"),A=r("."),_=u(),I=p("div"),L=u(),z=p("p"),D=r("Consider the Lagrange Interpolation Polynomial "),S=p("span"),K=r(" of "),Q=p("span"),ns=r(" at "),V=p("span"),ts=r("."),q=u(),T=p("p"),ss=r("It can be expressed as"),U=u(),N=p("div"),O=u(),R=p("p"),xs=r("Since "),F=p("span"),as=r(" is a polynomial of degree "),B=p("span"),bs=r(", we have"),Z=u(),hs=p("div"),$=u(),k=p("p"),ds=r("Since "),ms=p("span"),Y=r(" for "),J=p("span"),Ls=r(", and "),y=p("span"),ls=r(", we have"),es=u(),zs=p("div"),_s=u(),Ns=p("p"),ys=r("On the other hand,"),na=u(),is=p("div"),pa=u(),us=p("p"),Es=r("Hence,"),Ms=u(),os=p("div"),Rs=u(),Hs=p("p"),Ma=r("Similarly, we move on to the next step."),Ks=u(),Us=p("div"),Gs=u(),vs=p("p"),da=r("On the other hand, since "),ta=p("span"),ma=r(" is a polynomial of degree "),la=p("span"),Xs=r(", we have"),fn=u(),Bs=p("div"),fa=u(),Ts=p("p"),ka=r("Combine the two equations, we get"),Ws=u(),ks=p("div"),this.h()},l(h){i=t(h,"P",{});var E=m(i);b=c(E,"We first find "),d=t(E,"SPAN",{class:!0});var ia=m(d);ia.forEach(s),x=c(E," and "),g=t(E,"SPAN",{class:!0});var sp=m(g);sp.forEach(s),P=c(E," for "),f=t(E,"SPAN",{class:!0});var Pa=m(f);Pa.forEach(s),A=c(E,"."),E.forEach(s),_=v(h),I=t(h,"DIV",{class:!0});var ut=m(I);ut.forEach(s),L=v(h),z=t(h,"P",{});var Zs=m(z);D=c(Zs,"Consider the Lagrange Interpolation Polynomial "),S=t(Zs,"SPAN",{class:!0});var xn=m(S);xn.forEach(s),K=c(Zs," of "),Q=t(Zs,"SPAN",{class:!0});var xa=m(Q);xa.forEach(s),ns=c(Zs," at "),V=t(Zs,"SPAN",{class:!0});var vt=m(V);vt.forEach(s),ts=c(Zs,"."),Zs.forEach(s),q=v(h),T=t(h,"P",{});var en=m(T);ss=c(en,"It can be expressed as"),en.forEach(s),U=v(h),N=t(h,"DIV",{class:!0});var ra=m(N);ra.forEach(s),O=v(h),R=t(h,"P",{});var ca=m(R);xs=c(ca,"Since "),F=t(ca,"SPAN",{class:!0});var La=m(F);La.forEach(s),as=c(ca," is a polynomial of degree "),B=t(ca,"SPAN",{class:!0});var dt=m(B);dt.forEach(s),bs=c(ca,", we have"),ca.forEach(s),Z=v(h),hs=t(h,"DIV",{class:!0});var ap=m(hs);ap.forEach(s),$=v(h),k=t(h,"P",{});var Fs=m(k);ds=c(Fs,"Since "),ms=t(Fs,"SPAN",{class:!0});var oa=m(ms);oa.forEach(s),Y=c(Fs," for "),J=t(Fs,"SPAN",{class:!0});var ha=m(J);ha.forEach(s),Ls=c(Fs,", and "),y=t(Fs,"SPAN",{class:!0});var rn=m(y);rn.forEach(s),ls=c(Fs,", we have"),Fs.forEach(s),es=v(h),zs=t(h,"DIV",{class:!0});var np=m(zs);np.forEach(s),_s=v(h),Ns=t(h,"P",{});var cn=m(Ns);ys=c(cn,"On the other hand,"),cn.forEach(s),na=v(h),is=t(h,"DIV",{class:!0});var ga=m(is);ga.forEach(s),pa=v(h),us=t(h,"P",{});var bn=m(us);Es=c(bn,"Hence,"),bn.forEach(s),Ms=v(h),os=t(h,"DIV",{class:!0});var Ea=m(os);Ea.forEach(s),Rs=v(h),Hs=t(h,"P",{});var dp=m(Hs);Ma=c(dp,"Similarly, we move on to the next step."),dp.forEach(s),Ks=v(h),Us=t(h,"DIV",{class:!0});var pp=m(Us);pp.forEach(s),Gs=v(h),vs=t(h,"P",{});var sa=m(vs);da=c(sa,"On the other hand, since "),ta=t(sa,"SPAN",{class:!0});var ba=m(ta);ba.forEach(s),ma=c(sa," is a polynomial of degree "),la=t(sa,"SPAN",{class:!0});var ft=m(la);ft.forEach(s),Xs=c(sa,", we have"),sa.forEach(s),fn=v(h),Bs=t(h,"DIV",{class:!0});var wn=m(Bs);wn.forEach(s),fa=v(h),Ts=t(h,"P",{});var aa=m(Ts);ka=c(aa,"Combine the two equations, we get"),aa.forEach(s),Ws=v(h),ks=t(h,"DIV",{class:!0});var tp=m(ks);tp.forEach(s),this.h()},h(){e(d,"class","math math-inline"),e(g,"class","math math-inline"),e(f,"class","math math-inline"),e(I,"class","math math-display"),e(S,"class","math math-inline"),e(Q,"class","math math-inline"),e(V,"class","math math-inline"),e(N,"class","math math-display"),e(F,"class","math math-inline"),e(B,"class","math math-inline"),e(hs,"class","math math-display"),e(ms,"class","math math-inline"),e(J,"class","math math-inline"),e(y,"class","math math-inline"),e(zs,"class","math math-display"),e(is,"class","math math-display"),e(os,"class","math math-display"),e(Us,"class","math math-display"),e(ta,"class","math math-inline"),e(la,"class","math math-inline"),e(Bs,"class","math math-display"),e(ks,"class","math math-display")},m(h,E){l(h,i,E),n(i,b),n(i,d),d.innerHTML=C,n(i,x),n(i,g),g.innerHTML=H,n(i,P),n(i,f),f.innerHTML=M,n(i,A),l(h,_,E),l(h,I,E),I.innerHTML=G,l(h,L,E),l(h,z,E),n(z,D),n(z,S),S.innerHTML=j,n(z,K),n(z,Q),Q.innerHTML=X,n(z,ns),n(z,V),V.innerHTML=ps,n(z,ts),l(h,q,E),l(h,T,E),n(T,ss),l(h,U,E),l(h,N,E),N.innerHTML=fs,l(h,O,E),l(h,R,E),n(R,xs),n(R,F),F.innerHTML=rs,n(R,as),n(R,B),B.innerHTML=cs,n(R,bs),l(h,Z,E),l(h,hs,E),hs.innerHTML=Ps,l(h,$,E),l(h,k,E),n(k,ds),n(k,ms),ms.innerHTML=ws,n(k,Y),n(k,J),J.innerHTML=gs,n(k,Ls),n(k,y),y.innerHTML=w,n(k,ls),l(h,es,E),l(h,zs,E),zs.innerHTML=Ss,l(h,_s,E),l(h,Ns,E),n(Ns,ys),l(h,na,E),l(h,is,E),is.innerHTML=Vs,l(h,pa,E),l(h,us,E),n(us,Es),l(h,Ms,E),l(h,os,E),os.innerHTML=$s,l(h,Rs,E),l(h,Hs,E),n(Hs,Ma),l(h,Ks,E),l(h,Us,E),Us.innerHTML=un,l(h,Gs,E),l(h,vs,E),n(vs,da),n(vs,ta),ta.innerHTML=vn,n(vs,ma),n(vs,la),la.innerHTML=dn,n(vs,Xs),l(h,fn,E),l(h,Bs,E),Bs.innerHTML=ea,l(h,fa,E),l(h,Ts,E),n(Ts,ka),l(h,Ws,E),l(h,ks,E),ks.innerHTML=ln},p:Os,d(h){h&&s(i),h&&s(_),h&&s(I),h&&s(L),h&&s(z),h&&s(q),h&&s(T),h&&s(U),h&&s(N),h&&s(O),h&&s(R),h&&s(Z),h&&s(hs),h&&s($),h&&s(k),h&&s(es),h&&s(zs),h&&s(_s),h&&s(Ns),h&&s(na),h&&s(is),h&&s(pa),h&&s(us),h&&s(Ms),h&&s(os),h&&s(Rs),h&&s(Hs),h&&s(Ks),h&&s(Us),h&&s(Gs),h&&s(vs),h&&s(fn),h&&s(Bs),h&&s(fa),h&&s(Ts),h&&s(Ws),h&&s(ks)}}}function de(W){let i,b,d,C,x,g,H,P,f,M,A,_,I,G,L=`f(x)If(x)abf(x)dxabIf(x)dxf(x) \\approx I f(x)\\\\ -\\int_a^b f(x) dx \\approx \\int_a^b I f(x) dx`,z,D,S,j,K='nn',Q,X,ns,V,ps,ts,q=`f(x)=i=1nf(xi)j=1,jinxxjxixj+f(n)(ξ)n!i=1n(xxi)abf(x)dx=i=1nf(xi)abj=1,jinxxjxixjdx+abf(n)(ξ)n!i=1n(xxi)dxf(x) = \\sum_{i=1}^n f(x_i) \\prod_{j=1, j \\neq i}^n\\dfrac{x-x_j}{x_i-x_j} + \\dfrac{f^{(n)}(\\xi)}{n!} \\prod_{i=1}^n (x-x_i)\\\\ -\\int_a^b f(x) dx = \\sum_{i=1}^n f(x_i) \\int_a^b \\prod_{j=1, j \\neq i}^n\\dfrac{x-x_j}{x_i-x_j} dx + \\int_a^b \\dfrac{f^{(n)}(\\xi)}{n!} \\prod_{i=1}^n (x-x_i) dx`,T,ss,U,N,fs='abf(n)(ξ)n!i=1n(xxi)dx\\int_a^b \\dfrac{f^{(n)}(\\xi)}{n!} \\prod_{i=1}^n (x-x_i) dx',O,R,xs='E(f)E(f)',F,rs,as,B,cs,bs='abj=1,jinxxjxixjdx\\int_a^b \\prod_{j=1, j \\neq i}^n\\dfrac{x-x_j}{x_i-x_j} dx',Z,hs,Ps='f(x)f(x)',$,k,ds,ms,ws,Y,J,gs,Ls,y,w,ls,es,zs,Ss,_s='1,x,x2,1, x, x^2, \\cdots',Ns,ys,na='1,x,x2,,xn1, x, x^2, \\cdots, x^n',is,Vs,pa='nn',us,Es,Ms,os,$s,Rs,Hs,Ma,Ks,Us,un,Gs,vs,da,ta,vn,ma,la,dn,Xs,fn=`f(x)=f(a)xbab+f(b)xaba+f(ξ)2(xa)(xb)abf(x)dx=ba2(f(a)+f(b))f(ξ)12(ba)3f(x) = f(a)\\dfrac{x-b}{a-b} + f(b)\\dfrac{x-a}{b-a} + \\dfrac{f''(\\xi)}{2}(x-a)(x-b)\\\\ -\\int_a^b f(x) dx = \\dfrac{b-a}{2}(f(a) + f(b)) - \\dfrac{f''(\\xi)}{12}(b-a)^3`,Bs,ea,fa,Ts,ka,Ws,ks,ln,h,E,ia,sp,Pa,ut='33',Zs,xn,xa,vt='abf(x)dx=ba6(f(a)+4f(a+b2)+f(b))f(3)(ξ)90(ba)5\\int_a^b f(x) dx = \\dfrac{b-a}{6}(f(a) + 4f(\\dfrac{a + b}{2}) + f(b)) - \\dfrac{f^{(3)}(\\xi)}{90}(b-a)^5',en,ra,ca,La,dt='33',ap,Fs,oa,ha,rn,np,cn,ga,bn,Ea,dp='55',pp,sa,ba,ft='abf(x)dx=ba90(7f(a)+32f(3a+b4)+12f(a+b2)+32f(a+3b4)+7f(b))f(5)(ξ)2880(ba)7\\int_a^b f(x) dx = \\dfrac{b-a}{90}(7f(a) + 32f(\\dfrac{3a + b}{4}) + 12f(\\dfrac{a + b}{2}) + 32f(\\dfrac{a + 3b}{4}) + 7f(b)) - \\dfrac{f^{(5)}(\\xi)}{2880}(b-a)^7',wn,aa,tp,zn,Jm='55',xt,fp,$a,Ha,mp,bt,xp,Ta,wt,_n,Km='99',zt,bp,Mn,_t,wp,on,Um='abf(x)dx=i=0(n1)/2ba3n(f(x2i)+4f(x2i+1)+f(x2i+2))f(3)(ξ)90(ba)5\\int_a^b f(x) dx = \\sum_{i=0}^{(n - 1)/2} \\dfrac{b - a}{3n}(f(x_{2i}) + 4f(x_{2i+1}) + f(x_{2i+2})) - \\dfrac{f^{(3)}(\\xi)}{90}(b-a)^5',zp,kn,Mt,_p,Sa,Na,lp,kt,Mp,Ys,Pt,Pn,Xm='sinxx\\dfrac{\\sin x}{x}',Lt,Ln,sl='00',Et,En,al='11',$t,kp,$n,Ht,Pp,Hn,Tt,Lp,hn,nl='abf(x)dx=(ba)f(a+b2)f(ξ)24(ba)3\\int_a^b f(x) dx = (b - a)f(\\dfrac{a + b}{2}) - \\dfrac{f''(\\xi)}{24}(b-a)^3',Ep,Aa,ja,ep,St,$p,Tn,Nt,Hp,Sn,At,Tp,Ia,qa,ip,jt,Sp,ya,It,Nn,pl='xix_i',qt,An,tl='wiw_i',Ct,Np,Ca,Ap,Da,jp,Qa,Ip,Va,Ra,rp,Dt,qp,Js,Qt,jn,ml='xix_i',Vt,In,ll='Pn(x)P_n(x)',Rt,qn,el='2n12n-1',Gt,Cp,Ga,Wt,Cn,il='[1,1][-1, 1]',Ft,Dp,Wa,Qp,Dn,Ot,Vp,gn,rl='E(f)=f(2n)(ξ)(2n)!11i=1n(xxi)2dx=f(2n)(ξ)(2n)!ab(π(x))2dxE(f) = \\dfrac{f^{(2n)}(\\xi)}{(2n)!}\\int_{-1}^1 \\prod_{i=1}^n (x - x_i)^2 dx = \\dfrac{f^{(2n)}(\\xi)}{(2n)!}\\int_a^b(\\pi(x))^2dx',Rp,Fa,Bt,Qn,cl='π(x)=i=1n(xxi)\\pi(x) = \\prod_{i=1}^n (x - x_i)',Zt,Gp,Oa,Wp,Ba,Za,cp,Yt,Fp,Ya,Op,Ja,Bp,Ka,Ua,op,Jt,Zp,ua,Kt,Vn,ol='abρ(x)f(x)dx\\int_a^b \\rho(x)f(x) dx',Ut,Rn,hl='ρ(x)\\rho(x)',Xt,Yp,Xa,sm,Gn,gl=`ρ(x)=11+x2\\rho(x) = \\dfrac{1}{\\sqrt {1 + x^2}}`,am,Jp,sn,nm,Wn,yl='xix_i',pm,Kp,an,nn,hp,tm,Up,As,mm,Fn,ul='aa',lm,On,vl='bb',em,Bn,dl='Pn2(x)P'_{n-2}(x)',im,Zn,fl='xix_i',rm,Xp,Yn,cm,st;return w=new yn({props:{variant:"definition",$$slots:{default:[te]},$$scope:{ctx:W}}}),Ms=new yn({props:{variant:"theorem",$$slots:{default:[me]},$$scope:{ctx:W}}}),$s=new Xn({props:{$$slots:{default:[le]},$$scope:{ctx:W}}}),Hs=new yn({props:{variant:"theorem",$$slots:{default:[ee]},$$scope:{ctx:W}}}),ea=new yn({props:{variant:"collary",$$slots:{default:[ie]},$$scope:{ctx:W}}}),Ts=new Xn({props:{$$slots:{default:[re]},$$scope:{ctx:W}}}),Ca=new yn({props:{variant:"theorem",$$slots:{default:[ce]},$$scope:{ctx:W}}}),Da=new Xn({props:{$$slots:{default:[oe]},$$scope:{ctx:W}}}),Qa=new yn({props:{variant:"definition",$$slots:{default:[he]},$$scope:{ctx:W}}}),Wa=new Xn({props:{$$slots:{default:[ge]},$$scope:{ctx:W}}}),Oa=new Xn({props:{$$slots:{default:[ye]},$$scope:{ctx:W}}}),Ya=new yn({props:{variant:"theorem",$$slots:{default:[ue]},$$scope:{ctx:W}}}),Ja=new Xn({props:{$$slots:{default:[ve]},$$scope:{ctx:W}}}),{c(){i=p("h1"),b=p("a"),d=p("span"),C=r("Numeric Integration"),x=u(),g=p("h2"),H=p("a"),P=p("span"),f=r("Newton-Cotes Formula"),M=u(),A=p("p"),_=r("The general idea of Newton-Cotes formula is to first interpolate the function, then integrate the interpolation."),I=u(),G=p("div"),z=u(),D=p("p"),S=r("We substitute Lagrange interpolation polynomial into the formula. Let "),j=p("span"),Q=r(" be "),X=p("strong"),ns=r("the number of points we use"),V=r(". (Not the degree of the polynomial)"),ps=u(),ts=p("div"),T=u(),ss=p("p"),U=r("The part "),N=p("span"),O=r(" is called the remainder term, denoted as "),R=p("span"),F=r("."),rs=u(),as=p("p"),B=r("The "),cs=p("span"),Z=r(" part is unrelated to "),hs=p("span"),$=r(", so we can precompute it and store it in a table."),k=u(),ds=p("p"),ms=r("As for the remainder term, sadly we have no way to find a closed form. So we just keep the ugly form."),ws=u(),Y=p("h3"),J=p("a"),gs=p("span"),Ls=r("Degree of Precision"),y=u(),js(w.$$.fragment),ls=u(),es=p("p"),zs=r("To find out a formula’s degree of precision, we can verify it on "),Ss=p("span"),Ns=r(". Since integration is a linear operator, if the formula is exact for "),ys=p("span"),is=r(", then it’s exact for their linear combination. If they are not exact, of course its degree of precision is less than "),Vs=p("span"),us=r(" since the counterexample exists."),Es=u(),js(Ms.$$.fragment),os=u(),js($s.$$.fragment),Rs=u(),js(Hs.$$.fragment),Ma=u(),Ks=p("p"),Us=r("This is obvious since the points are symmetric, so the odd degree terms are cancelled out."),un=u(),Gs=p("h3"),vs=p("a"),da=p("span"),ta=r("Trapezoidal Rule"),vn=u(),ma=p("p"),la=r("If we just take the two end points, we get the Trapezoidal Rule."),dn=u(),Xs=p("div"),Bs=u(),js(ea.$$.fragment),fa=u(),js(Ts.$$.fragment),ka=u(),Ws=p("h3"),ks=p("a"),ln=p("span"),h=r("Simpson’s Rule"),E=u(),ia=p("p"),sp=r("If we take the "),Pa=p("span"),Zs=r(" points, we get the Simpson’s Rule."),xn=u(),xa=p("div"),en=u(),ra=p("p"),ca=r("The degree of precision is "),La=p("span"),ap=r(". Proof is trivial."),Fs=u(),oa=p("h3"),ha=p("a"),rn=p("span"),np=r("Boole’s Rule"),cn=u(),ga=p("p"),bn=r("If we take the "),Ea=p("span"),pp=r(" points, we get the Boole’s Rule."),sa=u(),ba=p("div"),wn=u(),aa=p("p"),tp=r("The degree of precision is "),zn=p("span"),xt=r(". Proof is trivial."),fp=u(),$a=p("h3"),Ha=p("a"),mp=p("span"),bt=r("Composite Newton-Cotes Formula"),xp=u(),Ta=p("p"),wt=r("When the number of points exceeds "),_n=p("span"),zt=r(", some of the coefficients become negative. This is not good for numerical computation. So we can divide the interval into subintervals, and apply the Newton-Cotes formula on each subinterval."),bp=u(),Mn=p("p"),_t=r("Take composite Simpson’s Rule as an example."),wp=u(),on=p("div"),zp=u(),kn=p("p"),Mt=r("The error term is the sum of the error terms of each subinterval, whose form is exactly the same as the error term of the original Simpson’s Rule."),_p=u(),Sa=p("h3"),Na=p("a"),lp=p("span"),kt=r("Open Newton-Cotes Formula"),Mp=u(),Ys=p("p"),Pt=r("Some functions are not defined at the end points, such as "),Pn=p("span"),Lt=r(". If we want to integrate it from "),Ln=p("span"),Et=r(" to "),En=p("span"),$t=r(", we can use the Open Newton-Cotes Formula."),kp=u(),$n=p("p"),Ht=r("The idea of Open Newton-Cotes Formula is simply avoiding the end points."),Pp=u(),Hn=p("p"),Tt=r("Midpoint Rule is the simplest Open Newton-Cotes Formula."),Lp=u(),hn=p("div"),Ep=u(),Aa=p("h3"),ja=p("a"),ep=p("span"),St=r("Adaptive Quadrature"),$p=u(),Tn=p("p"),Nt=r("Some part of the function changes rapidly, while some part changes slowly. If we use the same number of points in the whole interval, we may get Time Limit Exceeded. So we can use Adaptive Quadrature to use more points in the rapidly changing part, and less points in the slowly changing part."),Hp=u(),Sn=p("p"),At=r("We first start recursion with the whole interval, then divide the interval into two subintervals, and recurse on each subinterval. The key is comparing the difference between the integral of the whole interval and the sum of the integrals of the two subintervals. If the difference is small enough, we can stop the recursion."),Tp=u(),Ia=p("h2"),qa=p("a"),ip=p("span"),jt=r("Gaussian Quadrature"),Sp=u(),ya=p("p"),It=r("The idea of Gaussian Quadrature is to choose the points "),Nn=p("span"),qt=r(" and weights "),An=p("span"),Ct=r(" such that the degree of precision is as high as possible."),Np=u(),js(Ca.$$.fragment),Ap=u(),js(Da.$$.fragment),jp=u(),js(Qa.$$.fragment),Ip=u(),Va=p("h3"),Ra=p("a"),rp=p("span"),Dt=r("Legendre-Gauss Quadrature"),qp=u(),Js=p("p"),Qt=r("The idea is picking "),jn=p("span"),Vt=r(" as the roots of Legendre polynomial "),In=p("span"),Rt=r(". In this way, the degree of precision is exactly "),qn=p("span"),Gt=r("."),Cp=u(),Ga=p("p"),Wt=r("To make life easier, we can normalize the interval to "),Cn=p("span"),Ft=r(". This do no harm to the generality of the formula."),Dp=u(),js(Wa.$$.fragment),Qp=u(),Dn=p("p"),Ot=r("The error term is"),Vp=u(),gn=p("div"),Rp=u(),Fa=p("p"),Bt=r("where "),Qn=p("span"),Zt=r("."),Gp=u(),js(Oa.$$.fragment),Wp=u(),Ba=p("h3"),Za=p("a"),cp=p("span"),Yt=r("Weights of Legendre-Gauss Quadrature"),Fp=u(),js(Ya.$$.fragment),Op=u(),js(Ja.$$.fragment),Bp=u(),Ka=p("h3"),Ua=p("a"),op=p("span"),Jt=r("Weighted Gaussian Quadrature"),Zp=u(),ua=p("p"),Kt=r("Consider we want to integrate "),Vn=p("span"),Ut=r(", where "),Rn=p("span"),Xt=r(" is a weight function. We can use the same idea to get the weighted Gaussian Quadrature."),Yp=u(),Xa=p("p"),sm=r("Here we only discuss the case where "),Gn=p("span"),am=r("."),Jp=u(),sn=p("p"),nm=r("In this case, we use Chebyshev Zeroes as the points "),Wn=p("span"),pm=r(". The proof is similar to the proof of Gauss-Legendre Quadrature, we omit it here."),Kp=u(),an=p("h3"),nn=p("a"),hp=p("span"),tm=r("Lobatto Quadrature"),Up=u(),As=p("p"),mm=r("Lobatto’s idea is use "),Fn=p("span"),lm=r(", "),On=p("span"),em=r(" and the roots of "),Bn=p("span"),im=r(" as the points "),Zn=p("span"),rm=r("."),Xp=u(),Yn=p("p"),cm=r("In this way, it uses the end points as information."),this.h()},l(a){i=t(a,"H1",{id:!0});var o=m(i);b=t(o,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var gp=m(b);d=t(gp,"SPAN",{class:!0}),m(d).forEach(s),gp.forEach(s),C=c(o,"Numeric Integration"),o.forEach(s),x=v(a),g=t(a,"H2",{id:!0});var Jn=m(g);H=t(Jn,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var yp=m(H);P=t(yp,"SPAN",{class:!0}),m(P).forEach(s),yp.forEach(s),f=c(Jn,"Newton-Cotes Formula"),Jn.forEach(s),M=v(a),A=t(a,"P",{});var up=m(A);_=c(up,"The general idea of Newton-Cotes formula is to first interpolate the function, then integrate the interpolation."),up.forEach(s),I=v(a),G=t(a,"DIV",{class:!0});var at=m(G);at.forEach(s),z=v(a),D=t(a,"P",{});var wa=m(D);S=c(wa,"We substitute Lagrange interpolation polynomial into the formula. Let "),j=t(wa,"SPAN",{class:!0});var nt=m(j);nt.forEach(s),Q=c(wa," be "),X=t(wa,"STRONG",{});var vp=m(X);ns=c(vp,"the number of points we use"),vp.forEach(s),V=c(wa,". (Not the degree of the polynomial)"),wa.forEach(s),ps=v(a),ts=t(a,"DIV",{class:!0});var pt=m(ts);pt.forEach(s),T=v(a),ss=t(a,"P",{});var za=m(ss);U=c(za,"The part "),N=t(za,"SPAN",{class:!0});var tt=m(N);tt.forEach(s),O=c(za," is called the remainder term, denoted as "),R=t(za,"SPAN",{class:!0});var mt=m(R);mt.forEach(s),F=c(za,"."),za.forEach(s),rs=v(a),as=t(a,"P",{});var _a=m(as);B=c(_a,"The "),cs=t(_a,"SPAN",{class:!0});var xl=m(cs);xl.forEach(s),Z=c(_a," part is unrelated to "),hs=t(_a,"SPAN",{class:!0});var bl=m(hs);bl.forEach(s),$=c(_a,", so we can precompute it and store it in a table."),_a.forEach(s),k=v(a),ds=t(a,"P",{});var Mm=m(ds);ms=c(Mm,"As for the remainder term, sadly we have no way to find a closed form. So we just keep the ugly form."),Mm.forEach(s),ws=v(a),Y=t(a,"H3",{id:!0});var om=m(Y);J=t(om,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var km=m(J);gs=t(km,"SPAN",{class:!0}),m(gs).forEach(s),km.forEach(s),Ls=c(om,"Degree of Precision"),om.forEach(s),y=v(a),Is(w.$$.fragment,a),ls=v(a),es=t(a,"P",{});var pn=m(es);zs=c(pn,"To find out a formula’s degree of precision, we can verify it on "),Ss=t(pn,"SPAN",{class:!0});var wl=m(Ss);wl.forEach(s),Ns=c(pn,". Since integration is a linear operator, if the formula is exact for "),ys=t(pn,"SPAN",{class:!0});var zl=m(ys);zl.forEach(s),is=c(pn,", then it’s exact for their linear combination. If they are not exact, of course its degree of precision is less than "),Vs=t(pn,"SPAN",{class:!0});var _l=m(Vs);_l.forEach(s),us=c(pn," since the counterexample exists."),pn.forEach(s),Es=v(a),Is(Ms.$$.fragment,a),os=v(a),Is($s.$$.fragment,a),Rs=v(a),Is(Hs.$$.fragment,a),Ma=v(a),Ks=t(a,"P",{});var Pm=m(Ks);Us=c(Pm,"This is obvious since the points are symmetric, so the odd degree terms are cancelled out."),Pm.forEach(s),un=v(a),Gs=t(a,"H3",{id:!0});var hm=m(Gs);vs=t(hm,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Lm=m(vs);da=t(Lm,"SPAN",{class:!0}),m(da).forEach(s),Lm.forEach(s),ta=c(hm,"Trapezoidal Rule"),hm.forEach(s),vn=v(a),ma=t(a,"P",{});var Em=m(ma);la=c(Em,"If we just take the two end points, we get the Trapezoidal Rule."),Em.forEach(s),dn=v(a),Xs=t(a,"DIV",{class:!0});var Ml=m(Xs);Ml.forEach(s),Bs=v(a),Is(ea.$$.fragment,a),fa=v(a),Is(Ts.$$.fragment,a),ka=v(a),Ws=t(a,"H3",{id:!0});var gm=m(Ws);ks=t(gm,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var $m=m(ks);ln=t($m,"SPAN",{class:!0}),m(ln).forEach(s),$m.forEach(s),h=c(gm,"Simpson’s Rule"),gm.forEach(s),E=v(a),ia=t(a,"P",{});var lt=m(ia);sp=c(lt,"If we take the "),Pa=t(lt,"SPAN",{class:!0});var kl=m(Pa);kl.forEach(s),Zs=c(lt," points, we get the Simpson’s Rule."),lt.forEach(s),xn=v(a),xa=t(a,"DIV",{class:!0});var Pl=m(xa);Pl.forEach(s),en=v(a),ra=t(a,"P",{});var et=m(ra);ca=c(et,"The degree of precision is "),La=t(et,"SPAN",{class:!0});var Ll=m(La);Ll.forEach(s),ap=c(et,". Proof is trivial."),et.forEach(s),Fs=v(a),oa=t(a,"H3",{id:!0});var ym=m(oa);ha=t(ym,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Hm=m(ha);rn=t(Hm,"SPAN",{class:!0}),m(rn).forEach(s),Hm.forEach(s),np=c(ym,"Boole’s Rule"),ym.forEach(s),cn=v(a),ga=t(a,"P",{});var it=m(ga);bn=c(it,"If we take the "),Ea=t(it,"SPAN",{class:!0});var El=m(Ea);El.forEach(s),pp=c(it," points, we get the Boole’s Rule."),it.forEach(s),sa=v(a),ba=t(a,"DIV",{class:!0});var $l=m(ba);$l.forEach(s),wn=v(a),aa=t(a,"P",{});var rt=m(aa);tp=c(rt,"The degree of precision is "),zn=t(rt,"SPAN",{class:!0});var Hl=m(zn);Hl.forEach(s),xt=c(rt,". Proof is trivial."),rt.forEach(s),fp=v(a),$a=t(a,"H3",{id:!0});var um=m($a);Ha=t(um,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Tm=m(Ha);mp=t(Tm,"SPAN",{class:!0}),m(mp).forEach(s),Tm.forEach(s),bt=c(um,"Composite Newton-Cotes Formula"),um.forEach(s),xp=v(a),Ta=t(a,"P",{});var ct=m(Ta);wt=c(ct,"When the number of points exceeds "),_n=t(ct,"SPAN",{class:!0});var Tl=m(_n);Tl.forEach(s),zt=c(ct,", some of the coefficients become negative. This is not good for numerical computation. So we can divide the interval into subintervals, and apply the Newton-Cotes formula on each subinterval."),ct.forEach(s),bp=v(a),Mn=t(a,"P",{});var Sm=m(Mn);_t=c(Sm,"Take composite Simpson’s Rule as an example."),Sm.forEach(s),wp=v(a),on=t(a,"DIV",{class:!0});var Sl=m(on);Sl.forEach(s),zp=v(a),kn=t(a,"P",{});var Nm=m(kn);Mt=c(Nm,"The error term is the sum of the error terms of each subinterval, whose form is exactly the same as the error term of the original Simpson’s Rule."),Nm.forEach(s),_p=v(a),Sa=t(a,"H3",{id:!0});var vm=m(Sa);Na=t(vm,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Am=m(Na);lp=t(Am,"SPAN",{class:!0}),m(lp).forEach(s),Am.forEach(s),kt=c(vm,"Open Newton-Cotes Formula"),vm.forEach(s),Mp=v(a),Ys=t(a,"P",{});var tn=m(Ys);Pt=c(tn,"Some functions are not defined at the end points, such as "),Pn=t(tn,"SPAN",{class:!0});var Nl=m(Pn);Nl.forEach(s),Lt=c(tn,". If we want to integrate it from "),Ln=t(tn,"SPAN",{class:!0});var Al=m(Ln);Al.forEach(s),Et=c(tn," to "),En=t(tn,"SPAN",{class:!0});var jl=m(En);jl.forEach(s),$t=c(tn,", we can use the Open Newton-Cotes Formula."),tn.forEach(s),kp=v(a),$n=t(a,"P",{});var jm=m($n);Ht=c(jm,"The idea of Open Newton-Cotes Formula is simply avoiding the end points."),jm.forEach(s),Pp=v(a),Hn=t(a,"P",{});var Im=m(Hn);Tt=c(Im,"Midpoint Rule is the simplest Open Newton-Cotes Formula."),Im.forEach(s),Lp=v(a),hn=t(a,"DIV",{class:!0});var Il=m(hn);Il.forEach(s),Ep=v(a),Aa=t(a,"H3",{id:!0});var dm=m(Aa);ja=t(dm,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var qm=m(ja);ep=t(qm,"SPAN",{class:!0}),m(ep).forEach(s),qm.forEach(s),St=c(dm,"Adaptive Quadrature"),dm.forEach(s),$p=v(a),Tn=t(a,"P",{});var Cm=m(Tn);Nt=c(Cm,"Some part of the function changes rapidly, while some part changes slowly. If we use the same number of points in the whole interval, we may get Time Limit Exceeded. So we can use Adaptive Quadrature to use more points in the rapidly changing part, and less points in the slowly changing part."),Cm.forEach(s),Hp=v(a),Sn=t(a,"P",{});var Dm=m(Sn);At=c(Dm,"We first start recursion with the whole interval, then divide the interval into two subintervals, and recurse on each subinterval. The key is comparing the difference between the integral of the whole interval and the sum of the integrals of the two subintervals. If the difference is small enough, we can stop the recursion."),Dm.forEach(s),Tp=v(a),Ia=t(a,"H2",{id:!0});var fm=m(Ia);qa=t(fm,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Qm=m(qa);ip=t(Qm,"SPAN",{class:!0}),m(ip).forEach(s),Qm.forEach(s),jt=c(fm,"Gaussian Quadrature"),fm.forEach(s),Sp=v(a),ya=t(a,"P",{});var Kn=m(ya);It=c(Kn,"The idea of Gaussian Quadrature is to choose the points "),Nn=t(Kn,"SPAN",{class:!0});var ql=m(Nn);ql.forEach(s),qt=c(Kn," and weights "),An=t(Kn,"SPAN",{class:!0});var Cl=m(An);Cl.forEach(s),Ct=c(Kn," such that the degree of precision is as high as possible."),Kn.forEach(s),Np=v(a),Is(Ca.$$.fragment,a),Ap=v(a),Is(Da.$$.fragment,a),jp=v(a),Is(Qa.$$.fragment,a),Ip=v(a),Va=t(a,"H3",{id:!0});var xm=m(Va);Ra=t(xm,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Vm=m(Ra);rp=t(Vm,"SPAN",{class:!0}),m(rp).forEach(s),Vm.forEach(s),Dt=c(xm,"Legendre-Gauss Quadrature"),xm.forEach(s),qp=v(a),Js=t(a,"P",{});var mn=m(Js);Qt=c(mn,"The idea is picking "),jn=t(mn,"SPAN",{class:!0});var Dl=m(jn);Dl.forEach(s),Vt=c(mn," as the roots of Legendre polynomial "),In=t(mn,"SPAN",{class:!0});var Ql=m(In);Ql.forEach(s),Rt=c(mn,". In this way, the degree of precision is exactly "),qn=t(mn,"SPAN",{class:!0});var Vl=m(qn);Vl.forEach(s),Gt=c(mn,"."),mn.forEach(s),Cp=v(a),Ga=t(a,"P",{});var ot=m(Ga);Wt=c(ot,"To make life easier, we can normalize the interval to "),Cn=t(ot,"SPAN",{class:!0});var Rl=m(Cn);Rl.forEach(s),Ft=c(ot,". This do no harm to the generality of the formula."),ot.forEach(s),Dp=v(a),Is(Wa.$$.fragment,a),Qp=v(a),Dn=t(a,"P",{});var Rm=m(Dn);Ot=c(Rm,"The error term is"),Rm.forEach(s),Vp=v(a),gn=t(a,"DIV",{class:!0});var Gl=m(gn);Gl.forEach(s),Rp=v(a),Fa=t(a,"P",{});var ht=m(Fa);Bt=c(ht,"where "),Qn=t(ht,"SPAN",{class:!0});var Wl=m(Qn);Wl.forEach(s),Zt=c(ht,"."),ht.forEach(s),Gp=v(a),Is(Oa.$$.fragment,a),Wp=v(a),Ba=t(a,"H3",{id:!0});var bm=m(Ba);Za=t(bm,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Gm=m(Za);cp=t(Gm,"SPAN",{class:!0}),m(cp).forEach(s),Gm.forEach(s),Yt=c(bm,"Weights of Legendre-Gauss Quadrature"),bm.forEach(s),Fp=v(a),Is(Ya.$$.fragment,a),Op=v(a),Is(Ja.$$.fragment,a),Bp=v(a),Ka=t(a,"H3",{id:!0});var wm=m(Ka);Ua=t(wm,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Wm=m(Ua);op=t(Wm,"SPAN",{class:!0}),m(op).forEach(s),Wm.forEach(s),Jt=c(wm,"Weighted Gaussian Quadrature"),wm.forEach(s),Zp=v(a),ua=t(a,"P",{});var Un=m(ua);Kt=c(Un,"Consider we want to integrate "),Vn=t(Un,"SPAN",{class:!0});var Fl=m(Vn);Fl.forEach(s),Ut=c(Un,", where "),Rn=t(Un,"SPAN",{class:!0});var Ol=m(Rn);Ol.forEach(s),Xt=c(Un," is a weight function. We can use the same idea to get the weighted Gaussian Quadrature."),Un.forEach(s),Yp=v(a),Xa=t(a,"P",{});var gt=m(Xa);sm=c(gt,"Here we only discuss the case where "),Gn=t(gt,"SPAN",{class:!0});var Bl=m(Gn);Bl.forEach(s),am=c(gt,"."),gt.forEach(s),Jp=v(a),sn=t(a,"P",{});var yt=m(sn);nm=c(yt,"In this case, we use Chebyshev Zeroes as the points "),Wn=t(yt,"SPAN",{class:!0});var Zl=m(Wn);Zl.forEach(s),pm=c(yt,". The proof is similar to the proof of Gauss-Legendre Quadrature, we omit it here."),yt.forEach(s),Kp=v(a),an=t(a,"H3",{id:!0});var zm=m(an);nn=t(zm,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Fm=m(nn);hp=t(Fm,"SPAN",{class:!0}),m(hp).forEach(s),Fm.forEach(s),tm=c(zm,"Lobatto Quadrature"),zm.forEach(s),Up=v(a),As=t(a,"P",{});var va=m(As);mm=c(va,"Lobatto’s idea is use "),Fn=t(va,"SPAN",{class:!0});var Yl=m(Fn);Yl.forEach(s),lm=c(va,", "),On=t(va,"SPAN",{class:!0});var Jl=m(On);Jl.forEach(s),em=c(va," and the roots of "),Bn=t(va,"SPAN",{class:!0});var Kl=m(Bn);Kl.forEach(s),im=c(va," as the points "),Zn=t(va,"SPAN",{class:!0});var Ul=m(Zn);Ul.forEach(s),rm=c(va,"."),va.forEach(s),Xp=v(a),Yn=t(a,"P",{});var Om=m(Yn);cm=c(Om,"In this way, it uses the end points as information."),Om.forEach(s),this.h()},h(){e(d,"class","icon icon-link"),e(b,"aria-hidden","true"),e(b,"tabindex","-1"),e(b,"href","#numeric-integration"),e(i,"id","numeric-integration"),e(P,"class","icon icon-link"),e(H,"aria-hidden","true"),e(H,"tabindex","-1"),e(H,"href","#newton-cotes-formula"),e(g,"id","newton-cotes-formula"),e(G,"class","math math-display"),e(j,"class","math math-inline"),e(ts,"class","math math-display"),e(N,"class","math math-inline"),e(R,"class","math math-inline"),e(cs,"class","math math-inline"),e(hs,"class","math math-inline"),e(gs,"class","icon icon-link"),e(J,"aria-hidden","true"),e(J,"tabindex","-1"),e(J,"href","#degree-of-precision"),e(Y,"id","degree-of-precision"),e(Ss,"class","math math-inline"),e(ys,"class","math math-inline"),e(Vs,"class","math math-inline"),e(da,"class","icon icon-link"),e(vs,"aria-hidden","true"),e(vs,"tabindex","-1"),e(vs,"href","#trapezoidal-rule"),e(Gs,"id","trapezoidal-rule"),e(Xs,"class","math math-display"),e(ln,"class","icon icon-link"),e(ks,"aria-hidden","true"),e(ks,"tabindex","-1"),e(ks,"href","#simpsons-rule"),e(Ws,"id","simpsons-rule"),e(Pa,"class","math math-inline"),e(xa,"class","math math-display"),e(La,"class","math math-inline"),e(rn,"class","icon icon-link"),e(ha,"aria-hidden","true"),e(ha,"tabindex","-1"),e(ha,"href","#booles-rule"),e(oa,"id","booles-rule"),e(Ea,"class","math math-inline"),e(ba,"class","math math-display"),e(zn,"class","math math-inline"),e(mp,"class","icon icon-link"),e(Ha,"aria-hidden","true"),e(Ha,"tabindex","-1"),e(Ha,"href","#composite-newton-cotes-formula"),e($a,"id","composite-newton-cotes-formula"),e(_n,"class","math math-inline"),e(on,"class","math math-display"),e(lp,"class","icon icon-link"),e(Na,"aria-hidden","true"),e(Na,"tabindex","-1"),e(Na,"href","#open-newton-cotes-formula"),e(Sa,"id","open-newton-cotes-formula"),e(Pn,"class","math math-inline"),e(Ln,"class","math math-inline"),e(En,"class","math math-inline"),e(hn,"class","math math-display"),e(ep,"class","icon icon-link"),e(ja,"aria-hidden","true"),e(ja,"tabindex","-1"),e(ja,"href","#adaptive-quadrature"),e(Aa,"id","adaptive-quadrature"),e(ip,"class","icon icon-link"),e(qa,"aria-hidden","true"),e(qa,"tabindex","-1"),e(qa,"href","#gaussian-quadrature"),e(Ia,"id","gaussian-quadrature"),e(Nn,"class","math math-inline"),e(An,"class","math math-inline"),e(rp,"class","icon icon-link"),e(Ra,"aria-hidden","true"),e(Ra,"tabindex","-1"),e(Ra,"href","#legendre-gauss-quadrature"),e(Va,"id","legendre-gauss-quadrature"),e(jn,"class","math math-inline"),e(In,"class","math math-inline"),e(qn,"class","math math-inline"),e(Cn,"class","math math-inline"),e(gn,"class","math math-display"),e(Qn,"class","math math-inline"),e(cp,"class","icon icon-link"),e(Za,"aria-hidden","true"),e(Za,"tabindex","-1"),e(Za,"href","#weights-of-legendre-gauss-quadrature"),e(Ba,"id","weights-of-legendre-gauss-quadrature"),e(op,"class","icon icon-link"),e(Ua,"aria-hidden","true"),e(Ua,"tabindex","-1"),e(Ua,"href","#weighted-gaussian-quadrature"),e(Ka,"id","weighted-gaussian-quadrature"),e(Vn,"class","math math-inline"),e(Rn,"class","math math-inline"),e(Gn,"class","math math-inline"),e(Wn,"class","math math-inline"),e(hp,"class","icon icon-link"),e(nn,"aria-hidden","true"),e(nn,"tabindex","-1"),e(nn,"href","#lobatto-quadrature"),e(an,"id","lobatto-quadrature"),e(Fn,"class","math math-inline"),e(On,"class","math math-inline"),e(Bn,"class","math math-inline"),e(Zn,"class","math math-inline")},m(a,o){l(a,i,o),n(i,b),n(b,d),n(i,C),l(a,x,o),l(a,g,o),n(g,H),n(H,P),n(g,f),l(a,M,o),l(a,A,o),n(A,_),l(a,I,o),l(a,G,o),G.innerHTML=L,l(a,z,o),l(a,D,o),n(D,S),n(D,j),j.innerHTML=K,n(D,Q),n(D,X),n(X,ns),n(D,V),l(a,ps,o),l(a,ts,o),ts.innerHTML=q,l(a,T,o),l(a,ss,o),n(ss,U),n(ss,N),N.innerHTML=fs,n(ss,O),n(ss,R),R.innerHTML=xs,n(ss,F),l(a,rs,o),l(a,as,o),n(as,B),n(as,cs),cs.innerHTML=bs,n(as,Z),n(as,hs),hs.innerHTML=Ps,n(as,$),l(a,k,o),l(a,ds,o),n(ds,ms),l(a,ws,o),l(a,Y,o),n(Y,J),n(J,gs),n(Y,Ls),l(a,y,o),qs(w,a,o),l(a,ls,o),l(a,es,o),n(es,zs),n(es,Ss),Ss.innerHTML=_s,n(es,Ns),n(es,ys),ys.innerHTML=na,n(es,is),n(es,Vs),Vs.innerHTML=pa,n(es,us),l(a,Es,o),qs(Ms,a,o),l(a,os,o),qs($s,a,o),l(a,Rs,o),qs(Hs,a,o),l(a,Ma,o),l(a,Ks,o),n(Ks,Us),l(a,un,o),l(a,Gs,o),n(Gs,vs),n(vs,da),n(Gs,ta),l(a,vn,o),l(a,ma,o),n(ma,la),l(a,dn,o),l(a,Xs,o),Xs.innerHTML=fn,l(a,Bs,o),qs(ea,a,o),l(a,fa,o),qs(Ts,a,o),l(a,ka,o),l(a,Ws,o),n(Ws,ks),n(ks,ln),n(Ws,h),l(a,E,o),l(a,ia,o),n(ia,sp),n(ia,Pa),Pa.innerHTML=ut,n(ia,Zs),l(a,xn,o),l(a,xa,o),xa.innerHTML=vt,l(a,en,o),l(a,ra,o),n(ra,ca),n(ra,La),La.innerHTML=dt,n(ra,ap),l(a,Fs,o),l(a,oa,o),n(oa,ha),n(ha,rn),n(oa,np),l(a,cn,o),l(a,ga,o),n(ga,bn),n(ga,Ea),Ea.innerHTML=dp,n(ga,pp),l(a,sa,o),l(a,ba,o),ba.innerHTML=ft,l(a,wn,o),l(a,aa,o),n(aa,tp),n(aa,zn),zn.innerHTML=Jm,n(aa,xt),l(a,fp,o),l(a,$a,o),n($a,Ha),n(Ha,mp),n($a,bt),l(a,xp,o),l(a,Ta,o),n(Ta,wt),n(Ta,_n),_n.innerHTML=Km,n(Ta,zt),l(a,bp,o),l(a,Mn,o),n(Mn,_t),l(a,wp,o),l(a,on,o),on.innerHTML=Um,l(a,zp,o),l(a,kn,o),n(kn,Mt),l(a,_p,o),l(a,Sa,o),n(Sa,Na),n(Na,lp),n(Sa,kt),l(a,Mp,o),l(a,Ys,o),n(Ys,Pt),n(Ys,Pn),Pn.innerHTML=Xm,n(Ys,Lt),n(Ys,Ln),Ln.innerHTML=sl,n(Ys,Et),n(Ys,En),En.innerHTML=al,n(Ys,$t),l(a,kp,o),l(a,$n,o),n($n,Ht),l(a,Pp,o),l(a,Hn,o),n(Hn,Tt),l(a,Lp,o),l(a,hn,o),hn.innerHTML=nl,l(a,Ep,o),l(a,Aa,o),n(Aa,ja),n(ja,ep),n(Aa,St),l(a,$p,o),l(a,Tn,o),n(Tn,Nt),l(a,Hp,o),l(a,Sn,o),n(Sn,At),l(a,Tp,o),l(a,Ia,o),n(Ia,qa),n(qa,ip),n(Ia,jt),l(a,Sp,o),l(a,ya,o),n(ya,It),n(ya,Nn),Nn.innerHTML=pl,n(ya,qt),n(ya,An),An.innerHTML=tl,n(ya,Ct),l(a,Np,o),qs(Ca,a,o),l(a,Ap,o),qs(Da,a,o),l(a,jp,o),qs(Qa,a,o),l(a,Ip,o),l(a,Va,o),n(Va,Ra),n(Ra,rp),n(Va,Dt),l(a,qp,o),l(a,Js,o),n(Js,Qt),n(Js,jn),jn.innerHTML=ml,n(Js,Vt),n(Js,In),In.innerHTML=ll,n(Js,Rt),n(Js,qn),qn.innerHTML=el,n(Js,Gt),l(a,Cp,o),l(a,Ga,o),n(Ga,Wt),n(Ga,Cn),Cn.innerHTML=il,n(Ga,Ft),l(a,Dp,o),qs(Wa,a,o),l(a,Qp,o),l(a,Dn,o),n(Dn,Ot),l(a,Vp,o),l(a,gn,o),gn.innerHTML=rl,l(a,Rp,o),l(a,Fa,o),n(Fa,Bt),n(Fa,Qn),Qn.innerHTML=cl,n(Fa,Zt),l(a,Gp,o),qs(Oa,a,o),l(a,Wp,o),l(a,Ba,o),n(Ba,Za),n(Za,cp),n(Ba,Yt),l(a,Fp,o),qs(Ya,a,o),l(a,Op,o),qs(Ja,a,o),l(a,Bp,o),l(a,Ka,o),n(Ka,Ua),n(Ua,op),n(Ka,Jt),l(a,Zp,o),l(a,ua,o),n(ua,Kt),n(ua,Vn),Vn.innerHTML=ol,n(ua,Ut),n(ua,Rn),Rn.innerHTML=hl,n(ua,Xt),l(a,Yp,o),l(a,Xa,o),n(Xa,sm),n(Xa,Gn),Gn.innerHTML=gl,n(Xa,am),l(a,Jp,o),l(a,sn,o),n(sn,nm),n(sn,Wn),Wn.innerHTML=yl,n(sn,pm),l(a,Kp,o),l(a,an,o),n(an,nn),n(nn,hp),n(an,tm),l(a,Up,o),l(a,As,o),n(As,mm),n(As,Fn),Fn.innerHTML=ul,n(As,lm),n(As,On),On.innerHTML=vl,n(As,em),n(As,Bn),Bn.innerHTML=dl,n(As,im),n(As,Zn),Zn.innerHTML=fl,n(As,rm),l(a,Xp,o),l(a,Yn,o),n(Yn,cm),st=!0},p(a,o){const gp={};o&2&&(gp.$$scope={dirty:o,ctx:a}),w.$set(gp);const Jn={};o&2&&(Jn.$$scope={dirty:o,ctx:a}),Ms.$set(Jn);const yp={};o&2&&(yp.$$scope={dirty:o,ctx:a}),$s.$set(yp);const up={};o&2&&(up.$$scope={dirty:o,ctx:a}),Hs.$set(up);const at={};o&2&&(at.$$scope={dirty:o,ctx:a}),ea.$set(at);const wa={};o&2&&(wa.$$scope={dirty:o,ctx:a}),Ts.$set(wa);const nt={};o&2&&(nt.$$scope={dirty:o,ctx:a}),Ca.$set(nt);const vp={};o&2&&(vp.$$scope={dirty:o,ctx:a}),Da.$set(vp);const pt={};o&2&&(pt.$$scope={dirty:o,ctx:a}),Qa.$set(pt);const za={};o&2&&(za.$$scope={dirty:o,ctx:a}),Wa.$set(za);const tt={};o&2&&(tt.$$scope={dirty:o,ctx:a}),Oa.$set(tt);const mt={};o&2&&(mt.$$scope={dirty:o,ctx:a}),Ya.$set(mt);const _a={};o&2&&(_a.$$scope={dirty:o,ctx:a}),Ja.$set(_a)},i(a){st||(Cs(w.$$.fragment,a),Cs(Ms.$$.fragment,a),Cs($s.$$.fragment,a),Cs(Hs.$$.fragment,a),Cs(ea.$$.fragment,a),Cs(Ts.$$.fragment,a),Cs(Ca.$$.fragment,a),Cs(Da.$$.fragment,a),Cs(Qa.$$.fragment,a),Cs(Wa.$$.fragment,a),Cs(Oa.$$.fragment,a),Cs(Ya.$$.fragment,a),Cs(Ja.$$.fragment,a),st=!0)},o(a){Ds(w.$$.fragment,a),Ds(Ms.$$.fragment,a),Ds($s.$$.fragment,a),Ds(Hs.$$.fragment,a),Ds(ea.$$.fragment,a),Ds(Ts.$$.fragment,a),Ds(Ca.$$.fragment,a),Ds(Da.$$.fragment,a),Ds(Qa.$$.fragment,a),Ds(Wa.$$.fragment,a),Ds(Oa.$$.fragment,a),Ds(Ya.$$.fragment,a),Ds(Ja.$$.fragment,a),st=!1},d(a){a&&s(i),a&&s(x),a&&s(g),a&&s(M),a&&s(A),a&&s(I),a&&s(G),a&&s(z),a&&s(D),a&&s(ps),a&&s(ts),a&&s(T),a&&s(ss),a&&s(rs),a&&s(as),a&&s(k),a&&s(ds),a&&s(ws),a&&s(Y),a&&s(y),Qs(w,a),a&&s(ls),a&&s(es),a&&s(Es),Qs(Ms,a),a&&s(os),Qs($s,a),a&&s(Rs),Qs(Hs,a),a&&s(Ma),a&&s(Ks),a&&s(un),a&&s(Gs),a&&s(vn),a&&s(ma),a&&s(dn),a&&s(Xs),a&&s(Bs),Qs(ea,a),a&&s(fa),Qs(Ts,a),a&&s(ka),a&&s(Ws),a&&s(E),a&&s(ia),a&&s(xn),a&&s(xa),a&&s(en),a&&s(ra),a&&s(Fs),a&&s(oa),a&&s(cn),a&&s(ga),a&&s(sa),a&&s(ba),a&&s(wn),a&&s(aa),a&&s(fp),a&&s($a),a&&s(xp),a&&s(Ta),a&&s(bp),a&&s(Mn),a&&s(wp),a&&s(on),a&&s(zp),a&&s(kn),a&&s(_p),a&&s(Sa),a&&s(Mp),a&&s(Ys),a&&s(kp),a&&s($n),a&&s(Pp),a&&s(Hn),a&&s(Lp),a&&s(hn),a&&s(Ep),a&&s(Aa),a&&s($p),a&&s(Tn),a&&s(Hp),a&&s(Sn),a&&s(Tp),a&&s(Ia),a&&s(Sp),a&&s(ya),a&&s(Np),Qs(Ca,a),a&&s(Ap),Qs(Da,a),a&&s(jp),Qs(Qa,a),a&&s(Ip),a&&s(Va),a&&s(qp),a&&s(Js),a&&s(Cp),a&&s(Ga),a&&s(Dp),Qs(Wa,a),a&&s(Qp),a&&s(Dn),a&&s(Vp),a&&s(gn),a&&s(Rp),a&&s(Fa),a&&s(Gp),Qs(Oa,a),a&&s(Wp),a&&s(Ba),a&&s(Fp),Qs(Ya,a),a&&s(Op),Qs(Ja,a),a&&s(Bp),a&&s(Ka),a&&s(Zp),a&&s(ua),a&&s(Yp),a&&s(Xa),a&&s(Jp),a&&s(sn),a&&s(Kp),a&&s(an),a&&s(Up),a&&s(As),a&&s(Xp),a&&s(Yn)}}}function fe(W){let i,b;const d=[W[0],Ym];let C={$$slots:{default:[de]},$$scope:{ctx:W}};for(let x=0;x{b(0,i=_m(_m({},i),Zm(d)))},i=Zm(i),[i]}class Me extends Xl{constructor(i){super(),se(this,i,xe,fe,ae,{})}}export{Me as component}; diff --git a/docs/_app/immutable/nodes/2.f8da0bbd.js b/docs/_app/immutable/nodes/2.f8da0bbd.js deleted file mode 100644 index 0ffc76d..0000000 --- a/docs/_app/immutable/nodes/2.f8da0bbd.js +++ /dev/null @@ -1 +0,0 @@ -import{S as c,i as u,s as f,I as $,k as m,l as _,m as g,h as r,n as i,b as p,K as v,L as y,M as E,g as d,d as h,a as M,y as q,J as x,c as C,z as I,E as b,A as k,G as w,B as A}from"../chunks/index.488f1ee5.js";import{p as S}from"../chunks/common.2a229ee5.js";function j(l){let s,n;const a=l[1].default,t=$(a,l,l[0],null);return{c(){s=m("div"),t&&t.c(),this.h()},l(e){s=_(e,"DIV",{class:!0});var o=g(s);t&&t.l(o),o.forEach(r),this.h()},h(){i(s,"class","main-context svelte-1dilkma")},m(e,o){p(e,s,o),t&&t.m(s,null),n=!0},p(e,[o]){t&&t.p&&(!n||o&1)&&v(t,a,e,e[0],n?E(a,e[0],o,null):y(e[0]),null)},i(e){n||(d(t,e),n=!0)},o(e){h(t,e),n=!1},d(e){e&&r(s),t&&t.d(e)}}}function z(l,s,n){let{$$slots:a={},$$scope:t}=s;return l.$$set=e=>{"$$scope"in e&&n(0,t=e.$$scope)},[t,a]}class B extends c{constructor(s){super(),u(this,s,z,j,f,{})}}function D(l){let s,n,a,t;return a=new B({}),{c(){s=m("meta"),n=M(),q(a.$$.fragment),this.h()},l(e){const o=x("svelte-1j0gygw",document.head);s=_(o,"META",{"http-equiv":!0,content:!0}),o.forEach(r),n=C(e),I(a.$$.fragment,e),this.h()},h(){i(s,"http-equiv","Refresh"),i(s,"content","0;url=/note")},m(e,o){b(document.head,s),p(e,n,o),k(a,e,o),t=!0},p:w,i(e){t||(d(a.$$.fragment,e),t=!0)},o(e){h(a.$$.fragment,e),t=!1},d(e){r(s),e&&r(n),A(a,e)}}}function F(l){return S("目录",null,!1),[]}class K extends c{constructor(s){super(),u(this,s,F,D,f,{})}}export{K as component}; diff --git a/docs/_app/immutable/nodes/3.1dac1c85.js b/docs/_app/immutable/nodes/3.1dac1c85.js deleted file mode 100644 index 44df2e6..0000000 --- a/docs/_app/immutable/nodes/3.1dac1c85.js +++ /dev/null @@ -1 +0,0 @@ -import{S as T,i as j,s as z,O as I,y as B,z as C,A as G,P as H,Q as O,g as Q,d as U,B as F,R as D,k as _,q as x,a as N,l as d,m as f,h as r,r as $,c as k,n as g,b as A,E as n,G as J}from"../chunks/index.488f1ee5.js";import{L as K}from"../chunks/layout.c8702512.js";function M(m){let t,o,s,c,e,a,i,b,E,p,L,y,v,w;return{c(){t=_("h1"),o=_("a"),s=_("span"),c=x("To-do list"),e=N(),a=_("ul"),i=_("li"),b=x("Network flow"),E=N(),p=_("li"),L=x("Dirichlet convolution"),y=N(),v=_("li"),w=x("Numerical integration (Romberg / Lobatto)"),this.h()},l(l){t=d(l,"H1",{id:!0});var u=f(t);o=d(u,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var P=f(o);s=d(P,"SPAN",{class:!0}),f(s).forEach(r),P.forEach(r),c=$(u,"To-do list"),u.forEach(r),e=k(l),a=d(l,"UL",{});var h=f(a);i=d(h,"LI",{});var R=f(i);b=$(R,"Network flow"),R.forEach(r),E=k(h),p=d(h,"LI",{});var S=f(p);L=$(S,"Dirichlet convolution"),S.forEach(r),y=k(h),v=d(h,"LI",{});var q=f(v);w=$(q,"Numerical integration (Romberg / Lobatto)"),q.forEach(r),h.forEach(r),this.h()},h(){g(s,"class","icon icon-link"),g(o,"aria-hidden","true"),g(o,"tabindex","-1"),g(o,"href","#to-do-list"),g(t,"id","to-do-list")},m(l,u){A(l,t,u),n(t,o),n(o,s),n(t,c),A(l,e,u),A(l,a,u),n(a,i),n(i,b),n(a,E),n(a,p),n(p,L),n(a,y),n(a,v),n(v,w)},p:J,d(l){l&&r(t),l&&r(e),l&&r(a)}}}function V(m){let t,o;const s=[m[0]];let c={$$slots:{default:[M]},$$scope:{ctx:m}};for(let e=0;e{o(0,t=I(I({},t),D(s)))},t=D(t),[t]}class Z extends T{constructor(t){super(),j(this,t,W,V,z,{})}}export{Z as component}; diff --git a/docs/_app/immutable/nodes/4.6e2185d6.js b/docs/_app/immutable/nodes/4.6e2185d6.js deleted file mode 100644 index 006400d..0000000 --- a/docs/_app/immutable/nodes/4.6e2185d6.js +++ /dev/null @@ -1,7 +0,0 @@ -import{S as ip,i as cp,s as rp,O as Fn,y as ma,z as la,A as ea,P as op,Q as qn,g as ia,d as ca,B as ra,R as jn,k as p,q as i,a as v,l as m,m as l,h as s,r as c,c as w,n as r,b as e,E as a,G as Ba}from"../chunks/index.488f1ee5.js";import{L as hp}from"../chunks/layout.c8702512.js";import{P as Gn}from"../chunks/Proof.26996d3c.js";import{S as ln}from"../chunks/State.8d241e02.js";function gp(R){let o,b,u,z,f,y,x='Tn(x)T_n(x)',E,T,M,$='Tn(x)=cos(narccosx)T_n(x) = \\cos(n \\arccos x)';return{c(){o=p("p"),b=i("Define "),u=p("strong"),z=i("Chebyshev polynomial"),f=i(" of the first kind "),y=p("span"),E=i(" as"),T=v(),M=p("div"),this.h()},l(_){o=m(_,"P",{});var k=l(o);b=c(k,"Define "),u=m(k,"STRONG",{});var B=l(u);z=c(B,"Chebyshev polynomial"),B.forEach(s),f=c(k," of the first kind "),y=m(k,"SPAN",{class:!0});var P=l(y);P.forEach(s),E=c(k," as"),k.forEach(s),T=w(_),M=m(_,"DIV",{class:!0});var S=l(M);S.forEach(s),this.h()},h(){r(y,"class","math math-inline"),r(M,"class","math math-display")},m(_,k){e(_,o,k),a(o,b),a(o,u),a(u,z),a(o,f),a(o,y),y.innerHTML=x,a(o,E),e(_,T,k),e(_,M,k),M.innerHTML=$},p:Ba,d(_){_&&s(o),_&&s(T),_&&s(M)}}}function yp(R){let o,b,u,z,f;return{c(){o=p("p"),b=i("Define a polynomial whose coeffient of highest degree is 1 as a "),u=p("strong"),z=i("monic"),f=i(" polynomial.")},l(y){o=m(y,"P",{});var x=l(o);b=c(x,"Define a polynomial whose coeffient of highest degree is 1 as a "),u=m(x,"STRONG",{});var E=l(u);z=c(E,"monic"),E.forEach(s),f=c(x," polynomial."),x.forEach(s)},m(y,x){e(y,o,x),a(o,b),a(o,u),a(u,z),a(o,f)},p:Ba,d(y){y&&s(o)}}}function dp(R){let o,b,u,z='nn',f,y,x='12n1Tn(x)\\dfrac{1}{2^{n - 1}}T_n(x)',E,T,M='nn',$;return{c(){o=p("p"),b=i("For any positive integer "),u=p("span"),f=i(", "),y=p("span"),E=i(" is a monic polynomial with degree "),T=p("span"),$=i("."),this.h()},l(_){o=m(_,"P",{});var k=l(o);b=c(k,"For any positive integer "),u=m(k,"SPAN",{class:!0});var B=l(u);B.forEach(s),f=c(k,", "),y=m(k,"SPAN",{class:!0});var P=l(y);P.forEach(s),E=c(k," is a monic polynomial with degree "),T=m(k,"SPAN",{class:!0});var S=l(T);S.forEach(s),$=c(k,"."),k.forEach(s),this.h()},h(){r(u,"class","math math-inline"),r(y,"class","math math-inline"),r(T,"class","math math-inline")},m(_,k){e(_,o,k),a(o,b),a(o,u),u.innerHTML=z,a(o,f),a(o,y),y.innerHTML=x,a(o,E),a(o,T),T.innerHTML=M,a(o,$)},p:Ba,d(_){_&&s(o)}}}function up(R){let o,b,u,z,f=`1211T1(x)=x1221T2(x)=12(2x21)=x212\\dfrac{1}{2 ^ {1 - 1}} T_1(x) = x\\\\ -\\dfrac{1}{2 ^ {2 - 1}} T_2(x) = \\dfrac{1}{2} (2x^2 - 1) = x^2 - \\dfrac{1}{2}`,y,x,E,T,M,$,_,k='12n2Tn1(x)\\dfrac{1}{2 ^ {n - 2}} T_{n - 1}(x)',B,P,S='n1n - 1',us,Y,O='12n3Tn2(x)\\dfrac{1}{2 ^ {n - 3}} T_{n - 2}(x)',C,ls,bs='n2n - 2',V,js,Q,ts=`12n1Tn(x)=12n12xTn1(x)12n1Tn2(x)=x(12n2Tn1(x))12n1Tn2(x)\\dfrac{1}{2 ^ {n - 1}} T_n(x) = \\dfrac{1}{2 ^ {n - 1}} \\cdot 2xT_{n - 1}(x) - \\dfrac{1}{2 ^ {n - 1}} T_{n - 2}(x)\\\\ -= x(\\dfrac{1}{2 ^ {n - 2}}T_{n - 1}(x)) - \\dfrac{1}{2 ^ {n - 1}} T_{n - 2}(x)`,A,H,W,Ms,_s='nn',q,es,ks='n2n - 2',F,zs,Ts='nn',D;return{c(){o=p("p"),b=i("Basis Step:"),u=v(),z=p("div"),y=v(),x=p("p"),E=i("Inductive Step:"),T=v(),M=p("p"),$=i("Assume that "),_=p("span"),B=i(" is a monic polynomial with degree "),P=p("span"),us=i(", and "),Y=p("span"),C=i(" is a polynomial with degree "),ls=p("span"),V=i("."),js=v(),Q=p("div"),A=v(),H=p("p"),W=i("The first term provided the monic polynomial with degree "),Ms=p("span"),q=i(", and the second term provided the polynomial with degree "),es=p("span"),F=i(", so the sum of the two terms is a monic polynomial with degree "),zs=p("span"),D=i("."),this.h()},l(g){o=m(g,"P",{});var L=l(o);b=c(L,"Basis Step:"),L.forEach(s),u=w(g),z=m(g,"DIV",{class:!0});var Ls=l(z);Ls.forEach(s),y=w(g),x=m(g,"P",{});var Gs=l(x);E=c(Gs,"Inductive Step:"),Gs.forEach(s),T=w(g),M=m(g,"P",{});var N=l(M);$=c(N,"Assume that "),_=m(N,"SPAN",{class:!0});var Es=l(_);Es.forEach(s),B=c(N," is a monic polynomial with degree "),P=m(N,"SPAN",{class:!0});var aa=l(P);aa.forEach(s),us=c(N,", and "),Y=m(N,"SPAN",{class:!0});var Ps=l(Y);Ps.forEach(s),C=c(N," is a polynomial with degree "),ls=m(N,"SPAN",{class:!0});var J=l(ls);J.forEach(s),V=c(N,"."),N.forEach(s),js=w(g),Q=m(g,"DIV",{class:!0});var Ca=l(Q);Ca.forEach(s),A=w(g),H=m(g,"P",{});var j=l(H);W=c(j,"The first term provided the monic polynomial with degree "),Ms=m(j,"SPAN",{class:!0});var G=l(Ms);G.forEach(s),q=c(j,", and the second term provided the polynomial with degree "),es=m(j,"SPAN",{class:!0});var is=l(es);is.forEach(s),F=c(j,", so the sum of the two terms is a monic polynomial with degree "),zs=m(j,"SPAN",{class:!0});var vs=l(zs);vs.forEach(s),D=c(j,"."),j.forEach(s),this.h()},h(){r(z,"class","math math-display"),r(_,"class","math math-inline"),r(P,"class","math math-inline"),r(Y,"class","math math-inline"),r(ls,"class","math math-inline"),r(Q,"class","math math-display"),r(Ms,"class","math math-inline"),r(es,"class","math math-inline"),r(zs,"class","math math-inline")},m(g,L){e(g,o,L),a(o,b),e(g,u,L),e(g,z,L),z.innerHTML=f,e(g,y,L),e(g,x,L),a(x,E),e(g,T,L),e(g,M,L),a(M,$),a(M,_),_.innerHTML=k,a(M,B),a(M,P),P.innerHTML=S,a(M,us),a(M,Y),Y.innerHTML=O,a(M,C),a(M,ls),ls.innerHTML=bs,a(M,V),e(g,js,L),e(g,Q,L),Q.innerHTML=ts,e(g,A,L),e(g,H,L),a(H,W),a(H,Ms),Ms.innerHTML=_s,a(H,q),a(H,es),es.innerHTML=ks,a(H,F),a(H,zs),zs.innerHTML=Ts,a(H,D)},p:Ba,d(g){g&&s(o),g&&s(u),g&&s(z),g&&s(y),g&&s(x),g&&s(T),g&&s(M),g&&s(js),g&&s(Q),g&&s(A),g&&s(H)}}}function vp(R){let o,b,u,z='w(x)w(x)',f;return{c(){o=p("p"),b=i("No other zeros provide a narrower bound for "),u=p("span"),f=i(" than zeros of chebyshev polynomials."),this.h()},l(y){o=m(y,"P",{});var x=l(o);b=c(x,"No other zeros provide a narrower bound for "),u=m(x,"SPAN",{class:!0});var E=l(u);E.forEach(s),f=c(x," than zeros of chebyshev polynomials."),x.forEach(s),this.h()},h(){r(u,"class","math math-inline")},m(y,x){e(y,o,x),a(o,b),a(o,u),u.innerHTML=z,a(o,f)},p:Ba,d(y){y&&s(o)}}}function wp(R){let o,b,u,z='cos\\cos',f,y,x,E='Tn(x)=cos(narccosx)[1,1]T_n(x) = \\cos(n \\arccos x) \\in [-1, 1]',T,M,$,_,k='w(x)w(x)',B,P,S,us='w(x)=i=1n(xxi)w(x) = \\prod_{i = 1}^n (x - x_i)',Y,O,C,ls='w(x)w(x)',bs,V,js='nn',Q,ts,A,H,W,Ms='w(x)w(x)',_s,q,es='Tn(x)T_n(x)',ks,F,zs='12n1Tn(x)\\dfrac{1}{2 ^ {n - 1}} T_n(x)',Ts,D,g,L,Ls,Gs='n>1n > 1',N,Es,aa='12n1Tn(x)\\dfrac{1}{2 ^ {n - 1}} T_n(x)',Ps,J,Ca='w(x)w(x)',j,G,is='nn',vs,$s,oa='nn',ss,Os,as,en='w(x)=12n1Tn(x)w(x) = \\dfrac{1}{2 ^ {n - 1}} T_n(x)',Qs,Z,qa,Ss,ha='Tn(x)T_n(x)',cs,Is,K,ga='w(x)=12n1Tn(x)[12n1,12n1]w(x) = \\dfrac{1}{2 ^ {n - 1}} T_n(x) \\in [-\\dfrac{1}{2 ^ {n - 1}}, \\dfrac{1}{2 ^ {n - 1}}]',ps,I,rs,ws,Js='n+1n + 1',na,xs,n='w(x)w(x)',h,os,Ks='12n1-\\dfrac{1}{2 ^ {n - 1}}',Rs,ms,ta='12n1\\dfrac{1}{2 ^ {n - 1}}',Vs,ya,fs,ja,Ws,cn='w(x)w(x)',As,da,Fs,rn='w(x)=12n1Tn(x)=12n1Tn(x)12n1|w(x)| = |\\dfrac{1}{2 ^ {n - 1}} T_n(x)| = \\dfrac{1}{2 ^ {n - 1}} |T_n(x)| \\le \\dfrac{1}{2 ^ {n - 1}}',Us,Bs,Hs,ua,Xs,va,Ja,U,on,wa,Qn='p(x)p(x)',hn,xa,Jn='w(x)w(x)',gn,fa,Kn='w(x)w(x)',yn,ba,Un='p(x)p(x)',dn,Ma,Xn='nn',un,Ka,Ys,vn,_a,Yn='w(x)w(x)',wn,Ua,pa,xn,ka,Zn='p(x)<12n1|p(x)| < \\dfrac{1}{2 ^ {n - 1}}',Xa,Cs,fn,za,st='w(x)=12n1w(x) = \\dfrac{1}{2 ^ {n - 1}}',bn,Ta,at='w(x)p(x)=12n1p(x)>0w(x) - p(x) = \\dfrac{1}{2 ^ {n - 1}} - p(x) > 0',Ya,qs,Mn,La,nt='w(x)=12n1w(x) = -\\dfrac{1}{2 ^ {n - 1}}',_n,Ea,tt='w(x)p(x)=11n1p(x)<0w(x) - p(x) = -\\dfrac{1}{1 ^ {n - 1}} - p(x) < 0',Za,ns,kn,Pa,pt='w(x)p(x)w(x) - p(x)',zn,$a,mt='n+1n + 1',Tn,Sa,lt='nn',Ln,Aa,et='w(x)p(x)w(x) - p(x)',En,sn,X,Pn,Ha,it='w(x)w(x)',$n,Na,ct='p(x)p(x)',Sn,Da,rt='nn',An,Ia,ot='w(x)p(x)w(x) - p(x)',Hn,Ra,ht='n1n - 1',Nn,an,hs,Dn,Va,gt='n1n - 1',In,Wa,yt='nn',Rn,Fa,dt='p(x)p(x)',Vn;return{c(){o=p("p"),b=i("From the range of the function "),u=p("span"),f=i(", we have"),y=v(),x=p("div"),T=v(),M=p("p"),$=i("The "),_=p("span"),B=i(" in the expression of remainder of lagrange interpolation is:"),P=v(),S=p("div"),Y=v(),O=p("p"),C=p("span"),bs=i(" is a monic polynomial with degree "),V=p("span"),Q=i(". This is trivial."),ts=v(),A=p("p"),H=i("If we use zeros of chebyshev polynomials as interpolation points, then "),W=p("span"),_s=i(" shares the same zeros with "),q=p("span"),ks=i(", in another word, shares the same zeros with "),F=p("span"),Ts=i("."),D=v(),g=p("p"),L=i("When "),Ls=p("span"),N=i(", since both "),Es=p("span"),Ps=i(" and "),J=p("span"),j=i(" are monic polynomials with degree "),G=p("span"),vs=i(" and exactly same "),$s=p("span"),ss=i(" zeros, they must be the exactly same polynomial."),Os=v(),as=p("div"),Qs=v(),Z=p("p"),qa=i("From the range of "),Ss=p("span"),cs=i(", we have"),Is=v(),K=p("div"),ps=v(),I=p("p"),rs=i("And there exist exactly "),ws=p("span"),na=i(" extrema of "),xs=p("span"),h=i(", alternating between "),os=p("span"),Rs=i(" and "),ms=p("span"),Vs=i("."),ya=v(),fs=p("p"),ja=i("If we take absolute value of "),Ws=p("span"),As=i(" just as we do when we calculate the error bound of lagrange interpolation, we get:"),da=v(),Fs=p("div"),Us=v(),Bs=p("p"),Hs=i("Now we are going to prove that zeros of chebyshev polynomials are the best interpolation points."),ua=v(),Xs=p("p"),va=i("Proof by contradiction:"),Ja=v(),U=p("p"),on=i("Suppose that there exist a monic polynomial "),wa=p("span"),hn=i(" with same degree as "),xa=p("span"),gn=i(", which provide a narrower error bound than "),fa=p("span"),yn=i(", and "),ba=p("span"),dn=i(" has "),Ma=p("span"),un=i(" zeros."),Ka=v(),Ys=p("p"),vn=i("We consider the extrema of "),_a=p("span"),wn=i("."),Ua=v(),pa=p("p"),xn=i("Since "),ka=p("span"),Xa=v(),Cs=p("p"),fn=i("When "),za=p("span"),bn=i(", "),Ta=p("span"),Ya=v(),qs=p("p"),Mn=i("When "),La=p("span"),_n=i(", "),Ea=p("span"),Za=v(),ns=p("p"),kn=i("Since "),Pa=p("span"),zn=i(" alternates between positive and negative at "),$a=p("span"),Tn=i(" points, there must be at least "),Sa=p("span"),Ln=i(" zeros of "),Aa=p("span"),En=i("."),sn=v(),X=p("p"),Pn=i("Since "),Ha=p("span"),$n=i(" and "),Na=p("span"),Sn=i(" is monic polynomial with degree "),Da=p("span"),An=i(", "),Ia=p("span"),Hn=i(" is a polynomial with degree "),Ra=p("span"),Nn=i("."),an=v(),hs=p("p"),Dn=i("Polynomial with degree "),Va=p("span"),In=i(" can’t have "),Wa=p("span"),Rn=i(" zeros, so no such polynomial "),Fa=p("span"),Vn=i(" exists."),this.h()},l(t){o=m(t,"P",{});var d=l(o);b=c(d,"From the range of the function "),u=m(d,"SPAN",{class:!0});var ut=l(u);ut.forEach(s),f=c(d,", we have"),d.forEach(s),y=w(t),x=m(t,"DIV",{class:!0});var vt=l(x);vt.forEach(s),T=w(t),M=m(t,"P",{});var nn=l(M);$=c(nn,"The "),_=m(nn,"SPAN",{class:!0});var wt=l(_);wt.forEach(s),B=c(nn," in the expression of remainder of lagrange interpolation is:"),nn.forEach(s),P=w(t),S=m(t,"DIV",{class:!0});var xt=l(S);xt.forEach(s),Y=w(t),O=m(t,"P",{});var Ga=l(O);C=m(Ga,"SPAN",{class:!0});var ft=l(C);ft.forEach(s),bs=c(Ga," is a monic polynomial with degree "),V=m(Ga,"SPAN",{class:!0});var bt=l(V);bt.forEach(s),Q=c(Ga,". This is trivial."),Ga.forEach(s),ts=w(t),A=m(t,"P",{});var Zs=l(A);H=c(Zs,"If we use zeros of chebyshev polynomials as interpolation points, then "),W=m(Zs,"SPAN",{class:!0});var Mt=l(W);Mt.forEach(s),_s=c(Zs," shares the same zeros with "),q=m(Zs,"SPAN",{class:!0});var _t=l(q);_t.forEach(s),ks=c(Zs,", in another word, shares the same zeros with "),F=m(Zs,"SPAN",{class:!0});var kt=l(F);kt.forEach(s),Ts=c(Zs,"."),Zs.forEach(s),D=w(t),g=m(t,"P",{});var gs=l(g);L=c(gs,"When "),Ls=m(gs,"SPAN",{class:!0});var zt=l(Ls);zt.forEach(s),N=c(gs,", since both "),Es=m(gs,"SPAN",{class:!0});var Tt=l(Es);Tt.forEach(s),Ps=c(gs," and "),J=m(gs,"SPAN",{class:!0});var Lt=l(J);Lt.forEach(s),j=c(gs," are monic polynomials with degree "),G=m(gs,"SPAN",{class:!0});var Et=l(G);Et.forEach(s),vs=c(gs," and exactly same "),$s=m(gs,"SPAN",{class:!0});var Pt=l($s);Pt.forEach(s),ss=c(gs," zeros, they must be the exactly same polynomial."),gs.forEach(s),Os=w(t),as=m(t,"DIV",{class:!0});var $t=l(as);$t.forEach(s),Qs=w(t),Z=m(t,"P",{});var tn=l(Z);qa=c(tn,"From the range of "),Ss=m(tn,"SPAN",{class:!0});var St=l(Ss);St.forEach(s),cs=c(tn,", we have"),tn.forEach(s),Is=w(t),K=m(t,"DIV",{class:!0});var At=l(K);At.forEach(s),ps=w(t),I=m(t,"P",{});var Ns=l(I);rs=c(Ns,"And there exist exactly "),ws=m(Ns,"SPAN",{class:!0});var Ht=l(ws);Ht.forEach(s),na=c(Ns," extrema of "),xs=m(Ns,"SPAN",{class:!0});var Nt=l(xs);Nt.forEach(s),h=c(Ns,", alternating between "),os=m(Ns,"SPAN",{class:!0});var Dt=l(os);Dt.forEach(s),Rs=c(Ns," and "),ms=m(Ns,"SPAN",{class:!0});var It=l(ms);It.forEach(s),Vs=c(Ns,"."),Ns.forEach(s),ya=w(t),fs=m(t,"P",{});var pn=l(fs);ja=c(pn,"If we take absolute value of "),Ws=m(pn,"SPAN",{class:!0});var Rt=l(Ws);Rt.forEach(s),As=c(pn," just as we do when we calculate the error bound of lagrange interpolation, we get:"),pn.forEach(s),da=w(t),Fs=m(t,"DIV",{class:!0});var Vt=l(Fs);Vt.forEach(s),Us=w(t),Bs=m(t,"P",{});var Bn=l(Bs);Hs=c(Bn,"Now we are going to prove that zeros of chebyshev polynomials are the best interpolation points."),Bn.forEach(s),ua=w(t),Xs=m(t,"P",{});var Cn=l(Xs);va=c(Cn,"Proof by contradiction:"),Cn.forEach(s),Ja=w(t),U=m(t,"P",{});var ys=l(U);on=c(ys,"Suppose that there exist a monic polynomial "),wa=m(ys,"SPAN",{class:!0});var Wt=l(wa);Wt.forEach(s),hn=c(ys," with same degree as "),xa=m(ys,"SPAN",{class:!0});var Ft=l(xa);Ft.forEach(s),gn=c(ys,", which provide a narrower error bound than "),fa=m(ys,"SPAN",{class:!0});var Bt=l(fa);Bt.forEach(s),yn=c(ys,", and "),ba=m(ys,"SPAN",{class:!0});var Ct=l(ba);Ct.forEach(s),dn=c(ys," has "),Ma=m(ys,"SPAN",{class:!0});var qt=l(Ma);qt.forEach(s),un=c(ys," zeros."),ys.forEach(s),Ka=w(t),Ys=m(t,"P",{});var mn=l(Ys);vn=c(mn,"We consider the extrema of "),_a=m(mn,"SPAN",{class:!0});var jt=l(_a);jt.forEach(s),wn=c(mn,"."),mn.forEach(s),Ua=w(t),pa=m(t,"P",{});var Wn=l(pa);xn=c(Wn,"Since "),ka=m(Wn,"SPAN",{class:!0});var Gt=l(ka);Gt.forEach(s),Wn.forEach(s),Xa=w(t),Cs=m(t,"P",{});var Oa=l(Cs);fn=c(Oa,"When "),za=m(Oa,"SPAN",{class:!0});var Ot=l(za);Ot.forEach(s),bn=c(Oa,", "),Ta=m(Oa,"SPAN",{class:!0});var Qt=l(Ta);Qt.forEach(s),Oa.forEach(s),Ya=w(t),qs=m(t,"P",{});var Qa=l(qs);Mn=c(Qa,"When "),La=m(Qa,"SPAN",{class:!0});var Jt=l(La);Jt.forEach(s),_n=c(Qa,", "),Ea=m(Qa,"SPAN",{class:!0});var Kt=l(Ea);Kt.forEach(s),Qa.forEach(s),Za=w(t),ns=m(t,"P",{});var Ds=l(ns);kn=c(Ds,"Since "),Pa=m(Ds,"SPAN",{class:!0});var Ut=l(Pa);Ut.forEach(s),zn=c(Ds," alternates between positive and negative at "),$a=m(Ds,"SPAN",{class:!0});var Xt=l($a);Xt.forEach(s),Tn=c(Ds," points, there must be at least "),Sa=m(Ds,"SPAN",{class:!0});var Yt=l(Sa);Yt.forEach(s),Ln=c(Ds," zeros of "),Aa=m(Ds,"SPAN",{class:!0});var Zt=l(Aa);Zt.forEach(s),En=c(Ds,"."),Ds.forEach(s),sn=w(t),X=m(t,"P",{});var ds=l(X);Pn=c(ds,"Since "),Ha=m(ds,"SPAN",{class:!0});var sp=l(Ha);sp.forEach(s),$n=c(ds," and "),Na=m(ds,"SPAN",{class:!0});var ap=l(Na);ap.forEach(s),Sn=c(ds," is monic polynomial with degree "),Da=m(ds,"SPAN",{class:!0});var np=l(Da);np.forEach(s),An=c(ds,", "),Ia=m(ds,"SPAN",{class:!0});var tp=l(Ia);tp.forEach(s),Hn=c(ds," is a polynomial with degree "),Ra=m(ds,"SPAN",{class:!0});var pp=l(Ra);pp.forEach(s),Nn=c(ds,"."),ds.forEach(s),an=w(t),hs=m(t,"P",{});var sa=l(hs);Dn=c(sa,"Polynomial with degree "),Va=m(sa,"SPAN",{class:!0});var mp=l(Va);mp.forEach(s),In=c(sa," can’t have "),Wa=m(sa,"SPAN",{class:!0});var lp=l(Wa);lp.forEach(s),Rn=c(sa," zeros, so no such polynomial "),Fa=m(sa,"SPAN",{class:!0});var ep=l(Fa);ep.forEach(s),Vn=c(sa," exists."),sa.forEach(s),this.h()},h(){r(u,"class","math math-inline"),r(x,"class","math math-display"),r(_,"class","math math-inline"),r(S,"class","math math-display"),r(C,"class","math math-inline"),r(V,"class","math math-inline"),r(W,"class","math math-inline"),r(q,"class","math math-inline"),r(F,"class","math math-inline"),r(Ls,"class","math math-inline"),r(Es,"class","math math-inline"),r(J,"class","math math-inline"),r(G,"class","math math-inline"),r($s,"class","math math-inline"),r(as,"class","math math-display"),r(Ss,"class","math math-inline"),r(K,"class","math math-display"),r(ws,"class","math math-inline"),r(xs,"class","math math-inline"),r(os,"class","math math-inline"),r(ms,"class","math math-inline"),r(Ws,"class","math math-inline"),r(Fs,"class","math math-display"),r(wa,"class","math math-inline"),r(xa,"class","math math-inline"),r(fa,"class","math math-inline"),r(ba,"class","math math-inline"),r(Ma,"class","math math-inline"),r(_a,"class","math math-inline"),r(ka,"class","math math-inline"),r(za,"class","math math-inline"),r(Ta,"class","math math-inline"),r(La,"class","math math-inline"),r(Ea,"class","math math-inline"),r(Pa,"class","math math-inline"),r($a,"class","math math-inline"),r(Sa,"class","math math-inline"),r(Aa,"class","math math-inline"),r(Ha,"class","math math-inline"),r(Na,"class","math math-inline"),r(Da,"class","math math-inline"),r(Ia,"class","math math-inline"),r(Ra,"class","math math-inline"),r(Va,"class","math math-inline"),r(Wa,"class","math math-inline"),r(Fa,"class","math math-inline")},m(t,d){e(t,o,d),a(o,b),a(o,u),u.innerHTML=z,a(o,f),e(t,y,d),e(t,x,d),x.innerHTML=E,e(t,T,d),e(t,M,d),a(M,$),a(M,_),_.innerHTML=k,a(M,B),e(t,P,d),e(t,S,d),S.innerHTML=us,e(t,Y,d),e(t,O,d),a(O,C),C.innerHTML=ls,a(O,bs),a(O,V),V.innerHTML=js,a(O,Q),e(t,ts,d),e(t,A,d),a(A,H),a(A,W),W.innerHTML=Ms,a(A,_s),a(A,q),q.innerHTML=es,a(A,ks),a(A,F),F.innerHTML=zs,a(A,Ts),e(t,D,d),e(t,g,d),a(g,L),a(g,Ls),Ls.innerHTML=Gs,a(g,N),a(g,Es),Es.innerHTML=aa,a(g,Ps),a(g,J),J.innerHTML=Ca,a(g,j),a(g,G),G.innerHTML=is,a(g,vs),a(g,$s),$s.innerHTML=oa,a(g,ss),e(t,Os,d),e(t,as,d),as.innerHTML=en,e(t,Qs,d),e(t,Z,d),a(Z,qa),a(Z,Ss),Ss.innerHTML=ha,a(Z,cs),e(t,Is,d),e(t,K,d),K.innerHTML=ga,e(t,ps,d),e(t,I,d),a(I,rs),a(I,ws),ws.innerHTML=Js,a(I,na),a(I,xs),xs.innerHTML=n,a(I,h),a(I,os),os.innerHTML=Ks,a(I,Rs),a(I,ms),ms.innerHTML=ta,a(I,Vs),e(t,ya,d),e(t,fs,d),a(fs,ja),a(fs,Ws),Ws.innerHTML=cn,a(fs,As),e(t,da,d),e(t,Fs,d),Fs.innerHTML=rn,e(t,Us,d),e(t,Bs,d),a(Bs,Hs),e(t,ua,d),e(t,Xs,d),a(Xs,va),e(t,Ja,d),e(t,U,d),a(U,on),a(U,wa),wa.innerHTML=Qn,a(U,hn),a(U,xa),xa.innerHTML=Jn,a(U,gn),a(U,fa),fa.innerHTML=Kn,a(U,yn),a(U,ba),ba.innerHTML=Un,a(U,dn),a(U,Ma),Ma.innerHTML=Xn,a(U,un),e(t,Ka,d),e(t,Ys,d),a(Ys,vn),a(Ys,_a),_a.innerHTML=Yn,a(Ys,wn),e(t,Ua,d),e(t,pa,d),a(pa,xn),a(pa,ka),ka.innerHTML=Zn,e(t,Xa,d),e(t,Cs,d),a(Cs,fn),a(Cs,za),za.innerHTML=st,a(Cs,bn),a(Cs,Ta),Ta.innerHTML=at,e(t,Ya,d),e(t,qs,d),a(qs,Mn),a(qs,La),La.innerHTML=nt,a(qs,_n),a(qs,Ea),Ea.innerHTML=tt,e(t,Za,d),e(t,ns,d),a(ns,kn),a(ns,Pa),Pa.innerHTML=pt,a(ns,zn),a(ns,$a),$a.innerHTML=mt,a(ns,Tn),a(ns,Sa),Sa.innerHTML=lt,a(ns,Ln),a(ns,Aa),Aa.innerHTML=et,a(ns,En),e(t,sn,d),e(t,X,d),a(X,Pn),a(X,Ha),Ha.innerHTML=it,a(X,$n),a(X,Na),Na.innerHTML=ct,a(X,Sn),a(X,Da),Da.innerHTML=rt,a(X,An),a(X,Ia),Ia.innerHTML=ot,a(X,Hn),a(X,Ra),Ra.innerHTML=ht,a(X,Nn),e(t,an,d),e(t,hs,d),a(hs,Dn),a(hs,Va),Va.innerHTML=gt,a(hs,In),a(hs,Wa),Wa.innerHTML=yt,a(hs,Rn),a(hs,Fa),Fa.innerHTML=dt,a(hs,Vn)},p:Ba,d(t){t&&s(o),t&&s(y),t&&s(x),t&&s(T),t&&s(M),t&&s(P),t&&s(S),t&&s(Y),t&&s(O),t&&s(ts),t&&s(A),t&&s(D),t&&s(g),t&&s(Os),t&&s(as),t&&s(Qs),t&&s(Z),t&&s(Is),t&&s(K),t&&s(ps),t&&s(I),t&&s(ya),t&&s(fs),t&&s(da),t&&s(Fs),t&&s(Us),t&&s(Bs),t&&s(ua),t&&s(Xs),t&&s(Ja),t&&s(U),t&&s(Ka),t&&s(Ys),t&&s(Ua),t&&s(pa),t&&s(Xa),t&&s(Cs),t&&s(Ya),t&&s(qs),t&&s(Za),t&&s(ns),t&&s(sn),t&&s(X),t&&s(an),t&&s(hs)}}}function xp(R){let o,b,u,z,f,y,x,E,T,M,$,_,k,B,P,S,us,Y,O,C,ls,bs,V,js=`T0(x)=cos(0arccosx)=1T1(x)=cos(1arccosx)=xT_0(x) = \\cos(0 \\arccos x) = 1\\\\ -T_1(x) = \\cos(1 \\arccos x) = x`,Q,ts,A,H,W,Ms=`cos(n1)x=cosxcosnx+sinxsinnxcos(n+1)x=cosxcosnxsinxsinnx\\cos (n - 1)x = \\cos x \\cos nx + \\sin x \\sin nx\\\\ -\\cos (n + 1)x = \\cos x \\cos nx - \\sin x \\sin nx`,_s,q,es,ks,F,zs='cos(n1)x+cos(n+1)x=2cosxcosnx\\cos (n - 1)x + \\cos (n + 1)x = 2 \\cos x \\cos nx',Ts,D,g,L,Ls='xx',Gs,N,Es='arccosx\\arccos x',aa,Ps,J,Ca=`cos[(n1)arccosx]+cos[(n+1)arccosx]=2cos(arccosx)cos(narccosx)Tn1(x)+Tn+1(x)=2xTn(x)Tn+1(x)=2xTn(x)Tn1(x)\\cos \\left[(n - 1)\\arccos x\\right] + \\cos \\left[(n + 1)\\arccos x\\right] = 2 \\cos (\\arccos x) \\cos (n \\arccos x) \\\\ -T_{n - 1}(x) + T_{n + 1}(x) = 2xT_n(x)\\\\ -T_{n + 1}(x) = 2xT_n(x) - T_{n - 1}(x)`,j,G,is,vs,$s,oa,ss,Os,as,en='x[1,1]x \\in [-1, 1]',Qs,Z,qa='arccosx\\arccos x',Ss,ha,cs,Is,K,ga,ps,I,rs,ws,Js,na,xs;return $=new ln({props:{variant:"definition",$$slots:{default:[gp]},$$scope:{ctx:R}}}),k=new ln({props:{variant:"definition",$$slots:{default:[yp]},$$scope:{ctx:R}}}),cs=new ln({props:{variant:"lemma",$$slots:{default:[dp]},$$scope:{ctx:R}}}),K=new Gn({props:{$$slots:{default:[up]},$$scope:{ctx:R}}}),ps=new ln({props:{variant:"theorem",$$slots:{default:[vp]},$$scope:{ctx:R}}}),rs=new Gn({props:{$$slots:{default:[wp]},$$scope:{ctx:R}}}),{c(){o=p("h1"),b=p("a"),u=p("span"),z=i("Chebyshev Polynomial"),f=v(),y=p("h2"),x=p("a"),E=p("span"),T=i("Definition"),M=v(),ma($.$$.fragment),_=v(),ma(k.$$.fragment),B=v(),P=p("h2"),S=p("a"),us=p("span"),Y=i("Recurrence Relation"),O=v(),C=p("p"),ls=i("Basis Step:"),bs=v(),V=p("div"),Q=v(),ts=p("p"),A=i("Recursive Step:"),H=v(),W=p("div"),_s=v(),q=p("p"),es=i("Add the two equations above, we get:"),ks=v(),F=p("div"),Ts=v(),D=p("p"),g=i("Replace "),L=p("span"),Gs=i(" with "),N=p("span"),aa=i(", we get:"),Ps=v(),J=p("div"),j=v(),G=p("h2"),is=p("a"),vs=p("span"),$s=i("Why its zeros help relieve Runge’s phenomenon"),oa=v(),ss=p("p"),Os=i("We only discuss the case when "),as=p("span"),Qs=i(", so "),Z=p("span"),Ss=i(" is real."),ha=v(),ma(cs.$$.fragment),Is=v(),ma(K.$$.fragment),ga=v(),ma(ps.$$.fragment),I=v(),ma(rs.$$.fragment),ws=v(),Js=p("p"),na=i("So this is why we use zeros of chebyshev polynomials as interpolation points."),this.h()},l(n){o=m(n,"H1",{id:!0});var h=l(o);b=m(h,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var os=l(b);u=m(os,"SPAN",{class:!0}),l(u).forEach(s),os.forEach(s),z=c(h,"Chebyshev Polynomial"),h.forEach(s),f=w(n),y=m(n,"H2",{id:!0});var Ks=l(y);x=m(Ks,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Rs=l(x);E=m(Rs,"SPAN",{class:!0}),l(E).forEach(s),Rs.forEach(s),T=c(Ks,"Definition"),Ks.forEach(s),M=w(n),la($.$$.fragment,n),_=w(n),la(k.$$.fragment,n),B=w(n),P=m(n,"H2",{id:!0});var ms=l(P);S=m(ms,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var ta=l(S);us=m(ta,"SPAN",{class:!0}),l(us).forEach(s),ta.forEach(s),Y=c(ms,"Recurrence Relation"),ms.forEach(s),O=w(n),C=m(n,"P",{});var Vs=l(C);ls=c(Vs,"Basis Step:"),Vs.forEach(s),bs=w(n),V=m(n,"DIV",{class:!0});var ya=l(V);ya.forEach(s),Q=w(n),ts=m(n,"P",{});var fs=l(ts);A=c(fs,"Recursive Step:"),fs.forEach(s),H=w(n),W=m(n,"DIV",{class:!0});var ja=l(W);ja.forEach(s),_s=w(n),q=m(n,"P",{});var Ws=l(q);es=c(Ws,"Add the two equations above, we get:"),Ws.forEach(s),ks=w(n),F=m(n,"DIV",{class:!0});var cn=l(F);cn.forEach(s),Ts=w(n),D=m(n,"P",{});var As=l(D);g=c(As,"Replace "),L=m(As,"SPAN",{class:!0});var da=l(L);da.forEach(s),Gs=c(As," with "),N=m(As,"SPAN",{class:!0});var Fs=l(N);Fs.forEach(s),aa=c(As,", we get:"),As.forEach(s),Ps=w(n),J=m(n,"DIV",{class:!0});var rn=l(J);rn.forEach(s),j=w(n),G=m(n,"H2",{id:!0});var Us=l(G);is=m(Us,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Bs=l(is);vs=m(Bs,"SPAN",{class:!0}),l(vs).forEach(s),Bs.forEach(s),$s=c(Us,"Why its zeros help relieve Runge’s phenomenon"),Us.forEach(s),oa=w(n),ss=m(n,"P",{});var Hs=l(ss);Os=c(Hs,"We only discuss the case when "),as=m(Hs,"SPAN",{class:!0});var ua=l(as);ua.forEach(s),Qs=c(Hs,", so "),Z=m(Hs,"SPAN",{class:!0});var Xs=l(Z);Xs.forEach(s),Ss=c(Hs," is real."),Hs.forEach(s),ha=w(n),la(cs.$$.fragment,n),Is=w(n),la(K.$$.fragment,n),ga=w(n),la(ps.$$.fragment,n),I=w(n),la(rs.$$.fragment,n),ws=w(n),Js=m(n,"P",{});var va=l(Js);na=c(va,"So this is why we use zeros of chebyshev polynomials as interpolation points."),va.forEach(s),this.h()},h(){r(u,"class","icon icon-link"),r(b,"aria-hidden","true"),r(b,"tabindex","-1"),r(b,"href","#chebyshev-polynomial"),r(o,"id","chebyshev-polynomial"),r(E,"class","icon icon-link"),r(x,"aria-hidden","true"),r(x,"tabindex","-1"),r(x,"href","#definition"),r(y,"id","definition"),r(us,"class","icon icon-link"),r(S,"aria-hidden","true"),r(S,"tabindex","-1"),r(S,"href","#recurrence-relation"),r(P,"id","recurrence-relation"),r(V,"class","math math-display"),r(W,"class","math math-display"),r(F,"class","math math-display"),r(L,"class","math math-inline"),r(N,"class","math math-inline"),r(J,"class","math math-display"),r(vs,"class","icon icon-link"),r(is,"aria-hidden","true"),r(is,"tabindex","-1"),r(is,"href","#why-its-zeros-help-relieve-runges-phenomenon"),r(G,"id","why-its-zeros-help-relieve-runges-phenomenon"),r(as,"class","math math-inline"),r(Z,"class","math math-inline")},m(n,h){e(n,o,h),a(o,b),a(b,u),a(o,z),e(n,f,h),e(n,y,h),a(y,x),a(x,E),a(y,T),e(n,M,h),ea($,n,h),e(n,_,h),ea(k,n,h),e(n,B,h),e(n,P,h),a(P,S),a(S,us),a(P,Y),e(n,O,h),e(n,C,h),a(C,ls),e(n,bs,h),e(n,V,h),V.innerHTML=js,e(n,Q,h),e(n,ts,h),a(ts,A),e(n,H,h),e(n,W,h),W.innerHTML=Ms,e(n,_s,h),e(n,q,h),a(q,es),e(n,ks,h),e(n,F,h),F.innerHTML=zs,e(n,Ts,h),e(n,D,h),a(D,g),a(D,L),L.innerHTML=Ls,a(D,Gs),a(D,N),N.innerHTML=Es,a(D,aa),e(n,Ps,h),e(n,J,h),J.innerHTML=Ca,e(n,j,h),e(n,G,h),a(G,is),a(is,vs),a(G,$s),e(n,oa,h),e(n,ss,h),a(ss,Os),a(ss,as),as.innerHTML=en,a(ss,Qs),a(ss,Z),Z.innerHTML=qa,a(ss,Ss),e(n,ha,h),ea(cs,n,h),e(n,Is,h),ea(K,n,h),e(n,ga,h),ea(ps,n,h),e(n,I,h),ea(rs,n,h),e(n,ws,h),e(n,Js,h),a(Js,na),xs=!0},p(n,h){const os={};h&2&&(os.$$scope={dirty:h,ctx:n}),$.$set(os);const Ks={};h&2&&(Ks.$$scope={dirty:h,ctx:n}),k.$set(Ks);const Rs={};h&2&&(Rs.$$scope={dirty:h,ctx:n}),cs.$set(Rs);const ms={};h&2&&(ms.$$scope={dirty:h,ctx:n}),K.$set(ms);const ta={};h&2&&(ta.$$scope={dirty:h,ctx:n}),ps.$set(ta);const Vs={};h&2&&(Vs.$$scope={dirty:h,ctx:n}),rs.$set(Vs)},i(n){xs||(ia($.$$.fragment,n),ia(k.$$.fragment,n),ia(cs.$$.fragment,n),ia(K.$$.fragment,n),ia(ps.$$.fragment,n),ia(rs.$$.fragment,n),xs=!0)},o(n){ca($.$$.fragment,n),ca(k.$$.fragment,n),ca(cs.$$.fragment,n),ca(K.$$.fragment,n),ca(ps.$$.fragment,n),ca(rs.$$.fragment,n),xs=!1},d(n){n&&s(o),n&&s(f),n&&s(y),n&&s(M),ra($,n),n&&s(_),ra(k,n),n&&s(B),n&&s(P),n&&s(O),n&&s(C),n&&s(bs),n&&s(V),n&&s(Q),n&&s(ts),n&&s(H),n&&s(W),n&&s(_s),n&&s(q),n&&s(ks),n&&s(F),n&&s(Ts),n&&s(D),n&&s(Ps),n&&s(J),n&&s(j),n&&s(G),n&&s(oa),n&&s(ss),n&&s(ha),ra(cs,n),n&&s(Is),ra(K,n),n&&s(ga),ra(ps,n),n&&s(I),ra(rs,n),n&&s(ws),n&&s(Js)}}}function fp(R){let o,b;const u=[R[0],On];let z={$$slots:{default:[xp]},$$scope:{ctx:R}};for(let f=0;f{b(0,o=Fn(Fn({},o),jn(u)))},o=jn(o),[o]}class Tp extends ip{constructor(o){super(),cp(this,o,bp,fp,rp,{})}}export{Tp as component}; diff --git a/docs/_app/immutable/nodes/5.57bd73af.js b/docs/_app/immutable/nodes/5.57bd73af.js deleted file mode 100644 index 93d97bb..0000000 --- a/docs/_app/immutable/nodes/5.57bd73af.js +++ /dev/null @@ -1,10 +0,0 @@ -import{S as da,i as wa,s as ba,O as Ys,y as ks,z as Ls,A as $s,P as fa,Q as Qs,g as js,d as Es,B as Ts,R as Us,k as p,q as r,a as f,l as m,m as l,h as s,r as c,c as x,n as v,b as e,E as n,G as Ss}from"../chunks/index.488f1ee5.js";import{L as xa}from"../chunks/layout.c8702512.js";import{S as Bs}from"../chunks/State.8d241e02.js";import{P as Fs}from"../chunks/Proof.26996d3c.js";function za(O){let t,u,y='aa',P,h,i='mm',M,C,_='gcd(a,m)=1\\operatorname{gcd}(a, m) = 1';return{c(){t=p("p"),u=p("span"),P=r(" has a multiplicative inverse modulo "),h=p("span"),M=r(" if and only if "),C=p("span"),this.h()},l(b){t=m(b,"P",{});var H=l(t);u=m(H,"SPAN",{class:!0});var E=l(u);E.forEach(s),P=c(H," has a multiplicative inverse modulo "),h=m(H,"SPAN",{class:!0});var d=l(h);d.forEach(s),M=c(H," if and only if "),C=m(H,"SPAN",{class:!0});var U=l(C);U.forEach(s),H.forEach(s),this.h()},h(){v(u,"class","math math-inline"),v(h,"class","math math-inline"),v(C,"class","math math-inline")},m(b,H){e(b,t,H),n(t,u),u.innerHTML=y,n(t,P),n(t,h),h.innerHTML=i,n(t,M),n(t,C),C.innerHTML=_},p:Ss,d(b){b&&s(t)}}}function Ma(O){let t,u,y,P='rr',h,i,M,C='ra1(modm)ra \\equiv 1 \\pmod m',_,b,H='ra+km=1ra + km = 1',E,d,U='kk',k,vs,I,T,ns,ts='gcd(a,m)=1\\operatorname{gcd}(a, m) = 1',L;return{c(){t=p("p"),u=r("Let the inverse be "),y=p("span"),h=f(),i=p("p"),M=p("span"),_=r(" implies "),b=p("span"),E=r(" for some integer "),d=p("span"),k=r("."),vs=f(),I=p("p"),T=r("According to Bezout’s Lemma, "),ns=p("span"),L=r("."),this.h()},l(S){t=m(S,"P",{});var N=l(t);u=c(N,"Let the inverse be "),y=m(N,"SPAN",{class:!0});var q=l(y);q.forEach(s),N.forEach(s),h=x(S),i=m(S,"P",{});var ss=l(i);M=m(ss,"SPAN",{class:!0});var ps=l(M);ps.forEach(s),_=c(ss," implies "),b=m(ss,"SPAN",{class:!0});var R=l(b);R.forEach(s),E=c(ss," for some integer "),d=m(ss,"SPAN",{class:!0});var A=l(d);A.forEach(s),k=c(ss,"."),ss.forEach(s),vs=x(S),I=m(S,"P",{});var F=l(I);T=c(F,"According to Bezout’s Lemma, "),ns=m(F,"SPAN",{class:!0});var Q=l(ns);Q.forEach(s),L=c(F,"."),F.forEach(s),this.h()},h(){v(y,"class","math math-inline"),v(M,"class","math math-inline"),v(b,"class","math math-inline"),v(d,"class","math math-inline"),v(ns,"class","math math-inline")},m(S,N){e(S,t,N),n(t,u),n(t,y),y.innerHTML=P,e(S,h,N),e(S,i,N),n(i,M),M.innerHTML=C,n(i,_),n(i,b),b.innerHTML=H,n(i,E),n(i,d),d.innerHTML=U,n(i,k),e(S,vs,N),e(S,I,N),n(I,T),n(I,ns),ns.innerHTML=ts,n(I,L)},p:Ss,d(S){S&&s(t),S&&s(h),S&&s(i),S&&s(vs),S&&s(I)}}}function _a(O){let t,u,y='xi=1naiMiyi(modM)x \\equiv \\sum_{i = 1}^{n} a_i M_i y_i \\pmod M',P;return{c(){t=p("p"),u=p("span"),P=r(" is a solution"),this.h()},l(h){t=m(h,"P",{});var i=l(t);u=m(i,"SPAN",{class:!0});var M=l(u);M.forEach(s),P=c(i," is a solution"),i.forEach(s),this.h()},h(){v(u,"class","math math-inline")},m(h,i){e(h,t,i),n(t,u),u.innerHTML=y,n(t,P)},p:Ss,d(h){h&&s(t)}}}function ka(O){let t,u,y,P='m1,m2,...mnm_1, m_2, ... m_n',h,i,M='gcd(mi,mj)=1\\operatorname{gcd}(m_i, m_j) = 1',C,_,b='iji \\neq j',H,E,d,U,k,vs='jj',I,T,ns='11',ts,L,S='nn',N,q,ss='Mj=i=1,ijnmiM_j = \\prod_{i = 1, i \\neq j}^{n} m_i',ps,R,A='mjm_j',F,Q,zs='MjM_j',hs,D,Ms='mjm_j',ms,es,Y,J,K,G='jj',cs,V,ws='11',W,w,$='nn',us,as,j,a='i=1naiMiyi=i=1,ijnaiMiyi+ajMjyj\\sum_{i = 1}^{n} a_i M_i y_i = \\sum_{i = 1, i \\neq j}^{n} a_i M_i y_i + a_j M_j y_j',o,B,os,is,X='M1=i=1,ijnmiM_1 = \\prod_{i = 1, i \\neq j}^{n} m_i',ys,ls,As='mim_i',gs,rs,Ns='iji \\neq j',qs,bs,ds,Ks='i=1,ijnaiMiyi0(modmj)\\sum_{i = 1, i \\neq j}^{n} a_i M_i y_i \\equiv 0 \\pmod {m_j}',Rs,Ps,Is,Vs,_s,Ws='i=1naiMiyiajMjyjajMjMj1aj(modmj)\\sum_{i = 1}^{n} a_i M_i y_i \\equiv a_j M_j y_j \\equiv a_j M_j M_j^{-1} \\equiv a_j \\pmod {m_j}',Cs,Hs,Ds;return{c(){t=p("p"),u=r("Since "),y=p("span"),h=r(" are pairwise coprime, we have "),i=p("span"),C=r(" for all "),_=p("span"),H=r("."),E=f(),d=p("p"),U=r("Then for each "),k=p("span"),I=r(" from "),T=p("span"),ts=r(" to "),L=p("span"),N=r(", we have "),q=p("span"),ps=r(" is coprime to "),R=p("span"),F=r(", which means "),Q=p("span"),hs=r(" has a multiplicative inverse modulo "),D=p("span"),ms=r("."),es=f(),Y=p("p"),J=r("For each "),K=p("span"),cs=r(" from "),V=p("span"),W=r(" to "),w=p("span"),us=r(", we have"),as=f(),j=p("div"),o=f(),B=p("p"),os=r("Since "),is=p("span"),ys=r(" is divisible by "),ls=p("span"),gs=r(" for all "),rs=p("span"),qs=r(", we have"),bs=f(),ds=p("div"),Rs=f(),Ps=p("p"),Is=r("Hence,"),Vs=f(),_s=p("div"),Cs=f(),Hs=p("p"),Ds=r("So the equation holds."),this.h()},l(g){t=m(g,"P",{});var z=l(t);u=c(z,"Since "),y=m(z,"SPAN",{class:!0});var Xs=l(y);Xs.forEach(s),h=c(z," are pairwise coprime, we have "),i=m(z,"SPAN",{class:!0});var Zs=l(i);Zs.forEach(s),C=c(z," for all "),_=m(z,"SPAN",{class:!0});var sa=l(_);sa.forEach(s),H=c(z,"."),z.forEach(s),E=x(g),d=m(g,"P",{});var Z=l(d);U=c(Z,"Then for each "),k=m(Z,"SPAN",{class:!0});var aa=l(k);aa.forEach(s),I=c(Z," from "),T=m(Z,"SPAN",{class:!0});var na=l(T);na.forEach(s),ts=c(Z," to "),L=m(Z,"SPAN",{class:!0});var ta=l(L);ta.forEach(s),N=c(Z,", we have "),q=m(Z,"SPAN",{class:!0});var pa=l(q);pa.forEach(s),ps=c(Z," is coprime to "),R=m(Z,"SPAN",{class:!0});var ma=l(R);ma.forEach(s),F=c(Z,", which means "),Q=m(Z,"SPAN",{class:!0});var la=l(Q);la.forEach(s),hs=c(Z," has a multiplicative inverse modulo "),D=m(Z,"SPAN",{class:!0});var ea=l(D);ea.forEach(s),ms=c(Z,"."),Z.forEach(s),es=x(g),Y=m(g,"P",{});var fs=l(Y);J=c(fs,"For each "),K=m(fs,"SPAN",{class:!0});var ia=l(K);ia.forEach(s),cs=c(fs," from "),V=m(fs,"SPAN",{class:!0});var ra=l(V);ra.forEach(s),W=c(fs," to "),w=m(fs,"SPAN",{class:!0});var ca=l(w);ca.forEach(s),us=c(fs,", we have"),fs.forEach(s),as=x(g),j=m(g,"DIV",{class:!0});var ha=l(j);ha.forEach(s),o=x(g),B=m(g,"P",{});var xs=l(B);os=c(xs,"Since "),is=m(xs,"SPAN",{class:!0});var oa=l(is);oa.forEach(s),ys=c(xs," is divisible by "),ls=m(xs,"SPAN",{class:!0});var ga=l(ls);ga.forEach(s),gs=c(xs," for all "),rs=m(xs,"SPAN",{class:!0});var va=l(rs);va.forEach(s),qs=c(xs,", we have"),xs.forEach(s),bs=x(g),ds=m(g,"DIV",{class:!0});var ua=l(ds);ua.forEach(s),Rs=x(g),Ps=m(g,"P",{});var Gs=l(Ps);Is=c(Gs,"Hence,"),Gs.forEach(s),Vs=x(g),_s=m(g,"DIV",{class:!0});var ya=l(_s);ya.forEach(s),Cs=x(g),Hs=m(g,"P",{});var Os=l(Hs);Ds=c(Os,"So the equation holds."),Os.forEach(s),this.h()},h(){v(y,"class","math math-inline"),v(i,"class","math math-inline"),v(_,"class","math math-inline"),v(k,"class","math math-inline"),v(T,"class","math math-inline"),v(L,"class","math math-inline"),v(q,"class","math math-inline"),v(R,"class","math math-inline"),v(Q,"class","math math-inline"),v(D,"class","math math-inline"),v(K,"class","math math-inline"),v(V,"class","math math-inline"),v(w,"class","math math-inline"),v(j,"class","math math-display"),v(is,"class","math math-inline"),v(ls,"class","math math-inline"),v(rs,"class","math math-inline"),v(ds,"class","math math-display"),v(_s,"class","math math-display")},m(g,z){e(g,t,z),n(t,u),n(t,y),y.innerHTML=P,n(t,h),n(t,i),i.innerHTML=M,n(t,C),n(t,_),_.innerHTML=b,n(t,H),e(g,E,z),e(g,d,z),n(d,U),n(d,k),k.innerHTML=vs,n(d,I),n(d,T),T.innerHTML=ns,n(d,ts),n(d,L),L.innerHTML=S,n(d,N),n(d,q),q.innerHTML=ss,n(d,ps),n(d,R),R.innerHTML=A,n(d,F),n(d,Q),Q.innerHTML=zs,n(d,hs),n(d,D),D.innerHTML=Ms,n(d,ms),e(g,es,z),e(g,Y,z),n(Y,J),n(Y,K),K.innerHTML=G,n(Y,cs),n(Y,V),V.innerHTML=ws,n(Y,W),n(Y,w),w.innerHTML=$,n(Y,us),e(g,as,z),e(g,j,z),j.innerHTML=a,e(g,o,z),e(g,B,z),n(B,os),n(B,is),is.innerHTML=X,n(B,ys),n(B,ls),ls.innerHTML=As,n(B,gs),n(B,rs),rs.innerHTML=Ns,n(B,qs),e(g,bs,z),e(g,ds,z),ds.innerHTML=Ks,e(g,Rs,z),e(g,Ps,z),n(Ps,Is),e(g,Vs,z),e(g,_s,z),_s.innerHTML=Ws,e(g,Cs,z),e(g,Hs,z),n(Hs,Ds)},p:Ss,d(g){g&&s(t),g&&s(E),g&&s(d),g&&s(es),g&&s(Y),g&&s(as),g&&s(j),g&&s(o),g&&s(B),g&&s(bs),g&&s(ds),g&&s(Rs),g&&s(Ps),g&&s(Vs),g&&s(_s),g&&s(Cs),g&&s(Hs)}}}function La(O){let t,u,y,P='MM';return{c(){t=p("p"),u=r("There is no other solution under modulo "),y=p("span"),this.h()},l(h){t=m(h,"P",{});var i=l(t);u=c(i,"There is no other solution under modulo "),y=m(i,"SPAN",{class:!0});var M=l(y);M.forEach(s),i.forEach(s),this.h()},h(){v(y,"class","math math-inline")},m(h,i){e(h,t,i),n(t,u),n(t,y),y.innerHTML=P},p:Ss,d(h){h&&s(t)}}}function $a(O){let t,u,y,P='x1x_1',h,i,M='x2x_2',C,_,b,H,E,d='jj',U,k,vs='11',I,T,ns='nn',ts,L,S='x1x20(modmj)x_1 - x_2 \\equiv 0 \\pmod {m_j}',N,q,ss='mjx1x2m_j | x_1 - x_2',ps,R,A,F,Q,zs='m1,m2,...,mnm_1, m_2, ... , m_n',hs,D,Ms='lcm(m1,m2,...,mn)=M\\operatorname{lcm}(m_1, m_2, ... ,m_n) = M',ms,es,Y='Mx1x2M | x_1 - x_2',J,K,G,cs,V,ws='x1x2(modM)x_1 \\equiv x_2 \\pmod M',W;return{c(){t=p("p"),u=r("Suppose there are two solutions "),y=p("span"),h=r(" and "),i=p("span"),C=r("."),_=f(),b=p("p"),H=r("Then, for each "),E=p("span"),U=r(" from "),k=p("span"),I=r(" to "),T=p("span"),ts=r(", we have "),L=p("span"),N=r(" or "),q=p("span"),ps=r("."),R=f(),A=p("p"),F=r("As "),Q=p("span"),hs=r(" are pairwise coprime, "),D=p("span"),ms=r(", which means "),es=p("span"),J=r("."),K=f(),G=p("p"),cs=r("Hence, "),V=p("span"),W=r("."),this.h()},l(w){t=m(w,"P",{});var $=l(t);u=c($,"Suppose there are two solutions "),y=m($,"SPAN",{class:!0});var us=l(y);us.forEach(s),h=c($," and "),i=m($,"SPAN",{class:!0});var as=l(i);as.forEach(s),C=c($,"."),$.forEach(s),_=x(w),b=m(w,"P",{});var j=l(b);H=c(j,"Then, for each "),E=m(j,"SPAN",{class:!0});var a=l(E);a.forEach(s),U=c(j," from "),k=m(j,"SPAN",{class:!0});var o=l(k);o.forEach(s),I=c(j," to "),T=m(j,"SPAN",{class:!0});var B=l(T);B.forEach(s),ts=c(j,", we have "),L=m(j,"SPAN",{class:!0});var os=l(L);os.forEach(s),N=c(j," or "),q=m(j,"SPAN",{class:!0});var is=l(q);is.forEach(s),ps=c(j,"."),j.forEach(s),R=x(w),A=m(w,"P",{});var X=l(A);F=c(X,"As "),Q=m(X,"SPAN",{class:!0});var ys=l(Q);ys.forEach(s),hs=c(X," are pairwise coprime, "),D=m(X,"SPAN",{class:!0});var ls=l(D);ls.forEach(s),ms=c(X,", which means "),es=m(X,"SPAN",{class:!0});var As=l(es);As.forEach(s),J=c(X,"."),X.forEach(s),K=x(w),G=m(w,"P",{});var gs=l(G);cs=c(gs,"Hence, "),V=m(gs,"SPAN",{class:!0});var rs=l(V);rs.forEach(s),W=c(gs,"."),gs.forEach(s),this.h()},h(){v(y,"class","math math-inline"),v(i,"class","math math-inline"),v(E,"class","math math-inline"),v(k,"class","math math-inline"),v(T,"class","math math-inline"),v(L,"class","math math-inline"),v(q,"class","math math-inline"),v(Q,"class","math math-inline"),v(D,"class","math math-inline"),v(es,"class","math math-inline"),v(V,"class","math math-inline")},m(w,$){e(w,t,$),n(t,u),n(t,y),y.innerHTML=P,n(t,h),n(t,i),i.innerHTML=M,n(t,C),e(w,_,$),e(w,b,$),n(b,H),n(b,E),E.innerHTML=d,n(b,U),n(b,k),k.innerHTML=vs,n(b,I),n(b,T),T.innerHTML=ns,n(b,ts),n(b,L),L.innerHTML=S,n(b,N),n(b,q),q.innerHTML=ss,n(b,ps),e(w,R,$),e(w,A,$),n(A,F),n(A,Q),Q.innerHTML=zs,n(A,hs),n(A,D),D.innerHTML=Ms,n(A,ms),n(A,es),es.innerHTML=Y,n(A,J),e(w,K,$),e(w,G,$),n(G,cs),n(G,V),V.innerHTML=ws,n(G,W)},p:Ss,d(w){w&&s(t),w&&s(_),w&&s(b),w&&s(R),w&&s(A),w&&s(K),w&&s(G)}}}function ja(O){let t,u,y,P,h,i,M,C,_,b=`{xa1(modm1)xa2(modm2)xan(modmn)\\begin{cases} -x \\equiv a_1 \\pmod {m_1} \\\\ -x \\equiv a_2 \\pmod {m_2} \\\\ -\\vdots \\\\ -x \\equiv a_n \\pmod {m_n} -\\end{cases}`,H,E,d,U,k,vs='xi=1naiMiyi(modM)x \\equiv \\sum_{i = 1}^{n} a_i M_i y_i \\pmod M',I,T,ns,ts,L,S=`Mi=1nmiMiMmjyiMi1(modmi)\\begin{gather} -M \\equiv \\prod_{i = 1}^{n} m_i \\\\ -M_i \\equiv {M \\over m_j} \\\\ -y_i \\equiv M_i^{-1} \\pmod {m_i} -\\end{gather}`,N,q,ss,ps,R,A,F,Q='xi=1naiMiyi(modM)x \\equiv \\sum_{i = 1}^{n} a_i M_i y_i \\pmod M',zs,hs,D,Ms,ms,es='MM',Y,J,K,G,cs,V,ws,W,w,$,us,as,j;return J=new Bs({props:{variant:"lemma",$$slots:{default:[za]},$$scope:{ctx:O}}}),G=new Fs({props:{$$slots:{default:[Ma]},$$scope:{ctx:O}}}),V=new Bs({props:{$$slots:{default:[_a]},$$scope:{ctx:O}}}),W=new Fs({props:{$$slots:{default:[ka]},$$scope:{ctx:O}}}),$=new Bs({props:{$$slots:{default:[La]},$$scope:{ctx:O}}}),as=new Fs({props:{$$slots:{default:[$a]},$$scope:{ctx:O}}}),{c(){t=p("h1"),u=p("a"),y=p("span"),P=r("Chinese Remainder Theorem (CRT)"),h=f(),i=p("p"),M=r("CRT is a theorem that gives a unique solution to simultaneous linear congruences with pairwise coprime moduli."),C=f(),_=p("div"),H=f(),E=p("p"),d=r("The theorem states that the solution is given by"),U=f(),k=p("div"),I=f(),T=p("p"),ns=r("where"),ts=f(),L=p("div"),N=f(),q=p("p"),ss=r("To prove CRT, we are going to two things:"),ps=f(),R=p("ul"),A=p("li"),F=p("span"),zs=r(" is a solution"),hs=f(),D=p("li"),Ms=r("There is no other solution under modulo "),ms=p("span"),Y=f(),ks(J.$$.fragment),K=f(),ks(G.$$.fragment),cs=f(),ks(V.$$.fragment),ws=f(),ks(W.$$.fragment),w=f(),ks($.$$.fragment),us=f(),ks(as.$$.fragment),this.h()},l(a){t=m(a,"H1",{id:!0});var o=l(t);u=m(o,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var B=l(u);y=m(B,"SPAN",{class:!0}),l(y).forEach(s),B.forEach(s),P=c(o,"Chinese Remainder Theorem (CRT)"),o.forEach(s),h=x(a),i=m(a,"P",{});var os=l(i);M=c(os,"CRT is a theorem that gives a unique solution to simultaneous linear congruences with pairwise coprime moduli."),os.forEach(s),C=x(a),_=m(a,"DIV",{class:!0});var is=l(_);is.forEach(s),H=x(a),E=m(a,"P",{});var X=l(E);d=c(X,"The theorem states that the solution is given by"),X.forEach(s),U=x(a),k=m(a,"DIV",{class:!0});var ys=l(k);ys.forEach(s),I=x(a),T=m(a,"P",{});var ls=l(T);ns=c(ls,"where"),ls.forEach(s),ts=x(a),L=m(a,"DIV",{class:!0});var As=l(L);As.forEach(s),N=x(a),q=m(a,"P",{});var gs=l(q);ss=c(gs,"To prove CRT, we are going to two things:"),gs.forEach(s),ps=x(a),R=m(a,"UL",{});var rs=l(R);A=m(rs,"LI",{});var Ns=l(A);F=m(Ns,"SPAN",{class:!0});var qs=l(F);qs.forEach(s),zs=c(Ns," is a solution"),Ns.forEach(s),hs=x(rs),D=m(rs,"LI",{});var bs=l(D);Ms=c(bs,"There is no other solution under modulo "),ms=m(bs,"SPAN",{class:!0});var ds=l(ms);ds.forEach(s),bs.forEach(s),rs.forEach(s),Y=x(a),Ls(J.$$.fragment,a),K=x(a),Ls(G.$$.fragment,a),cs=x(a),Ls(V.$$.fragment,a),ws=x(a),Ls(W.$$.fragment,a),w=x(a),Ls($.$$.fragment,a),us=x(a),Ls(as.$$.fragment,a),this.h()},h(){v(y,"class","icon icon-link"),v(u,"aria-hidden","true"),v(u,"tabindex","-1"),v(u,"href","#chinese-remainder-theorem-crt"),v(t,"id","chinese-remainder-theorem-crt"),v(_,"class","math math-display"),v(k,"class","math math-display"),v(L,"class","math math-display"),v(F,"class","math math-inline"),v(ms,"class","math math-inline")},m(a,o){e(a,t,o),n(t,u),n(u,y),n(t,P),e(a,h,o),e(a,i,o),n(i,M),e(a,C,o),e(a,_,o),_.innerHTML=b,e(a,H,o),e(a,E,o),n(E,d),e(a,U,o),e(a,k,o),k.innerHTML=vs,e(a,I,o),e(a,T,o),n(T,ns),e(a,ts,o),e(a,L,o),L.innerHTML=S,e(a,N,o),e(a,q,o),n(q,ss),e(a,ps,o),e(a,R,o),n(R,A),n(A,F),F.innerHTML=Q,n(A,zs),n(R,hs),n(R,D),n(D,Ms),n(D,ms),ms.innerHTML=es,e(a,Y,o),$s(J,a,o),e(a,K,o),$s(G,a,o),e(a,cs,o),$s(V,a,o),e(a,ws,o),$s(W,a,o),e(a,w,o),$s($,a,o),e(a,us,o),$s(as,a,o),j=!0},p(a,o){const B={};o&2&&(B.$$scope={dirty:o,ctx:a}),J.$set(B);const os={};o&2&&(os.$$scope={dirty:o,ctx:a}),G.$set(os);const is={};o&2&&(is.$$scope={dirty:o,ctx:a}),V.$set(is);const X={};o&2&&(X.$$scope={dirty:o,ctx:a}),W.$set(X);const ys={};o&2&&(ys.$$scope={dirty:o,ctx:a}),$.$set(ys);const ls={};o&2&&(ls.$$scope={dirty:o,ctx:a}),as.$set(ls)},i(a){j||(js(J.$$.fragment,a),js(G.$$.fragment,a),js(V.$$.fragment,a),js(W.$$.fragment,a),js($.$$.fragment,a),js(as.$$.fragment,a),j=!0)},o(a){Es(J.$$.fragment,a),Es(G.$$.fragment,a),Es(V.$$.fragment,a),Es(W.$$.fragment,a),Es($.$$.fragment,a),Es(as.$$.fragment,a),j=!1},d(a){a&&s(t),a&&s(h),a&&s(i),a&&s(C),a&&s(_),a&&s(H),a&&s(E),a&&s(U),a&&s(k),a&&s(I),a&&s(T),a&&s(ts),a&&s(L),a&&s(N),a&&s(q),a&&s(ps),a&&s(R),a&&s(Y),Ts(J,a),a&&s(K),Ts(G,a),a&&s(cs),Ts(V,a),a&&s(ws),Ts(W,a),a&&s(w),Ts($,a),a&&s(us),Ts(as,a)}}}function Ea(O){let t,u;const y=[O[0],Js];let P={$$slots:{default:[ja]},$$scope:{ctx:O}};for(let h=0;h{u(0,t=Ys(Ys({},t),Us(y)))},t=Us(t),[t]}class Na extends da{constructor(t){super(),wa(this,t,Ta,Ea,ba,{})}}export{Na as component}; diff --git a/docs/_app/immutable/nodes/6.c732de2c.js b/docs/_app/immutable/nodes/6.c732de2c.js deleted file mode 100644 index 6081f45..0000000 --- a/docs/_app/immutable/nodes/6.c732de2c.js +++ /dev/null @@ -1 +0,0 @@ -import{S as B,i as C,s as G,O as $,y as E,z as L,A as S,P as I,Q as b,g as P,d as T,B as A,R as k,k as g,q as x,a as D,l as y,m as _,h as i,r as w,c as z,n as f,b as v,E as u,G as O}from"../chunks/index.488f1ee5.js";import{L as Q}from"../chunks/layout.c8702512.js";import{S as R}from"../chunks/State.8d241e02.js";function V(d){let s,e,l,c='ff',a,n,h='gg',t,m,p,H='(fg)(n)=dnf(d)g(nd)(f*g)(n) = \\sum_{d|n} f(d)g(\\frac{n}{d})';return{c(){s=g("p"),e=x("The Dirichlet convolution of two arithmetic functions "),l=g("span"),a=x(" and "),n=g("span"),t=x(" is defined as"),m=D(),p=g("div"),this.h()},l(r){s=y(r,"P",{});var o=_(s);e=w(o,"The Dirichlet convolution of two arithmetic functions "),l=y(o,"SPAN",{class:!0});var N=_(l);N.forEach(i),a=w(o," and "),n=y(o,"SPAN",{class:!0});var q=_(n);q.forEach(i),t=w(o," is defined as"),o.forEach(i),m=z(r),p=y(r,"DIV",{class:!0});var j=_(p);j.forEach(i),this.h()},h(){f(l,"class","math math-inline"),f(n,"class","math math-inline"),f(p,"class","math math-display")},m(r,o){v(r,s,o),u(s,e),u(s,l),l.innerHTML=c,u(s,a),u(s,n),n.innerHTML=h,u(s,t),v(r,m,o),v(r,p,o),p.innerHTML=H},p:O,d(r){r&&i(s),r&&i(m),r&&i(p)}}}function F(d){let s,e,l,c,a,n,h;return n=new R({props:{variant:"definition",$$slots:{default:[V]},$$scope:{ctx:d}}}),{c(){s=g("h1"),e=g("a"),l=g("span"),c=x("Dirichlet convolution"),a=D(),E(n.$$.fragment),this.h()},l(t){s=y(t,"H1",{id:!0});var m=_(s);e=y(m,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var p=_(e);l=y(p,"SPAN",{class:!0}),_(l).forEach(i),p.forEach(i),c=w(m,"Dirichlet convolution"),m.forEach(i),a=z(t),L(n.$$.fragment,t),this.h()},h(){f(l,"class","icon icon-link"),f(e,"aria-hidden","true"),f(e,"tabindex","-1"),f(e,"href","#dirichlet-convolution"),f(s,"id","dirichlet-convolution")},m(t,m){v(t,s,m),u(s,e),u(e,l),u(s,c),v(t,a,m),S(n,t,m),h=!0},p(t,m){const p={};m&2&&(p.$$scope={dirty:m,ctx:t}),n.$set(p)},i(t){h||(P(n.$$.fragment,t),h=!0)},o(t){T(n.$$.fragment,t),h=!1},d(t){t&&i(s),t&&i(a),A(n,t)}}}function J(d){let s,e;const l=[d[0],M];let c={$$slots:{default:[F]},$$scope:{ctx:d}};for(let a=0;a{e(0,s=$($({},s),k(l)))},s=k(s),[s]}class Y extends B{constructor(s){super(),C(this,s,K,J,G,{})}}export{Y as component}; diff --git a/docs/_app/immutable/nodes/7.93740cfc.js b/docs/_app/immutable/nodes/7.93740cfc.js deleted file mode 100644 index f630b21..0000000 --- a/docs/_app/immutable/nodes/7.93740cfc.js +++ /dev/null @@ -1,50 +0,0 @@ -import{S as Ln,i as zn,s as En,O as xn,y as $s,z as Ls,A as zs,P as Pn,Q as fn,g as Es,d as Ps,B as Ts,R as bn,k as p,q as l,a as z,l as m,m as e,h as s,r as i,c as E,n as r,b as c,E as a,G as Ss}from"../chunks/index.488f1ee5.js";import{L as Tn}from"../chunks/layout.c8702512.js";import{S as ra}from"../chunks/State.8d241e02.js";import{P as va}from"../chunks/Proof.26996d3c.js";import{A as An}from"../chunks/Algor.c1ca40d5.js";function Sn(D){let n,u,g,b='φ(n)\\varphi(n)',d,o,I='nn',M,y,_='nn',L;return{c(){n=p("p"),u=l("The Euler’s Totient Function, denoted as "),g=p("span"),d=l(", is defined as the number of natural number strictly less than to "),o=p("span"),M=l(" that are relatively prime to "),y=p("span"),L=l("."),this.h()},l(w){n=m(w,"P",{});var h=e(n);u=i(h,"The Euler’s Totient Function, denoted as "),g=m(h,"SPAN",{class:!0});var T=e(g);T.forEach(s),d=i(h,", is defined as the number of natural number strictly less than to "),o=m(h,"SPAN",{class:!0});var x=e(o);x.forEach(s),M=i(h," that are relatively prime to "),y=m(h,"SPAN",{class:!0});var A=e(y);A.forEach(s),L=i(h,"."),h.forEach(s),this.h()},h(){r(g,"class","math math-inline"),r(o,"class","math math-inline"),r(y,"class","math math-inline")},m(w,h){c(w,n,h),a(n,u),a(n,g),g.innerHTML=b,a(n,d),a(n,o),o.innerHTML=I,a(n,M),a(n,y),y.innerHTML=_,a(n,L)},p:Ss,d(w){w&&s(n)}}}function Hn(D){let n,u,g='φ(1)=1\\varphi(1) = 1';return{c(){n=p("p"),u=p("span"),this.h()},l(b){n=m(b,"P",{});var d=e(n);u=m(d,"SPAN",{class:!0});var o=e(u);o.forEach(s),d.forEach(s),this.h()},h(){r(u,"class","math math-inline")},m(b,d){c(b,n,d),a(n,u),u.innerHTML=g},p:Ss,d(b){b&&s(n)}}}function Nn(D){let n,u,g,b='00',d,o,I='11',M,y,_='11',L;return{c(){n=p("p"),u=l("Only "),g=p("span"),d=l(" is less than "),o=p("span"),M=l(" and relatively prime to "),y=p("span"),L=l("."),this.h()},l(w){n=m(w,"P",{});var h=e(n);u=i(h,"Only "),g=m(h,"SPAN",{class:!0});var T=e(g);T.forEach(s),d=i(h," is less than "),o=m(h,"SPAN",{class:!0});var x=e(o);x.forEach(s),M=i(h," and relatively prime to "),y=m(h,"SPAN",{class:!0});var A=e(y);A.forEach(s),L=i(h,"."),h.forEach(s),this.h()},h(){r(g,"class","math math-inline"),r(o,"class","math math-inline"),r(y,"class","math math-inline")},m(w,h){c(w,n,h),a(n,u),a(n,g),g.innerHTML=b,a(n,d),a(n,o),o.innerHTML=I,a(n,M),a(n,y),y.innerHTML=_,a(n,L)},p:Ss,d(w){w&&s(n)}}}function qn(D){let n,u,g='φ(n)=n1\\varphi(n) = n - 1',b,d,o='nn',I;return{c(){n=p("p"),u=p("span"),b=l(", if "),d=p("span"),I=l(" is prime"),this.h()},l(M){n=m(M,"P",{});var y=e(n);u=m(y,"SPAN",{class:!0});var _=e(u);_.forEach(s),b=i(y,", if "),d=m(y,"SPAN",{class:!0});var L=e(d);L.forEach(s),I=i(y," is prime"),y.forEach(s),this.h()},h(){r(u,"class","math math-inline"),r(d,"class","math math-inline")},m(M,y){c(M,n,y),a(n,u),u.innerHTML=g,a(n,b),a(n,d),d.innerHTML=o,a(n,I)},p:Ss,d(M){M&&s(n)}}}function jn(D){let n,u,g,b='nn',d,o,I='nn',M,y,_='nn',L,w,h,T,x,A='φ(n)=n1\\varphi(n) = n - 1',q;return{c(){n=p("p"),u=l("It’s easy to see that all positive intergers less than "),g=p("span"),d=l(" are relatively prime to "),o=p("span"),M=l(" if "),y=p("span"),L=l(" is prime."),w=z(),h=p("p"),T=l("Therefore, "),x=p("span"),q=l("."),this.h()},l(f){n=m(f,"P",{});var k=e(n);u=i(k,"It’s easy to see that all positive intergers less than "),g=m(k,"SPAN",{class:!0});var F=e(g);F.forEach(s),d=i(k," are relatively prime to "),o=m(k,"SPAN",{class:!0});var S=e(o);S.forEach(s),M=i(k," if "),y=m(k,"SPAN",{class:!0});var V=e(y);V.forEach(s),L=i(k," is prime."),k.forEach(s),w=E(f),h=m(f,"P",{});var Y=e(h);T=i(Y,"Therefore, "),x=m(Y,"SPAN",{class:!0});var N=e(x);N.forEach(s),q=i(Y,"."),Y.forEach(s),this.h()},h(){r(g,"class","math math-inline"),r(o,"class","math math-inline"),r(y,"class","math math-inline"),r(x,"class","math math-inline")},m(f,k){c(f,n,k),a(n,u),a(n,g),g.innerHTML=b,a(n,d),a(n,o),o.innerHTML=I,a(n,M),a(n,y),y.innerHTML=_,a(n,L),c(f,w,k),c(f,h,k),a(h,T),a(h,x),x.innerHTML=A,a(h,q)},p:Ss,d(f){f&&s(n),f&&s(w),f&&s(h)}}}function In(D){let n,u,g='φ(pq)=(p1)(q1)\\varphi(pq) = (p - 1)(q - 1)',b,d,o='pp',I,M,y='qq',_;return{c(){n=p("p"),u=p("span"),b=l(", if "),d=p("span"),I=l(" and "),M=p("span"),_=l(" are distinct primes"),this.h()},l(L){n=m(L,"P",{});var w=e(n);u=m(w,"SPAN",{class:!0});var h=e(u);h.forEach(s),b=i(w,", if "),d=m(w,"SPAN",{class:!0});var T=e(d);T.forEach(s),I=i(w," and "),M=m(w,"SPAN",{class:!0});var x=e(M);x.forEach(s),_=i(w," are distinct primes"),w.forEach(s),this.h()},h(){r(u,"class","math math-inline"),r(d,"class","math math-inline"),r(M,"class","math math-inline")},m(L,w){c(L,n,w),a(n,u),u.innerHTML=g,a(n,b),a(n,d),d.innerHTML=o,a(n,I),a(n,M),M.innerHTML=y,a(n,_)},p:Ss,d(L){L&&s(n)}}}function Wn(D){let n,u,g,b='pp',d,o,I='gcd(p,k)1\\operatorname{gcd}(p, k) \\neq 1',M,y,_='pkp | k',L,w,h='pqpq',T,x,A='pqpq',q,f,k='p,2p,,(q1)pp, 2p, \\dots, (q - 1)p',F,S,V='q1q - 1',Y,N,J,as,P,O='p1p - 1',X,B,U='pqpq',ms,H,C='pqpq',rs,Z,ns='xx',is,ts,ws='pxp | x',us,G,R='qxq | x',fs,ys,Cs='x<pqx < pq',Ms,bs,js,os,K,ss='φ(pq)=pq1(p1)(q1)=(p1)(q1)\\varphi(pq) = pq - 1 - (p - 1) - (q - 1) = (p - 1)(q - 1)',_s;return{c(){n=p("p"),u=l("Since "),g=p("span"),d=l(" is prime, "),o=p("span"),M=l(" gives "),y=p("span"),L=l(". Hence, numbers less than "),w=p("span"),T=l(" that are not relatively prime to "),x=p("span"),q=l(" are "),f=p("span"),F=l(". It’s easy to see that there are "),S=p("span"),Y=l(" such numbers."),N=z(),J=p("p"),as=l("Similarly, there are "),P=p("span"),X=l(" numbers less than "),B=p("span"),ms=l(" that are not relatively prime to "),H=p("span"),rs=l(" and the union of these 2 sets is empty since there is no such "),Z=p("span"),is=l(" that satisfy "),ts=p("span"),us=l(", "),G=p("span"),fs=l(" and "),ys=p("span"),Ms=l("."),bs=z(),js=p("p"),os=l("Therefore, "),K=p("span"),_s=l("."),this.h()},l(cs){n=m(cs,"P",{});var es=e(n);u=i(es,"Since "),g=m(es,"SPAN",{class:!0});var As=e(g);As.forEach(s),d=i(es," is prime, "),o=m(es,"SPAN",{class:!0});var Hs=e(o);Hs.forEach(s),M=i(es," gives "),y=m(es,"SPAN",{class:!0});var ta=e(y);ta.forEach(s),L=i(es,". Hence, numbers less than "),w=m(es,"SPAN",{class:!0});var ks=e(w);ks.forEach(s),T=i(es," that are not relatively prime to "),x=m(es,"SPAN",{class:!0});var Ns=e(x);Ns.forEach(s),q=i(es," are "),f=m(es,"SPAN",{class:!0});var na=e(f);na.forEach(s),F=i(es,". It’s easy to see that there are "),S=m(es,"SPAN",{class:!0});var Fs=e(S);Fs.forEach(s),Y=i(es," such numbers."),es.forEach(s),N=E(cs),J=m(cs,"P",{});var ls=e(J);as=i(ls,"Similarly, there are "),P=m(ls,"SPAN",{class:!0});var Us=e(P);Us.forEach(s),X=i(ls," numbers less than "),B=m(ls,"SPAN",{class:!0});var Ws=e(B);Ws.forEach(s),ms=i(ls," that are not relatively prime to "),H=m(ls,"SPAN",{class:!0});var hs=e(H);hs.forEach(s),rs=i(ls," and the union of these 2 sets is empty since there is no such "),Z=m(ls,"SPAN",{class:!0});var pa=e(Z);pa.forEach(s),is=i(ls," that satisfy "),ts=m(ls,"SPAN",{class:!0});var W=e(ts);W.forEach(s),us=i(ls,", "),G=m(ls,"SPAN",{class:!0});var ps=e(G);ps.forEach(s),fs=i(ls," and "),ys=m(ls,"SPAN",{class:!0});var Bs=e(ys);Bs.forEach(s),Ms=i(ls,"."),ls.forEach(s),bs=E(cs),js=m(cs,"P",{});var qs=e(js);os=i(qs,"Therefore, "),K=m(qs,"SPAN",{class:!0});var Vs=e(K);Vs.forEach(s),_s=i(qs,"."),qs.forEach(s),this.h()},h(){r(g,"class","math math-inline"),r(o,"class","math math-inline"),r(y,"class","math math-inline"),r(w,"class","math math-inline"),r(x,"class","math math-inline"),r(f,"class","math math-inline"),r(S,"class","math math-inline"),r(P,"class","math math-inline"),r(B,"class","math math-inline"),r(H,"class","math math-inline"),r(Z,"class","math math-inline"),r(ts,"class","math math-inline"),r(G,"class","math math-inline"),r(ys,"class","math math-inline"),r(K,"class","math math-inline")},m(cs,es){c(cs,n,es),a(n,u),a(n,g),g.innerHTML=b,a(n,d),a(n,o),o.innerHTML=I,a(n,M),a(n,y),y.innerHTML=_,a(n,L),a(n,w),w.innerHTML=h,a(n,T),a(n,x),x.innerHTML=A,a(n,q),a(n,f),f.innerHTML=k,a(n,F),a(n,S),S.innerHTML=V,a(n,Y),c(cs,N,es),c(cs,J,es),a(J,as),a(J,P),P.innerHTML=O,a(J,X),a(J,B),B.innerHTML=U,a(J,ms),a(J,H),H.innerHTML=C,a(J,rs),a(J,Z),Z.innerHTML=ns,a(J,is),a(J,ts),ts.innerHTML=ws,a(J,us),a(J,G),G.innerHTML=R,a(J,fs),a(J,ys),ys.innerHTML=Cs,a(J,Ms),c(cs,bs,es),c(cs,js,es),a(js,os),a(js,K),K.innerHTML=ss,a(js,_s)},p:Ss,d(cs){cs&&s(n),cs&&s(N),cs&&s(J),cs&&s(bs),cs&&s(js)}}}function Bn(D){let n,u,g='φ(pk)=pkpk1\\varphi(p^k) = p^k - p^{k - 1}',b,d,o='pp',I;return{c(){n=p("p"),u=p("span"),b=l(", if "),d=p("span"),I=l(" is prime"),this.h()},l(M){n=m(M,"P",{});var y=e(n);u=m(y,"SPAN",{class:!0});var _=e(u);_.forEach(s),b=i(y,", if "),d=m(y,"SPAN",{class:!0});var L=e(d);L.forEach(s),I=i(y," is prime"),y.forEach(s),this.h()},h(){r(u,"class","math math-inline"),r(d,"class","math math-inline")},m(M,y){c(M,n,y),a(n,u),u.innerHTML=g,a(n,b),a(n,d),d.innerHTML=o,a(n,I)},p:Ss,d(M){M&&s(n)}}}function Vn(D){let n,u,g,b='pp',d,o,I='gcd(p,k)1\\operatorname{gcd}(p, k) \\neq 1',M,y,_='pkp | k',L,w,h,T,x,A='pkp^k',q,f,k='pkp^k',F,S,V='p,2p,,(pk11)pp, 2p, \\dots, (p^{k - 1} - 1)p',Y,N,J='pkp1=pk11\\lfloor \\dfrac{p ^{k}}{p} \\rfloor - 1 = p^{k - 1} - 1',as,P,O,X,B,U='φ(pk)=pk1(pk11)=pkpk1\\varphi(p^k) = p^k - 1 - (p^{k - 1} - 1) = p^k - p^{k - 1}',ms;return{c(){n=p("p"),u=l("Since "),g=p("span"),d=l(" is prime, "),o=p("span"),M=l(" gives "),y=p("span"),L=l("."),w=z(),h=p("p"),T=l("Hence, numbers less than "),x=p("span"),q=l(" that are not relatively prime to "),f=p("span"),F=l(" are "),S=p("span"),Y=l(". It’s easy to see that there are "),N=p("span"),as=l(" such numbers."),P=z(),O=p("p"),X=l("Therefore, "),B=p("span"),ms=l("."),this.h()},l(H){n=m(H,"P",{});var C=e(n);u=i(C,"Since "),g=m(C,"SPAN",{class:!0});var rs=e(g);rs.forEach(s),d=i(C," is prime, "),o=m(C,"SPAN",{class:!0});var Z=e(o);Z.forEach(s),M=i(C," gives "),y=m(C,"SPAN",{class:!0});var ns=e(y);ns.forEach(s),L=i(C,"."),C.forEach(s),w=E(H),h=m(H,"P",{});var is=e(h);T=i(is,"Hence, numbers less than "),x=m(is,"SPAN",{class:!0});var ts=e(x);ts.forEach(s),q=i(is," that are not relatively prime to "),f=m(is,"SPAN",{class:!0});var ws=e(f);ws.forEach(s),F=i(is," are "),S=m(is,"SPAN",{class:!0});var us=e(S);us.forEach(s),Y=i(is,". It’s easy to see that there are "),N=m(is,"SPAN",{class:!0});var G=e(N);G.forEach(s),as=i(is," such numbers."),is.forEach(s),P=E(H),O=m(H,"P",{});var R=e(O);X=i(R,"Therefore, "),B=m(R,"SPAN",{class:!0});var fs=e(B);fs.forEach(s),ms=i(R,"."),R.forEach(s),this.h()},h(){r(g,"class","math math-inline"),r(o,"class","math math-inline"),r(y,"class","math math-inline"),r(x,"class","math math-inline"),r(f,"class","math math-inline"),r(S,"class","math math-inline"),r(N,"class","math math-inline"),r(B,"class","math math-inline")},m(H,C){c(H,n,C),a(n,u),a(n,g),g.innerHTML=b,a(n,d),a(n,o),o.innerHTML=I,a(n,M),a(n,y),y.innerHTML=_,a(n,L),c(H,w,C),c(H,h,C),a(h,T),a(h,x),x.innerHTML=A,a(h,q),a(h,f),f.innerHTML=k,a(h,F),a(h,S),S.innerHTML=V,a(h,Y),a(h,N),N.innerHTML=J,a(h,as),c(H,P,C),c(H,O,C),a(O,X),a(O,B),B.innerHTML=U,a(O,ms)},p:Ss,d(H){H&&s(n),H&&s(w),H&&s(h),H&&s(P),H&&s(O)}}}function Dn(D){let n,u,g='φ(n)\\varphi(n)',b;return{c(){n=p("p"),u=p("span"),b=l(" is multiplicative"),this.h()},l(d){n=m(d,"P",{});var o=e(n);u=m(o,"SPAN",{class:!0});var I=e(u);I.forEach(s),b=i(o," is multiplicative"),o.forEach(s),this.h()},h(){r(u,"class","math math-inline")},m(d,o){c(d,n,o),a(n,u),u.innerHTML=g,a(n,b)},p:Ss,d(d){d&&s(n)}}}function Fn(D){let n,u,g,b='aa',d,o,I='bb',M,y,_='φ(ab)=φ(a)φ(b)\\varphi(ab) = \\varphi(a)\\varphi(b)',L,w,h,T,x,A,q,f,k='m,nm, n',F,S,V='a,ba, b',Y,N,J='xx',as,P,O='0x<ab0 \\leq x < ab',X,B,U='xm(moda)x \\equiv m \\pmod{a}',ms,H,C='xn(modb)x \\equiv n \\pmod{b}',rs,Z,ns,is,ts,ws,us='gcd(x,ab)=1    gcd(x,a)=1gcd(x,b)=1\\operatorname{gcd}(x, ab) = 1 \\iff \\operatorname{gcd}(x, a) = 1 \\land \\operatorname{gcd}(x, b) = 1',G,R,fs,ys,Cs='xx',Ms,bs,js='abab',os,K,ss,_s,cs,es='xx',As,Hs,ta='a,ba, b',ks,Ns,na='(m,n)(m, n)',Fs,ls,Us='abab',Ws,hs,pa='0m<a0 \\leq m < a',W,ps,Bs='0n<b0 \\leq n < b',qs,Vs,Rs,Xs,Ys,la='φ(a)φ(b)\\varphi(a)\\varphi(b)',Zs,Gs,Qs='abab',Os,aa,Is='abab',ma;return{c(){n=p("p"),u=l("Let "),g=p("span"),d=l(" and "),o=p("span"),M=l(" be two arbitrary coprime positive integers. We want to show that "),y=p("span"),L=l("."),w=z(),h=p("p"),T=l("From "),x=p("a"),A=l("CRT"),q=l(", we know that for each pair of number "),f=p("span"),F=l(" that is coprime to "),S=p("span"),Y=l(", there is a unique number "),N=p("span"),as=l(" such that "),P=p("span"),X=l(" and "),B=p("span"),ms=l(" and "),H=p("span"),rs=l("."),Z=z(),ns=p("p"),is=l("Since"),ts=z(),ws=p("div"),G=z(),R=p("p"),fs=l("we know such "),ys=p("span"),Ms=l(" is also coprime to "),bs=p("span"),os=l("."),K=z(),ss=p("p"),_s=l("It’s easy to see echo "),cs=p("span"),As=l(" which is coprime to "),Hs=p("span"),ks=l(" can be mapped to a unique pair of numbers "),Ns=p("span"),Fs=l(" that is coprime to "),ls=p("span"),Ws=l(" s.t "),hs=p("span"),W=l(" and "),ps=p("span"),qs=l("."),Vs=z(),Rs=p("p"),Xs=l("Therefore, there are "),Ys=p("span"),Zs=l(" numbers less than "),Gs=p("span"),Os=l(" that are coprime to "),aa=p("span"),ma=l("."),this.h()},l($){n=m($,"P",{});var Q=e(n);u=i(Q,"Let "),g=m(Q,"SPAN",{class:!0});var j=e(g);j.forEach(s),d=i(Q," and "),o=m(Q,"SPAN",{class:!0});var gs=e(o);gs.forEach(s),M=i(Q," be two arbitrary coprime positive integers. We want to show that "),y=m(Q,"SPAN",{class:!0});var wa=e(y);wa.forEach(s),L=i(Q,"."),Q.forEach(s),w=E($),h=m($,"P",{});var ds=e(h);T=i(ds,"From "),x=m(ds,"A",{href:!0});var ea=e(x);A=i(ea,"CRT"),ea.forEach(s),q=i(ds,", we know that for each pair of number "),f=m(ds,"SPAN",{class:!0});var sa=e(f);sa.forEach(s),F=i(ds," that is coprime to "),S=m(ds,"SPAN",{class:!0});var ba=e(S);ba.forEach(s),Y=i(ds,", there is a unique number "),N=m(ds,"SPAN",{class:!0});var ca=e(N);ca.forEach(s),as=i(ds," such that "),P=m(ds,"SPAN",{class:!0});var oa=e(P);oa.forEach(s),X=i(ds," and "),B=m(ds,"SPAN",{class:!0});var Ds=e(B);Ds.forEach(s),ms=i(ds," and "),H=m(ds,"SPAN",{class:!0});var _a=e(H);_a.forEach(s),rs=i(ds,"."),ds.forEach(s),Z=E($),ns=m($,"P",{});var ha=e(ns);is=i(ha,"Since"),ha.forEach(s),ts=E($),ws=m($,"DIV",{class:!0});var ga=e(ws);ga.forEach(s),G=E($),R=m($,"P",{});var Js=e(R);fs=i(Js,"we know such "),ys=m(Js,"SPAN",{class:!0});var da=e(ys);da.forEach(s),Ms=i(Js," is also coprime to "),bs=m(Js,"SPAN",{class:!0});var Ma=e(bs);Ma.forEach(s),os=i(Js,"."),Js.forEach(s),K=E($),ss=m($,"P",{});var vs=e(ss);_s=i(vs,"It’s easy to see echo "),cs=m(vs,"SPAN",{class:!0});var ka=e(cs);ka.forEach(s),As=i(vs," which is coprime to "),Hs=m(vs,"SPAN",{class:!0});var Ks=e(Hs);Ks.forEach(s),ks=i(vs," can be mapped to a unique pair of numbers "),Ns=m(vs,"SPAN",{class:!0});var ua=e(Ns);ua.forEach(s),Fs=i(vs," that is coprime to "),ls=m(vs,"SPAN",{class:!0});var fa=e(ls);fa.forEach(s),Ws=i(vs," s.t "),hs=m(vs,"SPAN",{class:!0});var $a=e(hs);$a.forEach(s),W=i(vs," and "),ps=m(vs,"SPAN",{class:!0});var ia=e(ps);ia.forEach(s),qs=i(vs,"."),vs.forEach(s),Vs=E($),Rs=m($,"P",{});var xs=e(Rs);Xs=i(xs,"Therefore, there are "),Ys=m(xs,"SPAN",{class:!0});var ya=e(Ys);ya.forEach(s),Zs=i(xs," numbers less than "),Gs=m(xs,"SPAN",{class:!0});var xa=e(Gs);xa.forEach(s),Os=i(xs," that are coprime to "),aa=m(xs,"SPAN",{class:!0});var La=e(aa);La.forEach(s),ma=i(xs,"."),xs.forEach(s),this.h()},h(){r(g,"class","math math-inline"),r(o,"class","math math-inline"),r(y,"class","math math-inline"),r(x,"href","/note/chinese-remainder-theorem"),r(f,"class","math math-inline"),r(S,"class","math math-inline"),r(N,"class","math math-inline"),r(P,"class","math math-inline"),r(B,"class","math math-inline"),r(H,"class","math math-inline"),r(ws,"class","math math-display"),r(ys,"class","math math-inline"),r(bs,"class","math math-inline"),r(cs,"class","math math-inline"),r(Hs,"class","math math-inline"),r(Ns,"class","math math-inline"),r(ls,"class","math math-inline"),r(hs,"class","math math-inline"),r(ps,"class","math math-inline"),r(Ys,"class","math math-inline"),r(Gs,"class","math math-inline"),r(aa,"class","math math-inline")},m($,Q){c($,n,Q),a(n,u),a(n,g),g.innerHTML=b,a(n,d),a(n,o),o.innerHTML=I,a(n,M),a(n,y),y.innerHTML=_,a(n,L),c($,w,Q),c($,h,Q),a(h,T),a(h,x),a(x,A),a(h,q),a(h,f),f.innerHTML=k,a(h,F),a(h,S),S.innerHTML=V,a(h,Y),a(h,N),N.innerHTML=J,a(h,as),a(h,P),P.innerHTML=O,a(h,X),a(h,B),B.innerHTML=U,a(h,ms),a(h,H),H.innerHTML=C,a(h,rs),c($,Z,Q),c($,ns,Q),a(ns,is),c($,ts,Q),c($,ws,Q),ws.innerHTML=us,c($,G,Q),c($,R,Q),a(R,fs),a(R,ys),ys.innerHTML=Cs,a(R,Ms),a(R,bs),bs.innerHTML=js,a(R,os),c($,K,Q),c($,ss,Q),a(ss,_s),a(ss,cs),cs.innerHTML=es,a(ss,As),a(ss,Hs),Hs.innerHTML=ta,a(ss,ks),a(ss,Ns),Ns.innerHTML=na,a(ss,Fs),a(ss,ls),ls.innerHTML=Us,a(ss,Ws),a(ss,hs),hs.innerHTML=pa,a(ss,W),a(ss,ps),ps.innerHTML=Bs,a(ss,qs),c($,Vs,Q),c($,Rs,Q),a(Rs,Xs),a(Rs,Ys),Ys.innerHTML=la,a(Rs,Zs),a(Rs,Gs),Gs.innerHTML=Qs,a(Rs,Os),a(Rs,aa),aa.innerHTML=Is,a(Rs,ma)},p:Ss,d($){$&&s(n),$&&s(w),$&&s(h),$&&s(Z),$&&s(ns),$&&s(ts),$&&s(ws),$&&s(G),$&&s(R),$&&s(K),$&&s(ss),$&&s(Vs),$&&s(Rs)}}}function On(D){let n,u,g='φ(n)=npn(11p)\\varphi(n) = n\\prod_{p|n}(1 - \\frac{1}{p})';return{c(){n=p("p"),u=p("span"),this.h()},l(b){n=m(b,"P",{});var d=e(n);u=m(d,"SPAN",{class:!0});var o=e(u);o.forEach(s),d.forEach(s),this.h()},h(){r(u,"class","math math-inline")},m(b,d){c(b,n,d),a(n,u),u.innerHTML=g},p:Ss,d(b){b&&s(n)}}}function Cn(D){let n,u,g,b='n=i=1kpiain = \\prod_{i = 1}^k p_i^{a_i}',d,o,I='pip_i',M,y,_='aia_i',L,w,h,T=`φ(n)=φ(i=1kpiai)=i=1kφ(piai)=i=1kpiaipiai1=ni=1k(11pi)\\varphi(n) \\\\ -= \\varphi(\\prod_{i = 1}^k p_i^{a_i}) \\\\ -= \\prod_{i = 1}^k \\varphi(p_i^{a_i}) \\\\ -= \\prod_{i = 1}^k p_i^{a_i} - p_i^{a_i - 1} \\\\ -= n\\prod_{i = 1}^k(1 - \\frac{1}{p_i})`;return{c(){n=p("p"),u=l("Let a positive number "),g=p("span"),d=l(" where "),o=p("span"),M=l(" are distinct primes and "),y=p("span"),L=l(" are positive integers."),w=z(),h=p("div"),this.h()},l(x){n=m(x,"P",{});var A=e(n);u=i(A,"Let a positive number "),g=m(A,"SPAN",{class:!0});var q=e(g);q.forEach(s),d=i(A," where "),o=m(A,"SPAN",{class:!0});var f=e(o);f.forEach(s),M=i(A," are distinct primes and "),y=m(A,"SPAN",{class:!0});var k=e(y);k.forEach(s),L=i(A," are positive integers."),A.forEach(s),w=E(x),h=m(x,"DIV",{class:!0});var F=e(h);F.forEach(s),this.h()},h(){r(g,"class","math math-inline"),r(o,"class","math math-inline"),r(y,"class","math math-inline"),r(h,"class","math math-display")},m(x,A){c(x,n,A),a(n,u),a(n,g),g.innerHTML=b,a(n,d),a(n,o),o.innerHTML=I,a(n,M),a(n,y),y.innerHTML=_,a(n,L),c(x,w,A),c(x,h,A),h.innerHTML=T},p:Ss,d(x){x&&s(n),x&&s(w),x&&s(h)}}}function Rn(D){let n,u,g='dnφ(d)=n\\sum_{d|n} \\varphi(d) = n';return{c(){n=p("p"),u=p("span"),this.h()},l(b){n=m(b,"P",{});var d=e(n);u=m(d,"SPAN",{class:!0});var o=e(u);o.forEach(s),d.forEach(s),this.h()},h(){r(u,"class","math math-inline")},m(b,d){c(b,n,d),a(n,u),u.innerHTML=g},p:Ss,d(b){b&&s(n)}}}function Yn(D){let n,u,g,b='n1n-1',d,o,I='1n,2n,,n1n\\dfrac{1}{n}, \\dfrac{2}{n}, \\dots, \\dfrac{n-1}{n}',M,y,_,L,w,h='nn',T,x,A='nn',q,f,k,F,S,V='dn,n1φ(d)=n1\\sum_{d|n, n \\ne 1} \\varphi(d) = n - 1',Y,N,J='dnφ(d)=n\\sum_{d|n} \\varphi(d) = n',as;return{c(){n=p("p"),u=l("Consider "),g=p("span"),d=l(" fractions "),o=p("span"),M=l("."),y=z(),_=p("p"),L=l("After reducing each fraction to its simplest form, we get "),w=p("span"),T=l(" fractions, each of which has a denominator that is a divisor of "),x=p("span"),q=l(", and the numerator of each fraction is coprime to the denominator."),f=z(),k=p("p"),F=l("Therefore "),S=p("span"),Y=l(". And apply property 1, we get "),N=p("span"),as=l("."),this.h()},l(P){n=m(P,"P",{});var O=e(n);u=i(O,"Consider "),g=m(O,"SPAN",{class:!0});var X=e(g);X.forEach(s),d=i(O," fractions "),o=m(O,"SPAN",{class:!0});var B=e(o);B.forEach(s),M=i(O,"."),O.forEach(s),y=E(P),_=m(P,"P",{});var U=e(_);L=i(U,"After reducing each fraction to its simplest form, we get "),w=m(U,"SPAN",{class:!0});var ms=e(w);ms.forEach(s),T=i(U," fractions, each of which has a denominator that is a divisor of "),x=m(U,"SPAN",{class:!0});var H=e(x);H.forEach(s),q=i(U,", and the numerator of each fraction is coprime to the denominator."),U.forEach(s),f=E(P),k=m(P,"P",{});var C=e(k);F=i(C,"Therefore "),S=m(C,"SPAN",{class:!0});var rs=e(S);rs.forEach(s),Y=i(C,". And apply property 1, we get "),N=m(C,"SPAN",{class:!0});var Z=e(N);Z.forEach(s),as=i(C,"."),C.forEach(s),this.h()},h(){r(g,"class","math math-inline"),r(o,"class","math math-inline"),r(w,"class","math math-inline"),r(x,"class","math math-inline"),r(S,"class","math math-inline"),r(N,"class","math math-inline")},m(P,O){c(P,n,O),a(n,u),a(n,g),g.innerHTML=b,a(n,d),a(n,o),o.innerHTML=I,a(n,M),c(P,y,O),c(P,_,O),a(_,L),a(_,w),w.innerHTML=h,a(_,T),a(_,x),x.innerHTML=A,a(_,q),c(P,f,O),c(P,k,O),a(k,F),a(k,S),S.innerHTML=V,a(k,Y),a(k,N),N.innerHTML=J,a(k,as)},p:Ss,d(P){P&&s(n),P&&s(y),P&&s(_),P&&s(f),P&&s(k)}}}function Gn(D){let n,u,g,b='aa',d,o,I='nn',M,y,_,L='aφ(n)1(modn)a^{\\varphi(n)} \\equiv 1 \\pmod{n}';return{c(){n=p("p"),u=l("If "),g=p("span"),d=l(" and "),o=p("span"),M=l(" are coprime positive integers, then"),y=z(),_=p("div"),this.h()},l(w){n=m(w,"P",{});var h=e(n);u=i(h,"If "),g=m(h,"SPAN",{class:!0});var T=e(g);T.forEach(s),d=i(h," and "),o=m(h,"SPAN",{class:!0});var x=e(o);x.forEach(s),M=i(h," are coprime positive integers, then"),h.forEach(s),y=E(w),_=m(w,"DIV",{class:!0});var A=e(_);A.forEach(s),this.h()},h(){r(g,"class","math math-inline"),r(o,"class","math math-inline"),r(_,"class","math math-display")},m(w,h){c(w,n,h),a(n,u),a(n,g),g.innerHTML=b,a(n,d),a(n,o),o.innerHTML=I,a(n,M),c(w,y,h),c(w,_,h),_.innerHTML=L},p:Ss,d(w){w&&s(n),w&&s(y),w&&s(_)}}}function Qn(D){let n,u,g,b='B={b1,b2,,bφ(n)}B = \\{b_1, b_2, \\dots, b_{\\varphi(n)}\\}',d,o,I='nn',M,y,_='nn',L,w,h,T,x,A='bib_i',q,f,k='bjb_j',F,S,V='abiabj(modn)a b_i \\equiv a b_j \\pmod{n}',Y,N,J='bibjb_i \\neq b_j',as,P,O,X=`abiabj(modn)abiabj0(modn)a(bibj)0(modn)a b_i \\equiv a b_j \\pmod{n} \\\\ -a b_i - a b_j \\equiv 0 \\pmod{n} \\\\ -a (b_i - b_j) \\equiv 0 \\pmod{n}`,B,U,ms,H,C='aa',rs,Z,ns='nn',is,ts,ws='na(bibj)n | a (b_i - b_j)',us,G,R='nbibjn | b_i - b_j',fs,ys,Cs='bibj(modn)b_i \\equiv b_j \\pmod{n}',Ms,bs,js='bibjb_i \\neq b_j',os,K,ss,_s,cs,es='aa',As,Hs,ta='bib_i',ks,Ns,na='nn',Fs,ls,Us='abia b_i',Ws,hs,pa='nn',W,ps,Bs,qs,Vs,Rs='{ab1,ab2,,abφ(n)}\\{a b_1, a b_2, \\dots, a b_{\\varphi(n)}\\}',Xs,Ys,la='BB',Zs,Gs,Qs,Os,aa,Is,ma=`i=1φ(n)abii=1φ(n)bi(modn)aφ(n)i=1φ(n)bii=1φ(n)bi(modn)aφ(n)1(modn)\\prod_{i = 1}^{\\varphi(n)} ab_i \\equiv \\prod_{i = 1}^{\\varphi(n)} b_i \\pmod{n} \\\\ -a^{\\varphi(n)} \\prod_{i = 1}^{\\varphi(n)} b_i \\equiv \\prod_{i = 1}^{\\varphi(n)} b_i \\pmod{n} \\\\ -a^{\\varphi(n)} \\equiv 1 \\pmod{n}`;return{c(){n=p("p"),u=l("Let "),g=p("span"),d=l(" be the set of numbers less than "),o=p("span"),M=l(" that are coprime to "),y=p("span"),L=l("."),w=z(),h=p("p"),T=l("Assume that there are two such numbers "),x=p("span"),q=l(" and "),f=p("span"),F=l(" such that "),S=p("span"),Y=l(" and "),N=p("span"),as=l("."),P=z(),O=p("div"),B=z(),U=p("p"),ms=l("Since "),H=p("span"),rs=l(" and "),Z=p("span"),is=l(" are coprime, "),ts=p("span"),us=l(" gives "),G=p("span"),fs=l(" or "),ys=p("span"),Ms=l(", which contradicts with the assumption that "),bs=p("span"),os=l("."),K=z(),ss=p("p"),_s=l("What’s more, since both "),cs=p("span"),As=l(" and "),Hs=p("span"),ks=l(" are coprime to "),Ns=p("span"),Fs=l(", "),ls=p("span"),Ws=l(" is also coprime to "),hs=p("span"),W=l("."),ps=z(),Bs=p("p"),qs=l("Therefore, "),Vs=p("span"),Xs=l(" is a permutation of "),Ys=p("span"),Zs=l("."),Gs=z(),Qs=p("p"),Os=l("Hence,"),aa=z(),Is=p("div"),this.h()},l($){n=m($,"P",{});var Q=e(n);u=i(Q,"Let "),g=m(Q,"SPAN",{class:!0});var j=e(g);j.forEach(s),d=i(Q," be the set of numbers less than "),o=m(Q,"SPAN",{class:!0});var gs=e(o);gs.forEach(s),M=i(Q," that are coprime to "),y=m(Q,"SPAN",{class:!0});var wa=e(y);wa.forEach(s),L=i(Q,"."),Q.forEach(s),w=E($),h=m($,"P",{});var ds=e(h);T=i(ds,"Assume that there are two such numbers "),x=m(ds,"SPAN",{class:!0});var ea=e(x);ea.forEach(s),q=i(ds," and "),f=m(ds,"SPAN",{class:!0});var sa=e(f);sa.forEach(s),F=i(ds," such that "),S=m(ds,"SPAN",{class:!0});var ba=e(S);ba.forEach(s),Y=i(ds," and "),N=m(ds,"SPAN",{class:!0});var ca=e(N);ca.forEach(s),as=i(ds,"."),ds.forEach(s),P=E($),O=m($,"DIV",{class:!0});var oa=e(O);oa.forEach(s),B=E($),U=m($,"P",{});var Ds=e(U);ms=i(Ds,"Since "),H=m(Ds,"SPAN",{class:!0});var _a=e(H);_a.forEach(s),rs=i(Ds," and "),Z=m(Ds,"SPAN",{class:!0});var ha=e(Z);ha.forEach(s),is=i(Ds," are coprime, "),ts=m(Ds,"SPAN",{class:!0});var ga=e(ts);ga.forEach(s),us=i(Ds," gives "),G=m(Ds,"SPAN",{class:!0});var Js=e(G);Js.forEach(s),fs=i(Ds," or "),ys=m(Ds,"SPAN",{class:!0});var da=e(ys);da.forEach(s),Ms=i(Ds,", which contradicts with the assumption that "),bs=m(Ds,"SPAN",{class:!0});var Ma=e(bs);Ma.forEach(s),os=i(Ds,"."),Ds.forEach(s),K=E($),ss=m($,"P",{});var vs=e(ss);_s=i(vs,"What’s more, since both "),cs=m(vs,"SPAN",{class:!0});var ka=e(cs);ka.forEach(s),As=i(vs," and "),Hs=m(vs,"SPAN",{class:!0});var Ks=e(Hs);Ks.forEach(s),ks=i(vs," are coprime to "),Ns=m(vs,"SPAN",{class:!0});var ua=e(Ns);ua.forEach(s),Fs=i(vs,", "),ls=m(vs,"SPAN",{class:!0});var fa=e(ls);fa.forEach(s),Ws=i(vs," is also coprime to "),hs=m(vs,"SPAN",{class:!0});var $a=e(hs);$a.forEach(s),W=i(vs,"."),vs.forEach(s),ps=E($),Bs=m($,"P",{});var ia=e(Bs);qs=i(ia,"Therefore, "),Vs=m(ia,"SPAN",{class:!0});var xs=e(Vs);xs.forEach(s),Xs=i(ia," is a permutation of "),Ys=m(ia,"SPAN",{class:!0});var ya=e(Ys);ya.forEach(s),Zs=i(ia,"."),ia.forEach(s),Gs=E($),Qs=m($,"P",{});var xa=e(Qs);Os=i(xa,"Hence,"),xa.forEach(s),aa=E($),Is=m($,"DIV",{class:!0});var La=e(Is);La.forEach(s),this.h()},h(){r(g,"class","math math-inline"),r(o,"class","math math-inline"),r(y,"class","math math-inline"),r(x,"class","math math-inline"),r(f,"class","math math-inline"),r(S,"class","math math-inline"),r(N,"class","math math-inline"),r(O,"class","math math-display"),r(H,"class","math math-inline"),r(Z,"class","math math-inline"),r(ts,"class","math math-inline"),r(G,"class","math math-inline"),r(ys,"class","math math-inline"),r(bs,"class","math math-inline"),r(cs,"class","math math-inline"),r(Hs,"class","math math-inline"),r(Ns,"class","math math-inline"),r(ls,"class","math math-inline"),r(hs,"class","math math-inline"),r(Vs,"class","math math-inline"),r(Ys,"class","math math-inline"),r(Is,"class","math math-display")},m($,Q){c($,n,Q),a(n,u),a(n,g),g.innerHTML=b,a(n,d),a(n,o),o.innerHTML=I,a(n,M),a(n,y),y.innerHTML=_,a(n,L),c($,w,Q),c($,h,Q),a(h,T),a(h,x),x.innerHTML=A,a(h,q),a(h,f),f.innerHTML=k,a(h,F),a(h,S),S.innerHTML=V,a(h,Y),a(h,N),N.innerHTML=J,a(h,as),c($,P,Q),c($,O,Q),O.innerHTML=X,c($,B,Q),c($,U,Q),a(U,ms),a(U,H),H.innerHTML=C,a(U,rs),a(U,Z),Z.innerHTML=ns,a(U,is),a(U,ts),ts.innerHTML=ws,a(U,us),a(U,G),G.innerHTML=R,a(U,fs),a(U,ys),ys.innerHTML=Cs,a(U,Ms),a(U,bs),bs.innerHTML=js,a(U,os),c($,K,Q),c($,ss,Q),a(ss,_s),a(ss,cs),cs.innerHTML=es,a(ss,As),a(ss,Hs),Hs.innerHTML=ta,a(ss,ks),a(ss,Ns),Ns.innerHTML=na,a(ss,Fs),a(ss,ls),ls.innerHTML=Us,a(ss,Ws),a(ss,hs),hs.innerHTML=pa,a(ss,W),c($,ps,Q),c($,Bs,Q),a(Bs,qs),a(Bs,Vs),Vs.innerHTML=Rs,a(Bs,Xs),a(Bs,Ys),Ys.innerHTML=la,a(Bs,Zs),c($,Gs,Q),c($,Qs,Q),a(Qs,Os),c($,aa,Q),c($,Is,Q),Is.innerHTML=ma},p:Ss,d($){$&&s(n),$&&s(w),$&&s(h),$&&s(P),$&&s(O),$&&s(B),$&&s(U),$&&s(K),$&&s(ss),$&&s(ps),$&&s(Bs),$&&s(Gs),$&&s(Qs),$&&s(aa),$&&s(Is)}}}function Jn(D){let n,u,g,b='pp',d,o,I='aa',M,y,_='pp',L,w,h,T='ap11(modp)a^{p - 1} \\equiv 1 \\pmod{p}';return{c(){n=p("p"),u=l("If "),g=p("span"),d=l(" is a prime and "),o=p("span"),M=l(" is a positive integer that is not divisible by "),y=p("span"),L=l(", then"),w=z(),h=p("div"),this.h()},l(x){n=m(x,"P",{});var A=e(n);u=i(A,"If "),g=m(A,"SPAN",{class:!0});var q=e(g);q.forEach(s),d=i(A," is a prime and "),o=m(A,"SPAN",{class:!0});var f=e(o);f.forEach(s),M=i(A," is a positive integer that is not divisible by "),y=m(A,"SPAN",{class:!0});var k=e(y);k.forEach(s),L=i(A,", then"),A.forEach(s),w=E(x),h=m(x,"DIV",{class:!0});var F=e(h);F.forEach(s),this.h()},h(){r(g,"class","math math-inline"),r(o,"class","math math-inline"),r(y,"class","math math-inline"),r(h,"class","math math-display")},m(x,A){c(x,n,A),a(n,u),a(n,g),g.innerHTML=b,a(n,d),a(n,o),o.innerHTML=I,a(n,M),a(n,y),y.innerHTML=_,a(n,L),c(x,w,A),c(x,h,A),h.innerHTML=T},p:Ss,d(x){x&&s(n),x&&s(w),x&&s(h)}}}function Kn(D){let n,u,g,b='pp',d,o,I='φ(p)=p1\\varphi(p) = p - 1',M,y,_,L,w,h='aa',T,x,A='pp',q,f,k='pp',F,S,V='aa',Y,N,J='pp',as,P,O,X,B,U='ap11(modp)a^{p - 1} \\equiv 1 \\pmod{p}',ms;return{c(){n=p("p"),u=l("Since "),g=p("span"),d=l(" is a prime, "),o=p("span"),M=l("."),y=z(),_=p("p"),L=l("Since "),w=p("span"),T=l(" is less than "),x=p("span"),q=l(" and "),f=p("span"),F=l(" is a prime, "),S=p("span"),Y=l(" must be coprime to "),N=p("span"),as=l("."),P=z(),O=p("p"),X=l("Apply Euler’s Theorem and get "),B=p("span"),ms=l("."),this.h()},l(H){n=m(H,"P",{});var C=e(n);u=i(C,"Since "),g=m(C,"SPAN",{class:!0});var rs=e(g);rs.forEach(s),d=i(C," is a prime, "),o=m(C,"SPAN",{class:!0});var Z=e(o);Z.forEach(s),M=i(C,"."),C.forEach(s),y=E(H),_=m(H,"P",{});var ns=e(_);L=i(ns,"Since "),w=m(ns,"SPAN",{class:!0});var is=e(w);is.forEach(s),T=i(ns," is less than "),x=m(ns,"SPAN",{class:!0});var ts=e(x);ts.forEach(s),q=i(ns," and "),f=m(ns,"SPAN",{class:!0});var ws=e(f);ws.forEach(s),F=i(ns," is a prime, "),S=m(ns,"SPAN",{class:!0});var us=e(S);us.forEach(s),Y=i(ns," must be coprime to "),N=m(ns,"SPAN",{class:!0});var G=e(N);G.forEach(s),as=i(ns,"."),ns.forEach(s),P=E(H),O=m(H,"P",{});var R=e(O);X=i(R,"Apply Euler’s Theorem and get "),B=m(R,"SPAN",{class:!0});var fs=e(B);fs.forEach(s),ms=i(R,"."),R.forEach(s),this.h()},h(){r(g,"class","math math-inline"),r(o,"class","math math-inline"),r(w,"class","math math-inline"),r(x,"class","math math-inline"),r(f,"class","math math-inline"),r(S,"class","math math-inline"),r(N,"class","math math-inline"),r(B,"class","math math-inline")},m(H,C){c(H,n,C),a(n,u),a(n,g),g.innerHTML=b,a(n,d),a(n,o),o.innerHTML=I,a(n,M),c(H,y,C),c(H,_,C),a(_,L),a(_,w),w.innerHTML=h,a(_,T),a(_,x),x.innerHTML=A,a(_,q),a(_,f),f.innerHTML=k,a(_,F),a(_,S),S.innerHTML=V,a(_,Y),a(_,N),N.innerHTML=J,a(_,as),c(H,P,C),c(H,O,C),a(O,X),a(O,B),B.innerHTML=U,a(O,ms)},p:Ss,d(H){H&&s(n),H&&s(y),H&&s(_),H&&s(P),H&&s(O)}}}function Un(D){let n,u='(p1)!1(modp)    p is prime(p - 1)! \\equiv -1 \\pmod{p} \\iff p \\text{ is prime}',g,b,d,o,I='pp',M,y,_='11',L;return{c(){n=p("div"),g=z(),b=p("p"),d=l("where "),o=p("span"),M=l(" is an integer greater than "),y=p("span"),L=l("."),this.h()},l(w){n=m(w,"DIV",{class:!0});var h=e(n);h.forEach(s),g=E(w),b=m(w,"P",{});var T=e(b);d=i(T,"where "),o=m(T,"SPAN",{class:!0});var x=e(o);x.forEach(s),M=i(T," is an integer greater than "),y=m(T,"SPAN",{class:!0});var A=e(y);A.forEach(s),L=i(T,"."),T.forEach(s),this.h()},h(){r(n,"class","math math-display"),r(o,"class","math math-inline"),r(y,"class","math math-inline")},m(w,h){c(w,n,h),n.innerHTML=u,c(w,g,h),c(w,b,h),a(b,d),a(b,o),o.innerHTML=I,a(b,M),a(b,y),y.innerHTML=_,a(b,L)},p:Ss,d(w){w&&s(n),w&&s(g),w&&s(b)}}}function Xn(D){let n,u,g='p is prime    (p1)!1(modp)p \\text{ is prime} \\implies (p - 1)! \\equiv -1 \\pmod{p}',b,d,o,I,M='p=2p = 2',y,_,L='(p1)!=11(modp)(p - 1)! = 1 \\equiv -1 \\pmod{p}',w,h,T='pp',x,A,q,f;return{c(){n=p("p"),u=p("span"),b=z(),d=p("p"),o=l("When "),I=p("span"),y=l(", "),_=p("span"),w=l(", which is obviously true, so we are only going to prove the case where "),h=p("span"),x=l(" is an odd prime."),A=z(),q=p("p"),f=l("We are going to prove a lemma first."),this.h()},l(k){n=m(k,"P",{});var F=e(n);u=m(F,"SPAN",{class:!0});var S=e(u);S.forEach(s),F.forEach(s),b=E(k),d=m(k,"P",{});var V=e(d);o=i(V,"When "),I=m(V,"SPAN",{class:!0});var Y=e(I);Y.forEach(s),y=i(V,", "),_=m(V,"SPAN",{class:!0});var N=e(_);N.forEach(s),w=i(V,", which is obviously true, so we are only going to prove the case where "),h=m(V,"SPAN",{class:!0});var J=e(h);J.forEach(s),x=i(V," is an odd prime."),V.forEach(s),A=E(k),q=m(k,"P",{});var as=e(q);f=i(as,"We are going to prove a lemma first."),as.forEach(s),this.h()},h(){r(u,"class","math math-inline"),r(I,"class","math math-inline"),r(_,"class","math math-inline"),r(h,"class","math math-inline")},m(k,F){c(k,n,F),a(n,u),u.innerHTML=g,c(k,b,F),c(k,d,F),a(d,o),a(d,I),I.innerHTML=M,a(d,y),a(d,_),_.innerHTML=L,a(d,w),a(d,h),h.innerHTML=T,a(d,x),c(k,A,F),c(k,q,F),a(q,f)},p:Ss,d(k){k&&s(n),k&&s(b),k&&s(d),k&&s(A),k&&s(q)}}}function Zn(D){let n,u,g='x21(modp)x ^ 2 \\equiv 1 \\pmod{p}',b,d,o='pp',I,M,y='11',_,L,w='p1p - 1';return{c(){n=p("p"),u=p("span"),b=l(" has only 2 solutions where "),d=p("span"),I=l(" is a odd prime, and they are "),M=p("span"),_=l(" and "),L=p("span"),this.h()},l(h){n=m(h,"P",{});var T=e(n);u=m(T,"SPAN",{class:!0});var x=e(u);x.forEach(s),b=i(T," has only 2 solutions where "),d=m(T,"SPAN",{class:!0});var A=e(d);A.forEach(s),I=i(T," is a odd prime, and they are "),M=m(T,"SPAN",{class:!0});var q=e(M);q.forEach(s),_=i(T," and "),L=m(T,"SPAN",{class:!0});var f=e(L);f.forEach(s),T.forEach(s),this.h()},h(){r(u,"class","math math-inline"),r(d,"class","math math-inline"),r(M,"class","math math-inline"),r(L,"class","math math-inline")},m(h,T){c(h,n,T),a(n,u),u.innerHTML=g,a(n,b),a(n,d),d.innerHTML=o,a(n,I),a(n,M),M.innerHTML=y,a(n,_),a(n,L),L.innerHTML=w},p:Ss,d(h){h&&s(n)}}}function st(D){let n,u=`x21(modp)x210(modp)(x1)(x+1)0(modp)x ^ 2 \\equiv 1 \\pmod{p} \\\\ -x ^ 2 - 1 \\equiv 0 \\pmod{p} \\\\ -(x - 1)(x + 1) \\equiv 0 \\pmod{p}`,g,b,d,o,I='pp',M,y,_='p(x1)(x+1)p | (x - 1)(x + 1)',L,w,h='px1p | x - 1',T,x,A='px+1p | x + 1',q,f,k,F,S,V='11',Y,N,J='p1p - 1',as;return{c(){n=p("div"),g=z(),b=p("p"),d=l("Since "),o=p("span"),M=l(" is a prime, "),y=p("span"),L=l(" gives "),w=p("span"),T=l(" or "),x=p("span"),q=l("."),f=z(),k=p("p"),F=l("Therefore, the only solutions are "),S=p("span"),Y=l(" and "),N=p("span"),as=l("."),this.h()},l(P){n=m(P,"DIV",{class:!0});var O=e(n);O.forEach(s),g=E(P),b=m(P,"P",{});var X=e(b);d=i(X,"Since "),o=m(X,"SPAN",{class:!0});var B=e(o);B.forEach(s),M=i(X," is a prime, "),y=m(X,"SPAN",{class:!0});var U=e(y);U.forEach(s),L=i(X," gives "),w=m(X,"SPAN",{class:!0});var ms=e(w);ms.forEach(s),T=i(X," or "),x=m(X,"SPAN",{class:!0});var H=e(x);H.forEach(s),q=i(X,"."),X.forEach(s),f=E(P),k=m(P,"P",{});var C=e(k);F=i(C,"Therefore, the only solutions are "),S=m(C,"SPAN",{class:!0});var rs=e(S);rs.forEach(s),Y=i(C," and "),N=m(C,"SPAN",{class:!0});var Z=e(N);Z.forEach(s),as=i(C,"."),C.forEach(s),this.h()},h(){r(n,"class","math math-display"),r(o,"class","math math-inline"),r(y,"class","math math-inline"),r(w,"class","math math-inline"),r(x,"class","math math-inline"),r(S,"class","math math-inline"),r(N,"class","math math-inline")},m(P,O){c(P,n,O),n.innerHTML=u,c(P,g,O),c(P,b,O),a(b,d),a(b,o),o.innerHTML=I,a(b,M),a(b,y),y.innerHTML=_,a(b,L),a(b,w),w.innerHTML=h,a(b,T),a(b,x),x.innerHTML=A,a(b,q),c(P,f,O),c(P,k,O),a(k,F),a(k,S),S.innerHTML=V,a(k,Y),a(k,N),N.innerHTML=J,a(k,as)},p:Ss,d(P){P&&s(n),P&&s(g),P&&s(b),P&&s(f),P&&s(k)}}}function at(D){let n,u,g,b='{ab1,ab2,,abφ(n)}\\{a b_1, a b_2, \\dots, a b_{\\varphi(n)}\\}',d,o,I='BB',M,y,_='aa',L,w,h='nn',T,x,A='nn',q,f,k='0<a<n0 < a < n',F,S,V,Y,N,J='BB',as,P,O='pp',X,B,U='11',ms,H,C='p1p - 1',rs,Z,ns,is,ts,ws,us=`i=1p1i1(p1)1(modp)(p1)!1(modp)\\prod_{i = 1}^{p - 1} i \\equiv 1 \\cdot (p - 1) \\equiv -1 \\pmod{p} \\\\ -(p - 1)! \\equiv -1 \\pmod{p}`;return{c(){n=p("p"),u=l("Consider Euler’s Theorem’s proof. We know that "),g=p("span"),d=l(" is a permutation of "),o=p("span"),M=l(", which gives the inverse of "),y=p("span"),L=l(" modulo "),w=p("span"),T=l(" is unique if "),x=p("span"),q=l(" is prime and "),f=p("span"),F=l("."),S=z(),V=p("p"),Y=l("Thus, we can pair up each number in "),N=p("span"),as=l(" with its inverse modulo "),P=p("span"),X=l(" except "),B=p("span"),ms=l(" and "),H=p("span"),rs=l(", whose inverse is themselves."),Z=z(),ns=p("p"),is=l("Therefore, we have"),ts=z(),ws=p("div"),this.h()},l(G){n=m(G,"P",{});var R=e(n);u=i(R,"Consider Euler’s Theorem’s proof. We know that "),g=m(R,"SPAN",{class:!0});var fs=e(g);fs.forEach(s),d=i(R," is a permutation of "),o=m(R,"SPAN",{class:!0});var ys=e(o);ys.forEach(s),M=i(R,", which gives the inverse of "),y=m(R,"SPAN",{class:!0});var Cs=e(y);Cs.forEach(s),L=i(R," modulo "),w=m(R,"SPAN",{class:!0});var Ms=e(w);Ms.forEach(s),T=i(R," is unique if "),x=m(R,"SPAN",{class:!0});var bs=e(x);bs.forEach(s),q=i(R," is prime and "),f=m(R,"SPAN",{class:!0});var js=e(f);js.forEach(s),F=i(R,"."),R.forEach(s),S=E(G),V=m(G,"P",{});var os=e(V);Y=i(os,"Thus, we can pair up each number in "),N=m(os,"SPAN",{class:!0});var K=e(N);K.forEach(s),as=i(os," with its inverse modulo "),P=m(os,"SPAN",{class:!0});var ss=e(P);ss.forEach(s),X=i(os," except "),B=m(os,"SPAN",{class:!0});var _s=e(B);_s.forEach(s),ms=i(os," and "),H=m(os,"SPAN",{class:!0});var cs=e(H);cs.forEach(s),rs=i(os,", whose inverse is themselves."),os.forEach(s),Z=E(G),ns=m(G,"P",{});var es=e(ns);is=i(es,"Therefore, we have"),es.forEach(s),ts=E(G),ws=m(G,"DIV",{class:!0});var As=e(ws);As.forEach(s),this.h()},h(){r(g,"class","math math-inline"),r(o,"class","math math-inline"),r(y,"class","math math-inline"),r(w,"class","math math-inline"),r(x,"class","math math-inline"),r(f,"class","math math-inline"),r(N,"class","math math-inline"),r(P,"class","math math-inline"),r(B,"class","math math-inline"),r(H,"class","math math-inline"),r(ws,"class","math math-display")},m(G,R){c(G,n,R),a(n,u),a(n,g),g.innerHTML=b,a(n,d),a(n,o),o.innerHTML=I,a(n,M),a(n,y),y.innerHTML=_,a(n,L),a(n,w),w.innerHTML=h,a(n,T),a(n,x),x.innerHTML=A,a(n,q),a(n,f),f.innerHTML=k,a(n,F),c(G,S,R),c(G,V,R),a(V,Y),a(V,N),N.innerHTML=J,a(V,as),a(V,P),P.innerHTML=O,a(V,X),a(V,B),B.innerHTML=U,a(V,ms),a(V,H),H.innerHTML=C,a(V,rs),c(G,Z,R),c(G,ns,R),a(ns,is),c(G,ts,R),c(G,ws,R),ws.innerHTML=us},p:Ss,d(G){G&&s(n),G&&s(S),G&&s(V),G&&s(Z),G&&s(ns),G&&s(ts),G&&s(ws)}}}function nt(D){let n,u,g='(p1)!1(modp)    p is prime(p - 1)! \\equiv -1 \\pmod{p} \\implies p \\text{ is prime}';return{c(){n=p("p"),u=p("span"),this.h()},l(b){n=m(b,"P",{});var d=e(n);u=m(d,"SPAN",{class:!0});var o=e(u);o.forEach(s),d.forEach(s),this.h()},h(){r(u,"class","math math-inline")},m(b,d){c(b,n,d),a(n,u),u.innerHTML=g},p:Ss,d(b){b&&s(n)}}}function tt(D){let n,u,g,b='pp',d,o,I='(p1)!1(modp)(p - 1)! \\equiv -1 \\pmod{p}',M,y,_,L,w,h='pp',T,x,A='44',q,f,k='p=4p = 4',F,S,V,Y,N,J='p>=4p >= 4',as,P,O='(p1)!(p1)(p2)!(p - 1)! \\equiv (p - 1)(p - 2)!',X,B,U,ms,H='pp',C,rs,Z='dd',ns,is,ts,ws,us,G=`dpp2d \\leq \\sqrt{p} \\leq p - 2`,R,fs,ys,Cs,Ms,bs='(p2)!d(p2)!d(modp)(p - 2)! \\equiv d \\cdot \\dfrac{(p - 2)!}{d} \\pmod{p}',js,os,K,ss,_s,cs='dd',es,As,Hs='pp',ta,ks,Ns='d(p2)!d≢1(modp)d \\cdot \\dfrac{(p - 2)!}{d} \\not\\equiv 1 \\pmod{p}',na,Fs,ls,Us,Ws,hs='(p1)!(p1)(p2)!≢1(modp)(p - 1)! \\equiv (p - 1)(p - 2)! \\not\\equiv -1 \\pmod{p}',pa;return{c(){n=p("p"),u=l("We want to prove that non-prime "),g=p("span"),d=l(" can’t satisfy "),o=p("span"),M=l("."),y=z(),_=p("p"),L=l("Then minimum integer "),w=p("span"),T=l(" that is not a prime is "),x=p("span"),q=l(", so we start from "),f=p("span"),F=l("."),S=z(),V=p("p"),Y=l("When "),N=p("span"),as=l(", "),P=p("span"),X=z(),B=p("p"),U=l("Since "),ms=p("span"),C=l(" is composite, let its minimum divisor be "),rs=p("span"),ns=l("."),is=z(),ts=p("p"),ws=l("Then "),us=p("span"),R=l("."),fs=z(),ys=p("p"),Cs=l("We obtain "),Ms=p("span"),js=l("."),os=z(),K=p("p"),ss=l("Since "),_s=p("span"),es=l(" has no inverse modulo "),As=p("span"),ta=l(" (by applying CRT), we have "),ks=p("span"),na=l("."),Fs=z(),ls=p("p"),Us=l("Therefore, "),Ws=p("span"),pa=l("."),this.h()},l(W){n=m(W,"P",{});var ps=e(n);u=i(ps,"We want to prove that non-prime "),g=m(ps,"SPAN",{class:!0});var Bs=e(g);Bs.forEach(s),d=i(ps," can’t satisfy "),o=m(ps,"SPAN",{class:!0});var qs=e(o);qs.forEach(s),M=i(ps,"."),ps.forEach(s),y=E(W),_=m(W,"P",{});var Vs=e(_);L=i(Vs,"Then minimum integer "),w=m(Vs,"SPAN",{class:!0});var Rs=e(w);Rs.forEach(s),T=i(Vs," that is not a prime is "),x=m(Vs,"SPAN",{class:!0});var Xs=e(x);Xs.forEach(s),q=i(Vs,", so we start from "),f=m(Vs,"SPAN",{class:!0});var Ys=e(f);Ys.forEach(s),F=i(Vs,"."),Vs.forEach(s),S=E(W),V=m(W,"P",{});var la=e(V);Y=i(la,"When "),N=m(la,"SPAN",{class:!0});var Zs=e(N);Zs.forEach(s),as=i(la,", "),P=m(la,"SPAN",{class:!0});var Gs=e(P);Gs.forEach(s),la.forEach(s),X=E(W),B=m(W,"P",{});var Qs=e(B);U=i(Qs,"Since "),ms=m(Qs,"SPAN",{class:!0});var Os=e(ms);Os.forEach(s),C=i(Qs," is composite, let its minimum divisor be "),rs=m(Qs,"SPAN",{class:!0});var aa=e(rs);aa.forEach(s),ns=i(Qs,"."),Qs.forEach(s),is=E(W),ts=m(W,"P",{});var Is=e(ts);ws=i(Is,"Then "),us=m(Is,"SPAN",{class:!0});var ma=e(us);ma.forEach(s),R=i(Is,"."),Is.forEach(s),fs=E(W),ys=m(W,"P",{});var $=e(ys);Cs=i($,"We obtain "),Ms=m($,"SPAN",{class:!0});var Q=e(Ms);Q.forEach(s),js=i($,"."),$.forEach(s),os=E(W),K=m(W,"P",{});var j=e(K);ss=i(j,"Since "),_s=m(j,"SPAN",{class:!0});var gs=e(_s);gs.forEach(s),es=i(j," has no inverse modulo "),As=m(j,"SPAN",{class:!0});var wa=e(As);wa.forEach(s),ta=i(j," (by applying CRT), we have "),ks=m(j,"SPAN",{class:!0});var ds=e(ks);ds.forEach(s),na=i(j,"."),j.forEach(s),Fs=E(W),ls=m(W,"P",{});var ea=e(ls);Us=i(ea,"Therefore, "),Ws=m(ea,"SPAN",{class:!0});var sa=e(Ws);sa.forEach(s),pa=i(ea,"."),ea.forEach(s),this.h()},h(){r(g,"class","math math-inline"),r(o,"class","math math-inline"),r(w,"class","math math-inline"),r(x,"class","math math-inline"),r(f,"class","math math-inline"),r(N,"class","math math-inline"),r(P,"class","math math-inline"),r(ms,"class","math math-inline"),r(rs,"class","math math-inline"),r(us,"class","math math-inline"),r(Ms,"class","math math-inline"),r(_s,"class","math math-inline"),r(As,"class","math math-inline"),r(ks,"class","math math-inline"),r(Ws,"class","math math-inline")},m(W,ps){c(W,n,ps),a(n,u),a(n,g),g.innerHTML=b,a(n,d),a(n,o),o.innerHTML=I,a(n,M),c(W,y,ps),c(W,_,ps),a(_,L),a(_,w),w.innerHTML=h,a(_,T),a(_,x),x.innerHTML=A,a(_,q),a(_,f),f.innerHTML=k,a(_,F),c(W,S,ps),c(W,V,ps),a(V,Y),a(V,N),N.innerHTML=J,a(V,as),a(V,P),P.innerHTML=O,c(W,X,ps),c(W,B,ps),a(B,U),a(B,ms),ms.innerHTML=H,a(B,C),a(B,rs),rs.innerHTML=Z,a(B,ns),c(W,is,ps),c(W,ts,ps),a(ts,ws),a(ts,us),us.innerHTML=G,a(ts,R),c(W,fs,ps),c(W,ys,ps),a(ys,Cs),a(ys,Ms),Ms.innerHTML=bs,a(ys,js),c(W,os,ps),c(W,K,ps),a(K,ss),a(K,_s),_s.innerHTML=cs,a(K,es),a(K,As),As.innerHTML=Hs,a(K,ta),a(K,ks),ks.innerHTML=Ns,a(K,na),c(W,Fs,ps),c(W,ls,ps),a(ls,Us),a(ls,Ws),Ws.innerHTML=hs,a(ls,pa)},p:Ss,d(W){W&&s(n),W&&s(y),W&&s(_),W&&s(S),W&&s(V),W&&s(X),W&&s(B),W&&s(is),W&&s(ts),W&&s(fs),W&&s(ys),W&&s(os),W&&s(K),W&&s(Fs),W&&s(ls)}}}function pt(D){let n,u=`$'fn[INIT-PHI](n)$ [ - $p = 'varnothing$ - $'varphi = 'varnothing$ - $'varphi(1) = 1$ - for $i = 2$ to $n$ [ - $'varphi(i) = 0$ - ] - for $i = 2$ to $m$ [ - if $'varphi(i) = 0$ [ - $'varphi(i) = i - 1$ - $p(|p|) = i$ - ] - for $j$ in $p$ [ - if $i 'cdot j > n$ [ - break - ] - if $i 'bmod j = 0$ [ - $'varphi(i 'cdot j) = 'varphi(i) 'cdot j$ - break - ] - $'varphi(i 'cdot j) = 'varphi(i) 'cdot (j - 1)$ - ] - ] - return $'varphi, p$ -]`;return{c(){n=p("pre"),this.h()},l(g){n=m(g,"PRE",{class:!0});var b=e(n);b.forEach(s),this.h()},h(){r(n,"class","language-pesudo")},m(g,b){c(g,n,b),n.innerHTML=u},p:Ss,d(g){g&&s(n)}}}function mt(D){let n,u,g,b='φ(x)\\varphi(x)',d,o,I='xnx \\leq n',M,y,_='nn',L,w,h='O(n)O(n)',T,x,A,q;return A=new An({props:{$$slots:{default:[pt]},$$scope:{ctx:D}}}),{c(){n=p("p"),u=l("Euler’s Sieve is an algorithm to calculate "),g=p("span"),d=l(" for all "),o=p("span"),M=l(" and give the list of prime numbers less than "),y=p("span"),L=l(" in "),w=p("span"),T=l(" time. Notice that this algorithm can be use on any multiplicative function with slightly modification."),x=z(),$s(A.$$.fragment),this.h()},l(f){n=m(f,"P",{});var k=e(n);u=i(k,"Euler’s Sieve is an algorithm to calculate "),g=m(k,"SPAN",{class:!0});var F=e(g);F.forEach(s),d=i(k," for all "),o=m(k,"SPAN",{class:!0});var S=e(o);S.forEach(s),M=i(k," and give the list of prime numbers less than "),y=m(k,"SPAN",{class:!0});var V=e(y);V.forEach(s),L=i(k," in "),w=m(k,"SPAN",{class:!0});var Y=e(w);Y.forEach(s),T=i(k," time. Notice that this algorithm can be use on any multiplicative function with slightly modification."),k.forEach(s),x=E(f),Ls(A.$$.fragment,f),this.h()},h(){r(g,"class","math math-inline"),r(o,"class","math math-inline"),r(y,"class","math math-inline"),r(w,"class","math math-inline")},m(f,k){c(f,n,k),a(n,u),a(n,g),g.innerHTML=b,a(n,d),a(n,o),o.innerHTML=I,a(n,M),a(n,y),y.innerHTML=_,a(n,L),a(n,w),w.innerHTML=h,a(n,T),c(f,x,k),zs(A,f,k),q=!0},p(f,k){const F={};k&2&&(F.$$scope={dirty:k,ctx:f}),A.$set(F)},i(f){q||(Es(A.$$.fragment,f),q=!0)},o(f){Ps(A.$$.fragment,f),q=!1},d(f){f&&s(n),f&&s(x),Ts(A,f)}}}function et(D){let n,u,g,b='φ\\varphi',d,o,I='φ(x)=x1\\varphi(x) = x - 1',M,y,_='xx',L,w,h,T,x,A='xx',q,f,k='dd',F,S,V,Y=`φ(x)={φ(xd)dxmodd=0φ(xd)(d1)xmodd0\\varphi(x) = \\begin{cases} - \\varphi\\left(\\dfrac{x}{d}\\right) \\cdot d & x \\mod d = 0 \\\\ - \\varphi\\left(\\dfrac{x}{d}\\right) \\cdot (d - 1) & x \\mod d \\neq 0 -\\end{cases}`,N,J,as,P='φ(1)=1\\varphi(1)=1',O,X,B,U,ms,H='x>1x > 1',C,rs,Z,ns,is,ts='xx',ws,us,G='dd',R,fs,ys='dxdd \\leq \\dfrac{x}{d}',Cs,Ms,bs='xd\\dfrac{x}{d}',js,os,K,ss,_s,cs='dd',es,As,Hs='pp',ta,ks,Ns='xd\\dfrac{x}{d}',na,Fs,ls='φ(x)\\varphi(x)',Us,Ws,hs,pa,W,ps='xx',Bs,qs,Vs='φ(x)\\varphi(x)',Rs,Xs,Ys='xx',la,Zs,Gs='φ(x)=0\\varphi(x) = 0',Qs,Os,aa='φ(x)=x1\\varphi(x) = x - 1',Is,ma,$,Q;return{c(){n=p("p"),u=l("By the property of "),g=p("span"),d=l(", we know that "),o=p("span"),M=l(" if "),y=p("span"),L=l(" is prime."),w=z(),h=p("p"),T=l("And for composite "),x=p("span"),q=l(", suppose its minimum divisor is "),f=p("span"),F=l(", then we have"),S=z(),V=p("div"),N=z(),J=p("p"),as=p("span"),O=l(" is satisfied by the algorithm at the beginning and does not change."),X=z(),B=p("p"),U=l("Then consider an "),ms=p("span"),C=l("."),rs=z(),Z=p("p"),ns=l("If "),is=p("span"),ws=l(" is composite, then there must be a minimum prime divisor "),us=p("span"),R=l(", such that "),fs=p("span"),Cs=l(". (If this is not the case, then we can make a smaller prime divisor from "),Ms=p("span"),js=l(", which leads to a contradiction.)"),os=z(),K=p("p"),ss=l("This means "),_s=p("span"),es=l(" is in the prime list "),As=p("span"),ta=l(" when we reach "),ks=p("span"),na=l(". And by the condition of the loop, we know that "),Fs=p("span"),Us=l(" has been calculated correctly."),Ws=z(),hs=p("p"),pa=l("If "),W=p("span"),Bs=l(" is prime, then "),qs=p("span"),Rs=l(" cannot be reached by previous iterations, so when we reach "),Xs=p("span"),la=l(", "),Zs=p("span"),Qs=l(" and we set "),Os=p("span"),Is=l("."),ma=z(),$=p("p"),Q=l("Therefore, the algorithm is correct."),this.h()},l(j){n=m(j,"P",{});var gs=e(n);u=i(gs,"By the property of "),g=m(gs,"SPAN",{class:!0});var wa=e(g);wa.forEach(s),d=i(gs,", we know that "),o=m(gs,"SPAN",{class:!0});var ds=e(o);ds.forEach(s),M=i(gs," if "),y=m(gs,"SPAN",{class:!0});var ea=e(y);ea.forEach(s),L=i(gs," is prime."),gs.forEach(s),w=E(j),h=m(j,"P",{});var sa=e(h);T=i(sa,"And for composite "),x=m(sa,"SPAN",{class:!0});var ba=e(x);ba.forEach(s),q=i(sa,", suppose its minimum divisor is "),f=m(sa,"SPAN",{class:!0});var ca=e(f);ca.forEach(s),F=i(sa,", then we have"),sa.forEach(s),S=E(j),V=m(j,"DIV",{class:!0});var oa=e(V);oa.forEach(s),N=E(j),J=m(j,"P",{});var Ds=e(J);as=m(Ds,"SPAN",{class:!0});var _a=e(as);_a.forEach(s),O=i(Ds," is satisfied by the algorithm at the beginning and does not change."),Ds.forEach(s),X=E(j),B=m(j,"P",{});var ha=e(B);U=i(ha,"Then consider an "),ms=m(ha,"SPAN",{class:!0});var ga=e(ms);ga.forEach(s),C=i(ha,"."),ha.forEach(s),rs=E(j),Z=m(j,"P",{});var Js=e(Z);ns=i(Js,"If "),is=m(Js,"SPAN",{class:!0});var da=e(is);da.forEach(s),ws=i(Js," is composite, then there must be a minimum prime divisor "),us=m(Js,"SPAN",{class:!0});var Ma=e(us);Ma.forEach(s),R=i(Js,", such that "),fs=m(Js,"SPAN",{class:!0});var vs=e(fs);vs.forEach(s),Cs=i(Js,". (If this is not the case, then we can make a smaller prime divisor from "),Ms=m(Js,"SPAN",{class:!0});var ka=e(Ms);ka.forEach(s),js=i(Js,", which leads to a contradiction.)"),Js.forEach(s),os=E(j),K=m(j,"P",{});var Ks=e(K);ss=i(Ks,"This means "),_s=m(Ks,"SPAN",{class:!0});var ua=e(_s);ua.forEach(s),es=i(Ks," is in the prime list "),As=m(Ks,"SPAN",{class:!0});var fa=e(As);fa.forEach(s),ta=i(Ks," when we reach "),ks=m(Ks,"SPAN",{class:!0});var $a=e(ks);$a.forEach(s),na=i(Ks,". And by the condition of the loop, we know that "),Fs=m(Ks,"SPAN",{class:!0});var ia=e(Fs);ia.forEach(s),Us=i(Ks," has been calculated correctly."),Ks.forEach(s),Ws=E(j),hs=m(j,"P",{});var xs=e(hs);pa=i(xs,"If "),W=m(xs,"SPAN",{class:!0});var ya=e(W);ya.forEach(s),Bs=i(xs," is prime, then "),qs=m(xs,"SPAN",{class:!0});var xa=e(qs);xa.forEach(s),Rs=i(xs," cannot be reached by previous iterations, so when we reach "),Xs=m(xs,"SPAN",{class:!0});var La=e(Xs);La.forEach(s),la=i(xs,", "),Zs=m(xs,"SPAN",{class:!0});var Ea=e(Zs);Ea.forEach(s),Qs=i(xs," and we set "),Os=m(xs,"SPAN",{class:!0});var un=e(Os);un.forEach(s),Is=i(xs,"."),xs.forEach(s),ma=E(j),$=m(j,"P",{});var Sa=e($);Q=i(Sa,"Therefore, the algorithm is correct."),Sa.forEach(s),this.h()},h(){r(g,"class","math math-inline"),r(o,"class","math math-inline"),r(y,"class","math math-inline"),r(x,"class","math math-inline"),r(f,"class","math math-inline"),r(V,"class","math math-display"),r(as,"class","math math-inline"),r(ms,"class","math math-inline"),r(is,"class","math math-inline"),r(us,"class","math math-inline"),r(fs,"class","math math-inline"),r(Ms,"class","math math-inline"),r(_s,"class","math math-inline"),r(As,"class","math math-inline"),r(ks,"class","math math-inline"),r(Fs,"class","math math-inline"),r(W,"class","math math-inline"),r(qs,"class","math math-inline"),r(Xs,"class","math math-inline"),r(Zs,"class","math math-inline"),r(Os,"class","math math-inline")},m(j,gs){c(j,n,gs),a(n,u),a(n,g),g.innerHTML=b,a(n,d),a(n,o),o.innerHTML=I,a(n,M),a(n,y),y.innerHTML=_,a(n,L),c(j,w,gs),c(j,h,gs),a(h,T),a(h,x),x.innerHTML=A,a(h,q),a(h,f),f.innerHTML=k,a(h,F),c(j,S,gs),c(j,V,gs),V.innerHTML=Y,c(j,N,gs),c(j,J,gs),a(J,as),as.innerHTML=P,a(J,O),c(j,X,gs),c(j,B,gs),a(B,U),a(B,ms),ms.innerHTML=H,a(B,C),c(j,rs,gs),c(j,Z,gs),a(Z,ns),a(Z,is),is.innerHTML=ts,a(Z,ws),a(Z,us),us.innerHTML=G,a(Z,R),a(Z,fs),fs.innerHTML=ys,a(Z,Cs),a(Z,Ms),Ms.innerHTML=bs,a(Z,js),c(j,os,gs),c(j,K,gs),a(K,ss),a(K,_s),_s.innerHTML=cs,a(K,es),a(K,As),As.innerHTML=Hs,a(K,ta),a(K,ks),ks.innerHTML=Ns,a(K,na),a(K,Fs),Fs.innerHTML=ls,a(K,Us),c(j,Ws,gs),c(j,hs,gs),a(hs,pa),a(hs,W),W.innerHTML=ps,a(hs,Bs),a(hs,qs),qs.innerHTML=Vs,a(hs,Rs),a(hs,Xs),Xs.innerHTML=Ys,a(hs,la),a(hs,Zs),Zs.innerHTML=Gs,a(hs,Qs),a(hs,Os),Os.innerHTML=aa,a(hs,Is),c(j,ma,gs),c(j,$,gs),a($,Q)},p:Ss,d(j){j&&s(n),j&&s(w),j&&s(h),j&&s(S),j&&s(V),j&&s(N),j&&s(J),j&&s(X),j&&s(B),j&&s(rs),j&&s(Z),j&&s(os),j&&s(K),j&&s(Ws),j&&s(hs),j&&s(ma),j&&s($)}}}function lt(D){let n,u,g,b='φ(x)\\varphi(x)',d,o,I='xx',M,y,_,L,w,h,T,x,A='O(n)O(n)',q;return{c(){n=p("p"),u=l("By the proof of correctness, we know that "),g=p("span"),d=l(" is assigned exactly once for each "),o=p("span"),M=l(" except for the initial assignment."),y=z(),_=p("p"),L=l("And there are assignment statement in all loops, so the other parts will have at most the same order of time complexity as the assignment statement."),w=z(),h=p("p"),T=l("Therefore, the time complexity is "),x=p("span"),q=l("."),this.h()},l(f){n=m(f,"P",{});var k=e(n);u=i(k,"By the proof of correctness, we know that "),g=m(k,"SPAN",{class:!0});var F=e(g);F.forEach(s),d=i(k," is assigned exactly once for each "),o=m(k,"SPAN",{class:!0});var S=e(o);S.forEach(s),M=i(k," except for the initial assignment."),k.forEach(s),y=E(f),_=m(f,"P",{});var V=e(_);L=i(V,"And there are assignment statement in all loops, so the other parts will have at most the same order of time complexity as the assignment statement."),V.forEach(s),w=E(f),h=m(f,"P",{});var Y=e(h);T=i(Y,"Therefore, the time complexity is "),x=m(Y,"SPAN",{class:!0});var N=e(x);N.forEach(s),q=i(Y,"."),Y.forEach(s),this.h()},h(){r(g,"class","math math-inline"),r(o,"class","math math-inline"),r(x,"class","math math-inline")},m(f,k){c(f,n,k),a(n,u),a(n,g),g.innerHTML=b,a(n,d),a(n,o),o.innerHTML=I,a(n,M),c(f,y,k),c(f,_,k),a(_,L),c(f,w,k),c(f,h,k),a(h,T),a(h,x),x.innerHTML=A,a(h,q)},p:Ss,d(f){f&&s(n),f&&s(y),f&&s(_),f&&s(w),f&&s(h)}}}function it(D){let n,u,g,b,d,o,I,M,y,_,L,w,h,T,x,A,q,f,k,F,S,V,Y,N,J,as,P,O,X,B,U,ms,H,C,rs,Z,ns,is,ts,ws,us,G,R,fs,ys,Cs,Ms,bs,js,os,K,ss,_s,cs,es,As,Hs,ta,ks,Ns,na,Fs,ls,Us,Ws,hs,pa,W,ps,Bs,qs,Vs='p is prime    (p1)!1(modp)p \\text{ is prime} \\implies (p - 1)! \\equiv -1 \\pmod{p}',Rs,Xs,Ys,la='(p1)!1(modp)    p is prime(p - 1)! \\equiv -1 \\pmod{p} \\implies p \\text{ is prime}',Zs,Gs,Qs,Os,aa,Is,ma,$,Q,j,gs,wa,ds,ea,sa,ba,ca,oa,Ds,_a,ha,ga,Js,da,Ma,vs,ka,Ks,ua,fa,$a,ia,xs,ya,xa,La,Ea,un='22n+12^{2^n} + 1',Sa,Ha,kn='nn',pn,Pa,yn,Na,_n='n=5n = 5',vn,mn,qa,ja,$n='32253029026160(mod225+1)3 ^ {2 ^ {2 ^ 5}} \\equiv 3029026160 \\pmod{2 ^ {2 ^ 5} + 1}',en,Ia,wn,ln;return o=new ra({props:{variant:"definition",$$slots:{default:[Sn]},$$scope:{ctx:D}}}),h=new ra({props:{variant:"property",number:1,$$slots:{default:[Hn]},$$scope:{ctx:D}}}),x=new va({props:{$$slots:{default:[Nn]},$$scope:{ctx:D}}}),q=new ra({props:{variant:"property",number:2,$$slots:{default:[qn]},$$scope:{ctx:D}}}),k=new va({props:{$$slots:{default:[jn]},$$scope:{ctx:D}}}),S=new ra({props:{variant:"property",number:3,$$slots:{default:[In]},$$scope:{ctx:D}}}),Y=new va({props:{$$slots:{default:[Wn]},$$scope:{ctx:D}}}),J=new ra({props:{variant:"property",number:4,$$slots:{default:[Bn]},$$scope:{ctx:D}}}),P=new va({props:{$$slots:{default:[Vn]},$$scope:{ctx:D}}}),X=new ra({props:{variant:"property",number:5,$$slots:{default:[Dn]},$$scope:{ctx:D}}}),U=new va({props:{$$slots:{default:[Fn]},$$scope:{ctx:D}}}),H=new ra({props:{variant:"property",number:6,$$slots:{default:[On]},$$scope:{ctx:D}}}),rs=new va({props:{$$slots:{default:[Cn]},$$scope:{ctx:D}}}),ns=new ra({props:{variant:"property",number:7,$$slots:{default:[Rn]},$$scope:{ctx:D}}}),ts=new va({props:{$$slots:{default:[Yn]},$$scope:{ctx:D}}}),Cs=new ra({props:{variant:"theorem",name:"Euler's theorem",$$slots:{default:[Gn]},$$scope:{ctx:D}}}),bs=new va({props:{$$slots:{default:[Qn]},$$scope:{ctx:D}}}),es=new ra({props:{variant:"theorem",name:"Fermat's Little Theorem",$$slots:{default:[Jn]},$$scope:{ctx:D}}}),Hs=new va({props:{$$slots:{default:[Kn]},$$scope:{ctx:D}}}),Us=new ra({props:{variant:"theorem",name:"Wilson's Theorem",$$slots:{default:[Un]},$$scope:{ctx:D}}}),Gs=new ra({props:{variant:"goal",number:1,$$slots:{default:[Xn]},$$scope:{ctx:D}}}),Os=new ra({props:{variant:"lemma",$$slots:{default:[Zn]},$$scope:{ctx:D}}}),Is=new va({props:{$$slots:{default:[st]},$$scope:{ctx:D}}}),gs=new va({props:{$$slots:{default:[at]},$$scope:{ctx:D}}}),ds=new ra({props:{variant:"goal",number:2,$$slots:{default:[nt]},$$scope:{ctx:D}}}),sa=new va({props:{$$slots:{default:[tt]},$$scope:{ctx:D}}}),ga=new ra({props:{variant:"algorithm",name:"Euler's Sieve",$$slots:{default:[mt]},$$scope:{ctx:D}}}),da=new va({props:{variant:"correctness",$$slots:{default:[et]},$$scope:{ctx:D}}}),vs=new va({props:{variant:"time",$$slots:{default:[lt]},$$scope:{ctx:D}}}),{c(){n=p("h1"),u=p("a"),g=p("span"),b=l("Euler’s Totient Function"),d=z(),$s(o.$$.fragment),I=z(),M=p("h2"),y=p("a"),_=p("span"),L=l("Properties"),w=z(),$s(h.$$.fragment),T=z(),$s(x.$$.fragment),A=z(),$s(q.$$.fragment),f=z(),$s(k.$$.fragment),F=z(),$s(S.$$.fragment),V=z(),$s(Y.$$.fragment),N=z(),$s(J.$$.fragment),as=z(),$s(P.$$.fragment),O=z(),$s(X.$$.fragment),B=z(),$s(U.$$.fragment),ms=z(),$s(H.$$.fragment),C=z(),$s(rs.$$.fragment),Z=z(),$s(ns.$$.fragment),is=z(),$s(ts.$$.fragment),ws=z(),us=p("h2"),G=p("a"),R=p("span"),fs=l("Euler’s Theorem"),ys=z(),$s(Cs.$$.fragment),Ms=z(),$s(bs.$$.fragment),js=z(),os=p("h2"),K=p("a"),ss=p("span"),_s=l("Fermat’s Little Theorem"),cs=z(),$s(es.$$.fragment),As=z(),$s(Hs.$$.fragment),ta=z(),ks=p("h2"),Ns=p("a"),na=p("span"),Fs=l("Wilson’s Theorem"),ls=z(),$s(Us.$$.fragment),Ws=z(),hs=p("p"),pa=l("We need to prove two goals:"),W=z(),ps=p("ol"),Bs=p("li"),qs=p("span"),Rs=z(),Xs=p("li"),Ys=p("span"),Zs=z(),$s(Gs.$$.fragment),Qs=z(),$s(Os.$$.fragment),aa=z(),$s(Is.$$.fragment),ma=z(),$=p("p"),Q=l("Then we go back to the proof of Wilson’s Theorem."),j=z(),$s(gs.$$.fragment),wa=z(),$s(ds.$$.fragment),ea=z(),$s(sa.$$.fragment),ba=z(),ca=p("h2"),oa=p("a"),Ds=p("span"),_a=l("Euler’s Sieve"),ha=z(),$s(ga.$$.fragment),Js=z(),$s(da.$$.fragment),Ma=z(),$s(vs.$$.fragment),ka=z(),Ks=p("h2"),ua=p("a"),fa=p("span"),$a=l("Miscellaneous"),ia=z(),xs=p("h3"),ya=p("a"),xa=p("span"),La=l("Disproof of "),Ea=p("span"),Sa=l(" is prime for all "),Ha=p("span"),pn=z(),Pa=p("p"),yn=l("Take an anti-example "),Na=p("span"),vn=l("."),mn=z(),qa=p("p"),ja=p("span"),en=z(),Ia=p("p"),wn=l("This disagrees with Fermat’s Little Theorem, so the proposition is false."),this.h()},l(t){n=m(t,"H1",{id:!0});var v=e(n);u=m(v,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Ca=e(u);g=m(Ca,"SPAN",{class:!0}),e(g).forEach(s),Ca.forEach(s),b=i(v,"Euler’s Totient Function"),v.forEach(s),d=E(t),Ls(o.$$.fragment,t),I=E(t),M=m(t,"H2",{id:!0});var Wa=e(M);y=m(Wa,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Ra=e(y);_=m(Ra,"SPAN",{class:!0}),e(_).forEach(s),Ra.forEach(s),L=i(Wa,"Properties"),Wa.forEach(s),w=E(t),Ls(h.$$.fragment,t),T=E(t),Ls(x.$$.fragment,t),A=E(t),Ls(q.$$.fragment,t),f=E(t),Ls(k.$$.fragment,t),F=E(t),Ls(S.$$.fragment,t),V=E(t),Ls(Y.$$.fragment,t),N=E(t),Ls(J.$$.fragment,t),as=E(t),Ls(P.$$.fragment,t),O=E(t),Ls(X.$$.fragment,t),B=E(t),Ls(U.$$.fragment,t),ms=E(t),Ls(H.$$.fragment,t),C=E(t),Ls(rs.$$.fragment,t),Z=E(t),Ls(ns.$$.fragment,t),is=E(t),Ls(ts.$$.fragment,t),ws=E(t),us=m(t,"H2",{id:!0});var Ba=e(us);G=m(Ba,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Ya=e(G);R=m(Ya,"SPAN",{class:!0}),e(R).forEach(s),Ya.forEach(s),fs=i(Ba,"Euler’s Theorem"),Ba.forEach(s),ys=E(t),Ls(Cs.$$.fragment,t),Ms=E(t),Ls(bs.$$.fragment,t),js=E(t),os=m(t,"H2",{id:!0});var Va=e(os);K=m(Va,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Ga=e(K);ss=m(Ga,"SPAN",{class:!0}),e(ss).forEach(s),Ga.forEach(s),_s=i(Va,"Fermat’s Little Theorem"),Va.forEach(s),cs=E(t),Ls(es.$$.fragment,t),As=E(t),Ls(Hs.$$.fragment,t),ta=E(t),ks=m(t,"H2",{id:!0});var Da=e(ks);Ns=m(Da,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Qa=e(Ns);na=m(Qa,"SPAN",{class:!0}),e(na).forEach(s),Qa.forEach(s),Fs=i(Da,"Wilson’s Theorem"),Da.forEach(s),ls=E(t),Ls(Us.$$.fragment,t),Ws=E(t),hs=m(t,"P",{});var Ja=e(hs);pa=i(Ja,"We need to prove two goals:"),Ja.forEach(s),W=E(t),ps=m(t,"OL",{});var Ta=e(ps);Bs=m(Ta,"LI",{});var Ka=e(Bs);qs=m(Ka,"SPAN",{class:!0});var rn=e(qs);rn.forEach(s),Ka.forEach(s),Rs=E(Ta),Xs=m(Ta,"LI",{});var Ua=e(Xs);Ys=m(Ua,"SPAN",{class:!0});var cn=e(Ys);cn.forEach(s),Ua.forEach(s),Ta.forEach(s),Zs=E(t),Ls(Gs.$$.fragment,t),Qs=E(t),Ls(Os.$$.fragment,t),aa=E(t),Ls(Is.$$.fragment,t),ma=E(t),$=m(t,"P",{});var Xa=e($);Q=i(Xa,"Then we go back to the proof of Wilson’s Theorem."),Xa.forEach(s),j=E(t),Ls(gs.$$.fragment,t),wa=E(t),Ls(ds.$$.fragment,t),ea=E(t),Ls(sa.$$.fragment,t),ba=E(t),ca=m(t,"H2",{id:!0});var Fa=e(ca);oa=m(Fa,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Za=e(oa);Ds=m(Za,"SPAN",{class:!0}),e(Ds).forEach(s),Za.forEach(s),_a=i(Fa,"Euler’s Sieve"),Fa.forEach(s),ha=E(t),Ls(ga.$$.fragment,t),Js=E(t),Ls(da.$$.fragment,t),Ma=E(t),Ls(vs.$$.fragment,t),ka=E(t),Ks=m(t,"H2",{id:!0});var Oa=e(Ks);ua=m(Oa,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var sn=e(ua);fa=m(sn,"SPAN",{class:!0}),e(fa).forEach(s),sn.forEach(s),$a=i(Oa,"Miscellaneous"),Oa.forEach(s),ia=E(t),xs=m(t,"H3",{id:!0});var za=e(xs);ya=m(za,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var an=e(ya);xa=m(an,"SPAN",{class:!0}),e(xa).forEach(s),an.forEach(s),La=i(za,"Disproof of "),Ea=m(za,"SPAN",{class:!0});var on=e(Ea);on.forEach(s),Sa=i(za," is prime for all "),Ha=m(za,"SPAN",{class:!0});var hn=e(Ha);hn.forEach(s),za.forEach(s),pn=E(t),Pa=m(t,"P",{});var Aa=e(Pa);yn=i(Aa,"Take an anti-example "),Na=m(Aa,"SPAN",{class:!0});var gn=e(Na);gn.forEach(s),vn=i(Aa,"."),Aa.forEach(s),mn=E(t),qa=m(t,"P",{});var nn=e(qa);ja=m(nn,"SPAN",{class:!0});var dn=e(ja);dn.forEach(s),nn.forEach(s),en=E(t),Ia=m(t,"P",{});var tn=e(Ia);wn=i(tn,"This disagrees with Fermat’s Little Theorem, so the proposition is false."),tn.forEach(s),this.h()},h(){r(g,"class","icon icon-link"),r(u,"aria-hidden","true"),r(u,"tabindex","-1"),r(u,"href","#eulers-totient-function"),r(n,"id","eulers-totient-function"),r(_,"class","icon icon-link"),r(y,"aria-hidden","true"),r(y,"tabindex","-1"),r(y,"href","#properties"),r(M,"id","properties"),r(R,"class","icon icon-link"),r(G,"aria-hidden","true"),r(G,"tabindex","-1"),r(G,"href","#eulers-theorem"),r(us,"id","eulers-theorem"),r(ss,"class","icon icon-link"),r(K,"aria-hidden","true"),r(K,"tabindex","-1"),r(K,"href","#fermats-little-theorem"),r(os,"id","fermats-little-theorem"),r(na,"class","icon icon-link"),r(Ns,"aria-hidden","true"),r(Ns,"tabindex","-1"),r(Ns,"href","#wilsons-theorem"),r(ks,"id","wilsons-theorem"),r(qs,"class","math math-inline"),r(Ys,"class","math math-inline"),r(Ds,"class","icon icon-link"),r(oa,"aria-hidden","true"),r(oa,"tabindex","-1"),r(oa,"href","#eulers-sieve"),r(ca,"id","eulers-sieve"),r(fa,"class","icon icon-link"),r(ua,"aria-hidden","true"),r(ua,"tabindex","-1"),r(ua,"href","#miscellaneous"),r(Ks,"id","miscellaneous"),r(xa,"class","icon icon-link"),r(ya,"aria-hidden","true"),r(ya,"tabindex","-1"),r(ya,"href","#disproof-of-html-span-classkatexspan-classkatex-mathmlmath-xmlnshttpwwww3org1998mathmathmlsemanticsmrowmsupmn2mnmsupmn2mnminmimsupmsupmomomn1mnmrowannotation-encodingapplicationx-tex22n--1annotationsemanticsmathspanspan-classkatex-html-aria-hiddentruespan-classbasespan-classstrut-styleheight09633emvertical-align-00833emspanspan-classmordspan-classmord2spanspan-classmsupsubspan-classvlist-tspan-classvlist-rspan-classvlist-styleheight088emspan-styletop-3063emmargin-right005emspan-classpstrut-styleheight27emspanspan-classsizing-reset-size6-size3-mtightspan-classmord-mtightspan-classmord-mtightspan-classmord-mtight2spanspan-classmsupsubspan-classvlist-tspan-classvlist-rspan-classvlist-styleheight07385emspan-styletop-2931emmargin-right00714emspan-classpstrut-styleheight25emspanspan-classsizing-reset-size3-size1-mtightspan-classmord-mathnormal-mtightnspanspanspanspanspanspanspanspanspanspanspanspanspanspanspanspanspan-classmspace-stylemargin-right02222emspanspan-classmbinspanspan-classmspace-stylemargin-right02222emspanspanspan-classbasespan-classstrut-styleheight06444emspanspan-classmord1spanspanspanspan-is-prime-for-all-html-span-classkatexspan-classkatex-mathmlmath-xmlnshttpwwww3org1998mathmathmlsemanticsmrowminmimrowannotation-encodingapplicationx-texnannotationsemanticsmathspanspan-classkatex-html-aria-hiddentruespan-classbasespan-classstrut-styleheight04306emspanspan-classmord-mathnormalnspanspanspanspan"),r(Ea,"class","math math-inline"),r(Ha,"class","math math-inline"),r(xs,"id","disproof-of-html-span-classkatexspan-classkatex-mathmlmath-xmlnshttpwwww3org1998mathmathmlsemanticsmrowmsupmn2mnmsupmn2mnminmimsupmsupmomomn1mnmrowannotation-encodingapplicationx-tex22n--1annotationsemanticsmathspanspan-classkatex-html-aria-hiddentruespan-classbasespan-classstrut-styleheight09633emvertical-align-00833emspanspan-classmordspan-classmord2spanspan-classmsupsubspan-classvlist-tspan-classvlist-rspan-classvlist-styleheight088emspan-styletop-3063emmargin-right005emspan-classpstrut-styleheight27emspanspan-classsizing-reset-size6-size3-mtightspan-classmord-mtightspan-classmord-mtightspan-classmord-mtight2spanspan-classmsupsubspan-classvlist-tspan-classvlist-rspan-classvlist-styleheight07385emspan-styletop-2931emmargin-right00714emspan-classpstrut-styleheight25emspanspan-classsizing-reset-size3-size1-mtightspan-classmord-mathnormal-mtightnspanspanspanspanspanspanspanspanspanspanspanspanspanspanspanspanspan-classmspace-stylemargin-right02222emspanspan-classmbinspanspan-classmspace-stylemargin-right02222emspanspanspan-classbasespan-classstrut-styleheight06444emspanspan-classmord1spanspanspanspan-is-prime-for-all-html-span-classkatexspan-classkatex-mathmlmath-xmlnshttpwwww3org1998mathmathmlsemanticsmrowminmimrowannotation-encodingapplicationx-texnannotationsemanticsmathspanspan-classkatex-html-aria-hiddentruespan-classbasespan-classstrut-styleheight04306emspanspan-classmord-mathnormalnspanspanspanspan"),r(Na,"class","math math-inline"),r(ja,"class","math math-inline")},m(t,v){c(t,n,v),a(n,u),a(u,g),a(n,b),c(t,d,v),zs(o,t,v),c(t,I,v),c(t,M,v),a(M,y),a(y,_),a(M,L),c(t,w,v),zs(h,t,v),c(t,T,v),zs(x,t,v),c(t,A,v),zs(q,t,v),c(t,f,v),zs(k,t,v),c(t,F,v),zs(S,t,v),c(t,V,v),zs(Y,t,v),c(t,N,v),zs(J,t,v),c(t,as,v),zs(P,t,v),c(t,O,v),zs(X,t,v),c(t,B,v),zs(U,t,v),c(t,ms,v),zs(H,t,v),c(t,C,v),zs(rs,t,v),c(t,Z,v),zs(ns,t,v),c(t,is,v),zs(ts,t,v),c(t,ws,v),c(t,us,v),a(us,G),a(G,R),a(us,fs),c(t,ys,v),zs(Cs,t,v),c(t,Ms,v),zs(bs,t,v),c(t,js,v),c(t,os,v),a(os,K),a(K,ss),a(os,_s),c(t,cs,v),zs(es,t,v),c(t,As,v),zs(Hs,t,v),c(t,ta,v),c(t,ks,v),a(ks,Ns),a(Ns,na),a(ks,Fs),c(t,ls,v),zs(Us,t,v),c(t,Ws,v),c(t,hs,v),a(hs,pa),c(t,W,v),c(t,ps,v),a(ps,Bs),a(Bs,qs),qs.innerHTML=Vs,a(ps,Rs),a(ps,Xs),a(Xs,Ys),Ys.innerHTML=la,c(t,Zs,v),zs(Gs,t,v),c(t,Qs,v),zs(Os,t,v),c(t,aa,v),zs(Is,t,v),c(t,ma,v),c(t,$,v),a($,Q),c(t,j,v),zs(gs,t,v),c(t,wa,v),zs(ds,t,v),c(t,ea,v),zs(sa,t,v),c(t,ba,v),c(t,ca,v),a(ca,oa),a(oa,Ds),a(ca,_a),c(t,ha,v),zs(ga,t,v),c(t,Js,v),zs(da,t,v),c(t,Ma,v),zs(vs,t,v),c(t,ka,v),c(t,Ks,v),a(Ks,ua),a(ua,fa),a(Ks,$a),c(t,ia,v),c(t,xs,v),a(xs,ya),a(ya,xa),a(xs,La),a(xs,Ea),Ea.innerHTML=un,a(xs,Sa),a(xs,Ha),Ha.innerHTML=kn,c(t,pn,v),c(t,Pa,v),a(Pa,yn),a(Pa,Na),Na.innerHTML=_n,a(Pa,vn),c(t,mn,v),c(t,qa,v),a(qa,ja),ja.innerHTML=$n,c(t,en,v),c(t,Ia,v),a(Ia,wn),ln=!0},p(t,v){const Ca={};v&2&&(Ca.$$scope={dirty:v,ctx:t}),o.$set(Ca);const Wa={};v&2&&(Wa.$$scope={dirty:v,ctx:t}),h.$set(Wa);const Ra={};v&2&&(Ra.$$scope={dirty:v,ctx:t}),x.$set(Ra);const Ba={};v&2&&(Ba.$$scope={dirty:v,ctx:t}),q.$set(Ba);const Ya={};v&2&&(Ya.$$scope={dirty:v,ctx:t}),k.$set(Ya);const Va={};v&2&&(Va.$$scope={dirty:v,ctx:t}),S.$set(Va);const Ga={};v&2&&(Ga.$$scope={dirty:v,ctx:t}),Y.$set(Ga);const Da={};v&2&&(Da.$$scope={dirty:v,ctx:t}),J.$set(Da);const Qa={};v&2&&(Qa.$$scope={dirty:v,ctx:t}),P.$set(Qa);const Ja={};v&2&&(Ja.$$scope={dirty:v,ctx:t}),X.$set(Ja);const Ta={};v&2&&(Ta.$$scope={dirty:v,ctx:t}),U.$set(Ta);const Ka={};v&2&&(Ka.$$scope={dirty:v,ctx:t}),H.$set(Ka);const rn={};v&2&&(rn.$$scope={dirty:v,ctx:t}),rs.$set(rn);const Ua={};v&2&&(Ua.$$scope={dirty:v,ctx:t}),ns.$set(Ua);const cn={};v&2&&(cn.$$scope={dirty:v,ctx:t}),ts.$set(cn);const Xa={};v&2&&(Xa.$$scope={dirty:v,ctx:t}),Cs.$set(Xa);const Fa={};v&2&&(Fa.$$scope={dirty:v,ctx:t}),bs.$set(Fa);const Za={};v&2&&(Za.$$scope={dirty:v,ctx:t}),es.$set(Za);const Oa={};v&2&&(Oa.$$scope={dirty:v,ctx:t}),Hs.$set(Oa);const sn={};v&2&&(sn.$$scope={dirty:v,ctx:t}),Us.$set(sn);const za={};v&2&&(za.$$scope={dirty:v,ctx:t}),Gs.$set(za);const an={};v&2&&(an.$$scope={dirty:v,ctx:t}),Os.$set(an);const on={};v&2&&(on.$$scope={dirty:v,ctx:t}),Is.$set(on);const hn={};v&2&&(hn.$$scope={dirty:v,ctx:t}),gs.$set(hn);const Aa={};v&2&&(Aa.$$scope={dirty:v,ctx:t}),ds.$set(Aa);const gn={};v&2&&(gn.$$scope={dirty:v,ctx:t}),sa.$set(gn);const nn={};v&2&&(nn.$$scope={dirty:v,ctx:t}),ga.$set(nn);const dn={};v&2&&(dn.$$scope={dirty:v,ctx:t}),da.$set(dn);const tn={};v&2&&(tn.$$scope={dirty:v,ctx:t}),vs.$set(tn)},i(t){ln||(Es(o.$$.fragment,t),Es(h.$$.fragment,t),Es(x.$$.fragment,t),Es(q.$$.fragment,t),Es(k.$$.fragment,t),Es(S.$$.fragment,t),Es(Y.$$.fragment,t),Es(J.$$.fragment,t),Es(P.$$.fragment,t),Es(X.$$.fragment,t),Es(U.$$.fragment,t),Es(H.$$.fragment,t),Es(rs.$$.fragment,t),Es(ns.$$.fragment,t),Es(ts.$$.fragment,t),Es(Cs.$$.fragment,t),Es(bs.$$.fragment,t),Es(es.$$.fragment,t),Es(Hs.$$.fragment,t),Es(Us.$$.fragment,t),Es(Gs.$$.fragment,t),Es(Os.$$.fragment,t),Es(Is.$$.fragment,t),Es(gs.$$.fragment,t),Es(ds.$$.fragment,t),Es(sa.$$.fragment,t),Es(ga.$$.fragment,t),Es(da.$$.fragment,t),Es(vs.$$.fragment,t),ln=!0)},o(t){Ps(o.$$.fragment,t),Ps(h.$$.fragment,t),Ps(x.$$.fragment,t),Ps(q.$$.fragment,t),Ps(k.$$.fragment,t),Ps(S.$$.fragment,t),Ps(Y.$$.fragment,t),Ps(J.$$.fragment,t),Ps(P.$$.fragment,t),Ps(X.$$.fragment,t),Ps(U.$$.fragment,t),Ps(H.$$.fragment,t),Ps(rs.$$.fragment,t),Ps(ns.$$.fragment,t),Ps(ts.$$.fragment,t),Ps(Cs.$$.fragment,t),Ps(bs.$$.fragment,t),Ps(es.$$.fragment,t),Ps(Hs.$$.fragment,t),Ps(Us.$$.fragment,t),Ps(Gs.$$.fragment,t),Ps(Os.$$.fragment,t),Ps(Is.$$.fragment,t),Ps(gs.$$.fragment,t),Ps(ds.$$.fragment,t),Ps(sa.$$.fragment,t),Ps(ga.$$.fragment,t),Ps(da.$$.fragment,t),Ps(vs.$$.fragment,t),ln=!1},d(t){t&&s(n),t&&s(d),Ts(o,t),t&&s(I),t&&s(M),t&&s(w),Ts(h,t),t&&s(T),Ts(x,t),t&&s(A),Ts(q,t),t&&s(f),Ts(k,t),t&&s(F),Ts(S,t),t&&s(V),Ts(Y,t),t&&s(N),Ts(J,t),t&&s(as),Ts(P,t),t&&s(O),Ts(X,t),t&&s(B),Ts(U,t),t&&s(ms),Ts(H,t),t&&s(C),Ts(rs,t),t&&s(Z),Ts(ns,t),t&&s(is),Ts(ts,t),t&&s(ws),t&&s(us),t&&s(ys),Ts(Cs,t),t&&s(Ms),Ts(bs,t),t&&s(js),t&&s(os),t&&s(cs),Ts(es,t),t&&s(As),Ts(Hs,t),t&&s(ta),t&&s(ks),t&&s(ls),Ts(Us,t),t&&s(Ws),t&&s(hs),t&&s(W),t&&s(ps),t&&s(Zs),Ts(Gs,t),t&&s(Qs),Ts(Os,t),t&&s(aa),Ts(Is,t),t&&s(ma),t&&s($),t&&s(j),Ts(gs,t),t&&s(wa),Ts(ds,t),t&&s(ea),Ts(sa,t),t&&s(ba),t&&s(ca),t&&s(ha),Ts(ga,t),t&&s(Js),Ts(da,t),t&&s(Ma),Ts(vs,t),t&&s(ka),t&&s(Ks),t&&s(ia),t&&s(xs),t&&s(pn),t&&s(Pa),t&&s(mn),t&&s(qa),t&&s(en),t&&s(Ia)}}}function rt(D){let n,u;const g=[D[0],Mn];let b={$$slots:{default:[it]},$$scope:{ctx:D}};for(let d=0;d{u(0,n=xn(xn({},n),bn(g)))},n=bn(n),[n]}class yt extends Ln{constructor(n){super(),zn(this,n,ct,rt,En,{})}}export{yt as component}; diff --git a/docs/_app/immutable/nodes/8.b1ab7963.js b/docs/_app/immutable/nodes/8.b1ab7963.js deleted file mode 100644 index 80b454e..0000000 --- a/docs/_app/immutable/nodes/8.b1ab7963.js +++ /dev/null @@ -1,19 +0,0 @@ -var ie=Object.defineProperty;var oe=(l,t,e)=>t in l?ie(l,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[t]=e;var x=(l,t,e)=>(oe(l,typeof t!="symbol"?t+"":t,e),e);import{S as J,i as K,s as Z,k as b,a as L,q as R,l as A,m as z,h as w,c as S,r as $,n as m,T as P,b as O,E as _,U,F as q,u as C,G,H as le,o as ce,O as D,y as ee,z as te,A as se,P as ue,Q as X,g as ne,d as re,B as ae,R as B}from"../chunks/index.488f1ee5.js";import{L as he}from"../chunks/layout.c8702512.js";class E extends Array{constructor(e,r){super();x(this,0);x(this,1);this[0]=e,this[1]=r,Object.freeze(this)}static from(e){return e instanceof E?e:new E(e[0],e[1])}equals(e){return this[0]===e[0]&&this[1]===e[1]}toString(){return`(${this[0]}, ${this[1]})`}get x(){return this[0]}get y(){return this[1]}get euclidean(){return Math.sqrt(this[0]*this[0]+this[1]*this[1])}get manhattan(){return Math.abs(this[0])+Math.abs(this[1])}add(e){return new E(this[0]+e[0],this[1]+e[1])}sub(e){return new E(this[0]-e[0],this[1]-e[1])}mul(e){return new E(this[0]*e,this[1]*e)}div(e){return new E(this[0]/e,this[1]/e)}dot(e){return this[0]*e[0]+this[1]*e[1]}cross(e){return this[0]*e[1]-this[1]*e[0]}}function fe(l){const t=Math.max(...l.map(a=>a[0])),e=Math.min(...l.map(a=>a[0])),r=Math.max(...l.map(a=>a[1])),s=Math.min(...l.map(a=>a[1])),n=(t+e)/2,i=(r+s)/2,o=Math.max(t-e,r-s);return l.map(a=>E.from(a).sub(E.from([n,i])).div(o).add(E.from([.5,.5])))}async function H(l,t,e,r,s,n=async()=>{}){let i=t,o=new Array(i.length).fill(0);for(let a=0;ar*f-e*g[y]),i=i.map((f,y)=>f+o[y]),a&1023||await n(i)}return i}async function de(l,t,e,r,s,n=async()=>{}){let g=new Array(l).fill(0),f=1/0;for(let y=0;yMath.random());let u=await H(e,p,.1,.9,s,n);u=await H(e,u,.01,.9,s,n);const v=t(u);vnew Array(t).fill(!1));for(const[r,s]of e)this.adjacency[r][s]=this.adjacency[s][r]=!0}loss(t){const e=[];for(let s=0;se||i==-1&&-ne)throw this.errorMessage=`Line ${r}, column ${s}: Integer violates range [${t}, ${e}]`,new N;return n}static parseInput(t,e){const r=new k(t);try{let s=e(r);if(r.skipWhitespace(),r.offset{console.log("drawSegment",d,h),u.beginPath(),u.moveTo(d[0],d[1]),u.lineTo(h[0],h[1]),u.stroke()},M=d=>{console.log("drawVertex",d),u.beginPath(),u.arc(d[0],d[1],10,0,2*Math.PI),u.fill()};let I=0;const T=async d=>{u.clearRect(0,0,1200,1200);let h=[];console.log("locations",d);for(let c=0;cc.mul(1e3).add([100,100])),console.log("points",h);for(let[c,j]of r.edges)v(h[c],h[j]);for(let c of h)M(c);I++,I%64===0&&e(1,n+="."),await new Promise(c=>setTimeout(c,4))};de(r.size*2,d=>r.loss(d),d=>r.gradientLoss(d),15,16e3,T).then(d=>{T(d),e(1,n="Done, loss = "+r.loss(d).toFixed(2)),e(2,i="done")})}function f(){e(4,a="Submitted");let p=k.parseInput(o,u=>{const v=u.readInt(1,50),M=u.readInt(0,v*(v-1)/2),I=[];for(let T=0;T{e(0,t=D(D({},t),B(r)))},t=B(t),[t]}class xe extends J{constructor(t){super(),K(this,t,we,ve,Z,{})}}export{xe as component}; diff --git a/docs/_app/immutable/nodes/9.6eb73fd6.js b/docs/_app/immutable/nodes/9.6eb73fd6.js deleted file mode 100644 index e8537a1..0000000 --- a/docs/_app/immutable/nodes/9.6eb73fd6.js +++ /dev/null @@ -1,101 +0,0 @@ -import{S as $a,i as Ma,s as La,O as na,y as ps,z as ts,A as ms,P as Ea,Q as pa,g as ls,d as es,B as is,R as ta,k as l,q as d,a as z,l as e,m as i,h as a,r as u,c as k,n as o,b as m,E as t,G as vs}from"../chunks/index.488f1ee5.js";import{L as Pa}from"../chunks/layout.c8702512.js";import{P as Fs}from"../chunks/Proof.26996d3c.js";import{S as Ds}from"../chunks/State.8d241e02.js";function Ta(L){let n,h;return{c(){n=l("p"),h=d("We can reorder the items in a summation if the region of summation is finate, or countable but the sum is absolutely convergent.")},l(p){n=e(p,"P",{});var g=i(n);h=u(g,"We can reorder the items in a summation if the region of summation is finate, or countable but the sum is absolutely convergent."),g.forEach(a)},m(p,g){m(p,n,g),t(n,h)},p:vs,d(p){p&&a(n)}}}function Ha(L){let n,h='dnf(d)=dnf(nd)\\sum_{d | n} f(d) = \\sum_{d | n} f\\left(\\frac{n}{d}\\right)';return{c(){n=l("div"),this.h()},l(p){n=e(p,"DIV",{class:!0});var g=i(n);g.forEach(a),this.h()},h(){o(n,"class","math math-display")},m(p,g){m(p,n,g),n.innerHTML=h},p:vs,d(p){p&&a(n)}}}function Sa(L){let n,h;return{c(){n=l("p"),h=d("Reverse the order of summation.")},l(p){n=e(p,"P",{});var g=i(n);h=u(g,"Reverse the order of summation."),g.forEach(a)},m(p,g){m(p,n,g),t(n,h)},p:vs,d(p){p&&a(n)}}}function Aa(L){let n,h='dnedf(d,e)=enk(n/e)f(ke,e)\\sum_{d | n} \\sum_{e | d} f(d, e) = \\sum_{e | n} \\sum_{k | (n / e)} f(ke, e)';return{c(){n=l("div"),this.h()},l(p){n=e(p,"DIV",{class:!0});var g=i(n);g.forEach(a),this.h()},h(){o(n,"class","math math-display")},m(p,g){m(p,n,g),n.innerHTML=h},p:vs,d(p){p&&a(n)}}}function Na(L){let n,h,p,g,b=`dned    n=k1dd=k2e, where k1,k2 are integers    n=k1k2ed=k2e    enk1k2=(n/e)d=k2e    enk2(n/e)d=k2ed | n \\wedge e | d \\\\ -\\iff n=k_1d \\wedge d=k_2e, \\text{ where }k_1, k_2 \\text{ are integers} \\\\ -\\iff n=k_1k_2e \\wedge d = k_2e \\\\ -\\iff e | n \\wedge k_1k_2= (n / e) \\wedge d = k_2e \\\\ -\\iff e | n \\wedge k_2 | (n / e) \\wedge d = k_2e`;return{c(){n=l("p"),h=d("We just proof the two regions are the same, since the order of summation makes no difference."),p=z(),g=l("div"),this.h()},l(r){n=e(r,"P",{});var w=i(n);h=u(w,"We just proof the two regions are the same, since the order of summation makes no difference."),w.forEach(a),p=k(r),g=e(r,"DIV",{class:!0});var E=i(g);E.forEach(a),this.h()},h(){o(g,"class","math math-display")},m(r,w){m(r,n,w),t(n,h),m(r,p,w),m(r,g,w),g.innerHTML=b},p:vs,d(r){r&&a(n),r&&a(p),r&&a(g)}}}function Ia(L){let n,h,p,g='f(n)f(n)',b,r,w='g(n)=dnf(d)g(n) = \\sum_{d | n} f(d)',E;return{c(){n=l("p"),h=d("If "),p=l("span"),b=d(" is a multiplicative function, then so is "),r=l("span"),E=d("."),this.h()},l(y){n=e(y,"P",{});var _=i(n);h=u(_,"If "),p=e(_,"SPAN",{class:!0});var P=i(p);P.forEach(a),b=u(_," is a multiplicative function, then so is "),r=e(_,"SPAN",{class:!0});var $=i(r);$.forEach(a),E=u(_,"."),_.forEach(a),this.h()},h(){o(p,"class","math math-inline"),o(r,"class","math math-inline")},m(y,_){m(y,n,_),t(n,h),t(n,p),p.innerHTML=g,t(n,b),t(n,r),r.innerHTML=w,t(n,E)},p:vs,d(y){y&&a(n)}}}function Va(L){let n,h,p,g='gcd(n1,n2)=1\\gcd(n_1, n_2) = 1',b,r,w=`g(n1n2)=dn1n2f(d)g(n_1n_2) -= \\sum_{d | n_1n_2} f(d)`,E,y,_,P,$='gcd(n1,n2)=1\\gcd(n_1, n_2) = 1',V,j,fs='n1n2n_1n_2',A,Z,F='n1n_1',Ps,R,q='n2n_2',cs,Y,ds='pp',C,B,ks='n1n2n_1n_2',rs,Q,ns='n1n_1',xs,W,O='n2n_2',J,us,N,bs='=d1n1d2n2f(d1d2)= \\sum_{d_1 | n_1} \\sum_{d_2 | n_2} f(d_1d_2)\\\\',ss,I,hs,U,os='f(n)f(n)',gs,K,ys='f(d1d2)=f(d1)f(d2)f(d_1d_2) = f(d_1)f(d_2)',D,f,M,Ns=`=d1n1d2n2f(d1)f(d2)=(d1n1f(d1))(d2n2f(d2))=g(n1)g(n2)= \\sum_{d_1 | n_1} \\sum_{d_2 | n_2} f(d_1)f(d_2)\\\\ -= \\left(\\sum_{d_1 | n_1} f(d_1)\\right) \\left(\\sum_{d_2 | n_2} f(d_2)\\right)\\\\ -= g(n_1)g(n_2)`;return{c(){n=l("p"),h=d("Suppose "),p=l("span"),b=z(),r=l("div"),E=z(),y=l("p"),_=d("Since "),P=l("span"),V=d(", every divisor of "),j=l("span"),A=d(" is a unique product of a divisor of "),Z=l("span"),Ps=d(" and a divisor of "),R=l("span"),cs=d(", because for any prime "),Y=l("span"),C=d(" that divides "),B=l("span"),rs=d(", it can only divide one of "),Q=l("span"),xs=d(" or "),W=l("span"),J=d("."),us=z(),N=l("div"),ss=z(),I=l("p"),hs=d("Since "),U=l("span"),gs=d(" is multiplicative, "),K=l("span"),D=d("."),f=z(),M=l("div"),this.h()},l(x){n=e(x,"P",{});var T=i(n);h=u(T,"Suppose "),p=e(T,"SPAN",{class:!0});var _s=i(p);_s.forEach(a),T.forEach(a),b=k(x),r=e(x,"DIV",{class:!0});var Ts=i(r);Ts.forEach(a),E=k(x),y=e(x,"P",{});var H=i(y);_=u(H,"Since "),P=e(H,"SPAN",{class:!0});var G=i(P);G.forEach(a),V=u(H,", every divisor of "),j=e(H,"SPAN",{class:!0});var $s=i(j);$s.forEach(a),A=u(H," is a unique product of a divisor of "),Z=e(H,"SPAN",{class:!0});var Ms=i(Z);Ms.forEach(a),Ps=u(H," and a divisor of "),R=e(H,"SPAN",{class:!0});var X=i(R);X.forEach(a),cs=u(H,", because for any prime "),Y=e(H,"SPAN",{class:!0});var Hs=i(Y);Hs.forEach(a),C=u(H," that divides "),B=e(H,"SPAN",{class:!0});var s=i(B);s.forEach(a),rs=u(H,", it can only divide one of "),Q=e(H,"SPAN",{class:!0});var c=i(Q);c.forEach(a),xs=u(H," or "),W=e(H,"SPAN",{class:!0});var Ls=i(W);Ls.forEach(a),J=u(H,"."),H.forEach(a),us=k(x),N=e(x,"DIV",{class:!0});var ws=i(N);ws.forEach(a),ss=k(x),I=e(x,"P",{});var as=i(I);hs=u(as,"Since "),U=e(as,"SPAN",{class:!0});var qs=i(U);qs.forEach(a),gs=u(as," is multiplicative, "),K=e(as,"SPAN",{class:!0});var Es=i(K);Es.forEach(a),D=u(as,"."),as.forEach(a),f=k(x),M=e(x,"DIV",{class:!0});var zs=i(M);zs.forEach(a),this.h()},h(){o(p,"class","math math-inline"),o(r,"class","math math-display"),o(P,"class","math math-inline"),o(j,"class","math math-inline"),o(Z,"class","math math-inline"),o(R,"class","math math-inline"),o(Y,"class","math math-inline"),o(B,"class","math math-inline"),o(Q,"class","math math-inline"),o(W,"class","math math-inline"),o(N,"class","math math-display"),o(U,"class","math math-inline"),o(K,"class","math math-inline"),o(M,"class","math math-display")},m(x,T){m(x,n,T),t(n,h),t(n,p),p.innerHTML=g,m(x,b,T),m(x,r,T),r.innerHTML=w,m(x,E,T),m(x,y,T),t(y,_),t(y,P),P.innerHTML=$,t(y,V),t(y,j),j.innerHTML=fs,t(y,A),t(y,Z),Z.innerHTML=F,t(y,Ps),t(y,R),R.innerHTML=q,t(y,cs),t(y,Y),Y.innerHTML=ds,t(y,C),t(y,B),B.innerHTML=ks,t(y,rs),t(y,Q),Q.innerHTML=ns,t(y,xs),t(y,W),W.innerHTML=O,t(y,J),m(x,us,T),m(x,N,T),N.innerHTML=bs,m(x,ss,T),m(x,I,T),t(I,hs),t(I,U),U.innerHTML=os,t(I,gs),t(I,K),K.innerHTML=ys,t(I,D),m(x,f,T),m(x,M,T),M.innerHTML=Ns},p:vs,d(x){x&&a(n),x&&a(b),x&&a(r),x&&a(E),x&&a(y),x&&a(us),x&&a(N),x&&a(ss),x&&a(I),x&&a(f),x&&a(M)}}}function Da(L){let n,h,p,g='g(n)=dnf(d)g(n) = \\sum_{d | n} f(d)',b,r,w='f(n)f(n)',E;return{c(){n=l("p"),h=d("If "),p=l("span"),b=d(" is a multiplicative function, then so is "),r=l("span"),E=d("."),this.h()},l(y){n=e(y,"P",{});var _=i(n);h=u(_,"If "),p=e(_,"SPAN",{class:!0});var P=i(p);P.forEach(a),b=u(_," is a multiplicative function, then so is "),r=e(_,"SPAN",{class:!0});var $=i(r);$.forEach(a),E=u(_,"."),_.forEach(a),this.h()},h(){o(p,"class","math math-inline"),o(r,"class","math math-inline")},m(y,_){m(y,n,_),t(n,h),t(n,p),p.innerHTML=g,t(n,b),t(n,r),r.innerHTML=w,t(n,E)},p:vs,d(y){y&&a(n)}}}function qa(L){let n,h,p,g='n=1n = 1',b,r,w='g(1)=f(1)=f(1×1)=g(1)g(1)=g(1)2g(1) = f(1) = f(1 \\times 1) = g(1)g(1) = g(1)^2',E,y,_='g(1)=f(1)=0g(1) = f(1) = 0',P,$,V='g(1)=f(1)=1g(1) = f(1) = 1',j,fs,A,Z,F,Ps='nn',R,q,cs='g(n)=f(n)+f(1)g(n) = f(n) + f(1)',Y,ds,C,B,ks,rs='n=n1n2n = n_1n_2',Q,ns,xs='gcd(n1,n2)=1\\gcd(n_1, n_2) = 1',W,O,J,us,N,bs='ff',ss,I,hs='d<nd < n',U,os,gs,K=`g(n)=g(n1n2)=dn1n2f(d)=d1n1d2n2f(d1d2)g(n) \\\\ -= g(n_1n_2) \\\\ -= \\sum_{d | n_1n_2} f(d) \\\\ -= \\sum_{d_1 | n_1} \\sum_{d_2 | n_2} f(d_1d_2) \\\\`,ys,D,f,M,Ns='f(n1n2)f(n_1n_2)',x,T,_s='ff',Ts,H,G,$s=`=d1n1d2n2f(d1)f(d2)f(n1)(n2)+f(n1n2)=(d1n1f(d1))(d2n2f(d2))f(n1)f(n2)+f(n1n2)=g(n1)g(n2)f(n1)f(n2)+f(n1n2)= \\sum_{d_1 | n_1} \\sum_{d_2 | n_2} f(d_1)f(d_2) - f(n_1)(n_2) + f(n_1n_2) \\\\ -= \\left(\\sum_{d_1 | n_1} f(d_1)\\right) \\left(\\sum_{d_2 | n_2} f(d_2)\\right) - f(n_1)f(n_2) + f(n_1n_2) \\\\ -= g(n_1)g(n_2) - f(n_1)f(n_2) + f(n_1n_2) \\\\`,Ms,X,Hs,s,c='g(n1)g(n2)g(n_1)g(n_2)',Ls,ws,as,qs='g(n)g(n1)g(n2)=f(n1n2)f(n1)f(n2)g(n) - g(n_1)g(n_2) = f(n_1n_2) - f(n_1)f(n_2) \\\\',Es,zs,Is,Ss,Js='gg',js,Rs,Vs,Ks='0=f(n1n2)f(n1)f(n2)0 = f(n_1n_2) - f(n_1)f(n_2) \\\\',Ws,As,Cs,Bs,Us='ff',aa;return{c(){n=l("p"),h=d("If "),p=l("span"),b=d(", then "),r=l("span"),E=d(", which gives either "),y=l("span"),P=d(" or "),$=l("span"),j=d("."),fs=z(),A=l("p"),Z=d("If "),F=l("span"),R=d(" is prime, then "),q=l("span"),Y=d("."),ds=z(),C=l("p"),B=d("If "),ks=l("span"),Q=d(" where "),ns=l("span"),W=d(", then we prove by induction."),O=z(),J=l("p"),us=d("Suppose "),N=l("span"),ss=d(" is multiplicative for all "),I=l("span"),U=d("."),os=z(),gs=l("div"),ys=z(),D=l("p"),f=d("Only "),M=l("span"),x=d(" is out of the induction hypothesis, so we apply the multiplicative property of "),T=l("span"),Ts=d(" for all other terms."),H=z(),G=l("div"),Ms=z(),X=l("p"),Hs=d("Move "),s=l("span"),Ls=d(" to the left hand side."),ws=z(),as=l("div"),Es=z(),zs=l("p"),Is=d("Apply the multiplicative property of "),Ss=l("span"),js=d("."),Rs=z(),Vs=l("div"),Ws=z(),As=l("p"),Cs=d("Hence, "),Bs=l("span"),aa=d(" is multiplicative."),this.h()},l(v){n=e(v,"P",{});var S=i(n);h=u(S,"If "),p=e(S,"SPAN",{class:!0});var la=i(p);la.forEach(a),b=u(S,", then "),r=e(S,"SPAN",{class:!0});var ea=i(r);ea.forEach(a),E=u(S,", which gives either "),y=e(S,"SPAN",{class:!0});var ia=i(y);ia.forEach(a),P=u(S," or "),$=e(S,"SPAN",{class:!0});var ca=i($);ca.forEach(a),j=u(S,"."),S.forEach(a),fs=k(v),A=e(v,"P",{});var Os=i(A);Z=u(Os,"If "),F=e(Os,"SPAN",{class:!0});var ra=i(F);ra.forEach(a),R=u(Os," is prime, then "),q=e(Os,"SPAN",{class:!0});var ha=i(q);ha.forEach(a),Y=u(Os,"."),Os.forEach(a),ds=k(v),C=e(v,"P",{});var Gs=i(C);B=u(Gs,"If "),ks=e(Gs,"SPAN",{class:!0});var oa=i(ks);oa.forEach(a),Q=u(Gs," where "),ns=e(Gs,"SPAN",{class:!0});var ga=i(ns);ga.forEach(a),W=u(Gs,", then we prove by induction."),Gs.forEach(a),O=k(v),J=e(v,"P",{});var Ys=i(J);us=u(Ys,"Suppose "),N=e(Ys,"SPAN",{class:!0});var ya=i(N);ya.forEach(a),ss=u(Ys," is multiplicative for all "),I=e(Ys,"SPAN",{class:!0});var va=i(I);va.forEach(a),U=u(Ys,"."),Ys.forEach(a),os=k(v),gs=e(v,"DIV",{class:!0});var da=i(gs);da.forEach(a),ys=k(v),D=e(v,"P",{});var Qs=i(D);f=u(Qs,"Only "),M=e(Qs,"SPAN",{class:!0});var ua=i(M);ua.forEach(a),x=u(Qs," is out of the induction hypothesis, so we apply the multiplicative property of "),T=e(Qs,"SPAN",{class:!0});var fa=i(T);fa.forEach(a),Ts=u(Qs," for all other terms."),Qs.forEach(a),H=k(v),G=e(v,"DIV",{class:!0});var ba=i(G);ba.forEach(a),Ms=k(v),X=e(v,"P",{});var Xs=i(X);Hs=u(Xs,"Move "),s=e(Xs,"SPAN",{class:!0});var wa=i(s);wa.forEach(a),Ls=u(Xs," to the left hand side."),Xs.forEach(a),ws=k(v),as=e(v,"DIV",{class:!0});var za=i(as);za.forEach(a),Es=k(v),zs=e(v,"P",{});var Zs=i(zs);Is=u(Zs,"Apply the multiplicative property of "),Ss=e(Zs,"SPAN",{class:!0});var ka=i(Ss);ka.forEach(a),js=u(Zs,"."),Zs.forEach(a),Rs=k(v),Vs=e(v,"DIV",{class:!0});var xa=i(Vs);xa.forEach(a),Ws=k(v),As=e(v,"P",{});var sa=i(As);Cs=u(sa,"Hence, "),Bs=e(sa,"SPAN",{class:!0});var _a=i(Bs);_a.forEach(a),aa=u(sa," is multiplicative."),sa.forEach(a),this.h()},h(){o(p,"class","math math-inline"),o(r,"class","math math-inline"),o(y,"class","math math-inline"),o($,"class","math math-inline"),o(F,"class","math math-inline"),o(q,"class","math math-inline"),o(ks,"class","math math-inline"),o(ns,"class","math math-inline"),o(N,"class","math math-inline"),o(I,"class","math math-inline"),o(gs,"class","math math-display"),o(M,"class","math math-inline"),o(T,"class","math math-inline"),o(G,"class","math math-display"),o(s,"class","math math-inline"),o(as,"class","math math-display"),o(Ss,"class","math math-inline"),o(Vs,"class","math math-display"),o(Bs,"class","math math-inline")},m(v,S){m(v,n,S),t(n,h),t(n,p),p.innerHTML=g,t(n,b),t(n,r),r.innerHTML=w,t(n,E),t(n,y),y.innerHTML=_,t(n,P),t(n,$),$.innerHTML=V,t(n,j),m(v,fs,S),m(v,A,S),t(A,Z),t(A,F),F.innerHTML=Ps,t(A,R),t(A,q),q.innerHTML=cs,t(A,Y),m(v,ds,S),m(v,C,S),t(C,B),t(C,ks),ks.innerHTML=rs,t(C,Q),t(C,ns),ns.innerHTML=xs,t(C,W),m(v,O,S),m(v,J,S),t(J,us),t(J,N),N.innerHTML=bs,t(J,ss),t(J,I),I.innerHTML=hs,t(J,U),m(v,os,S),m(v,gs,S),gs.innerHTML=K,m(v,ys,S),m(v,D,S),t(D,f),t(D,M),M.innerHTML=Ns,t(D,x),t(D,T),T.innerHTML=_s,t(D,Ts),m(v,H,S),m(v,G,S),G.innerHTML=$s,m(v,Ms,S),m(v,X,S),t(X,Hs),t(X,s),s.innerHTML=c,t(X,Ls),m(v,ws,S),m(v,as,S),as.innerHTML=qs,m(v,Es,S),m(v,zs,S),t(zs,Is),t(zs,Ss),Ss.innerHTML=Js,t(zs,js),m(v,Rs,S),m(v,Vs,S),Vs.innerHTML=Ks,m(v,Ws,S),m(v,As,S),t(As,Cs),t(As,Bs),Bs.innerHTML=Us,t(As,aa)},p:vs,d(v){v&&a(n),v&&a(fs),v&&a(A),v&&a(ds),v&&a(C),v&&a(O),v&&a(J),v&&a(os),v&&a(gs),v&&a(ys),v&&a(D),v&&a(H),v&&a(G),v&&a(Ms),v&&a(X),v&&a(ws),v&&a(as),v&&a(Es),v&&a(zs),v&&a(Rs),v&&a(Vs),v&&a(Ws),v&&a(As)}}}function Ba(L){let n,h,p,g='μ(n)\\mu(n)',b,r,w,E='dnμ(d)=[n=1]\\sum_{d | n} \\mu(d) = [n = 1]';return{c(){n=l("p"),h=d("The Mobius Function, denoted as "),p=l("span"),b=d(", is defined by the following rules:"),r=z(),w=l("div"),this.h()},l(y){n=e(y,"P",{});var _=i(n);h=u(_,"The Mobius Function, denoted as "),p=e(_,"SPAN",{class:!0});var P=i(p);P.forEach(a),b=u(_,", is defined by the following rules:"),_.forEach(a),r=k(y),w=e(y,"DIV",{class:!0});var $=i(w);$.forEach(a),this.h()},h(){o(p,"class","math math-inline"),o(w,"class","math math-display")},m(y,_){m(y,n,_),t(n,h),t(n,p),p.innerHTML=g,t(n,b),m(y,r,_),m(y,w,_),w.innerHTML=E},p:vs,d(y){y&&a(n),y&&a(r),y&&a(w)}}}function Fa(L){let n,h='f(n)=dng(d)    g(n)=dnμ(d)f(nd)f(n) = \\sum_{d | n} g(d) \\iff g(n) = \\sum_{d | n} \\mu(d) f\\left(\\frac{n}{d}\\right)';return{c(){n=l("div"),this.h()},l(p){n=e(p,"DIV",{class:!0});var g=i(n);g.forEach(a),this.h()},h(){o(n,"class","math math-display")},m(p,g){m(p,n,g),n.innerHTML=h},p:vs,d(p){p&&a(n)}}}function Ra(L){let n,h,p,g,b=`dmμ(d)f(md)=dmμ(md)f(d)=dmμ(md)kdg(k)=dmkdμ(md)g(k)=kmd(m/k)μ(mkd)g(k)=kmg(k)d(m/k)μ(mkd)=kmg(k)d(m/k)μ(mk/mkd)=kmg(k)d(m/k)μ(d)=kmg(k)[m/k=1]=g(m)\\sum_{d | m} \\mu(d) f\\left(\\frac{m}{d}\\right) \\\\ -= \\sum_{d | m} \\mu\\left(\\frac{m}{d}\\right) f(d) \\\\ -= \\sum_{d | m} \\mu\\left(\\frac{m}{d}\\right) \\sum_{k | d} g(k) \\\\ -= \\sum_{d | m} \\sum_{k | d} \\mu\\left(\\frac{m}{d}\\right) g(k) \\\\ -= \\sum_{k | m} \\sum_{d | (m / k)} \\mu\\left(\\frac{m}{kd}\\right) g(k) \\\\ -= \\sum_{k | m} g(k) \\sum_{d | (m / k)} \\mu\\left(\\frac{m}{kd}\\right) \\\\ -= \\sum_{k | m} g(k) \\sum_{d | (m / k)} \\mu\\left(\\frac{m}{k} / \\frac{m}{kd}\\right) \\\\ -= \\sum_{k | m} g(k) \\sum_{d | (m / k)} \\mu(d) \\\\ -= \\sum_{k | m} g(k) [m / k = 1] \\\\ -= g(m)`,r,w,E,y,_,P=`dmg(d)=dmkdμ(k)f(dk)=kmd(m/k)μ(k)f(d)=kmf(k)d(m/k)μ(k)=kmf(k)[m/k=1]=f(m)\\sum_{d | m} g(d) \\\\ -= \\sum_{d | m} \\sum_{k | d} \\mu(k) f\\left(\\frac{d}{k}\\right) \\\\ -= \\sum_{k | m} \\sum_{d | (m / k)} \\mu(k) f(d)\\\\ -= \\sum_{k | m} f(k) \\sum_{d | (m / k)} \\mu(k) \\\\ -= \\sum_{k | m} f(k) [m / k = 1] \\\\ -= f(m)`;return{c(){n=l("p"),h=d("Left to right:"),p=z(),g=l("div"),r=z(),w=l("p"),E=d("Right to left:"),y=z(),_=l("div"),this.h()},l($){n=e($,"P",{});var V=i(n);h=u(V,"Left to right:"),V.forEach(a),p=k($),g=e($,"DIV",{class:!0});var j=i(g);j.forEach(a),r=k($),w=e($,"P",{});var fs=i(w);E=u(fs,"Right to left:"),fs.forEach(a),y=k($),_=e($,"DIV",{class:!0});var A=i(_);A.forEach(a),this.h()},h(){o(g,"class","math math-display"),o(_,"class","math math-display")},m($,V){m($,n,V),t(n,h),m($,p,V),m($,g,V),g.innerHTML=b,m($,r,V),m($,w,V),t(w,E),m($,y,V),m($,_,V),_.innerHTML=P},p:vs,d($){$&&a(n),$&&a(p),$&&a(g),$&&a(r),$&&a(w),$&&a(y),$&&a(_)}}}function Wa(L){let n,h;return{c(){n=l("p"),h=d("The Mobius Function is a multiplicative function.")},l(p){n=e(p,"P",{});var g=i(n);h=u(g,"The Mobius Function is a multiplicative function."),g.forEach(a)},m(p,g){m(p,n,g),t(n,h)},p:vs,d(p){p&&a(n)}}}function ja(L){let n,h,p='[n=1][n = 1]',g;return{c(){n=l("p"),h=l("span"),g=d(" is multiplicative. Immediately apply the lemma above."),this.h()},l(b){n=e(b,"P",{});var r=i(n);h=e(r,"SPAN",{class:!0});var w=i(h);w.forEach(a),g=u(r," is multiplicative. Immediately apply the lemma above."),r.forEach(a),this.h()},h(){o(h,"class","math math-inline")},m(b,r){m(b,n,r),t(n,h),h.innerHTML=p,t(n,g)},p:vs,d(b){b&&a(n)}}}function Ca(L){let n,h=`μ(n)={0if n has a squared prime factor1if n=1(1)kif n is a product of k distinct primes\\mu(n) = \\begin{cases} - 0 & \\text{if $n$ has a squared prime factor} \\\\ - 1 & \\text{if $n = 1$} \\\\ - (-1)^k & \\text{if $n$ is a product of $k$ distinct primes} -\\end{cases}`;return{c(){n=l("div"),this.h()},l(p){n=e(p,"DIV",{class:!0});var g=i(n);g.forEach(a),this.h()},h(){o(n,"class","math math-display")},m(p,g){m(p,n,g),n.innerHTML=h},p:vs,d(p){p&&a(n)}}}function Oa(L){let n,h,p,g='n=1n = 1',b,r,w='d1μ(d)=μ(1)=[1=1]=1\\sum_{d|1}\\mu(d) = \\mu(1) = [1 = 1] = 1',E,y,_,P,$='n=pn = p',V,j,fs='pp',A,Z,F,Ps='μ(p)=dpμ(d)μ(1)=[p=1]1=1\\mu(p) = \\sum_{d|p}\\mu(d) - \\mu(1) = [p = 1] - 1 = -1\\\\',R,q,cs,Y,ds='n=pkn = p^k',C,B,ks='pp',rs,Q,ns='k>1k > 1',xs,W,O,J='μ(pk)=dpkμ(d)dpk1μ(d)=[pk=1][pk1=1]=0\\mu(p^k) = \\sum_{d|p^k}\\mu(d) - \\sum_{d|p^{k-1}}\\mu(d) = [p^k = 1] - [p^{k-1} = 1] = 0',us,N,bs,ss,I='nn',hs,U,os,gs=`μ(n)=μ(p1a1p2a2pkak)=μ(p1a1)μ(p2a2)μ(pkak)={0μ(piai)=0 for some i(1)kμ(piai)=1 for all i={0maxai>1(1)kmaxai=1\\mu(n)\\\\ -= \\mu(p_1^{a_1}p_2^{a_2}\\cdots p_k^{a_k}) \\\\ -= \\mu(p_1^{a_1})\\mu(p_2^{a_2})\\cdots\\mu(p_k^{a_k})\\\\ -= \\begin{cases} - 0 & \\mu(p_i^{a_i}) = 0 \\text{ for some }i \\\\ - (-1)^k & \\mu(p_i^{a_i}) = -1 \\text{ for all }i -\\end{cases}\\\\ -= \\begin{cases} - 0 & \\max{a_i} > 1 \\\\ - (-1)^k & \\max{a_i} = 1 -\\end{cases}`,K,ys,D;return{c(){n=l("p"),h=d("If "),p=l("span"),b=z(),r=l("div"),E=z(),y=l("p"),_=d("If "),P=l("span"),V=d(", where "),j=l("span"),A=d(" is a prime number."),Z=z(),F=l("div"),R=z(),q=l("p"),cs=d("If "),Y=l("span"),C=d(", where "),B=l("span"),rs=d(" is a prime number and "),Q=l("span"),xs=d("."),W=z(),O=l("div"),us=z(),N=l("p"),bs=d("If "),ss=l("span"),hs=d(" has more than one prime factors, we can apply multiplicative property. Therefore,"),U=z(),os=l("div"),K=z(),ys=l("p"),D=d("Combining all cases, we get the general term."),this.h()},l(f){n=e(f,"P",{});var M=i(n);h=u(M,"If "),p=e(M,"SPAN",{class:!0});var Ns=i(p);Ns.forEach(a),M.forEach(a),b=k(f),r=e(f,"DIV",{class:!0});var x=i(r);x.forEach(a),E=k(f),y=e(f,"P",{});var T=i(y);_=u(T,"If "),P=e(T,"SPAN",{class:!0});var _s=i(P);_s.forEach(a),V=u(T,", where "),j=e(T,"SPAN",{class:!0});var Ts=i(j);Ts.forEach(a),A=u(T," is a prime number."),T.forEach(a),Z=k(f),F=e(f,"DIV",{class:!0});var H=i(F);H.forEach(a),R=k(f),q=e(f,"P",{});var G=i(q);cs=u(G,"If "),Y=e(G,"SPAN",{class:!0});var $s=i(Y);$s.forEach(a),C=u(G,", where "),B=e(G,"SPAN",{class:!0});var Ms=i(B);Ms.forEach(a),rs=u(G," is a prime number and "),Q=e(G,"SPAN",{class:!0});var X=i(Q);X.forEach(a),xs=u(G,"."),G.forEach(a),W=k(f),O=e(f,"DIV",{class:!0});var Hs=i(O);Hs.forEach(a),us=k(f),N=e(f,"P",{});var s=i(N);bs=u(s,"If "),ss=e(s,"SPAN",{class:!0});var c=i(ss);c.forEach(a),hs=u(s," has more than one prime factors, we can apply multiplicative property. Therefore,"),s.forEach(a),U=k(f),os=e(f,"DIV",{class:!0});var Ls=i(os);Ls.forEach(a),K=k(f),ys=e(f,"P",{});var ws=i(ys);D=u(ws,"Combining all cases, we get the general term."),ws.forEach(a),this.h()},h(){o(p,"class","math math-inline"),o(r,"class","math math-display"),o(P,"class","math math-inline"),o(j,"class","math math-inline"),o(F,"class","math math-display"),o(Y,"class","math math-inline"),o(B,"class","math math-inline"),o(Q,"class","math math-inline"),o(O,"class","math math-display"),o(ss,"class","math math-inline"),o(os,"class","math math-display")},m(f,M){m(f,n,M),t(n,h),t(n,p),p.innerHTML=g,m(f,b,M),m(f,r,M),r.innerHTML=w,m(f,E,M),m(f,y,M),t(y,_),t(y,P),P.innerHTML=$,t(y,V),t(y,j),j.innerHTML=fs,t(y,A),m(f,Z,M),m(f,F,M),F.innerHTML=Ps,m(f,R,M),m(f,q,M),t(q,cs),t(q,Y),Y.innerHTML=ds,t(q,C),t(q,B),B.innerHTML=ks,t(q,rs),t(q,Q),Q.innerHTML=ns,t(q,xs),m(f,W,M),m(f,O,M),O.innerHTML=J,m(f,us,M),m(f,N,M),t(N,bs),t(N,ss),ss.innerHTML=I,t(N,hs),m(f,U,M),m(f,os,M),os.innerHTML=gs,m(f,K,M),m(f,ys,M),t(ys,D)},p:vs,d(f){f&&a(n),f&&a(b),f&&a(r),f&&a(E),f&&a(y),f&&a(Z),f&&a(F),f&&a(R),f&&a(q),f&&a(W),f&&a(O),f&&a(us),f&&a(N),f&&a(U),f&&a(os),f&&a(K),f&&a(ys)}}}function Ga(L){let n,h='φ(n)=dnμ(d)nd\\varphi(n) = \\sum_{d | n} \\mu(d)\\frac{n}{d}';return{c(){n=l("div"),this.h()},l(p){n=e(p,"DIV",{class:!0});var g=i(n);g.forEach(a),this.h()},h(){o(n,"class","math math-display")},m(p,g){m(p,n,g),n.innerHTML=h},p:vs,d(p){p&&a(n)}}}function Ya(L){let n,h,p,g,b;return{c(){n=l("p"),h=d("Immediate from applying the inversion principle on Propterty 7 of "),p=l("a"),g=d("Euler’s Totient Function"),b=d("."),this.h()},l(r){n=e(r,"P",{});var w=i(n);h=u(w,"Immediate from applying the inversion principle on Propterty 7 of "),p=e(w,"A",{href:!0});var E=i(p);g=u(E,"Euler’s Totient Function"),E.forEach(a),b=u(w,"."),w.forEach(a),this.h()},h(){o(p,"href","/note/eulers-totient-function")},m(r,w){m(r,n,w),t(n,h),t(n,p),t(p,g),t(n,b)},p:vs,d(r){r&&a(n)}}}function Qa(L){let n,h,p,g,b,r,w,E,y,_,P,$,V,j,fs,A,Z,F,Ps,R,q,cs,Y,ds,C,B,ks,rs,Q,ns,xs,W,O,J,us,N,bs,ss,I,hs,U,os,gs,K,ys,D,f,M,Ns,x,T,_s,Ts,H,G,$s,Ms,X,Hs;return P=new Ds({props:{variant:"assertion",$$slots:{default:[Ta]},$$scope:{ctx:L}}}),A=new Ds({props:{variant:"lemma",$$slots:{default:[Ha]},$$scope:{ctx:L}}}),F=new Fs({props:{$$slots:{default:[Sa]},$$scope:{ctx:L}}}),R=new Ds({props:{variant:"lemma",$$slots:{default:[Aa]},$$scope:{ctx:L}}}),cs=new Fs({props:{$$slots:{default:[Na]},$$scope:{ctx:L}}}),ds=new Ds({props:{variant:"lemma",$$slots:{default:[Ia]},$$scope:{ctx:L}}}),B=new Fs({props:{$$slots:{default:[Va]},$$scope:{ctx:L}}}),rs=new Ds({props:{variant:"lemma",$$slots:{default:[Da]},$$scope:{ctx:L}}}),ns=new Fs({props:{$$slots:{default:[qa]},$$scope:{ctx:L}}}),bs=new Ds({props:{variant:"definition",$$slots:{default:[Ba]},$$scope:{ctx:L}}}),K=new Ds({props:{variant:"theorem",name:"Inversion Principle",$$slots:{default:[Fa]},$$scope:{ctx:L}}}),D=new Fs({props:{$$slots:{default:[Ra]},$$scope:{ctx:L}}}),M=new Ds({props:{variant:"theorem",name:"Multiplicative Property",$$slots:{default:[Wa]},$$scope:{ctx:L}}}),x=new Fs({props:{$$slots:{default:[ja]},$$scope:{ctx:L}}}),_s=new Ds({props:{variant:"theorem",name:"General Term",$$slots:{default:[Ca]},$$scope:{ctx:L}}}),H=new Fs({props:{$$slots:{default:[Oa]},$$scope:{ctx:L}}}),$s=new Ds({props:{variant:"theorem",name:"Relation to Eular's Totient Function",$$slots:{default:[Ga]},$$scope:{ctx:L}}}),X=new Fs({props:{$$slots:{default:[Ya]},$$scope:{ctx:L}}}),{c(){n=l("h1"),h=l("a"),p=l("span"),g=d("Mobius Function"),b=z(),r=l("h2"),w=l("a"),E=l("span"),y=d("Pre-requisite Number Theory"),_=z(),ps(P.$$.fragment),$=z(),V=l("p"),j=d("This is a well-known calculus theorem so we are not going to prove it here."),fs=z(),ps(A.$$.fragment),Z=z(),ps(F.$$.fragment),Ps=z(),ps(R.$$.fragment),q=z(),ps(cs.$$.fragment),Y=z(),ps(ds.$$.fragment),C=z(),ps(B.$$.fragment),ks=z(),ps(rs.$$.fragment),Q=z(),ps(ns.$$.fragment),xs=z(),W=l("h2"),O=l("a"),J=l("span"),us=d("Definition"),N=z(),ps(bs.$$.fragment),ss=z(),I=l("h2"),hs=l("a"),U=l("span"),os=d("Properties"),gs=z(),ps(K.$$.fragment),ys=z(),ps(D.$$.fragment),f=z(),ps(M.$$.fragment),Ns=z(),ps(x.$$.fragment),T=z(),ps(_s.$$.fragment),Ts=z(),ps(H.$$.fragment),G=z(),ps($s.$$.fragment),Ms=z(),ps(X.$$.fragment),this.h()},l(s){n=e(s,"H1",{id:!0});var c=i(n);h=e(c,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Ls=i(h);p=e(Ls,"SPAN",{class:!0}),i(p).forEach(a),Ls.forEach(a),g=u(c,"Mobius Function"),c.forEach(a),b=k(s),r=e(s,"H2",{id:!0});var ws=i(r);w=e(ws,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var as=i(w);E=e(as,"SPAN",{class:!0}),i(E).forEach(a),as.forEach(a),y=u(ws,"Pre-requisite Number Theory"),ws.forEach(a),_=k(s),ts(P.$$.fragment,s),$=k(s),V=e(s,"P",{});var qs=i(V);j=u(qs,"This is a well-known calculus theorem so we are not going to prove it here."),qs.forEach(a),fs=k(s),ts(A.$$.fragment,s),Z=k(s),ts(F.$$.fragment,s),Ps=k(s),ts(R.$$.fragment,s),q=k(s),ts(cs.$$.fragment,s),Y=k(s),ts(ds.$$.fragment,s),C=k(s),ts(B.$$.fragment,s),ks=k(s),ts(rs.$$.fragment,s),Q=k(s),ts(ns.$$.fragment,s),xs=k(s),W=e(s,"H2",{id:!0});var Es=i(W);O=e(Es,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var zs=i(O);J=e(zs,"SPAN",{class:!0}),i(J).forEach(a),zs.forEach(a),us=u(Es,"Definition"),Es.forEach(a),N=k(s),ts(bs.$$.fragment,s),ss=k(s),I=e(s,"H2",{id:!0});var Is=i(I);hs=e(Is,"A",{"aria-hidden":!0,tabindex:!0,href:!0});var Ss=i(hs);U=e(Ss,"SPAN",{class:!0}),i(U).forEach(a),Ss.forEach(a),os=u(Is,"Properties"),Is.forEach(a),gs=k(s),ts(K.$$.fragment,s),ys=k(s),ts(D.$$.fragment,s),f=k(s),ts(M.$$.fragment,s),Ns=k(s),ts(x.$$.fragment,s),T=k(s),ts(_s.$$.fragment,s),Ts=k(s),ts(H.$$.fragment,s),G=k(s),ts($s.$$.fragment,s),Ms=k(s),ts(X.$$.fragment,s),this.h()},h(){o(p,"class","icon icon-link"),o(h,"aria-hidden","true"),o(h,"tabindex","-1"),o(h,"href","#mobius-function"),o(n,"id","mobius-function"),o(E,"class","icon icon-link"),o(w,"aria-hidden","true"),o(w,"tabindex","-1"),o(w,"href","#pre-requisite-number-theory"),o(r,"id","pre-requisite-number-theory"),o(J,"class","icon icon-link"),o(O,"aria-hidden","true"),o(O,"tabindex","-1"),o(O,"href","#definition"),o(W,"id","definition"),o(U,"class","icon icon-link"),o(hs,"aria-hidden","true"),o(hs,"tabindex","-1"),o(hs,"href","#properties"),o(I,"id","properties")},m(s,c){m(s,n,c),t(n,h),t(h,p),t(n,g),m(s,b,c),m(s,r,c),t(r,w),t(w,E),t(r,y),m(s,_,c),ms(P,s,c),m(s,$,c),m(s,V,c),t(V,j),m(s,fs,c),ms(A,s,c),m(s,Z,c),ms(F,s,c),m(s,Ps,c),ms(R,s,c),m(s,q,c),ms(cs,s,c),m(s,Y,c),ms(ds,s,c),m(s,C,c),ms(B,s,c),m(s,ks,c),ms(rs,s,c),m(s,Q,c),ms(ns,s,c),m(s,xs,c),m(s,W,c),t(W,O),t(O,J),t(W,us),m(s,N,c),ms(bs,s,c),m(s,ss,c),m(s,I,c),t(I,hs),t(hs,U),t(I,os),m(s,gs,c),ms(K,s,c),m(s,ys,c),ms(D,s,c),m(s,f,c),ms(M,s,c),m(s,Ns,c),ms(x,s,c),m(s,T,c),ms(_s,s,c),m(s,Ts,c),ms(H,s,c),m(s,G,c),ms($s,s,c),m(s,Ms,c),ms(X,s,c),Hs=!0},p(s,c){const Ls={};c&2&&(Ls.$$scope={dirty:c,ctx:s}),P.$set(Ls);const ws={};c&2&&(ws.$$scope={dirty:c,ctx:s}),A.$set(ws);const as={};c&2&&(as.$$scope={dirty:c,ctx:s}),F.$set(as);const qs={};c&2&&(qs.$$scope={dirty:c,ctx:s}),R.$set(qs);const Es={};c&2&&(Es.$$scope={dirty:c,ctx:s}),cs.$set(Es);const zs={};c&2&&(zs.$$scope={dirty:c,ctx:s}),ds.$set(zs);const Is={};c&2&&(Is.$$scope={dirty:c,ctx:s}),B.$set(Is);const Ss={};c&2&&(Ss.$$scope={dirty:c,ctx:s}),rs.$set(Ss);const Js={};c&2&&(Js.$$scope={dirty:c,ctx:s}),ns.$set(Js);const js={};c&2&&(js.$$scope={dirty:c,ctx:s}),bs.$set(js);const Rs={};c&2&&(Rs.$$scope={dirty:c,ctx:s}),K.$set(Rs);const Vs={};c&2&&(Vs.$$scope={dirty:c,ctx:s}),D.$set(Vs);const Ks={};c&2&&(Ks.$$scope={dirty:c,ctx:s}),M.$set(Ks);const Ws={};c&2&&(Ws.$$scope={dirty:c,ctx:s}),x.$set(Ws);const As={};c&2&&(As.$$scope={dirty:c,ctx:s}),_s.$set(As);const Cs={};c&2&&(Cs.$$scope={dirty:c,ctx:s}),H.$set(Cs);const Bs={};c&2&&(Bs.$$scope={dirty:c,ctx:s}),$s.$set(Bs);const Us={};c&2&&(Us.$$scope={dirty:c,ctx:s}),X.$set(Us)},i(s){Hs||(ls(P.$$.fragment,s),ls(A.$$.fragment,s),ls(F.$$.fragment,s),ls(R.$$.fragment,s),ls(cs.$$.fragment,s),ls(ds.$$.fragment,s),ls(B.$$.fragment,s),ls(rs.$$.fragment,s),ls(ns.$$.fragment,s),ls(bs.$$.fragment,s),ls(K.$$.fragment,s),ls(D.$$.fragment,s),ls(M.$$.fragment,s),ls(x.$$.fragment,s),ls(_s.$$.fragment,s),ls(H.$$.fragment,s),ls($s.$$.fragment,s),ls(X.$$.fragment,s),Hs=!0)},o(s){es(P.$$.fragment,s),es(A.$$.fragment,s),es(F.$$.fragment,s),es(R.$$.fragment,s),es(cs.$$.fragment,s),es(ds.$$.fragment,s),es(B.$$.fragment,s),es(rs.$$.fragment,s),es(ns.$$.fragment,s),es(bs.$$.fragment,s),es(K.$$.fragment,s),es(D.$$.fragment,s),es(M.$$.fragment,s),es(x.$$.fragment,s),es(_s.$$.fragment,s),es(H.$$.fragment,s),es($s.$$.fragment,s),es(X.$$.fragment,s),Hs=!1},d(s){s&&a(n),s&&a(b),s&&a(r),s&&a(_),is(P,s),s&&a($),s&&a(V),s&&a(fs),is(A,s),s&&a(Z),is(F,s),s&&a(Ps),is(R,s),s&&a(q),is(cs,s),s&&a(Y),is(ds,s),s&&a(C),is(B,s),s&&a(ks),is(rs,s),s&&a(Q),is(ns,s),s&&a(xs),s&&a(W),s&&a(N),is(bs,s),s&&a(ss),s&&a(I),s&&a(gs),is(K,s),s&&a(ys),is(D,s),s&&a(f),is(M,s),s&&a(Ns),is(x,s),s&&a(T),is(_s,s),s&&a(Ts),is(H,s),s&&a(G),is($s,s),s&&a(Ms),is(X,s)}}}function Ja(L){let n,h;const p=[L[0],ma];let g={$$slots:{default:[Qa]},$$scope:{ctx:L}};for(let b=0;b{h(0,n=na(na({},n),ta(p)))},n=ta(n),[n]}class an extends $a{constructor(n){super(),Ma(this,n,Ka,Ja,La,{})}}export{an as component}; diff --git a/docs/_app/version.json b/docs/_app/version.json deleted file mode 100644 index 97ac512..0000000 --- a/docs/_app/version.json +++ /dev/null @@ -1 +0,0 @@ -{"version":"1714752774009"} \ No newline at end of file diff --git a/docs/assets/common.css b/docs/assets/common.css deleted file mode 100644 index 8890c97..0000000 --- a/docs/assets/common.css +++ /dev/null @@ -1,76 +0,0 @@ -:root { - font-family: "Times New Roman", Times, serif; -} - -.algorithm-container, .graph-container { - /** - * The algorithm box is a container for the algorithm - * There is an inner element that contains the algorithm - **/ - background-color: #f9f9f9; - padding: 1em; - border-radius: 0.5em; - display: flex; - justify-content: center; -} - -@media screen and (min-width: 1200px) { - .katex-display>.katex { - /** - * Override the default text-align: center - * Since modern screens are wide - * If we place equations in the center - * It will be too far from the text - **/ - text-align: left !important; - padding-left: 10em !important; - } - - .algorithm-container, .graph-container { - text-align: left; - padding-left: 10em; - width: calc(100% - 10em); - display: block; - } -} - -.md-main { - line-height: 1.6em; -} - -.md-main a { - color: black; -} - -h1 { - font-size: 2em; - border-bottom: 1px solid #ccc; - padding: 0.5em 0; -} - -h2 { - font-size: 1.5em; - border-bottom: 1px solid #ccc; - padding: 0.5em 0; -} - -h3 { - font-size: 1.2em; - border-bottom: 1px solid #ccc; - padding: 0.5em 0; -} - -p { - margin: 0.5em 0; -} - -.code { - background-color: #eee; - padding: 0.2em 0.4em; - border-radius: 0.2em; -} - -/**Add more spaces between formulas*/ -.mspace.newline { - height: 1.5em; -} \ No newline at end of file diff --git a/docs/assets/creditchart/userscript.patch b/docs/assets/creditchart/userscript.patch deleted file mode 100644 index b5d8965..0000000 --- a/docs/assets/creditchart/userscript.patch +++ /dev/null @@ -1,83 +0,0 @@ -Index: MCBBS CreditAnalysis.user.js -=================================================================== ---- MCBBS CreditAnalysis.user.js -+++ MCBBS CreditAnalysis.user.js -@@ -9,9 +9,16 @@ - // @match https://*.mcbbs.net/home.php?mod=space&username=* - // @grant none - // ==/UserScript== - -+ - (function() { -+ // CaveNightingale - begin -+ const creditRegex = /
  • 积分<\/em>(-?[0-9]+)<\/li>
  • 人气<\/em>(-?[0-9]+) 点<\/li>\n
  • 金粒<\/em>(-?[0-9]+) 粒<\/li>\n
  • 金锭\[已弃用\]<\/em>(-?[0-9]+) 块<\/li>\n
  • 宝石<\/em>(-?[0-9]+) 颗<\/li>\n
  • 下界之星<\/em>(-?[0-9]+) 枚<\/li>\n
  • 贡献<\/em>(-?[0-9]+) 份<\/li>\n
  • 爱心<\/em>(-?[0-9]+) 心<\/li>\n
  • 钻石<\/em>(-?[0-9]+) 颗<\/li>/; -+ const creditList = ['积分', '人气', '金粒', '金锭', '宝石', '下界之心', '贡献', '爱心', '钻石']; -+ const postsRegex = / target="_blank">回帖数 (-?[0-9]+?)<\/a>/; -+ const threadsRegex = / target="_blank">主题数 (-?[0-9]+?)<\/a>/; -+ // CaveNightingale - end - - console.log(" %c MCBBS %c CreditAnalysis", "color: #fff; background: #f8981d; padding:5px;", "color:#fff; background: #000; padding:5px;"); - console.log(" %c Made by %c 快乐小方 ", "color: #fff; background: #815098; padding:5px;", "color:#fff; background: #000; padding:5px;"); - console.group('MCA Log'); -@@ -23,21 +30,39 @@ - console.log("[L] 用户UID:" + uid); - - console.log("[L] 开始获取用户数据"); - // 调用api -- jq.ajax({ -- type:'get', -- url:"https://www.mcbbs.net/api/mobile/index.php?module=profile&uid=" + uid, -- success:function(body,heads,status){ -+ // CaveNightingale - begin -+ // copyed form netlify/functions/get-mcbbs-credit.js -+ console.log("[L] 正在运行的CreditAnalysis是洞穴夜莺补丁版本"); -+ let data = document.body.innerHTML; -+ let result = {}; -+ let creditParsed = creditRegex.exec(data); -+ if (creditParsed) { -+ let credits = {}; -+ for (let i = 0; i < creditList.length; i++) -+ credits[creditList[i]] = parseInt(creditParsed[i + 1]); -+ result.credits = credits; -+ } -+ let postsParsed = postsRegex.exec(data); -+ if (postsParsed) -+ result.posts = parseInt(postsParsed[1]); -+ let threadsParsed = threadsRegex.exec(data); -+ if (threadsParsed) -+ result.threads = parseInt(threadsParsed[1]); -+ // CaveNightingale - end - console.log("[L] 成功获取用户数据"); -- var credits = body.Variables.space.credits; //积分总值 -- var extcredits1 = body.Variables.space.extcredits1; //人气 -- var extcredits2 = body.Variables.space.extcredits6; //贡献 -- var extcredits3 = body.Variables.space.extcredits7; //爱心 -- var extcredits4 = body.Variables.space.extcredits8; //钻石 -- var posts = body.Variables.space.posts; //发帖数 -- var threads = body.Variables.space.threads; //主题数 -- var digestposts = body.Variables.space.digestposts; //精华数 -+ // CaveNightingale - begin -+ var credits = result.credits['积分']; //积分总值 -+ var extcredits1 = result.credits['人气']; //人气 -+ var extcredits2 = result.credits['贡献']; //贡献 -+ var extcredits3 = result.credits['爱心']; //爱心 -+ var extcredits4 = result.credits['钻石']; //钻石 -+ var posts = result.posts + result.threads; //发帖数 -+ var threads = result.threads; //主题数 -+ var tempSum = Math.round(extcredits1*3 + extcredits2*10 + extcredits3*4 + extcredits4*2 + posts / 3 + threads * 2); -+ var digestposts = (credits - tempSum) / 45; //精华数 -+ // CaveNightingale - end - - //DeBug:console.log("[D] 人气分:" + extcredits1*3 + "\n贡献分:" + extcredits2*10 + "\n爱心分:" + extcredits3*4 + "\n钻石分:" + extcredits4*2 + "\n发帖分:" + Math.round(posts/3) + "\n主题分:" + threads*2 + "\n精华分:" + digestposts*45) - var json = [credits,extcredits1*3,extcredits2*10,extcredits3*4,extcredits4*2,posts/3,threads*2,digestposts*45]; - console.log("[D] 用户积分数:" + json[0] +",公式计算得:" + Math.round(json[1] + json[2] + json[3] + json[4] + json[5] + json[6] + json[7])); -@@ -276,8 +301,5 @@ - console.log("[L] 绘制完成"); - - - `); -- console.groupEnd(); -- } -- }); - })(); -\ No newline at end of file diff --git a/docs/assets/freemutecode/block.gif b/docs/assets/freemutecode/block.gif deleted file mode 100644 index 3f39a73..0000000 Binary files a/docs/assets/freemutecode/block.gif and /dev/null differ diff --git a/docs/assets/icon/parent.svg b/docs/assets/icon/parent.svg deleted file mode 100644 index 6011492..0000000 --- a/docs/assets/icon/parent.svg +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - diff --git a/docs/assets/icon/subtree.svg b/docs/assets/icon/subtree.svg deleted file mode 100644 index 84d1f6e..0000000 --- a/docs/assets/icon/subtree.svg +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - diff --git a/docs/favicon.png b/docs/favicon.png deleted file mode 100644 index 5cffcf9..0000000 Binary files a/docs/favicon.png and /dev/null differ diff --git a/docs/freegiftcode.html b/docs/freegiftcode.html deleted file mode 100644 index 2d9d0f2..0000000 --- a/docs/freegiftcode.html +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index ca38f79..0000000 --- a/docs/index.html +++ /dev/null @@ -1,61 +0,0 @@ - - - - - - - - - - - - - - - - - 夜莺洞穴 - - - -
    - - - - -
    -
    -
    - - -
    -
    - - - - -
    - - diff --git a/docs/note.html b/docs/note.html deleted file mode 100644 index 65f6ac9..0000000 --- a/docs/note.html +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - 夜莺洞穴 - 目录 - - -
    - - - - -
    -
    目录
    -
    - -

    To-do list

    -
    • Network flow
    • -
    • Dirichlet convolution
    • -
    • Numerical integration (Romberg / Lobatto)
    - - - - - -
    - - diff --git a/docs/note/chebyshev-polynomial.html b/docs/note/chebyshev-polynomial.html deleted file mode 100644 index 992d851..0000000 --- a/docs/note/chebyshev-polynomial.html +++ /dev/null @@ -1,164 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - 夜莺洞穴 - 笔记 - - - -
    - - - - -
    -
    笔记 -
    -
    - -

    Chebyshev Polynomial

    -

    Definition

    -
    Definition - - -

    Define Chebyshev polynomial of the first kind Tn(x)T_n(x) as

    -
    Tn(x)=cos(narccosx)T_n(x) = \cos(n \arccos x)
    -
    -
    Definition - - -

    Define a polynomial whose coeffient of highest degree is 1 as a monic polynomial.

    -
    -

    Recurrence Relation

    -

    Basis Step:

    -
    T0(x)=cos(0arccosx)=1T1(x)=cos(1arccosx)=xT_0(x) = \cos(0 \arccos x) = 1\\ -T_1(x) = \cos(1 \arccos x) = x
    -

    Recursive Step:

    -
    cos(n1)x=cosxcosnx+sinxsinnxcos(n+1)x=cosxcosnxsinxsinnx\cos (n - 1)x = \cos x \cos nx + \sin x \sin nx\\ -\cos (n + 1)x = \cos x \cos nx - \sin x \sin nx
    -

    Add the two equations above, we get:

    -
    cos(n1)x+cos(n+1)x=2cosxcosnx\cos (n - 1)x + \cos (n + 1)x = 2 \cos x \cos nx
    -

    Replace xx with arccosx\arccos x, we get:

    -
    cos[(n1)arccosx]+cos[(n+1)arccosx]=2cos(arccosx)cos(narccosx)Tn1(x)+Tn+1(x)=2xTn(x)Tn+1(x)=2xTn(x)Tn1(x)\cos \left[(n - 1)\arccos x\right] + \cos \left[(n + 1)\arccos x\right] = 2 \cos (\arccos x) \cos (n \arccos x) \\ -T_{n - 1}(x) + T_{n + 1}(x) = 2xT_n(x)\\ -T_{n + 1}(x) = 2xT_n(x) - T_{n - 1}(x)
    -

    Why its zeros help relieve Runge’s phenomenon

    -

    We only discuss the case when x[1,1]x \in [-1, 1], so arccosx\arccos x is real.

    -
    Lemma - - -

    For any positive integer nn, 12n1Tn(x)\dfrac{1}{2^{n - 1}}T_n(x) is a monic polynomial with degree nn.

    -
    -
    Proof - -

    Basis Step:

    -
    1211T1(x)=x1221T2(x)=12(2x21)=x212\dfrac{1}{2 ^ {1 - 1}} T_1(x) = x\\ -\dfrac{1}{2 ^ {2 - 1}} T_2(x) = \dfrac{1}{2} (2x^2 - 1) = x^2 - \dfrac{1}{2}
    -

    Inductive Step:

    -

    Assume that 12n2Tn1(x)\dfrac{1}{2 ^ {n - 2}} T_{n - 1}(x) is a monic polynomial with degree n1n - 1, and 12n3Tn2(x)\dfrac{1}{2 ^ {n - 3}} T_{n - 2}(x) is a polynomial with degree n2n - 2.

    -
    12n1Tn(x)=12n12xTn1(x)12n1Tn2(x)=x(12n2Tn1(x))12n1Tn2(x)\dfrac{1}{2 ^ {n - 1}} T_n(x) = \dfrac{1}{2 ^ {n - 1}} \cdot 2xT_{n - 1}(x) - \dfrac{1}{2 ^ {n - 1}} T_{n - 2}(x)\\ -= x(\dfrac{1}{2 ^ {n - 2}}T_{n - 1}(x)) - \dfrac{1}{2 ^ {n - 1}} T_{n - 2}(x)
    -

    The first term provided the monic polynomial with degree nn, and the second term provided the polynomial with degree n2n - 2, so the sum of the two terms is a monic polynomial with degree nn.

    - -
    -
    Theorem - - -

    No other zeros provide a narrower bound for w(x)w(x) than zeros of chebyshev polynomials.

    -
    -
    Proof - -

    From the range of the function cos\cos, we have

    -
    Tn(x)=cos(narccosx)[1,1]T_n(x) = \cos(n \arccos x) \in [-1, 1]
    -

    The w(x)w(x) in the expression of remainder of lagrange interpolation is:

    -
    w(x)=i=1n(xxi)w(x) = \prod_{i = 1}^n (x - x_i)
    -

    w(x)w(x) is a monic polynomial with degree nn. This is trivial.

    -

    If we use zeros of chebyshev polynomials as interpolation points, then w(x)w(x) shares the same zeros with Tn(x)T_n(x), in another word, shares the same zeros with 12n1Tn(x)\dfrac{1}{2 ^ {n - 1}} T_n(x).

    -

    When n>1n > 1, since both 12n1Tn(x)\dfrac{1}{2 ^ {n - 1}} T_n(x) and w(x)w(x) are monic polynomials with degree nn and exactly same nn zeros, they must be the exactly same polynomial.

    -
    w(x)=12n1Tn(x)w(x) = \dfrac{1}{2 ^ {n - 1}} T_n(x)
    -

    From the range of Tn(x)T_n(x), we have

    -
    w(x)=12n1Tn(x)[12n1,12n1]w(x) = \dfrac{1}{2 ^ {n - 1}} T_n(x) \in [-\dfrac{1}{2 ^ {n - 1}}, \dfrac{1}{2 ^ {n - 1}}]
    -

    And there exist exactly n+1n + 1 extrema of w(x)w(x), alternating between 12n1-\dfrac{1}{2 ^ {n - 1}} and 12n1\dfrac{1}{2 ^ {n - 1}}.

    -

    If we take absolute value of w(x)w(x) just as we do when we calculate the error bound of lagrange interpolation, we get:

    -
    w(x)=12n1Tn(x)=12n1Tn(x)12n1|w(x)| = |\dfrac{1}{2 ^ {n - 1}} T_n(x)| = \dfrac{1}{2 ^ {n - 1}} |T_n(x)| \le \dfrac{1}{2 ^ {n - 1}}
    -

    Now we are going to prove that zeros of chebyshev polynomials are the best interpolation points.

    -

    Proof by contradiction:

    -

    Suppose that there exist a monic polynomial p(x)p(x) with same degree as w(x)w(x), which provide a narrower error bound than w(x)w(x), and p(x)p(x) has nn zeros.

    -

    We consider the extrema of w(x)w(x).

    -

    Since p(x)<12n1|p(x)| < \dfrac{1}{2 ^ {n - 1}}

    -

    When w(x)=12n1w(x) = \dfrac{1}{2 ^ {n - 1}}, w(x)p(x)=12n1p(x)>0w(x) - p(x) = \dfrac{1}{2 ^ {n - 1}} - p(x) > 0

    -

    When w(x)=12n1w(x) = -\dfrac{1}{2 ^ {n - 1}}, w(x)p(x)=11n1p(x)<0w(x) - p(x) = -\dfrac{1}{1 ^ {n - 1}} - p(x) < 0

    -

    Since w(x)p(x)w(x) - p(x) alternates between positive and negative at n+1n + 1 points, there must be at least nn zeros of w(x)p(x)w(x) - p(x).

    -

    Since w(x)w(x) and p(x)p(x) is monic polynomial with degree nn, w(x)p(x)w(x) - p(x) is a polynomial with degree n1n - 1.

    -

    Polynomial with degree n1n - 1 can’t have nn zeros, so no such polynomial p(x)p(x) exists.

    - -
    -

    So this is why we use zeros of chebyshev polynomials as interpolation points.

    - - - - - -
    - - diff --git a/docs/note/chinese-remainder-theorem.html b/docs/note/chinese-remainder-theorem.html deleted file mode 100644 index 9e05630..0000000 --- a/docs/note/chinese-remainder-theorem.html +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - 夜莺洞穴 - 笔记 - Chebyshev Polynomial - - -
    - - - - -
    返回 -
    笔记 - Chebyshev Polynomial
    -
    - -

    Chinese Remainder Theorem (CRT)

    -

    CRT is a theorem that gives a unique solution to simultaneous linear congruences with pairwise coprime moduli.

    -
    {xa1(modm1)xa2(modm2)xan(modmn)\begin{cases} -x \equiv a_1 \pmod {m_1} \\ -x \equiv a_2 \pmod {m_2} \\ -\vdots \\ -x \equiv a_n \pmod {m_n} -\end{cases}
    -

    The theorem states that the solution is given by

    -
    xi=1naiMiyi(modM)x \equiv \sum_{i = 1}^{n} a_i M_i y_i \pmod M
    -

    where

    -
    Mi=1nmiMiMmjyiMi1(modmi)\begin{gather} -M \equiv \prod_{i = 1}^{n} m_i \\ -M_i \equiv {M \over m_j} \\ -y_i \equiv M_i^{-1} \pmod {m_i} -\end{gather}
    -

    To prove CRT, we are going to two things:

    -
    • xi=1naiMiyi(modM)x \equiv \sum_{i = 1}^{n} a_i M_i y_i \pmod M is a solution
    • -
    • There is no other solution under modulo MM
    -
    Lemma - - -

    aa has a multiplicative inverse modulo mm if and only if gcd(a,m)=1\operatorname{gcd}(a, m) = 1

    -
    -
    Proof - -

    Let the inverse be rr

    -

    ra1(modm)ra \equiv 1 \pmod m implies ra+km=1ra + km = 1 for some integer kk.

    -

    According to Bezout’s Lemma, gcd(a,m)=1\operatorname{gcd}(a, m) = 1.

    - -
    -
    Proposition - - -

    xi=1naiMiyi(modM)x \equiv \sum_{i = 1}^{n} a_i M_i y_i \pmod M is a solution

    -
    -
    Proof - -

    Since m1,m2,...mnm_1, m_2, ... m_n are pairwise coprime, we have gcd(mi,mj)=1\operatorname{gcd}(m_i, m_j) = 1 for all iji \neq j.

    -

    Then for each jj from 11 to nn, we have Mj=i=1,ijnmiM_j = \prod_{i = 1, i \neq j}^{n} m_i is coprime to mjm_j, which means MjM_j has a multiplicative inverse modulo mjm_j.

    -

    For each jj from 11 to nn, we have

    -
    i=1naiMiyi=i=1,ijnaiMiyi+ajMjyj\sum_{i = 1}^{n} a_i M_i y_i = \sum_{i = 1, i \neq j}^{n} a_i M_i y_i + a_j M_j y_j
    -

    Since M1=i=1,ijnmiM_1 = \prod_{i = 1, i \neq j}^{n} m_i is divisible by mim_i for all iji \neq j, we have

    -
    i=1,ijnaiMiyi0(modmj)\sum_{i = 1, i \neq j}^{n} a_i M_i y_i \equiv 0 \pmod {m_j}
    -

    Hence,

    -
    i=1naiMiyiajMjyjajMjMj1aj(modmj)\sum_{i = 1}^{n} a_i M_i y_i \equiv a_j M_j y_j \equiv a_j M_j M_j^{-1} \equiv a_j \pmod {m_j}
    -

    So the equation holds.

    - -
    -
    Proposition - - -

    There is no other solution under modulo MM

    -
    -
    Proof - -

    Suppose there are two solutions x1x_1 and x2x_2.

    -

    Then, for each jj from 11 to nn, we have x1x20(modmj)x_1 - x_2 \equiv 0 \pmod {m_j} or mjx1x2m_j | x_1 - x_2.

    -

    As m1,m2,...,mnm_1, m_2, ... , m_n are pairwise coprime, lcm(m1,m2,...,mn)=M\operatorname{lcm}(m_1, m_2, ... ,m_n) = M, which means Mx1x2M | x_1 - x_2.

    -

    Hence, x1x2(modM)x_1 \equiv x_2 \pmod M.

    - -
    - - - - - -
    - - diff --git a/docs/note/dirichlet-convolution.html b/docs/note/dirichlet-convolution.html deleted file mode 100644 index b20ab94..0000000 --- a/docs/note/dirichlet-convolution.html +++ /dev/null @@ -1,95 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - 夜莺洞穴 - 笔记 - Chinese Remainder Theorem (CRT) - - -
    - - - - -
    返回 -
    笔记 - Chinese Remainder Theorem (CRT)
    -
    - -

    Dirichlet convolution

    -
    Definition - - -

    The Dirichlet convolution of two arithmetic functions ff and gg is defined as

    -
    (fg)(n)=dnf(d)g(nd)(f*g)(n) = \sum_{d|n} f(d)g(\frac{n}{d})
    -
    - - - - - -
    - - diff --git a/docs/note/eulers-totient-function.html b/docs/note/eulers-totient-function.html deleted file mode 100644 index e3c8bc7..0000000 --- a/docs/note/eulers-totient-function.html +++ /dev/null @@ -1,354 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - 夜莺洞穴 - 笔记 - Dirichlet convolution - - -
    - - - - -
    返回 -
    笔记 - Dirichlet convolution
    -
    - -

    Euler’s Totient Function

    -
    Definition - - -

    The Euler’s Totient Function, denoted as φ(n)\varphi(n), is defined as the number of natural number strictly less than to nn that are relatively prime to nn.

    -
    -

    Properties

    -
    Property - 1 - -

    φ(1)=1\varphi(1) = 1

    -
    -
    Proof - -

    Only 00 is less than 11 and relatively prime to 11.

    - -
    -
    Property - 2 - -

    φ(n)=n1\varphi(n) = n - 1, if nn is prime

    -
    -
    Proof - -

    It’s easy to see that all positive intergers less than nn are relatively prime to nn if nn is prime.

    -

    Therefore, φ(n)=n1\varphi(n) = n - 1.

    - -
    -
    Property - 3 - -

    φ(pq)=(p1)(q1)\varphi(pq) = (p - 1)(q - 1), if pp and qq are distinct primes

    -
    -
    Proof - -

    Since pp is prime, gcd(p,k)1\operatorname{gcd}(p, k) \neq 1 gives pkp | k. Hence, numbers less than pqpq that are not relatively prime to pqpq are p,2p,,(q1)pp, 2p, \dots, (q - 1)p. It’s easy to see that there are q1q - 1 such numbers.

    -

    Similarly, there are p1p - 1 numbers less than pqpq that are not relatively prime to pqpq and the union of these 2 sets is empty since there is no such xx that satisfy pxp | x, qxq | x and x<pqx < pq.

    -

    Therefore, φ(pq)=pq1(p1)(q1)=(p1)(q1)\varphi(pq) = pq - 1 - (p - 1) - (q - 1) = (p - 1)(q - 1).

    - -
    -
    Property - 4 - -

    φ(pk)=pkpk1\varphi(p^k) = p^k - p^{k - 1}, if pp is prime

    -
    -
    Proof - -

    Since pp is prime, gcd(p,k)1\operatorname{gcd}(p, k) \neq 1 gives pkp | k.

    -

    Hence, numbers less than pkp^k that are not relatively prime to pkp^k are p,2p,,(pk11)pp, 2p, \dots, (p^{k - 1} - 1)p. It’s easy to see that there are pkp1=pk11\lfloor \dfrac{p ^{k}}{p} \rfloor - 1 = p^{k - 1} - 1 such numbers.

    -

    Therefore, φ(pk)=pk1(pk11)=pkpk1\varphi(p^k) = p^k - 1 - (p^{k - 1} - 1) = p^k - p^{k - 1}.

    - -
    -
    Property - 5 - -

    φ(n)\varphi(n) is multiplicative

    -
    -
    Proof - -

    Let aa and bb be two arbitrary coprime positive integers. We want to show that φ(ab)=φ(a)φ(b)\varphi(ab) = \varphi(a)\varphi(b).

    -

    From CRT, we know that for each pair of number m,nm, n that is coprime to a,ba, b, there is a unique number xx such that 0x<ab0 \leq x < ab and xm(moda)x \equiv m \pmod{a} and xn(modb)x \equiv n \pmod{b}.

    -

    Since

    -
    gcd(x,ab)=1    gcd(x,a)=1gcd(x,b)=1\operatorname{gcd}(x, ab) = 1 \iff \operatorname{gcd}(x, a) = 1 \land \operatorname{gcd}(x, b) = 1
    -

    we know such xx is also coprime to abab.

    -

    It’s easy to see echo xx which is coprime to a,ba, b can be mapped to a unique pair of numbers (m,n)(m, n) that is coprime to abab s.t 0m<a0 \leq m < a and 0n<b0 \leq n < b.

    -

    Therefore, there are φ(a)φ(b)\varphi(a)\varphi(b) numbers less than abab that are coprime to abab.

    - -
    -
    Property - 6 - -

    φ(n)=npn(11p)\varphi(n) = n\prod_{p|n}(1 - \frac{1}{p})

    -
    -
    Proof - -

    Let a positive number n=i=1kpiain = \prod_{i = 1}^k p_i^{a_i} where pip_i are distinct primes and aia_i are positive integers.

    -
    φ(n)=φ(i=1kpiai)=i=1kφ(piai)=i=1kpiaipiai1=ni=1k(11pi)\varphi(n) \\ -= \varphi(\prod_{i = 1}^k p_i^{a_i}) \\ -= \prod_{i = 1}^k \varphi(p_i^{a_i}) \\ -= \prod_{i = 1}^k p_i^{a_i} - p_i^{a_i - 1} \\ -= n\prod_{i = 1}^k(1 - \frac{1}{p_i})
    - -
    -
    Property - 7 - -

    dnφ(d)=n\sum_{d|n} \varphi(d) = n

    -
    -
    Proof - -

    Consider n1n-1 fractions 1n,2n,,n1n\dfrac{1}{n}, \dfrac{2}{n}, \dots, \dfrac{n-1}{n}.

    -

    After reducing each fraction to its simplest form, we get nn fractions, each of which has a denominator that is a divisor of nn, and the numerator of each fraction is coprime to the denominator.

    -

    Therefore dn,n1φ(d)=n1\sum_{d|n, n \ne 1} \varphi(d) = n - 1. And apply property 1, we get dnφ(d)=n\sum_{d|n} \varphi(d) = n.

    - -
    -

    Euler’s Theorem

    -
    Theorem - - (Euler's theorem) -

    If aa and nn are coprime positive integers, then

    -
    aφ(n)1(modn)a^{\varphi(n)} \equiv 1 \pmod{n}
    -
    -
    Proof - -

    Let B={b1,b2,,bφ(n)}B = \{b_1, b_2, \dots, b_{\varphi(n)}\} be the set of numbers less than nn that are coprime to nn.

    -

    Assume that there are two such numbers bib_i and bjb_j such that abiabj(modn)a b_i \equiv a b_j \pmod{n} and bibjb_i \neq b_j.

    -
    abiabj(modn)abiabj0(modn)a(bibj)0(modn)a b_i \equiv a b_j \pmod{n} \\ -a b_i - a b_j \equiv 0 \pmod{n} \\ -a (b_i - b_j) \equiv 0 \pmod{n}
    -

    Since aa and nn are coprime, na(bibj)n | a (b_i - b_j) gives nbibjn | b_i - b_j or bibj(modn)b_i \equiv b_j \pmod{n}, which contradicts with the assumption that bibjb_i \neq b_j.

    -

    What’s more, since both aa and bib_i are coprime to nn, abia b_i is also coprime to nn.

    -

    Therefore, {ab1,ab2,,abφ(n)}\{a b_1, a b_2, \dots, a b_{\varphi(n)}\} is a permutation of BB.

    -

    Hence,

    -
    i=1φ(n)abii=1φ(n)bi(modn)aφ(n)i=1φ(n)bii=1φ(n)bi(modn)aφ(n)1(modn)\prod_{i = 1}^{\varphi(n)} ab_i \equiv \prod_{i = 1}^{\varphi(n)} b_i \pmod{n} \\ -a^{\varphi(n)} \prod_{i = 1}^{\varphi(n)} b_i \equiv \prod_{i = 1}^{\varphi(n)} b_i \pmod{n} \\ -a^{\varphi(n)} \equiv 1 \pmod{n}
    - -
    -

    Fermat’s Little Theorem

    -
    Theorem - - (Fermat's Little Theorem) -

    If pp is a prime and aa is a positive integer that is not divisible by pp, then

    -
    ap11(modp)a^{p - 1} \equiv 1 \pmod{p}
    -
    -
    Proof - -

    Since pp is a prime, φ(p)=p1\varphi(p) = p - 1.

    -

    Since aa is less than pp and pp is a prime, aa must be coprime to pp.

    -

    Apply Euler’s Theorem and get ap11(modp)a^{p - 1} \equiv 1 \pmod{p}.

    - -
    -

    Wilson’s Theorem

    -
    Theorem - - (Wilson's Theorem) -
    (p1)!1(modp)    p is prime(p - 1)! \equiv -1 \pmod{p} \iff p \text{ is prime}
    -

    where pp is an integer greater than 11.

    -
    -

    We need to prove two goals:

    -
    1. p is prime    (p1)!1(modp)p \text{ is prime} \implies (p - 1)! \equiv -1 \pmod{p}
    2. -
    3. (p1)!1(modp)    p is prime(p - 1)! \equiv -1 \pmod{p} \implies p \text{ is prime}
    -
    Goal - 1 - -

    p is prime    (p1)!1(modp)p \text{ is prime} \implies (p - 1)! \equiv -1 \pmod{p}

    -

    When p=2p = 2, (p1)!=11(modp)(p - 1)! = 1 \equiv -1 \pmod{p}, which is obviously true, so we are only going to prove the case where pp is an odd prime.

    -

    We are going to prove a lemma first.

    -
    -
    Lemma - - -

    x21(modp)x ^ 2 \equiv 1 \pmod{p} has only 2 solutions where pp is a odd prime, and they are 11 and p1p - 1

    -
    -
    Proof - -
    x21(modp)x210(modp)(x1)(x+1)0(modp)x ^ 2 \equiv 1 \pmod{p} \\ -x ^ 2 - 1 \equiv 0 \pmod{p} \\ -(x - 1)(x + 1) \equiv 0 \pmod{p}
    -

    Since pp is a prime, p(x1)(x+1)p | (x - 1)(x + 1) gives px1p | x - 1 or px+1p | x + 1.

    -

    Therefore, the only solutions are 11 and p1p - 1.

    - -
    -

    Then we go back to the proof of Wilson’s Theorem.

    -
    Proof - -

    Consider Euler’s Theorem’s proof. We know that {ab1,ab2,,abφ(n)}\{a b_1, a b_2, \dots, a b_{\varphi(n)}\} is a permutation of BB, which gives the inverse of aa modulo nn is unique if nn is prime and 0<a<n0 < a < n.

    -

    Thus, we can pair up each number in BB with its inverse modulo pp except 11 and p1p - 1, whose inverse is themselves.

    -

    Therefore, we have

    -
    i=1p1i1(p1)1(modp)(p1)!1(modp)\prod_{i = 1}^{p - 1} i \equiv 1 \cdot (p - 1) \equiv -1 \pmod{p} \\ -(p - 1)! \equiv -1 \pmod{p}
    - -
    -
    Goal - 2 - -

    (p1)!1(modp)    p is prime(p - 1)! \equiv -1 \pmod{p} \implies p \text{ is prime}

    -
    -
    Proof - -

    We want to prove that non-prime pp can’t satisfy (p1)!1(modp)(p - 1)! \equiv -1 \pmod{p}.

    -

    Then minimum integer pp that is not a prime is 44, so we start from p=4p = 4.

    -

    When p>=4p >= 4, (p1)!(p1)(p2)!(p - 1)! \equiv (p - 1)(p - 2)!

    -

    Since pp is composite, let its minimum divisor be dd.

    -

    Then dpp2d \leq \sqrt{p} \leq p - 2.

    -

    We obtain (p2)!d(p2)!d(modp)(p - 2)! \equiv d \cdot \dfrac{(p - 2)!}{d} \pmod{p}.

    -

    Since dd has no inverse modulo pp (by applying CRT), we have d(p2)!d≢1(modp)d \cdot \dfrac{(p - 2)!}{d} \not\equiv 1 \pmod{p}.

    -

    Therefore, (p1)!(p1)(p2)!≢1(modp)(p - 1)! \equiv (p - 1)(p - 2)! \not\equiv -1 \pmod{p}.

    - -
    -

    Euler’s Sieve

    -
    Algorithm - - (Euler's Sieve) -

    Euler’s Sieve is an algorithm to calculate φ(x)\varphi(x) for all xnx \leq n and give the list of prime numbers less than nn in O(n)O(n) time. Notice that this algorithm can be use on any multiplicative function with slightly modification.

    - - - -
    -
    $'fn[INIT-PHI](n)$ [
    -	$p = 'varnothing$
    -	$'varphi = 'varnothing$
    -	$'varphi(1) = 1$
    -	for $i = 2$ to $n$ [
    -		$'varphi(i) = 0$
    -	]	
    -	for $i = 2$ to $m$ [
    -		if $'varphi(i) = 0$ [
    -			$'varphi(i) = i - 1$
    -			$p(|p|) = i$
    -		]
    -		for $j$ in $p$ [
    -			if $i 'cdot j > n$ [
    -				break
    -			]
    -			if $i 'bmod j = 0$ [
    -				$'varphi(i 'cdot j) = 'varphi(i) 'cdot j$
    -				break
    -			]
    -			$'varphi(i 'cdot j) = 'varphi(i) 'cdot (j - 1)$
    -		]
    -	]
    -	return $'varphi, p$
    -]
    -
    -
    Proof - of Correctness -

    By the property of φ\varphi, we know that φ(x)=x1\varphi(x) = x - 1 if xx is prime.

    -

    And for composite xx, suppose its minimum divisor is dd, then we have

    -
    φ(x)={φ(xd)dxmodd=0φ(xd)(d1)xmodd0\varphi(x) = \begin{cases} - \varphi\left(\dfrac{x}{d}\right) \cdot d & x \mod d = 0 \\ - \varphi\left(\dfrac{x}{d}\right) \cdot (d - 1) & x \mod d \neq 0 -\end{cases}
    -

    φ(1)=1\varphi(1)=1 is satisfied by the algorithm at the beginning and does not change.

    -

    Then consider an x>1x > 1.

    -

    If xx is composite, then there must be a minimum prime divisor dd, such that dxdd \leq \dfrac{x}{d}. (If this is not the case, then we can make a smaller prime divisor from xd\dfrac{x}{d}, which leads to a contradiction.)

    -

    This means dd is in the prime list pp when we reach xd\dfrac{x}{d}. And by the condition of the loop, we know that φ(x)\varphi(x) has been calculated correctly.

    -

    If xx is prime, then φ(x)\varphi(x) cannot be reached by previous iterations, so when we reach xx, φ(x)=0\varphi(x) = 0 and we set φ(x)=x1\varphi(x) = x - 1.

    -

    Therefore, the algorithm is correct.

    - -
    -
    Proof - of Time Complexity -

    By the proof of correctness, we know that φ(x)\varphi(x) is assigned exactly once for each xx except for the initial assignment.

    -

    And there are assignment statement in all loops, so the other parts will have at most the same order of time complexity as the assignment statement.

    -

    Therefore, the time complexity is O(n)O(n).

    - -
    -

    Miscellaneous

    -

    Disproof of 22n+12^{2^n} + 1 is prime for all nn

    -

    Take an anti-example n=5n = 5.

    -

    32253029026160(mod225+1)3 ^ {2 ^ {2 ^ 5}} \equiv 3029026160 \pmod{2 ^ {2 ^ 5} + 1}

    -

    This disagrees with Fermat’s Little Theorem, so the proposition is false.

    - - - - - -
    - - diff --git a/docs/note/graph-experiment.html b/docs/note/graph-experiment.html deleted file mode 100644 index 513051a..0000000 --- a/docs/note/graph-experiment.html +++ /dev/null @@ -1,102 +0,0 @@ - - - - - - - - - - - - - - - - - - - - 夜莺洞穴 - 笔记 - Euler's Totient Function - - -
    - - - - -
    返回 -
    笔记 - Euler's Totient Function
    -
    - -

    画图

    -
    -
    -
    - - -
    - - - - - -
    - - diff --git a/docs/note/mobius-function.html b/docs/note/mobius-function.html deleted file mode 100644 index e44346f..0000000 --- a/docs/note/mobius-function.html +++ /dev/null @@ -1,313 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - 夜莺洞穴 - 笔记 - 画图 - - -
    - - - - -
    返回 -
    笔记 - 画图
    -
    - -

    Mobius Function

    -

    Pre-requisite Number Theory

    -
    Assertion - - -

    We can reorder the items in a summation if the region of summation is finate, or countable but the sum is absolutely convergent.

    -
    -

    This is a well-known calculus theorem so we are not going to prove it here.

    -
    Lemma - - -
    dnf(d)=dnf(nd)\sum_{d | n} f(d) = \sum_{d | n} f\left(\frac{n}{d}\right)
    -
    -
    Proof - -

    Reverse the order of summation.

    - -
    -
    Lemma - - -
    dnedf(d,e)=enk(n/e)f(ke,e)\sum_{d | n} \sum_{e | d} f(d, e) = \sum_{e | n} \sum_{k | (n / e)} f(ke, e)
    -
    -
    Proof - -

    We just proof the two regions are the same, since the order of summation makes no difference.

    -
    dned    n=k1dd=k2e, where k1,k2 are integers    n=k1k2ed=k2e    enk1k2=(n/e)d=k2e    enk2(n/e)d=k2ed | n \wedge e | d \\ -\iff n=k_1d \wedge d=k_2e, \text{ where }k_1, k_2 \text{ are integers} \\ -\iff n=k_1k_2e \wedge d = k_2e \\ -\iff e | n \wedge k_1k_2= (n / e) \wedge d = k_2e \\ -\iff e | n \wedge k_2 | (n / e) \wedge d = k_2e
    - -
    -
    Lemma - - -

    If f(n)f(n) is a multiplicative function, then so is g(n)=dnf(d)g(n) = \sum_{d | n} f(d).

    -
    -
    Proof - -

    Suppose gcd(n1,n2)=1\gcd(n_1, n_2) = 1

    -
    g(n1n2)=dn1n2f(d)g(n_1n_2) -= \sum_{d | n_1n_2} f(d)
    -

    Since gcd(n1,n2)=1\gcd(n_1, n_2) = 1, every divisor of n1n2n_1n_2 is a unique product of a divisor of n1n_1 and a divisor of n2n_2, because for any prime pp that divides n1n2n_1n_2, it can only divide one of n1n_1 or n2n_2.

    -
    =d1n1d2n2f(d1d2)= \sum_{d_1 | n_1} \sum_{d_2 | n_2} f(d_1d_2)\\
    -

    Since f(n)f(n) is multiplicative, f(d1d2)=f(d1)f(d2)f(d_1d_2) = f(d_1)f(d_2).

    -
    =d1n1d2n2f(d1)f(d2)=(d1n1f(d1))(d2n2f(d2))=g(n1)g(n2)= \sum_{d_1 | n_1} \sum_{d_2 | n_2} f(d_1)f(d_2)\\ -= \left(\sum_{d_1 | n_1} f(d_1)\right) \left(\sum_{d_2 | n_2} f(d_2)\right)\\ -= g(n_1)g(n_2)
    - -
    -
    Lemma - - -

    If g(n)=dnf(d)g(n) = \sum_{d | n} f(d) is a multiplicative function, then so is f(n)f(n).

    -
    -
    Proof - -

    If n=1n = 1, then g(1)=f(1)=f(1×1)=g(1)g(1)=g(1)2g(1) = f(1) = f(1 \times 1) = g(1)g(1) = g(1)^2, which gives either g(1)=f(1)=0g(1) = f(1) = 0 or g(1)=f(1)=1g(1) = f(1) = 1.

    -

    If nn is prime, then g(n)=f(n)+f(1)g(n) = f(n) + f(1).

    -

    If n=n1n2n = n_1n_2 where gcd(n1,n2)=1\gcd(n_1, n_2) = 1, then we prove by induction.

    -

    Suppose ff is multiplicative for all d<nd < n.

    -
    g(n)=g(n1n2)=dn1n2f(d)=d1n1d2n2f(d1d2)g(n) \\ -= g(n_1n_2) \\ -= \sum_{d | n_1n_2} f(d) \\ -= \sum_{d_1 | n_1} \sum_{d_2 | n_2} f(d_1d_2) \\
    -

    Only f(n1n2)f(n_1n_2) is out of the induction hypothesis, so we apply the multiplicative property of ff for all other terms.

    -
    =d1n1d2n2f(d1)f(d2)f(n1)(n2)+f(n1n2)=(d1n1f(d1))(d2n2f(d2))f(n1)f(n2)+f(n1n2)=g(n1)g(n2)f(n1)f(n2)+f(n1n2)= \sum_{d_1 | n_1} \sum_{d_2 | n_2} f(d_1)f(d_2) - f(n_1)(n_2) + f(n_1n_2) \\ -= \left(\sum_{d_1 | n_1} f(d_1)\right) \left(\sum_{d_2 | n_2} f(d_2)\right) - f(n_1)f(n_2) + f(n_1n_2) \\ -= g(n_1)g(n_2) - f(n_1)f(n_2) + f(n_1n_2) \\
    -

    Move g(n1)g(n2)g(n_1)g(n_2) to the left hand side.

    -
    g(n)g(n1)g(n2)=f(n1n2)f(n1)f(n2)g(n) - g(n_1)g(n_2) = f(n_1n_2) - f(n_1)f(n_2) \\
    -

    Apply the multiplicative property of gg.

    -
    0=f(n1n2)f(n1)f(n2)0 = f(n_1n_2) - f(n_1)f(n_2) \\
    -

    Hence, ff is multiplicative.

    - -
    -

    Definition

    -
    Definition - - -

    The Mobius Function, denoted as μ(n)\mu(n), is defined by the following rules:

    -
    dnμ(d)=[n=1]\sum_{d | n} \mu(d) = [n = 1]
    -
    -

    Properties

    -
    Theorem - - (Inversion Principle) -
    f(n)=dng(d)    g(n)=dnμ(d)f(nd)f(n) = \sum_{d | n} g(d) \iff g(n) = \sum_{d | n} \mu(d) f\left(\frac{n}{d}\right)
    -
    -
    Proof - -

    Left to right:

    -
    dmμ(d)f(md)=dmμ(md)f(d)=dmμ(md)kdg(k)=dmkdμ(md)g(k)=kmd(m/k)μ(mkd)g(k)=kmg(k)d(m/k)μ(mkd)=kmg(k)d(m/k)μ(mk/mkd)=kmg(k)d(m/k)μ(d)=kmg(k)[m/k=1]=g(m)\sum_{d | m} \mu(d) f\left(\frac{m}{d}\right) \\ -= \sum_{d | m} \mu\left(\frac{m}{d}\right) f(d) \\ -= \sum_{d | m} \mu\left(\frac{m}{d}\right) \sum_{k | d} g(k) \\ -= \sum_{d | m} \sum_{k | d} \mu\left(\frac{m}{d}\right) g(k) \\ -= \sum_{k | m} \sum_{d | (m / k)} \mu\left(\frac{m}{kd}\right) g(k) \\ -= \sum_{k | m} g(k) \sum_{d | (m / k)} \mu\left(\frac{m}{kd}\right) \\ -= \sum_{k | m} g(k) \sum_{d | (m / k)} \mu\left(\frac{m}{k} / \frac{m}{kd}\right) \\ -= \sum_{k | m} g(k) \sum_{d | (m / k)} \mu(d) \\ -= \sum_{k | m} g(k) [m / k = 1] \\ -= g(m)
    -

    Right to left:

    -
    dmg(d)=dmkdμ(k)f(dk)=kmd(m/k)μ(k)f(d)=kmf(k)d(m/k)μ(k)=kmf(k)[m/k=1]=f(m)\sum_{d | m} g(d) \\ -= \sum_{d | m} \sum_{k | d} \mu(k) f\left(\frac{d}{k}\right) \\ -= \sum_{k | m} \sum_{d | (m / k)} \mu(k) f(d)\\ -= \sum_{k | m} f(k) \sum_{d | (m / k)} \mu(k) \\ -= \sum_{k | m} f(k) [m / k = 1] \\ -= f(m)
    - -
    -
    Theorem - - (Multiplicative Property) -

    The Mobius Function is a multiplicative function.

    -
    -
    Proof - -

    [n=1][n = 1] is multiplicative. Immediately apply the lemma above.

    - -
    -
    Theorem - - (General Term) -
    μ(n)={0if n has a squared prime factor1if n=1(1)kif n is a product of k distinct primes\mu(n) = \begin{cases} - 0 & \text{if $n$ has a squared prime factor} \\ - 1 & \text{if $n = 1$} \\ - (-1)^k & \text{if $n$ is a product of $k$ distinct primes} -\end{cases}
    -
    -
    Proof - -

    If n=1n = 1

    -
    d1μ(d)=μ(1)=[1=1]=1\sum_{d|1}\mu(d) = \mu(1) = [1 = 1] = 1
    -

    If n=pn = p, where pp is a prime number.

    -
    μ(p)=dpμ(d)μ(1)=[p=1]1=1\mu(p) = \sum_{d|p}\mu(d) - \mu(1) = [p = 1] - 1 = -1\\
    -

    If n=pkn = p^k, where pp is a prime number and k>1k > 1.

    -
    μ(pk)=dpkμ(d)dpk1μ(d)=[pk=1][pk1=1]=0\mu(p^k) = \sum_{d|p^k}\mu(d) - \sum_{d|p^{k-1}}\mu(d) = [p^k = 1] - [p^{k-1} = 1] = 0
    -

    If nn has more than one prime factors, we can apply multiplicative property. Therefore,

    -
    μ(n)=μ(p1a1p2a2pkak)=μ(p1a1)μ(p2a2)μ(pkak)={0μ(piai)=0 for some i(1)kμ(piai)=1 for all i={0maxai>1(1)kmaxai=1\mu(n)\\ -= \mu(p_1^{a_1}p_2^{a_2}\cdots p_k^{a_k}) \\ -= \mu(p_1^{a_1})\mu(p_2^{a_2})\cdots\mu(p_k^{a_k})\\ -= \begin{cases} - 0 & \mu(p_i^{a_i}) = 0 \text{ for some }i \\ - (-1)^k & \mu(p_i^{a_i}) = -1 \text{ for all }i -\end{cases}\\ -= \begin{cases} - 0 & \max{a_i} > 1 \\ - (-1)^k & \max{a_i} = 1 -\end{cases}
    -

    Combining all cases, we get the general term.

    - -
    -
    Theorem - - (Relation to Eular's Totient Function) -
    φ(n)=dnμ(d)nd\varphi(n) = \sum_{d | n} \mu(d)\frac{n}{d}
    -
    -
    Proof - -

    Immediate from applying the inversion principle on Propterty 7 of Euler’s Totient Function.

    - -
    - - - - - -
    - - diff --git a/docs/note/network-flow.html b/docs/note/network-flow.html deleted file mode 100644 index bc501d0..0000000 --- a/docs/note/network-flow.html +++ /dev/null @@ -1,540 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - 夜莺洞穴 - 笔记 - Mobius Function - - -
    - - - - -
    返回 -
    笔记 - Mobius Function
    -
    - -

    Network Flow

    -

    Network flow is an interesting but difficult topic in graph theory. Most algorithm have high time complexity.

    -

    Definition

    -
    Definition - - -

    A network is a simple directed graph G=(V,E)G = (V, E), where EE is anti-symmetric, with a capacity function c:ER+c: E \to \mathbb{R}^+ and two distinguished vertices, the source ss and the sink tt.

    -
    -
    Example - - -
    -
    node(50 + 150i, "s");
    -node(400 + 150i, "t");
    -node(150 + 150i, "v_1");
    -node(300 + 150i, "v_2");
    -node(200 + 250i, "v_3");
    -node(200 + 50i, "v_4");
    -edge(s, v_1, 10);
    -edge(s, v_3, 5);
    -edge(v_1, v_2, 5);
    -edge(v_1, v_3, 15);
    -edge(v_1, v_4, 10);
    -edge(v_3, v_2, 5);
    -edge(v_2, t, 10);
    -edge(v_3, t, 10);
    -edge(v_4, t, 10);
    -
    -
    -
    Definition - - -

    A flow in a graph (V,E)(V, E) is defined as a real-valued function f:ER+f: E \to \mathbb{R}^+ that satisfies the following conditions:

    -
    • Capacity Contraint: 0f(e)c(e)0 \leq f(e) \leq c(e) for all eEe \in E.
    • -
    • Flow conservation: (u,v)Ef(u,v)=(v,w)Ef(v,w)\sum_{(u, v) \in E} f(u, v) = \sum_{(v, w) \in E} f(v, w) for all v(V{s,t})v \in (V - \{s, t\}).
    -
    -
    Definition - - -

    The value of a flow ff is defined as the total flow out of the source ss minus the total flow into the source ss, noted as f=(s,v)Ef(s,v)(v,s)Ef(v,s)|f| = \sum_{(s, v) \in E} f(s, v) - \sum_{(v, s) \in E} f(v, s).

    -
    -

    Model Reduction

    -

    For non-simple digraphs, we can merge parallel edges into a single edge with the sum of the capacities and remove self-loops.

    -

    For non-anti-symmetric digraphs, we can replace (u,v),(v,u)(u, v), (v, u) by (u,v),(v,v),(v,u)(u, v'), (v', v), (v, u) where vv' is a new vertex, setting the capacity of (u,v),(v,v)(u, v'), (v, v') to be the same as (u,v)(u, v).

    -

    For multiple sources and sinks, we can add a new source ss', called supersource, and sink tt', called supersink, connecting ss' to all sources and all sinks to tt'.

    -

    Agumenting Path and Max-Flow Min-Cut Theorem

    -
    Definition - - (Properly Oriented Edge) -

    Consider there is path P=(v0,v1,,vn)P = (v_0, v_1, \dots, v_n) in the undirected copy of the netwrok GG, an edge e=(u,v)Ge = (u, v) \in G is called properly oriented with respect to PP if u=viu = v_i and v=vi+1v = v_{i + 1} for some ii and improperly oriented if u=vi+1u = v_{i + 1} and v=viv = v_i for some ii.

    -
    -
    Example - - -
    -
    node(50 + 150i, "s");
    -node(225 + 150i, "v_1");
    -node(137 + 225i, "'text{properly oriented}", "text");
    -node(400 + 150i, "t");
    -node(317 + 225i, "'text{improperly oriented}", "text");
    -node(225 + 75i, "P = (s, v_1, t)", "text");
    -edge(s, v_1, 10);
    -edge(t, v_1, 10);
    -
    -
    -
    Definition - - (Argumenting Path) -

    Consider a network GG with a flow ff. An argumenting path is a simple path P=(s,v0,v1,,vn,t)P = (s, v_0, v_1, \dots, v_n, t) in the undirected copy of the network GG satisfying the following conditions:

    -
    • For all edges ee properly oriented with respect to PP, f(e)<c(e)f(e) < c(e).
    • -
    • For all edges ee improperly oriented with respect to PP, f(e)>0f(e) > 0.
    -
    -
    Theorem - - -

    Suppose there is an argumenting path PP in the network GG with respect to the flow ff.

    -
    d=mineE{c(e)f(e)if e is properly oriented with respect to Pf(e)if e is improperly oriented with respect to P+otherwised = \min_{e \in E} \begin{cases} -c(e) - f(e) & \text{if } e \text{ is properly oriented with respect to }P\\ -f(e) & \text{if } e \text{ is improperly oriented with respect to }P\\ -+\infty & \text{otherwise} -\end{cases}
    -

    Then we can construct a new flow ff^* with value f=f+d|f^*| = |f| + d.

    -
    f(e)={f(e)+dif e is properly oriented with respect to Pf(e)dif e is improperly oriented with respect to Pf(e)otherwisef^*(e) = \begin{cases} -f(e) + d & \text{if } e \text{ is properly oriented with respect to }P\\ -f(e) - d & \text{if } e \text{ is improperly oriented with respect to }P\\ -f(e) & \text{otherwise} -\end{cases}
    -
    -
    Proof - -

    First by the definition of argumenting path, we have d>0d > 0.

    -

    And by the formula of dd, for improperly oriented edges, f(e)=f(e)d>0f^*(e) = f(e) - d > 0. For properly oriented edges, f(e)=f(e)+d<c(e)f^*(e) = f(e) + d < c(e). Other edges are unchanged. Therefore the adjusted flow ff^* is a valid flow.

    -

    The since the argument path must pass through the source ss and sink tt, the value of the new flow f=f+d|f^*| = |f| + d.

    - -
    -
    Example - - -
    -
    node(225 + 20i, "a/b'text{ stands for flow } a 'text{ out of capacity } b", "text");
    -node(10 + 100i, "f", "text");
    -node(50 + 150i, "s");
    -node(175 + 150i, "v_1");
    -node(300 + 150i, "v_2");
    -node(425 + 150i, "t");
    -node(225 + 125i, "'dots", "text");
    -node(225 + 175i, "'dots$", "text");
    -edge(s, v_1, "5/10");
    -edge(v_2, v_1, "3/5");
    -edge(v_2, t, "0/5");
    -node(225 + 250i, "d = 3", "text");
    -node(10 + 300i, "f^*", "text");
    -node(50 + 350i, "s$");
    -node(175 + 350i, "v_1$");
    -node(300 + 350i, "v_2$");
    -node(425 + 350i, "t$");
    -node(225 + 325i, "'dots$$", "text");
    -node(225 + 375i, "'dots$$$", "text");
    -edge(s$, v_1$, "8/10");
    -edge(v_2$, v_1$, "0/5");
    -edge(v_2$, t$, "3/5");
    -
    -
    -
    Definition - - (Cut) -

    A cut is a partition of the vertices VV into two sets PP and P=VP\overline{P} = V - P such that sSs \in S and tTt \in T.

    -
    -
    Definition - - (Capacity of a Cut) -

    The capacity of a cut (P,P)(P, \overline{P}) is defined as the sum of the capacities of the edges from PP to P\overline{P}, denoted as C(P,P)=(u,v)E,uP,vPc(u,v)C(P, \overline{P}) = \sum_{(u, v) \in E, u \in P, v \in \overline{P}} c(u, v).

    -
    -
    Example - - -
    -
    node(50 + 150i, "s");
    -node(400 + 150i, "t", "light");
    -node(150 + 150i, "v_1");
    -node(300 + 150i, "v_2", "light");
    -node(200 + 250i, "v_3", "light");
    -node(200 + 50i, "v_4");
    -edge(s, v_1, 10);
    -edge(s, v_3, 5);
    -edge(v_1, v_2, 5);
    -edge(v_1, v_3, 15);
    -edge(v_1, v_4, 10);
    -edge(v_3, v_2, 5);
    -edge(v_2, t, 10);
    -edge(v_3, t, 10);
    -edge(v_4, t, 10);
    -node(200 + 290i, "C(P, 'overline{P}) = 35", "text");
    -
    -
    -
    Theorem - - -

    For any flow ff in the network GG, and any cut (P,P)(P, \overline{P}), we have

    -
    fC(P,P)|f| \leq C(P, \overline{P})
    -
    -
    Proof - -

    Consider flows enter P{s}P - \{s\} and leave P{s}\overline{P} - \{s\}, we have

    -
    0=u(Ps)0=u(Ps)(vV,(u,v)Ef(u,v)vV,(v,u)Ef(v,u))=u(Ps)(vP,(u,v)Ef(u,v)vP,(v,u)Ef(v,u)+vP,(u,v)Ef(u,v)vP,(v,u)Ef(v,u))=u(Ps)(vP,(u,v)Ef(u,v)vP,(v,u)Ef(v,u))+u(Ps)(vP,(u,v)Ef(u,v)vP,(v,u)Ef(v,u))=uP,vP,(u,v)Ef(u,v)uP,vP,(v,u)Ef(v,u)+u(Ps)(vP,(u,v)Ef(u,v)vP,(v,u)Ef(v,u))(Note: Simple graph.)=u(Ps)(vP,(u,v)Ef(u,v)vP,(v,u)Ef(v,u))(Note: First 2 summations have same region.)=(uP,vP,(u,v)Ef(u,v)uP,vP,(v,u)Ef(v,u))(vP,(s,v)Ef(s,v)vP,(v,s)Ef(v,s))(uP,vP,(u,v)Ef(u,v)uP,vP,(v,u)Ef(v,u))(vV,(s,v)Ef(s,v)vV,(v,s)Ef(v,s))=uP,vP,(u,v)Ef(u,v)uP,vP,(v,u)Ef(v,u)fuP,vP,(u,v)Ec(u,v)uP,vP,(v,u)Ec(v,u)f=C(P,P)f0\\ -= \sum_{u \in (P - {s})} 0\\ -= \sum_{u \in (P - {s})} \left(\sum_{v \in V, (u, v) \in E} f(u, v) - \sum_{v \in V, (v, u) \in E} f(v, u)\right)\\ -= \sum_{u \in (P - {s})} \left(\sum_{v \in P, (u, v) \in E} f(u, v) - \sum_{v \in P, (v, u) \in E} f(v, u) + \sum_{v \in \overline{P}, (u, v) \in E} f(u, v) - \sum_{v \in \overline{P}, (v, u) \in E} f(v, u)\right)\\ -= \sum_{u \in (P - {s})} \left(\sum_{v \in P, (u, v) \in E} f(u, v) - \sum_{v \in P, (v, u) \in E} f(v, u)\right) + \sum_{u \in (P - {s})}\left(\sum_{v \in \overline{P}, (u, v) \in E} f(u, v) - \sum_{v \in \overline{P}, (v, u) \in E} f(v, u)\right)\\ -= \sum_{u \in P, v \in P, (u, v) \in E} f(u, v) - \sum_{u \in P, v \in P, (v, u) \in E} f(v, u) + \sum_{u \in (P - {s})}\left(\sum_{v \in \overline{P}, (u, v) \in E} f(u, v) - \sum_{v \in \overline{P}, (v, u) \in E} f(v, u)\right) \text{(Note: Simple graph.)}\\ -= \sum_{u \in (P - {s})}\left(\sum_{v \in \overline{P}, (u, v) \in E} f(u, v) - \sum_{v \in \overline{P}, (v, u) \in E} f(v, u)\right) \text{(Note: First 2 summations have same region.)}\\ -= \left(\sum_{u \in P, v \in \overline{P}, (u, v) \in E} f(u, v) - \sum_{u \in P, v \in \overline{P}, (v, u) \in E} f(v, u)\right) - \left(\sum_{v \in \overline{P}, (s, v) \in E} f(s, v) - \sum_{v \in \overline{P}, (v, s) \in E} f(v, s)\right)\\ -\le \left(\sum_{u \in P, v \in \overline{P}, (u, v) \in E} f(u, v) - \sum_{u \in P, v \in \overline{P}, (v, u) \in E} f(v, u)\right) - \left(\sum_{v \in V, (s, v) \in E} f(s, v) - \sum_{v \in V, (v, s) \in E} f(v, s)\right) \\ -= \sum_{u \in P, v \in \overline{P}, (u, v) \in E} f(u, v) - \sum_{u \in P, v \in \overline{P}, (v, u) \in E} f(v, u) - |f|\\ -\le \sum_{u \in P, v \in \overline{P}, (u, v) \in E} c(u, v) - \sum_{u \in P, v \in \overline{P}, (v, u) \in E} c(v, u) - |f|\\ -= C(P, \overline{P}) - |f|
    -

    And move the f|f| to the left side, we have fC(P,P)|f| \leq C(P, \overline{P}).

    - -
    -
    Theorem - - (Max-Flow Min-Cut Theorem) -

    If the equality f=C(P,P)|f| = C(P, \overline{P}) holds for some flow ff and cut (P,P)(P, \overline{P}), then the flow ff is a maximum flow and the cut (P,P)(P, \overline{P}) is a minimum cut. And the equality hold if and only if f(i,j)=c(i,j)f(i, j) = c(i, j) for all (i,j)E(i, j) \in E with iPi \in P and jPj \in \overline{P} and f(i,j)=0f(i, j) = 0 otherwise.

    -
    -
    Proof - -

    Obtained from the above reduction when two \le is used in the proof.

    - -
    -

    Ford-Fulkerson Method

    -
    Definition - - (Residual Network) -

    Resiual Network GfG_f of a network GG with respect to a flow ff is defined as the graph with the same vertices and edges as GG and the capacity function cf:ER+c_f: E \to \mathbb{R}^+ defined as

    -
    cf(u,v)={c(u,v)f(u,v)if (u,v)Ef(v,u)if (v,u)E0otherwisec_f(u, v) = \begin{cases} -c(u, v) - f(u, v) & \text{if } (u, v) \in E\\ -f(v, u) & \text{if } (v, u) \in E\\ -0 & \text{otherwise} -\end{cases}
    -
    -
    Algorithm - - (Ford-Fulkerson Method) -

    Coninuously find an argumenting path in the residual network GfG_f and adjust the flow ff until no argumenting path can be found.

    -
    -
    Theorem - - -

    After the Ford-Fulkerson Method, the flow ff is a maximum flow.

    -
    -
    Proof - -

    First, after the Ford-Fulkerson Method, the sink tt should not be reachable from the source ss in the residual network GfG_f. Otherwise, there is an argumenting path in the residual network GfG_f.

    -

    Therefore, the vertices reachable from the source ss in the residual network GfG_f form a cut (P,P)(P, \overline{P}) with sPs \in P and tPt \in \overline{P}. There shouldn’t be a edge from PP to P\overline{P} in the residual network GfG_f, otherwise there exists a vertex in P\overline{P} reachable from the source ss, which leads to a contradiction.

    -

    Therefore, the flow ff is a maximum flow.

    -

    But this does not guarantee the termination of the algorithm. If the capacities are integers, the algorithm obviously terminates since the flow value increases and bounded. But if it is not, the algorithm may not terminate since we know there are some infinate increasing sequences in real numbers.

    - -
    -
    Algorithm - - (Dinic's Implementation of Ford-Fulkerson Method) -

    This algorithm terminates. We will provide the proof later. The time complexity is O(V2E)O(V^2E).

    - - - -
    -
    $'fn{bfs}(s, t, vertices)$ [
    -	for $u$ in $vertices$ [
    -		$u.level = -1$
    -	]
    -	$q = {s}$
    -	$s.level = -1$
    -	while $'neg 'fn{QUQUE-EMPTY}(q)$ [
    -		$u = 'fn{QUQUE-POP}(q)$
    -		for $e$ in $u.edges$ [
    -			if $e.v.level = -1$ and $e.cap > 0$ [
    -				$e.v.level = u.level + 1$
    -				$'fn{QUQUE-PUSH}(q, e.v)$
    -			]
    -		]
    -	]
    -	return $t.level \neq -1$
    -]
    -
    -$'fn{dfs}(u, f, t)$ [
    -	if $u = t 'lor f 'le 0$ [
    -		return $f$
    -	]
    -	$r = 0$
    -	while $u.current < |u.edges|$ [
    -		$e = u.edges(u.current)$
    -		if $e.cap > 0 'land e.v.level = u.level + 1$ [
    -			$delta = 'fn{dfs}(e.v, 'min(f - r, e.cap), t)$
    -			$e.cap -= delta$
    -			$e.rev.cap += delta$
    -			$r += delta$
    -			if $r = f$ [
    -				return $r$
    -			]
    -		]
    -		$u.current += 1$
    -	]
    -	return $r$
    -]
    -
    -# G is the network, c is the capacity function, s is the source, t is the sink
    -# Return the maximum flow and the flow function
    -$'fn{dinic}(digraph, c, s, t)$ [
    -	$vertices = 'varnothing$
    -	$edges = 'varnothing$
    -	for $u$ in $digraph.vertices$ [
    -		$vertices(u) = $ new $'text{Vertex}'{level: -1, edges: 'varnothing, current: 0'}$
    -	]
    -	for $e$ in $digraph.edges$ [
    -		$u = vertices(e.u)$
    -		$v = vertices(e.v)$
    -		$proper = $ new $'text{Edge}'{v: v, cap: c(e), rev: $null$'}$
    -		$improper = $ new $'text{Edge}'{v: u, cap: 0, rev: proper'}$
    -		$proper.rev = improper$
    -		$u.edges(|u.edges|) = proper$
    -		$v.edges(|v.edges|) = improper$
    -		$edges(e) = proper$
    -	]
    -	$flow = 0$
    -	$s = vertices(s)$
    -	$t = vertices(t)$
    -	while $'fn{bfs}(s, t, vertices)$ [
    -		for $u$ in $vertices$ [
    -			$u.current = 0$
    -		]
    -		$flow += 'fn{dfs}(s, +'infty, t)$
    -	]
    -	$f = 'varnothing$
    -	for $e$ in $digraph.edges$ [
    -		$f(e) = edges(e).rev.cap$
    -	]
    -	return $flow, f$
    -]
    -
    -
    Proof - of Correctness -

    To be continued.

    - -
    -

    Min-Cost Flow

    -

    To be continued.

    -

    Bipartite Matching

    -

    To be continued.

    - - - - - -
    - - diff --git a/docs/note/numerical-differentiation.html b/docs/note/numerical-differentiation.html deleted file mode 100644 index e288048..0000000 --- a/docs/note/numerical-differentiation.html +++ /dev/null @@ -1,265 +0,0 @@ - - - - - - - - - - - - - - - - - - - 夜莺洞穴 - 笔记 - Network Flow - - -
    - - - - -
    返回 -
    笔记 - Network Flow
    -
    - -

    Numeric Differentiation

    -

    Finite Difference

    -

    By defination of differentiation, we have

    -
    f(x)=limh0f(x+h)f(x)hf'(x) = \lim_{h \to 0} \frac{f(x+h) - f(x)}{h}
    -

    By Taylor’s Theorem, if ff is twice differentiable, we have

    -
    f(x+h)=f(x)+hf(x)+h22f(ξ)f(x+h) = f(x) + hf'(x) + {h^2 \over 2} f''(\xi)
    -

    where ξ\xi is a real number between xx and x+hx + h.

    -

    Then we have

    -
    f(x)=f(x+h)f(x)hh2f(ξ)f(x+h)f(x)hf'(x) = \frac{f(x+h) - f(x)}{h} - {h \over 2} f''(\xi) \approx \frac{f(x+h) - f(x)}{h}
    -

    In this case h2f(ξ)-{h \over 2} f''(\xi) become error.

    -

    Generally, if error is O(hk)O(h^k), we say the method is of order kk.

    -
    f(x+h)=f(x)+hf(x)+h22f(x)+h36f(ξ1)f(xh)=f(x)hf(x)+h22f(x)h36f(ξ2)f(x + h) = f(x) + hf'(x) + {h^2 \over 2}f''(x) + {h^3 \over 6}f'''(\xi_1)\\ -f(x - h) = f(x) - hf'(x) + {h^2 \over 2}f''(x) - {h^3 \over 6}f'''(\xi_2)
    -

    where ξ1\xi_1 is a real number between xx and x+hx + h, and ξ2\xi_2 is a real number between xhx - h and xx.

    -

    Then we have

    -
    f(x)=f(x+h)f(xh)2hh212f(ξ1)h212f(ξ2)f(x+h)f(xh)2hf'(x) = \frac{f(x+h) - f(x - h)}{2h} - {h^2 \over 12} f'''(\xi_1) - {h^2 \over 12} f'''(\xi_2) \approx \frac{f(x+h) - f(x - h)}{2h}
    -

    So we obtain a method of order 2. And obviously this can be written as

    -
    f(x)=f(x+h)f(xh)2hh26f(ξ)f(x+h)f(xh)2hf'(x) = \frac{f(x+h) - f(x - h)}{2h} - {h^2 \over 6} f'''(\xi) \approx \frac{f(x+h) - f(x - h)}{2h}
    -

    However, we wonder if we can get the derivative from f(x)f(x), f(x+h)f(x+h) and f(x+2h)f(x+2h).

    -

    Consider

    -
    f(x+2h)=f(x)+2hf(x)+2h2f(x)+4h33f(ξ1)f(x+h)=f(x)+hf(x)+h22f(x)+h36f(ξ2)\begin{gather} -f(x + 2h) = f(x) + 2hf'(x) + 2h^2 f''(x) + {4h^3 \over 3} f'''(\xi_1)\\ -f(x + h) = f(x) + hf'(x) + {h^2 \over 2} f''(x) + {h^3 \over 6} f'''(\xi_2) -\end{gather}
    -

    We want to remove f(x)f''(x) so we subtract 44 times the second equation from the first one and get

    -
    f(x+2h)4f(x+h)=3f(x)2hf(x)+2h33f(ξ1)2h33f(ξ2)f(x)=3f(x)+4f(x+h)f(x+2h)2h+h23f(ξ1)h23f(ξ2)3f(x)+4f(x+h)f(x+2h)2hf(x + 2h) - 4 f(x + h) = -3 f(x) - 2h f'(x) + {2h^3 \over 3} f'''(\xi_1) - {2h^3 \over 3} f'''(\xi_2)\\ -f'(x) = \frac{- 3 f(x) + 4 f(x + h) - f(x + 2h) }{2h} + {h^2 \over 3} f'''(\xi_1) - {h^2 \over 3} f'''(\xi_2) \approx \frac{- 3 f(x) + 4 f(x + h) - f(x + 2h)}{2h}
    -

    The error is O(h2)O(h^2). The f(x2h)f(x - 2h) case is symmetric, so we just skip it.

    -

    Notice that since hh is used as denominator, we can’t make it too small.

    -

    Higher Order Derivatives

    -

    Differentiation Matrix

    -

    While it’s possible to get higher order derivatives by Taylor’s Theorem, it’s often hard.

    -

    So we apply first order derivative many times.

    -

    Notice that in the previous section, the first order derivative is a linear combination of f(x)f(x) near xx.

    -

    The operation can be written as a matrix multiplication. Let xn=x+nhx_n = x + nh, then we have

    -
    (f(x1)f(x2)f(x3)f(x4)f(xn))12h(3410012100012100012000003)(f(x1)f(x2)f(x3)f(x4)f(xn))\begin{pmatrix} -f'(x_1)\\ -f'(x_2)\\ -f'(x_3)\\ -f'(x_4)\\ -\vdots\\ -f'(x_n) -\end{pmatrix} -\approx -\dfrac{1}{2h} -\begin{pmatrix} --3 & 4 & -1 & 0 & \cdots & 0\\ -1 & -2 & 1 & 0 & \cdots & 0\\ -0 & 1 & -2 & 1 & \cdots & 0\\ -0 & 0 & 1 & -2 & \cdots & 0\\ -\vdots & \vdots & \vdots & \vdots & \ddots & \vdots\\ -0 & 0 & 0 & 0 & \cdots & -3 -\end{pmatrix} -\begin{pmatrix} -f(x_1)\\ -f(x_2)\\ -f(x_3)\\ -f(x_4)\\ -\vdots\\ -f(x_n) -\end{pmatrix}
    -

    So we can have a general formula

    -
    (f(k)(x1)f(k)(x2)f(k)(x3)f(k)(x4)f(k)(xn))(12h)k(3410012100012100012000003)k(f(x1)f(x2)f(x3)f(x4)f(xn))\begin{pmatrix} -f^{(k)}(x_1)\\ -f^{(k)}(x_2)\\ -f^{(k)}(x_3)\\ -f^{(k)}(x_4)\\ -\vdots\\ -f^{(k)}(x_n) -\end{pmatrix} -\approx -(\dfrac{1}{2h})^k -\begin{pmatrix} --3 & 4 & -1 & 0 & \cdots & 0\\ -1 & -2 & 1 & 0 & \cdots & 0\\ -0 & 1 & -2 & 1 & \cdots & 0\\ -0 & 0 & 1 & -2 & \cdots & 0\\ -\vdots & \vdots & \vdots & \vdots & \ddots & \vdots\\ -0 & 0 & 0 & 0 & \cdots & -3 -\end{pmatrix}^k -\begin{pmatrix} -f(x_1)\\ -f(x_2)\\ -f(x_3)\\ -f(x_4)\\ -\vdots\\ -f(x_n) -\end{pmatrix}
    -

    Interpolation and Differentiation

    -

    It’s a good idea to interpolate the function first, then differentiate the interpolation.

    -

    Typically, we can use Cubic Spline Interpolation for derivative less than 3, since it’s first and second order derivative converge to the original function.

    -

    For higher order derivative, we can use Chebyshev Polynomial Interpolation or Lagrange Polynomial Interpolation. They are polynomials and easy to differentiate.

    - - - - - -
    - - diff --git a/docs/note/numerical-integration.html b/docs/note/numerical-integration.html deleted file mode 100644 index 7acf763..0000000 --- a/docs/note/numerical-integration.html +++ /dev/null @@ -1,268 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - 夜莺洞穴 - 笔记 - Numeric Differentiation - - -
    - - - - -
    返回 -
    笔记 - Numeric Differentiation
    -
    - -

    Numeric Integration

    -

    Newton-Cotes Formula

    -

    The general idea of Newton-Cotes formula is to first interpolate the function, then integrate the interpolation.

    -
    f(x)If(x)abf(x)dxabIf(x)dxf(x) \approx I f(x)\\ -\int_a^b f(x) dx \approx \int_a^b I f(x) dx
    -

    We substitute Lagrange interpolation polynomial into the formula. Let nn be the number of points we use. (Not the degree of the polynomial)

    -
    f(x)=i=1nf(xi)j=1,jinxxjxixj+f(n)(ξ)n!i=1n(xxi)abf(x)dx=i=1nf(xi)abj=1,jinxxjxixjdx+abf(n)(ξ)n!i=1n(xxi)dxf(x) = \sum_{i=1}^n f(x_i) \prod_{j=1, j \neq i}^n\dfrac{x-x_j}{x_i-x_j} + \dfrac{f^{(n)}(\xi)}{n!} \prod_{i=1}^n (x-x_i)\\ -\int_a^b f(x) dx = \sum_{i=1}^n f(x_i) \int_a^b \prod_{j=1, j \neq i}^n\dfrac{x-x_j}{x_i-x_j} dx + \int_a^b \dfrac{f^{(n)}(\xi)}{n!} \prod_{i=1}^n (x-x_i) dx
    -

    The part abf(n)(ξ)n!i=1n(xxi)dx\int_a^b \dfrac{f^{(n)}(\xi)}{n!} \prod_{i=1}^n (x-x_i) dx is called the remainder term, denoted as E(f)E(f).

    -

    The abj=1,jinxxjxixjdx\int_a^b \prod_{j=1, j \neq i}^n\dfrac{x-x_j}{x_i-x_j} dx part is unrelated to f(x)f(x), so we can precompute it and store it in a table.

    -

    As for the remainder term, sadly we have no way to find a closed form. So we just keep the ugly form.

    -

    Degree of Precision

    -
    Definition - - -

    The degree of precision of a numerical integration formula is the largest integer nn such that the formula is exact for all polynomials of degree nn or less.

    -
    -

    To find out a formula’s degree of precision, we can verify it on 1,x,x2,1, x, x^2, \cdots. Since integration is a linear operator, if the formula is exact for 1,x,x2,,xn1, x, x^2, \cdots, x^n, then it’s exact for their linear combination. If they are not exact, of course its degree of precision is less than nn since the counterexample exists.

    -
    Theorem - - -

    If we use nn points in Lagrange Interpolation, then the degree of precision is at least n1n-1.

    -
    -
    Proof - -

    For any polynomial f(x)f(x) of degree n1n-1, Lagrange Interpolation restores f(x)f(x) exactly. So the degree of precision is at least n1n-1.

    - -
    -
    Theorem - - -

    If we use nn equally spaced points, then the degree of precision is at least nn when nn is odd, and n1n-1 when nn is even.

    -
    -

    This is obvious since the points are symmetric, so the odd degree terms are cancelled out.

    -

    Trapezoidal Rule

    -

    If we just take the two end points, we get the Trapezoidal Rule.

    -
    f(x)=f(a)xbab+f(b)xaba+f(ξ)2(xa)(xb)abf(x)dx=ba2(f(a)+f(b))f(ξ)12(ba)3f(x) = f(a)\dfrac{x-b}{a-b} + f(b)\dfrac{x-a}{b-a} + \dfrac{f''(\xi)}{2}(x-a)(x-b)\\ -\int_a^b f(x) dx = \dfrac{b-a}{2}(f(a) + f(b)) - \dfrac{f''(\xi)}{12}(b-a)^3
    -
    Collary - - -

    The degree of precision is 11.

    -
    -
    Proof - -

    When f(x)=1f(x) = 1, abf(x)dx=ba\int_a^b f(x) dx = b-a. The formula is exact.

    -

    When f(x)=xf(x) = x, abf(x)dx=b2a22\int_a^b f(x) dx = \dfrac{b^2-a^2}{2}. The formula is exact.

    -

    When f(x)=x2f(x) = x^2, abf(x)dx=b3a33\int_a^b f(x) dx = \dfrac{b^3-a^3}{3}. The formula is not exact.

    - -
    -

    Simpson’s Rule

    -

    If we take the 33 points, we get the Simpson’s Rule.

    -
    abf(x)dx=ba6(f(a)+4f(a+b2)+f(b))f(3)(ξ)90(ba)5\int_a^b f(x) dx = \dfrac{b-a}{6}(f(a) + 4f(\dfrac{a + b}{2}) + f(b)) - \dfrac{f^{(3)}(\xi)}{90}(b-a)^5
    -

    The degree of precision is 33. Proof is trivial.

    -

    Boole’s Rule

    -

    If we take the 55 points, we get the Boole’s Rule.

    -
    abf(x)dx=ba90(7f(a)+32f(3a+b4)+12f(a+b2)+32f(a+3b4)+7f(b))f(5)(ξ)2880(ba)7\int_a^b f(x) dx = \dfrac{b-a}{90}(7f(a) + 32f(\dfrac{3a + b}{4}) + 12f(\dfrac{a + b}{2}) + 32f(\dfrac{a + 3b}{4}) + 7f(b)) - \dfrac{f^{(5)}(\xi)}{2880}(b-a)^7
    -

    The degree of precision is 55. Proof is trivial.

    -

    Composite Newton-Cotes Formula

    -

    When the number of points exceeds 99, some of the coefficients become negative. This is not good for numerical computation. So we can divide the interval into subintervals, and apply the Newton-Cotes formula on each subinterval.

    -

    Take composite Simpson’s Rule as an example.

    -
    abf(x)dx=i=0(n1)/2ba3n(f(x2i)+4f(x2i+1)+f(x2i+2))f(3)(ξ)90(ba)5\int_a^b f(x) dx = \sum_{i=0}^{(n - 1)/2} \dfrac{b - a}{3n}(f(x_{2i}) + 4f(x_{2i+1}) + f(x_{2i+2})) - \dfrac{f^{(3)}(\xi)}{90}(b-a)^5
    -

    The error term is the sum of the error terms of each subinterval, whose form is exactly the same as the error term of the original Simpson’s Rule.

    -

    Open Newton-Cotes Formula

    -

    Some functions are not defined at the end points, such as sinxx\dfrac{\sin x}{x}. If we want to integrate it from 00 to 11, we can use the Open Newton-Cotes Formula.

    -

    The idea of Open Newton-Cotes Formula is simply avoiding the end points.

    -

    Midpoint Rule is the simplest Open Newton-Cotes Formula.

    -
    abf(x)dx=(ba)f(a+b2)f(ξ)24(ba)3\int_a^b f(x) dx = (b - a)f(\dfrac{a + b}{2}) - \dfrac{f''(\xi)}{24}(b-a)^3
    -

    Adaptive Quadrature

    -

    Some part of the function changes rapidly, while some part changes slowly. If we use the same number of points in the whole interval, we may get Time Limit Exceeded. So we can use Adaptive Quadrature to use more points in the rapidly changing part, and less points in the slowly changing part.

    -

    We first start recursion with the whole interval, then divide the interval into two subintervals, and recurse on each subinterval. The key is comparing the difference between the integral of the whole interval and the sum of the integrals of the two subintervals. If the difference is small enough, we can stop the recursion.

    -

    Gaussian Quadrature

    -

    The idea of Gaussian Quadrature is to choose the points xix_i and weights wiw_i such that the degree of precision is as high as possible.

    -
    Theorem - - -

    If we use nn points in Newton-Cotes formula, then the degree of precision is at most 2n12n-1.

    -
    -
    Proof - -

    Proof by contradiction. Suppose that some one choose points xix_i and weights wiw_i such that the degree of precision is 2n2n.

    -

    Then let f(x)=i=1n(xxi)2f(x) = \prod_{i = 1}^n (x - x_i)^2, which is a polynomial of degree 2n2n. Then the formula is exact for f(x)f(x).

    -

    Hence

    -
    abf(x)dx=i=1nwif(xi)=i=1nwi0=0\int_a^b f(x) dx = \sum_{i=1}^n w_i f(x_i) = \sum_{i = 1}^n w_i \cdot 0 = 0
    -

    However, f(x)=0f(x) = 0 holds only when x=xix = x_i for all ii, and f(x)>0f(x) > 0 for all other places. So the integral is positive. Contradiction.

    - -
    -
    Definition - - -

    If nn points xix_i and weights wiw_i satisfy the degree of precision is 2n12n-1, then the intergation formula is called Gaussian Quadrature.

    -
    -

    Legendre-Gauss Quadrature

    -

    The idea is picking xix_i as the roots of Legendre polynomial Pn(x)P_n(x). In this way, the degree of precision is exactly 2n12n-1.

    -

    To make life easier, we can normalize the interval to [1,1][-1, 1]. This do no harm to the generality of the formula.

    -
    Proof - -

    Let f(x)f(x) be a polynomial of degree 2n12n-1. Then f(x)=Pn(x)g(x)+r(x)f(x) = P_n(x)g(x) + r(x), where g(x)g(x), r(x)r(x) are two polynomial of degree less than nn.

    -

    It’s trival that g(x)g(x) can be express as a linear combination of P0(x),P1(x),,Pn1(x)P_0(x), P_1(x), \cdots, P_{n-1}(x).

    -

    By the othogonality of Legendre polynomial and linearity of integration, we have

    -
    11f(x)dx=11Pn(x)g(x)dx+11r(x)dx=11r(x)dx\int_{-1}^1 f(x) dx = \int_{-1}^1 P_n(x)g(x) dx + \int_{-1}^1 r(x) dx = \int_{-1}^1 r(x) dx
    -

    By the previous theorem, we know that the the integration formula is at least for r(x)r(x), so the degree of precision is at least 2n12n-1.

    -

    Since the degree of precision is at most 2n12n-1, the degree of precision is exactly 2n12n-1.

    - -
    -

    The error term is

    -
    E(f)=f(2n)(ξ)(2n)!11i=1n(xxi)2dx=f(2n)(ξ)(2n)!ab(π(x))2dxE(f) = \dfrac{f^{(2n)}(\xi)}{(2n)!}\int_{-1}^1 \prod_{i=1}^n (x - x_i)^2 dx = \dfrac{f^{(2n)}(\xi)}{(2n)!}\int_a^b(\pi(x))^2dx
    -

    where π(x)=i=1n(xxi)\pi(x) = \prod_{i=1}^n (x - x_i).

    -
    Proof - -

    Consider Hermite Interpolation Polynomial H(x)H(x) of f(x)f(x) at xix_i.

    -
    H(xi)=f(xi)H(xi)=f(xi)H(x_i) = f(x_i)\\ -H'(x_i) = f'(x_i)
    -

    Then H(x)H(x) is a polynomial of degree at most 2n12n-1.

    -
    f(x)=H(x)+f(2n)(ξ)(2n)!(π(x))211f(x)dx=11H(x)dx+f(2n)(ξ)(2n)!11(π(x))2dxf(x) = H(x) + \dfrac{f^{(2n)}(\xi)}{(2n)!}(\pi(x))^2 \\ -\int_{-1}^1 f(x) dx = \int_{-1}^1 H(x) dx + \dfrac{f^{(2n)}(\xi)}{(2n)!}\int_{-1}^1 (\pi(x))^2 dx
    -

    Since H(x)H(x) is a polynomial of degree at most 2n12n-1, the integration formula is exact for H(x)H(x).

    -

    By the condition of Hermite Interpolation Polynomial, we know that H(xi)=f(xi)H(x_i) = f(x_i).

    -
    11H(x)dx=i=1nwiH(xi)=i=1nwif(xi)\int_{-1}^1 H(x) dx = \sum_{i=1}^n w_i H(x_i) = \sum_{i=1}^n w_i f(x_i)
    -

    Substitute it into the previous equation, we get

    -
    f(x)=H(x)+f(2n)(ξ)(2n)!(π(x))211f(x)dx=i=1nwif(xi)+f(2n)(ξ)(2n)!11(π(x))2dxf(x) = H(x) + \dfrac{f^{(2n)}(\xi)}{(2n)!}(\pi(x))^2 \\ -\int_{-1}^1 f(x) dx = \sum_{i=1}^n w_i f(x_i) + \dfrac{f^{(2n)}(\xi)}{(2n)!}\int_{-1}^1 (\pi(x))^2 dx
    - -
    -

    Weights of Legendre-Gauss Quadrature

    -
    Theorem - - -

    The weights of Legendre-Gauss Quadrature can be calculated by the following formula.

    -
    wi=11(π(x))2=2(1xi2)[Pn(xi)]2w_i = \int_{-1}^1 (\pi(x))^2 = \dfrac{2}{(1 - x_i^2)[P_n'(x_i)]^2}
    -
    -
    Proof - -

    We first find π(x)\pi'(x) and π(xi)\pi'(x_i) for i=1,2,,ni = 1, 2, \cdots, n.

    -
    π(x)=j=1n(xxj)=(xxi)j=1,jin(xxj)π(x)=j=1,jin(xxj)+(xxi)(j=1,jin(xxj))π(xi)=j=1,jin(xixj)+(xixi)(j=1,jin(xixj))=j=1,jin(xixj)\pi(x) = \prod_{j=1}^n (x - x_j) = (x - x_i) \prod_{j=1, j \neq i}^n (x - x_j)\\ -\pi'(x) = \prod_{j=1, j \neq i}^n (x - x_j) + (x - x_i)(\prod_{j=1, j \neq i}^n (x - x_j))'\\ -\pi'(x_i) = \prod_{j=1, j \neq i}^n (x_i - x_j) + (x_i - x_i)(\prod_{j=1, j \neq i}^n (x_i - x_j))' = \prod_{j=1, j \neq i}^n (x_i - x_j)
    -

    Consider the Lagrange Interpolation Polynomial li(x)l_i(x) of π(x)\pi(x) at xix_i.

    -

    It can be expressed as

    -
    li(x)=π(x)(xxi)π(xi)=Pn(x)(xxi)Pn(xi)l_i(x) = \dfrac{\pi(x)}{(x - x_i)\pi'(x_i)} = \dfrac{P_n(x)}{(x - x_i)P_n'(x_i)}
    -

    Since li(x)Pn(x)l_i(x)P_n'(x) is a polynomial of degree 2n22n - 2, we have

    -
    11li(x)Pn(x)dx=j=1nwjli(xj)Pn(xj)\int_{-1}^1 l_i(x)P_n'(x) dx = \sum_{j=1}^n w_j l_i(x_j) P_n'(x_j)
    -

    Since li(xj)=0l_i(x_j) = 0 for jij \neq i, and li(xi)=1l_i(x_i) = 1, we have

    -
    11li(x)Pn(x)dx=wili(xi)Pn(xi)=wiPn(xi)\int_{-1}^1 l_i(x)P_n'(x) dx = w_i l_i(x_i) P_n'(x_i) = w_i P_n'(x_i)
    -

    On the other hand,

    -
    11li(x)Pn(x)dx=11Pn(x)Pn(x)(xxi)Pn(xi)dx\int_{-1}^1 l_i(x)P_n'(x) dx = \int_{-1}^1 \dfrac{P_n(x)P_n'(x)}{(x - x_i)P_n'(x_i)} dx
    -

    Hence,

    -
    wi=1(Pn(x))211Pn(x)Pn(x)xxjdxw_i = \dfrac{1}{(P_n'(x))^2} \int_{-1}^1 \dfrac{P_n(x)P_n'(x)}{x - x_j} dx
    -

    Similarly, we move on to the next step.

    -
    11(li(x))2=11(Pn(x))2(xxi)2(Pn(xi))2dx=1(Pn(xi))211(Pn(x))2(xxi)2dx=1(Pn(xi))211(Pn(x))2d1xxi=1(Pn(xi))2(((Pn(x))2xxi)11+111xxid(Pn(x))2)=1(Pn(xi))2(((Pn(1))21xi(Pn(1))21xi)+211Pn(x)Pn(x)xxidx)=1(Pn(xi))2(11+xi+11xi)+2(Pn(xi))211Pn(x)Pn(x)xxidx=2(1xi2)(Pn(xi))2+2wi\int_{-1}^1 (l_i(x))^2\\ -= \int_{-1}^1 \dfrac{(P_n(x))^2}{(x - x_i)^2(P_n'(x_i))^2} dx\\ -= \dfrac{1}{(P_n'(x_i))^2}\int_{-1}^1 \dfrac{(P_n(x))^2}{(x - x_i)^2} dx\\ -= \dfrac{1}{(P_n'(x_i))^2}\int_{-1}^1 -(P_n(x))^2 d \dfrac{1}{x - x_i}\\ -= \dfrac{1}{(P_n'(x_i))^2} ((\dfrac{-(P_n(x))^2}{x - x_i})|_{-1}^1 + \int_{-1}^1 \dfrac{1}{x - x_i} d(P_n(x))^2)\\ -= \dfrac{1}{(P_n'(x_i))^2} ((\dfrac{-(P_n(1))^2}{1 - x_i} - \dfrac{-(P_n(-1))^2}{-1 - x_i}) + 2\int_{-1}^1 \dfrac{P_n(x)P_n'(x)}{x - x_i} dx)\\ -= -\dfrac{1}{(P_n'(x_i))^2} (\dfrac{1}{1 + x_i} + \dfrac{1}{1 - x_i}) + \dfrac{2}{(P_n'(x_i))^2}\int_{-1}^1 \dfrac{P_n(x)P_n'(x)}{x - x_i} dx\\ -= -\dfrac{2}{(1 - x_i^2)(P_n'(x_i))^2} + 2w_i\\
    -

    On the other hand, since (li(x))2(l_i(x))^2 is a polynomial of degree 2n22n - 2, we have

    -
    11(li(x))2dx=j=1nwj(li(xj))2=wi(li(xi))2=wi\int_{-1}^1 (l_i(x))^2 dx = \sum_{j=1}^n w_j (l_i(x_j))^2 = w_i (l_i(x_i))^2 = w_i
    -

    Combine the two equations, we get

    -
    wi=11(li(x))2dx=2(1xi2)(Pn(xi))2+2wiwi=2(1xi2)(Pn(xi))2w_i = \int_{-1}^1 (l_i(x))^2 dx = -\dfrac{2}{(1 - x_i^2)(P_n'(x_i))^2} + 2w_i\\ -w_i = \dfrac{2}{(1 - x_i^2)(P_n'(x_i))^2}
    - -
    -

    Weighted Gaussian Quadrature

    -

    Consider we want to integrate abρ(x)f(x)dx\int_a^b \rho(x)f(x) dx, where ρ(x)\rho(x) is a weight function. We can use the same idea to get the weighted Gaussian Quadrature.

    -

    Here we only discuss the case where ρ(x)=11+x2\rho(x) = \dfrac{1}{\sqrt {1 + x^2}}.

    -

    In this case, we use Chebyshev Zeroes as the points xix_i. The proof is similar to the proof of Gauss-Legendre Quadrature, we omit it here.

    -

    Lobatto Quadrature

    -

    Lobatto’s idea is use aa, bb and the roots of Pn2(x)P'_{n-2}(x) as the points xix_i.

    -

    In this way, it uses the end points as information.

    - - - - - -
    - - diff --git a/src/routes/note/network-flow/+page.md b/src/routes/note/network-flow/+page.md index dce9ad6..0b7c7c1 100644 --- a/src/routes/note/network-flow/+page.md +++ b/src/routes/note/network-flow/+page.md @@ -341,15 +341,15 @@ $'fn{dfs}(u, f, t)$ [ return $r$ ] -# G is the network, c is the capacity function, s is the source, t is the sink +# d is the digraph of the network, c is the capacity function, s is the source, t is the sink # Return the maximum flow and the flow function -$'fn{dinic}(digraph, c, s, t)$ [ +$'fn{dinic}(d, c, s, t)$ [ $vertices = 'varnothing$ $edges = 'varnothing$ - for $u$ in $digraph.vertices$ [ + for $u$ in $d.vertices$ [ $vertices(u) = $ new $'text{Vertex}'{level: -1, edges: 'varnothing, current: 0'}$ ] - for $e$ in $digraph.edges$ [ + for $e$ in $d.edges$ [ $u = vertices(e.u)$ $v = vertices(e.v)$ $proper = $ new $'text{Edge}'{v: v, cap: c(e), rev: $null$'}$ @@ -369,7 +369,7 @@ $'fn{dinic}(digraph, c, s, t)$ [ $flow += 'fn{dfs}(s, +'infty, t)$ ] $f = 'varnothing$ - for $e$ in $digraph.edges$ [ + for $e$ in $d.edges$ [ $f(e) = edges(e).rev.cap$ ] return $flow, f$ diff --git a/svelte.config.js b/svelte.config.js index ebf40a2..7cb6a9d 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -3,6 +3,7 @@ import mdsvexConfig from "./mdsvex.config.js"; import adapter from "@sveltejs/adapter-static"; import { vitePreprocess } from "@sveltejs/kit/vite"; import fs from "fs"; +import path from "path"; /** @@ -48,6 +49,9 @@ function toSnakeCategory(category) { function scanNotes() { let root = 'src/routes/note'; let output = 'src/lib/generated/topic-list.json'; + if (!fs.existsSync(path.dirname(output))) { + fs.mkdirSync(path.dirname(output), { recursive: true }); + } let lastGeneratedTime = fs.existsSync(output) ? fs.statSync(output).mtimeMs : 0; let lastSourceTime = fs.statSync(root).mtimeMs;