/*! For license information please see 7757.bf6158e4b73c7d8189ba.js.LICENSE.txt */ (self.webpackChunklauncher=self.webpackChunklauncher||[]).push([[7757],{1977:function(e,r){var t;!function(n){"use strict";var i=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:.5*(Math.exp(e)+Math.exp(-e))},a=Math.sinh||function(e){return Math.abs(e)<1e-9?e:.5*(Math.exp(e)-Math.exp(-e))},o=function(){throw SyntaxError("Invalid Param")};function s(e,r){var t=Math.abs(e),n=Math.abs(r);return 0===e?Math.log(n):0===r?Math.log(t):t<3e3&&n<3e3?.5*Math.log(e*e+r*r):(e/=2,r/=2,.5*Math.log(e*e+r*r)+Math.LN2)}function u(e,r){if(!(this instanceof u))return new u(e,r);var t=function(e,r){var t={re:0,im:0};if(null==e)t.re=t.im=0;else if(void 0!==r)t.re=e,t.im=r;else switch(typeof e){case"object":if("im"in e&&"re"in e)t.re=e.re,t.im=e.im;else if("abs"in e&&"arg"in e){if(!Number.isFinite(e.abs)&&Number.isFinite(e.arg))return u.INFINITY;t.re=e.abs*Math.cos(e.arg),t.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!Number.isFinite(e.r)&&Number.isFinite(e.phi))return u.INFINITY;t.re=e.r*Math.cos(e.phi),t.im=e.r*Math.sin(e.phi)}else 2===e.length?(t.re=e[0],t.im=e[1]):o();break;case"string":t.im=t.re=0;var n=e.match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),i=1,a=0;null===n&&o();for(var s=0;s0&&o();break;case"number":t.im=0,t.re=e;break;default:o()}return isNaN(t.re)||isNaN(t.im),t}(e,r);this.re=t.re,this.im=t.im}u.prototype={re:0,im:0,sign:function(){var e=this.abs();return new u(this.re/e,this.im/e)},add:function(e,r){var t=new u(e,r);return this.isInfinite()&&t.isInfinite()?u.NAN:this.isInfinite()||t.isInfinite()?u.INFINITY:new u(this.re+t.re,this.im+t.im)},sub:function(e,r){var t=new u(e,r);return this.isInfinite()&&t.isInfinite()?u.NAN:this.isInfinite()||t.isInfinite()?u.INFINITY:new u(this.re-t.re,this.im-t.im)},mul:function(e,r){var t=new u(e,r);return this.isInfinite()&&t.isZero()||this.isZero()&&t.isInfinite()?u.NAN:this.isInfinite()||t.isInfinite()?u.INFINITY:0===t.im&&0===this.im?new u(this.re*t.re,0):new u(this.re*t.re-this.im*t.im,this.re*t.im+this.im*t.re)},div:function(e,r){var t=new u(e,r);if(this.isZero()&&t.isZero()||this.isInfinite()&&t.isInfinite())return u.NAN;if(this.isInfinite()||t.isZero())return u.INFINITY;if(this.isZero()||t.isInfinite())return u.ZERO;e=this.re,r=this.im;var n,i,a=t.re,o=t.im;return 0===o?new u(e/a,r/a):Math.abs(a)0)return new u(Math.pow(e,t.re),0);if(0===e)switch((t.re%4+4)%4){case 0:return new u(Math.pow(r,t.re),0);case 1:return new u(0,Math.pow(r,t.re));case 2:return new u(-Math.pow(r,t.re),0);case 3:return new u(0,-Math.pow(r,t.re))}}if(0===e&&0===r&&t.re>0&&t.im>=0)return u.ZERO;var n=Math.atan2(r,e),i=s(e,r);return e=Math.exp(t.re*i-t.im*n),r=t.im*i+t.re*n,new u(e*Math.cos(r),e*Math.sin(r))},sqrt:function(){var e,r,t=this.re,n=this.im,i=this.abs();if(t>=0){if(0===n)return new u(Math.sqrt(t),0);e=.5*Math.sqrt(2*(i+t))}else e=Math.abs(n)/Math.sqrt(2*(i-t));return r=t<=0?.5*Math.sqrt(2*(i-t)):Math.abs(n)/Math.sqrt(2*(i+t)),new u(e,n<0?-r:r)},exp:function(){var e=Math.exp(this.re);return this.im,new u(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){var e=this.re,r=this.im;return new u(Math.expm1(e)*Math.cos(r)+function(e){var r=Math.PI/4;if(-r>e||e>r)return Math.cos(e)-1;var t=e*e;return t*(t*(t*(t*(t*(t*(t*(t/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-.5)}(r),Math.exp(e)*Math.sin(r))},log:function(){var e=this.re,r=this.im;return new u(s(e,r),Math.atan2(r,e))},abs:function(){return e=this.re,r=this.im,t=Math.abs(e),n=Math.abs(r),t<3e3&&n<3e3?Math.sqrt(t*t+n*n):(t1&&0===r,n=1-e,i=1+e,a=n*n+r*r,o=0!==a?new u((i*n-r*r)/a,(r*n+i*r)/a):new u(-1!==e?e/0:0,0!==r?r/0:0),c=o.re;return o.re=s(o.re,o.im)/2,o.im=Math.atan2(o.im,c)/2,t&&(o.im=-o.im),o},acoth:function(){var e=this.re,r=this.im;if(0===e&&0===r)return new u(0,Math.PI/2);var t=e*e+r*r;return 0!==t?new u(e/t,-r/t).atanh():new u(0!==e?e/0:0,0!==r?-r/0:0).atanh()},acsch:function(){var e=this.re,r=this.im;if(0===r)return new u(0!==e?Math.log(e+Math.sqrt(e*e+1)):1/0,0);var t=e*e+r*r;return 0!==t?new u(e/t,-r/t).asinh():new u(0!==e?e/0:0,0!==r?-r/0:0).asinh()},asech:function(){var e=this.re,r=this.im;if(this.isZero())return u.INFINITY;var t=e*e+r*r;return 0!==t?new u(e/t,-r/t).acosh():new u(0!==e?e/0:0,0!==r?-r/0:0).acosh()},inverse:function(){if(this.isZero())return u.INFINITY;if(this.isInfinite())return u.ZERO;var e=this.re,r=this.im,t=e*e+r*r;return new u(e/t,-r/t)},conjugate:function(){return new u(this.re,-this.im)},neg:function(){return new u(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new u(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new u(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new u(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,r){var t=new u(e,r);return Math.abs(t.re-this.re)<=u.EPSILON&&Math.abs(t.im-this.im)<=u.EPSILON},clone:function(){return new u(this.re,this.im)},toString:function(){var e=this.re,r=this.im,t="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e){"use strict";var r=Object.assign||function(e){for(var r=1;r1&&void 0!==arguments[1]?arguments[1]:{},o=a.preserveFormatting,s=void 0!==o&&o,u=a.escapeMapFn,c=void 0===u?i:u,l=String(e),p="",f=c(r({},t),s?r({},n):{}),d=Object.keys(f),m=function(){var e=!1;d.forEach((function(r,t){e||l.length>=r.length&&l.slice(0,r.length)===r&&(p+=f[d[t]],l=l.slice(r.length,l.length),e=!0)})),e||(p+=l.slice(0,1),l=l.slice(1,l.length))};l;)m();return p}},5628:function(e,r){var t;!function(n){"use strict";var i={s:1,n:0,d:1};function a(e,r){if(isNaN(e=parseInt(e,10)))throw l.InvalidParameter;return e*r}function o(e,r){if(0===r)throw l.DivisionByZero;var t=Object.create(l.prototype);t.s=e<0?-1:1;var n=c(e=e<0?-e:e,r);return t.n=e/n,t.d=r/n,t}function s(e){for(var r={},t=e,n=2,i=4;i<=t;){for(;t%n==0;)t/=n,r[n]=(r[n]||0)+1;i+=1+2*n++}return t!==e?t>1&&(r[t]=(r[t]||0)+1):r[e]=(r[e]||0)+1,r}var u=function(e,r){var t,n=0,o=1,s=1,u=0,c=0,p=0,f=1,d=1,m=0,h=1,g=1,y=1,v=1e7;if(null==e);else if(void 0!==r){if(s=(n=e)*(o=r),n%1!=0||o%1!=0)throw l.NonIntegerParameter}else switch(typeof e){case"object":if("d"in e&&"n"in e)n=e.n,o=e.d,"s"in e&&(n*=e.s);else{if(!(0 in e))throw l.InvalidParameter;n=e[0],1 in e&&(o=e[1])}s=n*o;break;case"number":if(e<0&&(s=e,e=-e),e%1==0)n=e;else if(e>0){for(e>=1&&(e/=d=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)));h<=v&&y<=v;){if(e===(t=(m+g)/(h+y))){h+y<=v?(n=m+g,o=h+y):y>h?(n=g,o=y):(n=m,o=h);break}e>t?(m+=g,h+=y):(g+=m,y+=h),h>v?(n=g,o=y):(n=m,o=h)}n*=d}else(isNaN(e)||isNaN(r))&&(o=n=NaN);break;case"string":if(null===(h=e.match(/\d+|./g)))throw l.InvalidParameter;if("-"===h[m]?(s=-1,m++):"+"===h[m]&&m++,h.length===m+1?c=a(h[m++],s):"."===h[m+1]||"."===h[m]?("."!==h[m]&&(u=a(h[m++],s)),(1+ ++m===h.length||"("===h[m+1]&&")"===h[m+3]||"'"===h[m+1]&&"'"===h[m+3])&&(c=a(h[m],s),f=Math.pow(10,h[m].length),m++),("("===h[m]&&")"===h[m+2]||"'"===h[m]&&"'"===h[m+2])&&(p=a(h[m+1],s),d=Math.pow(10,h[m+1].length)-1,m+=3)):"/"===h[m+1]||":"===h[m+1]?(c=a(h[m],s),f=a(h[m+2],1),m+=3):"/"===h[m+3]&&" "===h[m+1]&&(u=a(h[m],s),c=a(h[m+2],s),f=a(h[m+4],1),m+=5),h.length<=m){s=n=p+(o=f*d)*u+d*c;break}default:throw l.InvalidParameter}if(0===o)throw l.DivisionByZero;i.s=s<0?-1:1,i.n=Math.abs(n),i.d=Math.abs(o)};function c(e,r){if(!e)return r;if(!r)return e;for(;;){if(!(e%=r))return r;if(!(r%=e))return e}}function l(e,r){if(u(e,r),!(this instanceof l))return o(i.s*i.n,i.d);e=c(i.d,i.n),this.s=i.s,this.n=i.n/e,this.d=i.d/e}l.DivisionByZero=new Error("Division by Zero"),l.InvalidParameter=new Error("Invalid argument"),l.NonIntegerParameter=new Error("Parameters must be integer"),l.prototype={s:1,n:0,d:1,abs:function(){return o(this.n,this.d)},neg:function(){return o(-this.s*this.n,this.d)},add:function(e,r){return u(e,r),o(this.s*this.n*i.d+i.s*this.d*i.n,this.d*i.d)},sub:function(e,r){return u(e,r),o(this.s*this.n*i.d-i.s*this.d*i.n,this.d*i.d)},mul:function(e,r){return u(e,r),o(this.s*i.s*this.n*i.n,this.d*i.d)},div:function(e,r){return u(e,r),o(this.s*i.s*this.n*i.d,this.d*i.n)},clone:function(){return o(this.s*this.n,this.d)},mod:function(e,r){if(isNaN(this.n)||isNaN(this.d))return new l(NaN);if(void 0===e)return o(this.s*this.n%this.d,1);if(u(e,r),0===i.n&&0===this.d)throw l.DivisionByZero;return o(this.s*(i.d*this.n)%(i.n*this.d),i.d*this.d)},gcd:function(e,r){return u(e,r),o(c(i.n,this.n)*c(i.d,this.d),i.d*this.d)},lcm:function(e,r){return u(e,r),0===i.n&&0===this.n?o(0,1):o(i.n*this.n,c(i.n,this.n)*c(i.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new l(NaN):o(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new l(NaN):o(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new l(NaN):o(Math.round(e*this.s*this.n/this.d),e)},inverse:function(){return o(this.s*this.d,this.n)},pow:function(e,r){if(u(e,r),1===i.d)return i.s<0?o(Math.pow(this.s*this.d,i.n),Math.pow(this.n,i.n)):o(Math.pow(this.s*this.n,i.n),Math.pow(this.d,i.n));if(this.s<0)return null;var t=s(this.n),n=s(this.d),a=1,c=1;for(var l in t)if("1"!==l){if("0"===l){a=0;break}if(t[l]*=i.n,t[l]%i.d!=0)return null;t[l]/=i.d,a*=Math.pow(l,t[l])}for(var l in n)if("1"!==l){if(n[l]*=i.n,n[l]%i.d!=0)return null;n[l]/=i.d,c*=Math.pow(l,n[l])}return i.s<0?o(c,a):o(a,c)},equals:function(e,r){return u(e,r),this.s*this.n*i.d==i.s*i.n*this.d},compare:function(e,r){u(e,r);var t=this.s*this.n*i.d-i.s*i.n*this.d;return(0=0;a--)i=i.inverse().add(t[a]);if(i.sub(r).abs().valueOf()0&&(t+=r,t+=" ",n%=i),t+=n,t+="/",t+=i),t},toLatex:function(e){var r,t="",n=this.n,i=this.d;return this.s<0&&(t+="-"),1===i?t+=n:(e&&(r=Math.floor(n/i))>0&&(t+=r,n%=i),t+="\\frac{",t+=n,t+="}{",t+=i,t+="}"),t},toContinued:function(){var e,r=this.n,t=this.d,n=[];if(isNaN(r)||isNaN(t))return n;do{n.push(Math.floor(r/t)),e=r%t,r=t,t=e}while(1!==r);return n},toString:function(e){var r=this.n,t=this.d;if(isNaN(r)||isNaN(t))return"NaN";e=e||15;var n=function(e,r){for(;r%2==0;r/=2);for(;r%5==0;r/=5);if(1===r)return 0;for(var t=10%r,n=1;1!==t;n++)if(t=10*t%r,n>2e3)return 0;return n}(0,t),i=function(e,r,t){for(var n=1,i=function(e,r,t){for(var n=1;r>0;e=e*e%t,r>>=1)1&r&&(n=n*e%t);return n}(10,t,r),a=0;a<300;a++){if(n===i)return a;n=10*n%r,i=10*i%r}return 0}(0,t,n),a=this.s<0?"-":"";if(a+=r/t|0,r%=t,(r*=10)&&(a+="."),n){for(var o=i;o--;)a+=r/t|0,r%=t,r*=10;for(a+="(",o=n;o--;)a+=r/t|0,r%=t,r*=10;a+=")"}else for(o=e;r&&o--;)a+=r/t|0,r%=t,r*=10;return a}},void 0===(t=function(){return l}.apply(r,[]))||(e.exports=t)}()},3228:e=>{e.exports=function e(r,t){"use strict";var n,i,a=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,o=/(^[ ]*|[ ]*$)/g,s=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,u=/^0x[0-9a-f]+$/i,c=/^0/,l=function(r){return e.insensitive&&(""+r).toLowerCase()||""+r},p=l(r).replace(o,"")||"",f=l(t).replace(o,"")||"",d=p.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=f.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=parseInt(p.match(u),16)||1!==d.length&&p.match(s)&&Date.parse(p),g=parseInt(f.match(u),16)||h&&f.match(s)&&Date.parse(f)||null;if(g){if(hg)return 1}for(var y=0,v=Math.max(d.length,m.length);yi)return 1}return 0}},6377:(e,r,t)=>{var n=t(4832),i=t(8652),a=t(801),o=t(2030),s=t(3618),u=t(9049),c=t(1971);c.alea=n,c.xor128=i,c.xorwow=a,c.xorshift7=o,c.xor4096=s,c.tychei=u,e.exports=c},4832:function(e,r,t){var n;!function(e,i,a){function o(e){var r,t=this,n=(r=4022871197,function(e){e=String(e);for(var t=0;t>>0,r=(n*=r)>>>0,r+=4294967296*(n-=r)}return 2.3283064365386963e-10*(r>>>0)});t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=n(" "),t.s1=n(" "),t.s2=n(" "),t.s0-=n(e),t.s0<0&&(t.s0+=1),t.s1-=n(e),t.s1<0&&(t.s1+=1),t.s2-=n(e),t.s2<0&&(t.s2+=1),n=null}function s(e,r){return r.c=e.c,r.s0=e.s0,r.s1=e.s1,r.s2=e.s2,r}function u(e,r){var t=new o(e),n=r&&r.state,i=t.next;return i.int32=function(){return 4294967296*t.next()|0},i.double=function(){return i()+11102230246251565e-32*(2097152*i()|0)},i.quick=i,n&&("object"==typeof n&&s(n,t),i.state=function(){return s(t,{})}),i}i&&i.exports?i.exports=u:t.amdD&&t.amdO?void 0===(n=function(){return u}.call(r,t,r,i))||(i.exports=n):this.alea=u}(0,e=t.nmd(e),t.amdD)},9049:function(e,r,t){var n;!function(e,i,a){function o(e){var r=this,t="";r.next=function(){var e=r.b,t=r.c,n=r.d,i=r.a;return e=e<<25^e>>>7^t,t=t-n|0,n=n<<24^n>>>8^i,i=i-e|0,r.b=e=e<<20^e>>>12^t,r.c=t=t-n|0,r.d=n<<16^t>>>16^i,r.a=i-e|0},r.a=0,r.b=0,r.c=-1640531527,r.d=1367130551,e===Math.floor(e)?(r.a=e/4294967296|0,r.b=0|e):t+=e;for(var n=0;n>>0)/4294967296};return i.double=function(){do{var e=((t.next()>>>11)+(t.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=t.next,i.quick=i,n&&("object"==typeof n&&s(n,t),i.state=function(){return s(t,{})}),i}i&&i.exports?i.exports=u:t.amdD&&t.amdO?void 0===(n=function(){return u}.call(r,t,r,i))||(i.exports=n):this.tychei=u}(0,e=t.nmd(e),t.amdD)},8652:function(e,r,t){var n;!function(e,i,a){function o(e){var r=this,t="";r.x=0,r.y=0,r.z=0,r.w=0,r.next=function(){var e=r.x^r.x<<11;return r.x=r.y,r.y=r.z,r.z=r.w,r.w^=r.w>>>19^e^e>>>8},e===(0|e)?r.x=e:t+=e;for(var n=0;n>>0)/4294967296};return i.double=function(){do{var e=((t.next()>>>11)+(t.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=t.next,i.quick=i,n&&("object"==typeof n&&s(n,t),i.state=function(){return s(t,{})}),i}i&&i.exports?i.exports=u:t.amdD&&t.amdO?void 0===(n=function(){return u}.call(r,t,r,i))||(i.exports=n):this.xor128=u}(0,e=t.nmd(e),t.amdD)},3618:function(e,r,t){var n;!function(e,i,a){function o(e){var r=this;r.next=function(){var e,t,n=r.w,i=r.X,a=r.i;return r.w=n=n+1640531527|0,t=i[a+34&127],e=i[a=a+1&127],t^=t<<13,e^=e<<17,t^=t>>>15,e^=e>>>12,t=i[a]=t^e,r.i=a,t+(n^n>>>16)|0},function(e,r){var t,n,i,a,o,s=[],u=128;for(r===(0|r)?(n=r,r=null):(r+="\0",n=0,u=Math.max(u,r.length)),i=0,a=-32;a>>15,n^=n<<4,n^=n>>>13,a>=0&&(o=o+1640531527|0,i=0==(t=s[127&a]^=n+o)?i+1:0);for(i>=128&&(s[127&(r&&r.length||0)]=-1),i=127,a=512;a>0;--a)n=s[i+34&127],t=s[i=i+1&127],n^=n<<13,t^=t<<17,n^=n>>>15,t^=t>>>12,s[i]=n^t;e.w=o,e.X=s,e.i=i}(r,e)}function s(e,r){return r.i=e.i,r.w=e.w,r.X=e.X.slice(),r}function u(e,r){null==e&&(e=+new Date);var t=new o(e),n=r&&r.state,i=function(){return(t.next()>>>0)/4294967296};return i.double=function(){do{var e=((t.next()>>>11)+(t.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=t.next,i.quick=i,n&&(n.X&&s(n,t),i.state=function(){return s(t,{})}),i}i&&i.exports?i.exports=u:t.amdD&&t.amdO?void 0===(n=function(){return u}.call(r,t,r,i))||(i.exports=n):this.xor4096=u}(0,e=t.nmd(e),t.amdD)},2030:function(e,r,t){var n;!function(e,i,a){function o(e){var r=this;r.next=function(){var e,t,n=r.x,i=r.i;return e=n[i],t=(e^=e>>>7)^e<<24,t^=(e=n[i+1&7])^e>>>10,t^=(e=n[i+3&7])^e>>>3,t^=(e=n[i+4&7])^e<<7,e=n[i+7&7],t^=(e^=e<<13)^e<<9,n[i]=t,r.i=i+1&7,t},function(e,r){var t,n=[];if(r===(0|r))n[0]=r;else for(r=""+r,t=0;t0;--t)e.next()}(r,e)}function s(e,r){return r.x=e.x.slice(),r.i=e.i,r}function u(e,r){null==e&&(e=+new Date);var t=new o(e),n=r&&r.state,i=function(){return(t.next()>>>0)/4294967296};return i.double=function(){do{var e=((t.next()>>>11)+(t.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=t.next,i.quick=i,n&&(n.x&&s(n,t),i.state=function(){return s(t,{})}),i}i&&i.exports?i.exports=u:t.amdD&&t.amdO?void 0===(n=function(){return u}.call(r,t,r,i))||(i.exports=n):this.xorshift7=u}(0,e=t.nmd(e),t.amdD)},801:function(e,r,t){var n;!function(e,i,a){function o(e){var r=this,t="";r.next=function(){var e=r.x^r.x>>>2;return r.x=r.y,r.y=r.z,r.z=r.w,r.w=r.v,(r.d=r.d+362437|0)+(r.v=r.v^r.v<<4^e^e<<1)|0},r.x=0,r.y=0,r.z=0,r.w=0,r.v=0,e===(0|e)?r.x=e:t+=e;for(var n=0;n>>4),r.next()}function s(e,r){return r.x=e.x,r.y=e.y,r.z=e.z,r.w=e.w,r.v=e.v,r.d=e.d,r}function u(e,r){var t=new o(e),n=r&&r.state,i=function(){return(t.next()>>>0)/4294967296};return i.double=function(){do{var e=((t.next()>>>11)+(t.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},i.int32=t.next,i.quick=i,n&&("object"==typeof n&&s(n,t),i.state=function(){return s(t,{})}),i}i&&i.exports?i.exports=u:t.amdD&&t.amdO?void 0===(n=function(){return u}.call(r,t,r,i))||(i.exports=n):this.xorwow=u}(0,e=t.nmd(e),t.amdD)},1971:function(e,r,t){var n;!function(i,a,o){var s,u=256,c=o.pow(u,6),l=o.pow(2,52),p=2*l,f=u-1;function d(e,r,t){var n=[],f=y(g((r=1==r?{entropy:!0}:r||{}).entropy?[e,v(a)]:null==e?function(){try{var e;return s&&(e=s.randomBytes)?e=e(u):(e=new Uint8Array(u),(i.crypto||i.msCrypto).getRandomValues(e)),v(e)}catch(e){var r=i.navigator,t=r&&r.plugins;return[+new Date,i,t,i.screen,v(a)]}}():e,3),n),d=new m(n),x=function(){for(var e=d.g(6),r=c,t=0;e=p;)e/=2,r/=2,t>>>=1;return(e+t)/r};return x.int32=function(){return 0|d.g(4)},x.quick=function(){return d.g(4)/4294967296},x.double=x,y(v(d.S),a),(r.pass||t||function(e,r,t,n){return n&&(n.S&&h(n,d),e.state=function(){return h(d,{})}),t?(o.random=e,r):e})(x,f,"global"in r?r.global:this==o,r.state)}function m(e){var r,t=e.length,n=this,i=0,a=n.i=n.j=0,o=n.S=[];for(t||(e=[t++]);i{function r(){}r.prototype={on:function(e,r,t){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:r,ctx:t}),this},once:function(e,r,t){var n=this;function i(){n.off(e,i),r.apply(t,arguments)}return i._=r,this.on(e,i,t)},emit:function(e){for(var r=[].slice.call(arguments,1),t=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=t.length;n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){u=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(u)throw o}}}}function r(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t1&&void 0!==arguments[1]?arguments[1]:"any",t=r?m(r).index:c.length,n=[],i=0;i1&&void 0!==arguments[1]?arguments[1]:",";return e.map((function(e){return e.name})).join(r)}function b(e){var r=0===e.indexOf("..."),t=(r?e.length>3?e.slice(3):"any":e).split("|").map((function(e){return m(e.trim())})),n=!1,i=r?"...":"";return{types:t.map((function(e){return n=e.isAny||n,i+=e.name+"|",{name:e.name,typeIndex:e.index,test:e.test,isAny:e.isAny,conversion:null,conversionIndex:-1}})),name:i.slice(0,-1),hasAny:n,hasConversion:!1,restParam:r}}function w(r){var t=function(r){if(0===r.length)return[];var t=r.map(m);r.length>1&&t.sort((function(e,r){return e.index-r.index}));var n=t[0].conversionsTo;if(1===r.length)return n;n=n.concat([]);for(var i=new Set(r),a=1;a0,restParam:r.restParam}}function N(e){return e.typeSet||(e.typeSet=new Set,e.types.forEach((function(r){return e.typeSet.add(r.name)}))),e.typeSet}function E(e){var r=[];if("string"!=typeof e)throw new TypeError("Signatures must be strings");var t=e.trim();if(""===t)return r;for(var n=t.split(","),i=0;i=i+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(t=S(e[0]),function(e){return t(e[0])&&1===e.length}):2===e.length?(t=S(e[0]),n=S(e[1]),function(e){return t(e[0])&&n(e[1])&&2===e.length}):(r=e.map(S),function(e){for(var t=0;t0){var t=y(r[o]);return(i=new TypeError("Unexpected type of argument in function "+s+" (expected: "+a.join(" or ")+", actual: "+t.join(" | ")+", index: "+o+")")).data={category:"wrongType",fn:s,index:o,actual:t,expected:a},{v:i}}}else u=e};for(o=0;of)return(i=new TypeError("Too many arguments in function "+s+" (expected: "+f+", actual: "+r.length+")")).data={category:"tooManyArgs",fn:s,index:r.length,expectedLength:f},i;for(var d=[],m=0;m0)return 1;var n=q(e)-q(r);return n<0?-1:n>0?1:0}function z(r,t){var n=r.params,i=t.params,a=$(n),o=$(i),s=A(n),u=A(i);if(s&&a.hasAny){if(!u||!o.hasAny)return 1}else if(u&&o.hasAny)return-1;var c,l,p=0,f=0,d=e(n);try{for(d.s();!(l=d.n()).done;)(c=l.value).hasAny&&++p,c.hasConversion&&++f}catch(e){d.e(e)}finally{d.f()}var m,h=0,g=0,y=e(i);try{for(y.s();!(m=y.n()).done;)(c=m.value).hasAny&&++h,c.hasConversion&&++g}catch(e){y.e(e)}finally{y.f()}if(p!==h)return p-h;if(s&&a.hasConversion){if(!u||!o.hasConversion)return 1}else if(u&&o.hasConversion)return-1;if(f!==g)return f-g;if(s){if(!u)return 1}else if(u)return-1;var v=(n.length-i.length)*(s?-1:1);if(0!==v)return v;for(var x,D=[],b=0,w=0;w=l:d?l>=p:l===p}(t,r))throw new TypeError('Conflicting signatures "'+D(t)+'" and "'+D(r)+'".')})),o.push(r);var i=s.length;s.push(t[n]);var a,l=void 0,p=e(P(r.map(w)));try{for(p.s();!(a=p.n()).done;){var f=D(l=a.value);c.push({params:l,name:f,fn:i}),l.every((function(e){return!e.hasConversion}))&&(u[f]=i)}}catch(e){p.e(e)}finally{p.f()}};for(n in t)l();c.sort(z);var p,f=j(s,u,de);for(p in u)Object.prototype.hasOwnProperty.call(u,p)&&(u[p]=f[u[p]]);for(var m=[],h=new Map,g=0,y=c;g{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,r,t){return(r=function(e){var r=function(e,r){if("object"!==n(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===n(r)?r:String(r)}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}t.d(r,{Z:()=>i})},7462:(e,r,t)=>{"use strict";function n(){return n=Object.assign?Object.assign.bind():function(e){for(var r=1;rn})},7757:(e,r,t)=>{"use strict";t.r(r),t.d(r,{AccessorNode:()=>dN,AccessorNodeDependencies:()=>$N,ArgumentsError:()=>El,ArrayNode:()=>iN,ArrayNodeDependencies:()=>uE,AssignmentNode:()=>hN,AssignmentNodeDependencies:()=>dE,BigNumber:()=>wh,BigNumberDependencies:()=>_N,BlockNode:()=>aN,BlockNodeDependencies:()=>nA,Chain:()=>lN,ChainDependencies:()=>lA,Complex:()=>Nh,ComplexDependencies:()=>qN,ConditionalNode:()=>oN,ConditionalNodeDependencies:()=>CA,ConstantNode:()=>sN,ConstantNodeDependencies:()=>MA,DenseMatrix:()=>Hh,DenseMatrixDependencies:()=>zN,DimensionError:()=>ci,EDependencies:()=>XF,FibonacciHeap:()=>Vv,FibonacciHeapDependencies:()=>QS,Fraction:()=>Ch,FractionDependencies:()=>kN,FunctionAssignmentNode:()=>pN,FunctionAssignmentNodeDependencies:()=>FA,FunctionNode:()=>yN,FunctionNodeDependencies:()=>BA,Help:()=>wN,HelpDependencies:()=>fC,ImmutableDenseMatrix:()=>xv,ImmutableDenseMatrixDependencies:()=>hA,Index:()=>Dv,IndexDependencies:()=>gA,IndexError:()=>li,IndexNode:()=>mN,IndexNodeDependencies:()=>OA,InfinityDependencies:()=>xC,LN10:()=>Th,LN10Dependencies:()=>_C,LN2:()=>$h,LN2Dependencies:()=>qC,LOG10E:()=>Bh,LOG10EDependencies:()=>IC,LOG2E:()=>_g,LOG2EDependencies:()=>zC,Matrix:()=>Oh,MatrixDependencies:()=>IN,NaNDependencies:()=>DM,Node:()=>Kw,NodeDependencies:()=>UN,ObjectNode:()=>eN,ObjectNodeDependencies:()=>_A,OperatorNode:()=>rN,OperatorNodeDependencies:()=>qA,PIDependencies:()=>KF,ParenthesisNode:()=>tN,ParenthesisNodeDependencies:()=>IA,Parser:()=>CN,ParserDependencies:()=>FM,Range:()=>zh,RangeDependencies:()=>JM,RangeNode:()=>uN,RangeNodeDependencies:()=>zA,RelationalNode:()=>nN,RelationalNodeDependencies:()=>kA,ResultSet:()=>kh,ResultSetDependencies:()=>tA,SQRT1_2:()=>Rh,SQRT1_2Dependencies:()=>pF,SQRT2:()=>Wh,SQRT2Dependencies:()=>fF,Spa:()=>vx,SpaDependencies:()=>GC,SparseMatrix:()=>Yg,SparseMatrixDependencies:()=>LN,SymbolNode:()=>gN,SymbolNodeDependencies:()=>TA,Unit:()=>Sx,UnitDependencies:()=>jE,_Infinity:()=>Fh,_NaN:()=>_h,_false:()=>Ah,_null:()=>qh,_true:()=>jh,abs:()=>Xh,absDependencies:()=>PN,acos:()=>Kh,acosDependencies:()=>GN,acosh:()=>ry,acoshDependencies:()=>VN,acot:()=>eg,acotDependencies:()=>WN,acoth:()=>vy,acothDependencies:()=>YN,acsc:()=>rg,acscDependencies:()=>JN,acsch:()=>ty,acschDependencies:()=>QN,add:()=>sv,addDependencies:()=>rE,addScalar:()=>tg,addScalarDependencies:()=>XN,all:()=>sT,and:()=>kv,andDependencies:()=>iE,apply:()=>ny,applyDependencies:()=>aE,applyTransformDependencies:()=>oE,arg:()=>ng,argDependencies:()=>sE,asec:()=>iy,asecDependencies:()=>cE,asech:()=>ig,asechDependencies:()=>lE,asin:()=>qy,asinDependencies:()=>pE,asinh:()=>ag,asinhDependencies:()=>fE,atan:()=>og,atan2:()=>fx,atan2Dependencies:()=>hE,atanDependencies:()=>mE,atanh:()=>sg,atanhDependencies:()=>gE,atomicMass:()=>Fx,atomicMassDependencies:()=>LE,avogadro:()=>uD,avogadroDependencies:()=>HE,bellNumbers:()=>MD,bellNumbersDependencies:()=>JE,bignumber:()=>ug,bignumberDependencies:()=>yE,bin:()=>ay,binDependencies:()=>QE,bitAnd:()=>uv,bitAndDependencies:()=>XE,bitNot:()=>cg,bitNotDependencies:()=>KE,bitOr:()=>Rv,bitOrDependencies:()=>eA,bitXor:()=>cv,bitXorDependencies:()=>rA,bohrMagneton:()=>Tx,bohrMagnetonDependencies:()=>iA,bohrRadius:()=>cD,bohrRadiusDependencies:()=>aA,boltzmann:()=>Bx,boltzmannDependencies:()=>oA,boolean:()=>lg,booleanDependencies:()=>sA,catalan:()=>lv,catalanDependencies:()=>uA,cbrt:()=>Iy,cbrtDependencies:()=>cA,ceil:()=>Pv,ceilDependencies:()=>EE,chain:()=>fN,chainDependencies:()=>pA,classicalElectronRadius:()=>kD,classicalElectronRadiusDependencies:()=>fA,clone:()=>pg,cloneDependencies:()=>dA,column:()=>dx,columnDependencies:()=>bA,columnTransformDependencies:()=>wA,combinations:()=>fg,combinationsDependencies:()=>$E,combinationsWithRep:()=>oy,combinationsWithRepDependencies:()=>NA,compare:()=>pv,compareDependencies:()=>EA,compareNatural:()=>Uv,compareNaturalDependencies:()=>AA,compareText:()=>fv,compareTextDependencies:()=>SA,compile:()=>bN,compileDependencies:()=>PA,complex:()=>dg,complexDependencies:()=>UA,composition:()=>jv,compositionDependencies:()=>jA,concat:()=>zy,concatDependencies:()=>eE,concatTransformDependencies:()=>LA,conductanceQuantum:()=>Ox,conductanceQuantumDependencies:()=>HA,config:()=>se,conj:()=>mg,conjDependencies:()=>OE,cos:()=>sy,cosDependencies:()=>ZA,cosh:()=>hg,coshDependencies:()=>$A,cot:()=>xy,cotDependencies:()=>GA,coth:()=>gg,cothDependencies:()=>VA,coulomb:()=>lD,coulombDependencies:()=>WA,count:()=>ky,countDependencies:()=>JA,create:()=>cT,createAbs:()=>Ba,createAccessorNode:()=>kb,createAcos:()=>_a,createAcosh:()=>Tu,createAcot:()=>Xa,createAcoth:()=>uc,createAcsc:()=>eo,createAcsch:()=>Ou,createAdd:()=>pp,createAddScalar:()=>to,createAnd:()=>gf,createApply:()=>qu,createApplyTransform:()=>Bw,createArg:()=>no,createArrayNode:()=>xb,createAsec:()=>ku,createAsech:()=>ao,createAsin:()=>$c,createAsinh:()=>oo,createAssignmentNode:()=>jb,createAtan:()=>so,createAtan2:()=>Fd,createAtanh:()=>co,createAtomicMass:()=>Cn,createAvogadro:()=>Mn,createBellNumbers:()=>Im,createBigNumberClass:()=>Yr,createBignumber:()=>lo,createBin:()=>Ru,createBitAnd:()=>dp,createBitNot:()=>Fo,createBitOr:()=>vf,createBitXor:()=>hp,createBlockNode:()=>bb,createBohrMagneton:()=>sn,createBohrRadius:()=>dn,createBoltzmann:()=>Fn,createBoolean:()=>Bo,createCatalan:()=>yp,createCbrt:()=>Vc,createCeil:()=>wf,createChain:()=>_b,createChainClass:()=>Fb,createClassicalElectronRadius:()=>mn,createClone:()=>_o,createColumn:()=>Bd,createColumnTransform:()=>$w,createCombinations:()=>ko,createCombinationsWithRep:()=>Uu,createCompare:()=>xp,createCompareNatural:()=>Af,createCompareText:()=>Np,createCompile:()=>ew,createComplex:()=>Po,createComplexClass:()=>xt,createComposition:()=>Cf,createConcat:()=>Yc,createConcatTransform:()=>_w,createConditionalNode:()=>Nb,createConductanceQuantum:()=>un,createConj:()=>jo,createConstantNode:()=>Ab,createCos:()=>Lu,createCosh:()=>Ho,createCot:()=>cc,createCoth:()=>$o,createCoulomb:()=>an,createCount:()=>Xc,createCreateUnit:()=>nm,createCross:()=>Ff,createCsc:()=>Vo,createCsch:()=>Zu,createCtranspose:()=>el,createCube:()=>Yo,createCumSum:()=>Ap,createCumSumTransform:()=>Pw,createDeepEqual:()=>Cp,createDenseMatrixClass:()=>qi,createDerivative:()=>Dw,createDet:()=>Tf,createDeuteronMass:()=>Dn,createDiag:()=>tl,createDiff:()=>Of,createDiffTransform:()=>jw,createDistance:()=>qf,createDivide:()=>dm,createDivideScalar:()=>il,createDot:()=>Mp,createDotDivide:()=>hl,createDotMultiply:()=>kf,createDotPow:()=>am,createE:()=>Rt,createEfimovFactor:()=>Sn,createEigs:()=>km,createElectricConstant:()=>tn,createElectronMass:()=>hn,createElementaryCharge:()=>on,createEqual:()=>yl,createEqualScalar:()=>Ko,createEqualText:()=>Tp,createErf:()=>es,createEvaluate:()=>sw,createExp:()=>os,createExpm:()=>sm,createExpm1:()=>us,createFactorial:()=>hm,createFalse:()=>Ot,createFaraday:()=>Tn,createFermiCoupling:()=>gn,createFft:()=>um,createFibonacciHeapClass:()=>Rf,createFilter:()=>ls,createFilterTransform:()=>Sw,createFineStructure:()=>yn,createFirstRadiation:()=>Bn,createFix:()=>Lf,createFlatten:()=>Dl,createFloor:()=>qp,createForEach:()=>ds,createForEachTransform:()=>Mw,createFormat:()=>gs,createFraction:()=>lc,createFractionClass:()=>Qn,createFreqz:()=>nh,createFunctionAssignmentNode:()=>Bb,createFunctionNode:()=>$b,createGamma:()=>lm,createGasConstant:()=>_n,createGcd:()=>Fl,createGetMatrixDataType:()=>vs,createGravitationConstant:()=>Xt,createGravity:()=>Ln,createHartreeEnergy:()=>vn,createHasNumericValue:()=>Bl,createHelp:()=>fw,createHelpClass:()=>rw,createHex:()=>xs,createHypot:()=>zp,createI:()=>Gt,createIdentity:()=>_l,createIfft:()=>fm,createIm:()=>Ds,createImmutableDenseMatrixClass:()=>kp,createIndex:()=>Zf,createIndexClass:()=>Rp,createIndexNode:()=>Pb,createIndexTransform:()=>Lw,createInfinity:()=>qt,createIntersect:()=>$f,createInv:()=>jd,createInverseConductanceQuantum:()=>cn,createInvmod:()=>Up,createIsInteger:()=>ws,createIsNaN:()=>Gu,createIsNegative:()=>Fs,createIsNumeric:()=>fc,createIsPositive:()=>Bs,createIsPrime:()=>Wu,createIsZero:()=>_s,createKldivergence:()=>Jm,createKlitzing:()=>fn,createKron:()=>Il,createLN10:()=>jt,createLN2:()=>Ut,createLOG10E:()=>Ht,createLOG2E:()=>Lt,createLarger:()=>Lp,createLargerEq:()=>kl,createLcm:()=>Gf,createLeafCount:()=>nw,createLeftShift:()=>Ll,createLgamma:()=>js,createLog:()=>Zp,createLog10:()=>Hs,createLog1p:()=>Wf,createLog2:()=>$s,createLoschmidt:()=>On,createLsolve:()=>Jf,createLsolveAll:()=>_d,createLup:()=>Ld,createLusolve:()=>vm,createLyap:()=>bh,createMad:()=>Xm,createMagneticConstant:()=>rn,createMagneticFluxQuantum:()=>ln,createMap:()=>Gs,createMapTransform:()=>Fw,createMatrix:()=>mc,createMatrixClass:()=>Xn,createMatrixFromColumns:()=>Zl,createMatrixFromFunction:()=>gc,createMatrixFromRows:()=>Gp,createMax:()=>Qf,createMaxTransform:()=>Iw,createMean:()=>Um,createMeanTransform:()=>Gw,createMedian:()=>Vm,createMin:()=>Vp,createMinTransform:()=>kw,createMod:()=>Gl,createMode:()=>vc,createMolarMass:()=>Un,createMolarMassC12:()=>jn,createMolarPlanckConstant:()=>qn,createMolarVolume:()=>In,createMultinomial:()=>Dm,createMultiply:()=>Yp,createMultiplyScalar:()=>Ws,createNaN:()=>It,createNeutronMass:()=>bn,createNode:()=>QD,createNorm:()=>oh,createNot:()=>eu,createNthRoot:()=>Yl,createNthRoots:()=>Qp,createNuclearMagneton:()=>pn,createNull:()=>_t,createNumber:()=>ru,createNumeric:()=>wc,createObjectNode:()=>KD,createOct:()=>tu,createOnes:()=>Jl,createOperatorNode:()=>db,createOr:()=>Xp,createParenthesisNode:()=>hb,createParse:()=>Vb,createParser:()=>ww,createParserClass:()=>dw,createPartitionSelect:()=>ef,createPermutations:()=>wm,createPhi:()=>Pt,createPi:()=>zt,createPickRandom:()=>su,createPinv:()=>Zd,createPlanckCharge:()=>Gn,createPlanckConstant:()=>Kt,createPlanckLength:()=>Hn,createPlanckMass:()=>Zn,createPlanckTemperature:()=>Vn,createPlanckTime:()=>$n,createPolynomialRoot:()=>Am,createPow:()=>$d,createPrint:()=>cu,createProd:()=>Ac,createProtonMass:()=>xn,createQr:()=>Xf,createQuantileSeq:()=>rf,createQuantumOfCirculation:()=>wn,createRandom:()=>du,createRandomInt:()=>Ju,createRange:()=>ed,createRangeClass:()=>Kn,createRangeNode:()=>Cb,createRangeTransform:()=>Hw,createRationalize:()=>Ew,createRe:()=>mu,createReducedPlanckConstant:()=>en,createRelationalNode:()=>yb,createReplacer:()=>Ii,createReshape:()=>Cc,createResize:()=>Ql,createResolve:()=>Wb,createResultSet:()=>ei,createReviver:()=>Mb,createRightArithShift:()=>Kl,createRightLogShift:()=>nf,createRotate:()=>hh,createRotationMatrix:()=>ch,createRound:()=>tp,createRow:()=>rd,createRowTransform:()=>Zw,createRydberg:()=>Nn,createSQRT1_2:()=>Zt,createSQRT2:()=>$t,createSackurTetrode:()=>zn,createSchur:()=>fh,createSec:()=>hu,createSech:()=>Xu,createSecondRadiation:()=>kn,createSetCartesian:()=>nd,createSetDifference:()=>Id,createSetDistinct:()=>ad,createSetIntersect:()=>Vd,createSetIsSubset:()=>sd,createSetMultiplicity:()=>kd,createSetPowerset:()=>cd,createSetSize:()=>Cm,createSetSymDifference:()=>Pd,createSetUnion:()=>Yd,createSign:()=>yu,createSimplify:()=>gw,createSimplifyConstant:()=>Xb,createSimplifyCore:()=>aw,createSin:()=>vu,createSinh:()=>ec,createSize:()=>Fc,createSlu:()=>wd,createSmaller:()=>ip,createSmallerEq:()=>of,createSolveODE:()=>Fm,createSort:()=>Ed,createSpaClass:()=>Ud,createSparse:()=>tc,createSparseMatrixClass:()=>xu,createSpeedOfLight:()=>Qt,createSplitUnit:()=>bu,createSqrt:()=>nc,createSqrtm:()=>Qd,createSquare:()=>Nu,createSqueeze:()=>Bc,createStd:()=>eh,createStdTransform:()=>Yw,createStefanBoltzmann:()=>Rn,createStirlingS2:()=>Bm,createString:()=>Au,createSubset:()=>_c,createSubsetTransform:()=>Ow,createSubtract:()=>cf,createSum:()=>Ad,createSumTransform:()=>zw,createSylvester:()=>vh,createSymbolNode:()=>Lb,createSymbolicEqual:()=>vw,createTan:()=>Su,createTanh:()=>ic,createTau:()=>kt,createThomsonCrossSection:()=>En,createTo:()=>op,createTrace:()=>lf,createTranspose:()=>Pc,createTrue:()=>Bt,createTypeOf:()=>Mu,createTyped:()=>Ji,createUnaryMinus:()=>oc,createUnaryPlus:()=>Ta,createUnequal:()=>up,createUnit:()=>_x,createUnitClass:()=>rm,createUnitDependencies:()=>QA,createUnitFunction:()=>_m,createUppercaseE:()=>Wt,createUppercasePi:()=>Vt,createUsolve:()=>df,createUsolveAll:()=>Cd,createVacuumImpedance:()=>nn,createVariance:()=>Zm,createVarianceTransform:()=>Ww,createVersion:()=>Yt,createWeakMixingAngle:()=>An,createWienDisplacement:()=>Pn,createXgcd:()=>jc,createXor:()=>lp,createZeros:()=>Hc,createZpk2tf:()=>hf,cross:()=>Lv,crossDependencies:()=>XA,csc:()=>yg,cscDependencies:()=>KA,csch:()=>uy,cschDependencies:()=>eS,ctranspose:()=>Ry,ctransposeDependencies:()=>tS,cube:()=>vg,cubeDependencies:()=>nS,cumsum:()=>dv,cumsumDependencies:()=>aS,cumsumTransformDependencies:()=>oS,deepEqual:()=>mv,deepEqualDependencies:()=>sS,derivative:()=>TN,derivativeDependencies:()=>dS,det:()=>Hv,detDependencies:()=>RE,deuteronMass:()=>qx,deuteronMassDependencies:()=>mS,diag:()=>Py,diagDependencies:()=>hS,diff:()=>Zv,diffDependencies:()=>gS,diffTransformDependencies:()=>yS,distance:()=>$v,distanceDependencies:()=>xS,divide:()=>pD,divideDependencies:()=>uS,divideScalar:()=>Uy,divideScalarDependencies:()=>bE,docs:()=>lw,dot:()=>hv,dotDependencies:()=>qE,dotDivide:()=>jy,dotDivideDependencies:()=>DS,dotMultiply:()=>Gv,dotMultiplyDependencies:()=>bS,dotPow:()=>Ix,dotPowDependencies:()=>wS,e:()=>Eh,eDependencies:()=>NS,efimovFactor:()=>Zh,efimovFactorDependencies:()=>ES,eigs:()=>FD,eigsDependencies:()=>qS,electricConstant:()=>zx,electricConstantDependencies:()=>IS,electronMass:()=>fD,electronMassDependencies:()=>zS,elementaryCharge:()=>kx,elementaryChargeDependencies:()=>kS,equal:()=>Ly,equalDependencies:()=>wE,equalScalar:()=>xg,equalScalarDependencies:()=>jN,equalText:()=>gv,equalTextDependencies:()=>RS,erf:()=>Dg,erfDependencies:()=>PS,evaluate:()=>AN,evaluateDependencies:()=>US,exp:()=>bg,expDependencies:()=>jS,expm:()=>Rx,expm1:()=>wg,expm1Dependencies:()=>HS,expmDependencies:()=>LS,factorial:()=>dD,factorialDependencies:()=>VE,factory:()=>Gr,falseDependencies:()=>ZS,faraday:()=>Px,faradayDependencies:()=>$S,fermiCoupling:()=>TD,fermiCouplingDependencies:()=>GS,fft:()=>Ux,fftDependencies:()=>JS,filter:()=>Ng,filterDependencies:()=>XS,filterTransformDependencies:()=>KS,fineStructure:()=>Sh,fineStructureDependencies:()=>eC,firstRadiation:()=>mD,firstRadiationDependencies:()=>rC,fix:()=>Wv,fixDependencies:()=>SE,flatten:()=>Hy,flattenDependencies:()=>AS,floor:()=>yv,floorDependencies:()=>AE,forEach:()=>Eg,forEachDependencies:()=>tC,forEachTransformDependencies:()=>nC,format:()=>Ag,formatDependencies:()=>CE,fraction:()=>Dy,fractionDependencies:()=>vE,freqz:()=>LD,freqzDependencies:()=>iC,gamma:()=>jx,gammaDependencies:()=>GE,gasConstant:()=>BD,gasConstantDependencies:()=>aC,gcd:()=>Zy,gcdDependencies:()=>oC,getMatrixDataType:()=>Sg,getMatrixDataTypeDependencies:()=>sC,gravitationConstant:()=>Lx,gravitationConstantDependencies:()=>uC,gravity:()=>hD,gravityDependencies:()=>cC,hartreeEnergy:()=>Hx,hartreeEnergyDependencies:()=>lC,hasNumericValue:()=>$y,hasNumericValueDependencies:()=>pC,help:()=>SN,helpDependencies:()=>dC,hex:()=>Cg,hexDependencies:()=>mC,hypot:()=>vv,hypotDependencies:()=>hC,i:()=>Mh,iDependencies:()=>VS,identity:()=>Gy,identityDependencies:()=>TE,ifft:()=>Zx,ifftDependencies:()=>gC,im:()=>Mg,imDependencies:()=>SS,index:()=>Yv,indexDependencies:()=>yC,indexTransformDependencies:()=>vC,intersect:()=>Jv,intersectDependencies:()=>DC,inv:()=>xx,invDependencies:()=>PE,inverseConductanceQuantum:()=>gD,inverseConductanceQuantumDependencies:()=>bC,invmod:()=>bv,invmodDependencies:()=>EC,isAccessorNode:()=>M,isArray:()=>f,isArrayNode:()=>F,isAssignmentNode:()=>T,isBigNumber:()=>s,isBlockNode:()=>B,isBoolean:()=>x,isChain:()=>$,isCollection:()=>m,isComplex:()=>u,isConditionalNode:()=>O,isConstantNode:()=>_,isDate:()=>N,isDenseMatrix:()=>h,isFraction:()=>c,isFunction:()=>w,isFunctionAssignmentNode:()=>I,isFunctionNode:()=>z,isHelp:()=>b,isIndex:()=>v,isIndexNode:()=>k,isInteger:()=>Fg,isIntegerDependencies:()=>KN,isMatrix:()=>d,isNaN:()=>cy,isNaNDependencies:()=>AC,isNegative:()=>Tg,isNegativeDependencies:()=>ZE,isNode:()=>R,isNull:()=>S,isNumber:()=>o,isNumeric:()=>by,isNumericDependencies:()=>ME,isObject:()=>A,isObjectNode:()=>P,isOperatorNode:()=>U,isParenthesisNode:()=>j,isPositive:()=>Bg,isPositiveDependencies:()=>yA,isPrime:()=>ly,isPrimeDependencies:()=>SC,isRange:()=>y,isRangeNode:()=>L,isRegExp:()=>E,isRelationalNode:()=>H,isResultSet:()=>D,isSparseMatrix:()=>g,isString:()=>p,isSymbolNode:()=>Z,isUndefined:()=>C,isUnit:()=>l,isZero:()=>Og,isZeroDependencies:()=>BE,kldivergence:()=>PD,kldivergenceDependencies:()=>TC,klitzing:()=>$x,klitzingDependencies:()=>BC,kron:()=>Vy,kronDependencies:()=>OC,larger:()=>wv,largerDependencies:()=>WE,largerEq:()=>Wy,largerEqDependencies:()=>vA,lcm:()=>Qv,lcmDependencies:()=>kC,leafCount:()=>NN,leafCountDependencies:()=>RC,leftShift:()=>Yy,leftShiftDependencies:()=>PC,lgamma:()=>qg,lgammaDependencies:()=>UC,log:()=>Nv,log10:()=>Ig,log10Dependencies:()=>jC,log1p:()=>Xv,log1pDependencies:()=>LC,log2:()=>zg,log2Dependencies:()=>WS,logDependencies:()=>CC,loschmidt:()=>Gx,loschmidtDependencies:()=>HC,lsolve:()=>Kv,lsolveAll:()=>mx,lsolveAllDependencies:()=>$C,lsolveDependencies:()=>ZC,lup:()=>Dx,lupDependencies:()=>VC,lusolve:()=>yD,lusolveDependencies:()=>YC,lyap:()=>YD,lyapDependencies:()=>KC,mad:()=>UD,madDependencies:()=>tM,magneticConstant:()=>Vx,magneticConstantDependencies:()=>nM,magneticFluxQuantum:()=>vD,magneticFluxQuantumDependencies:()=>iM,map:()=>kg,mapDependencies:()=>MC,mapTransformDependencies:()=>aM,matrix:()=>wy,matrixDependencies:()=>HN,matrixFromColumns:()=>Jy,matrixFromColumnsDependencies:()=>CS,matrixFromFunction:()=>Ny,matrixFromFunctionDependencies:()=>oM,matrixFromRows:()=>Ev,matrixFromRowsDependencies:()=>sM,max:()=>ex,maxDependencies:()=>uM,maxTransformDependencies:()=>cM,mean:()=>OD,meanDependencies:()=>lM,meanTransformDependencies:()=>pM,median:()=>RD,medianDependencies:()=>rM,min:()=>Av,minDependencies:()=>fM,minTransformDependencies:()=>dM,mod:()=>Qy,modDependencies:()=>wC,mode:()=>Ey,modeDependencies:()=>mM,molarMass:()=>Wx,molarMassC12:()=>xD,molarMassC12Dependencies:()=>gM,molarMassDependencies:()=>hM,molarPlanckConstant:()=>Yx,molarPlanckConstantDependencies:()=>yM,molarVolume:()=>_D,molarVolumeDependencies:()=>vM,multinomial:()=>DD,multinomialDependencies:()=>xM,multiply:()=>Sv,multiplyDependencies:()=>IE,multiplyScalar:()=>Rg,multiplyScalarDependencies:()=>FE,neutronMass:()=>Jx,neutronMassDependencies:()=>bM,norm:()=>HD,normDependencies:()=>JC,not:()=>Pg,notDependencies:()=>tE,nthRoot:()=>Xy,nthRootDependencies:()=>wM,nthRoots:()=>Cv,nthRootsDependencies:()=>NM,nuclearMagneton:()=>Qx,nuclearMagnetonDependencies:()=>EM,nullDependencies:()=>AM,number:()=>Ug,numberDependencies:()=>xE,numeric:()=>Ay,numericDependencies:()=>DE,oct:()=>jg,octDependencies:()=>SM,ones:()=>Ky,onesDependencies:()=>CM,or:()=>Mv,orDependencies:()=>MM,parse:()=>vN,parseDependencies:()=>RA,parser:()=>BN,parserDependencies:()=>TM,partitionSelect:()=>Fv,partitionSelectDependencies:()=>eM,permutations:()=>bD,permutationsDependencies:()=>BM,phi:()=>Ih,phiDependencies:()=>OM,pi:()=>Gh,piDependencies:()=>_M,pickRandom:()=>Lg,pickRandomDependencies:()=>qM,pinv:()=>bx,pinvDependencies:()=>IM,planckCharge:()=>Xx,planckChargeDependencies:()=>zM,planckConstant:()=>qD,planckConstantDependencies:()=>kM,planckLength:()=>Kx,planckLengthDependencies:()=>RM,planckMass:()=>wD,planckMassDependencies:()=>PM,planckTemperature:()=>eD,planckTemperatureDependencies:()=>UM,planckTime:()=>$D,planckTimeDependencies:()=>jM,polynomialRoot:()=>ND,polynomialRootDependencies:()=>HM,pow:()=>wx,powDependencies:()=>UE,print:()=>Hg,printDependencies:()=>ZM,prod:()=>Sy,prodDependencies:()=>YA,protonMass:()=>rD,protonMassDependencies:()=>$M,qr:()=>rx,qrDependencies:()=>FS,quantileSeq:()=>Tv,quantileSeqDependencies:()=>GM,quantumOfCirculation:()=>ID,quantumOfCirculationDependencies:()=>VM,random:()=>Zg,randomDependencies:()=>WM,randomInt:()=>py,randomIntDependencies:()=>YM,range:()=>tx,rangeDependencies:()=>DA,rangeTransformDependencies:()=>QM,rationalize:()=>ON,rationalizeDependencies:()=>XM,re:()=>$g,reDependencies:()=>TS,reducedPlanckConstant:()=>tD,reducedPlanckConstantDependencies:()=>KM,replacer:()=>Vh,replacerDependencies:()=>eF,reshape:()=>Cy,reshapeDependencies:()=>rF,resize:()=>ev,resizeDependencies:()=>tF,resolve:()=>xN,resolveDependencies:()=>cS,reviver:()=>cN,reviverDependencies:()=>nF,rightArithShift:()=>rv,rightArithShiftDependencies:()=>iF,rightLogShift:()=>Bv,rightLogShiftDependencies:()=>aF,rotate:()=>VD,rotateDependencies:()=>sF,rotationMatrix:()=>ZD,rotationMatrixDependencies:()=>oF,round:()=>tv,roundDependencies:()=>NE,row:()=>nx,rowDependencies:()=>uF,rowTransformDependencies:()=>cF,rydberg:()=>nD,rydbergDependencies:()=>lF,sackurTetrode:()=>Ph,sackurTetrodeDependencies:()=>dF,schur:()=>GD,schurDependencies:()=>QC,sec:()=>Gg,secDependencies:()=>mF,sech:()=>fy,sechDependencies:()=>hF,secondRadiation:()=>iD,secondRadiationDependencies:()=>gF,setCartesian:()=>ix,setCartesianDependencies:()=>yF,setDifference:()=>hx,setDifferenceDependencies:()=>vF,setDistinct:()=>ax,setDistinctDependencies:()=>xF,setIntersect:()=>Nx,setIntersectDependencies:()=>DF,setIsSubset:()=>ox,setIsSubsetDependencies:()=>bF,setMultiplicity:()=>gx,setMultiplicityDependencies:()=>wF,setPowerset:()=>sx,setPowersetDependencies:()=>NF,setSize:()=>ED,setSizeDependencies:()=>EF,setSymDifference:()=>yx,setSymDifferenceDependencies:()=>AF,setUnion:()=>Ex,setUnionDependencies:()=>SF,sign:()=>Vg,signDependencies:()=>MS,simplify:()=>MN,simplifyConstant:()=>DN,simplifyConstantDependencies:()=>lS,simplifyCore:()=>EN,simplifyCoreDependencies:()=>pS,simplifyDependencies:()=>fS,sin:()=>Wg,sinDependencies:()=>BS,sinh:()=>dy,sinhDependencies:()=>CF,size:()=>My,sizeDependencies:()=>_E,slu:()=>ux,sluDependencies:()=>WC,smaller:()=>nv,smallerDependencies:()=>mA,smallerEq:()=>Ov,smallerEqDependencies:()=>xA,solveODE:()=>AD,solveODEDependencies:()=>MF,sort:()=>cx,sortDependencies:()=>FF,sparse:()=>my,sparseDependencies:()=>TF,speedOfLight:()=>aD,speedOfLightDependencies:()=>BF,splitUnit:()=>Jg,splitUnitDependencies:()=>OF,sqrt:()=>hy,sqrtDependencies:()=>vS,sqrtm:()=>Ax,sqrtmDependencies:()=>_F,square:()=>Qg,squareDependencies:()=>qF,squeeze:()=>Fy,squeezeDependencies:()=>IF,std:()=>jD,stdDependencies:()=>kF,stdTransformDependencies:()=>RF,stefanBoltzmann:()=>oD,stefanBoltzmannDependencies:()=>PF,stirlingS2:()=>SD,stirlingS2Dependencies:()=>YE,string:()=>Xg,stringDependencies:()=>UF,subset:()=>Ty,subsetDependencies:()=>ZN,subsetTransformDependencies:()=>jF,subtract:()=>_v,subtractDependencies:()=>kE,sum:()=>lx,sumDependencies:()=>FC,sumTransformDependencies:()=>LF,sylvester:()=>WD,sylvesterDependencies:()=>XC,symbolicEqual:()=>FN,symbolicEqualDependencies:()=>HF,tan:()=>Kg,tanDependencies:()=>ZF,tanh:()=>gy,tanhDependencies:()=>$F,tau:()=>Uh,tauDependencies:()=>YS,thomsonCrossSection:()=>sD,thomsonCrossSectionDependencies:()=>GF,to:()=>iv,toDependencies:()=>VF,trace:()=>qv,traceDependencies:()=>WF,transpose:()=>By,transposeDependencies:()=>rS,trueDependencies:()=>YF,typeOf:()=>ey,typeOfDependencies:()=>LM,typed:()=>Yh,typedDependencies:()=>RN,unaryMinus:()=>yy,unaryMinusDependencies:()=>zE,unaryPlus:()=>Jh,unaryPlusDependencies:()=>iS,unequal:()=>av,unequalDependencies:()=>JF,unit:()=>CD,unitDependencies:()=>QF,usolve:()=>Iv,usolveAll:()=>px,usolveAllDependencies:()=>_S,usolveDependencies:()=>OS,vacuumImpedance:()=>Cx,vacuumImpedanceDependencies:()=>eT,variance:()=>zD,varianceDependencies:()=>zF,varianceTransformDependencies:()=>rT,version:()=>Lh,versionDependencies:()=>tT,weakMixingAngle:()=>Qh,weakMixingAngleDependencies:()=>nT,wienDisplacement:()=>Mx,wienDisplacementDependencies:()=>iT,xgcd:()=>Oy,xgcdDependencies:()=>NC,xor:()=>ov,xorDependencies:()=>aT,zeros:()=>_y,zerosDependencies:()=>nE,zpk2tf:()=>zv,zpk2tfDependencies:()=>oT});var n={};t.r(n),t.d(n,{createAbs:()=>Ba,createAccessorNode:()=>kb,createAcos:()=>_a,createAcosh:()=>Tu,createAcot:()=>Xa,createAcoth:()=>uc,createAcsc:()=>eo,createAcsch:()=>Ou,createAdd:()=>pp,createAddScalar:()=>to,createAnd:()=>gf,createApply:()=>qu,createApplyTransform:()=>Bw,createArg:()=>no,createArrayNode:()=>xb,createAsec:()=>ku,createAsech:()=>ao,createAsin:()=>$c,createAsinh:()=>oo,createAssignmentNode:()=>jb,createAtan:()=>so,createAtan2:()=>Fd,createAtanh:()=>co,createAtomicMass:()=>Cn,createAvogadro:()=>Mn,createBellNumbers:()=>Im,createBigNumberClass:()=>Yr,createBignumber:()=>lo,createBin:()=>Ru,createBitAnd:()=>dp,createBitNot:()=>Fo,createBitOr:()=>vf,createBitXor:()=>hp,createBlockNode:()=>bb,createBohrMagneton:()=>sn,createBohrRadius:()=>dn,createBoltzmann:()=>Fn,createBoolean:()=>Bo,createCatalan:()=>yp,createCbrt:()=>Vc,createCeil:()=>wf,createChain:()=>_b,createChainClass:()=>Fb,createClassicalElectronRadius:()=>mn,createClone:()=>_o,createColumn:()=>Bd,createColumnTransform:()=>$w,createCombinations:()=>ko,createCombinationsWithRep:()=>Uu,createCompare:()=>xp,createCompareNatural:()=>Af,createCompareText:()=>Np,createCompile:()=>ew,createComplex:()=>Po,createComplexClass:()=>xt,createComposition:()=>Cf,createConcat:()=>Yc,createConcatTransform:()=>_w,createConditionalNode:()=>Nb,createConductanceQuantum:()=>un,createConj:()=>jo,createConstantNode:()=>Ab,createCos:()=>Lu,createCosh:()=>Ho,createCot:()=>cc,createCoth:()=>$o,createCoulomb:()=>an,createCount:()=>Xc,createCreateUnit:()=>nm,createCross:()=>Ff,createCsc:()=>Vo,createCsch:()=>Zu,createCtranspose:()=>el,createCube:()=>Yo,createCumSum:()=>Ap,createCumSumTransform:()=>Pw,createDeepEqual:()=>Cp,createDenseMatrixClass:()=>qi,createDerivative:()=>Dw,createDet:()=>Tf,createDeuteronMass:()=>Dn,createDiag:()=>tl,createDiff:()=>Of,createDiffTransform:()=>jw,createDistance:()=>qf,createDivide:()=>dm,createDivideScalar:()=>il,createDot:()=>Mp,createDotDivide:()=>hl,createDotMultiply:()=>kf,createDotPow:()=>am,createE:()=>Rt,createEfimovFactor:()=>Sn,createEigs:()=>km,createElectricConstant:()=>tn,createElectronMass:()=>hn,createElementaryCharge:()=>on,createEqual:()=>yl,createEqualScalar:()=>Ko,createEqualText:()=>Tp,createErf:()=>es,createEvaluate:()=>sw,createExp:()=>os,createExpm:()=>sm,createExpm1:()=>us,createFactorial:()=>hm,createFalse:()=>Ot,createFaraday:()=>Tn,createFermiCoupling:()=>gn,createFft:()=>um,createFibonacciHeapClass:()=>Rf,createFilter:()=>ls,createFilterTransform:()=>Sw,createFineStructure:()=>yn,createFirstRadiation:()=>Bn,createFix:()=>Lf,createFlatten:()=>Dl,createFloor:()=>qp,createForEach:()=>ds,createForEachTransform:()=>Mw,createFormat:()=>gs,createFraction:()=>lc,createFractionClass:()=>Qn,createFreqz:()=>nh,createFunctionAssignmentNode:()=>Bb,createFunctionNode:()=>$b,createGamma:()=>lm,createGasConstant:()=>_n,createGcd:()=>Fl,createGetMatrixDataType:()=>vs,createGravitationConstant:()=>Xt,createGravity:()=>Ln,createHartreeEnergy:()=>vn,createHasNumericValue:()=>Bl,createHelp:()=>fw,createHelpClass:()=>rw,createHex:()=>xs,createHypot:()=>zp,createI:()=>Gt,createIdentity:()=>_l,createIfft:()=>fm,createIm:()=>Ds,createImmutableDenseMatrixClass:()=>kp,createIndex:()=>Zf,createIndexClass:()=>Rp,createIndexNode:()=>Pb,createIndexTransform:()=>Lw,createInfinity:()=>qt,createIntersect:()=>$f,createInv:()=>jd,createInverseConductanceQuantum:()=>cn,createInvmod:()=>Up,createIsInteger:()=>ws,createIsNaN:()=>Gu,createIsNegative:()=>Fs,createIsNumeric:()=>fc,createIsPositive:()=>Bs,createIsPrime:()=>Wu,createIsZero:()=>_s,createKldivergence:()=>Jm,createKlitzing:()=>fn,createKron:()=>Il,createLN10:()=>jt,createLN2:()=>Ut,createLOG10E:()=>Ht,createLOG2E:()=>Lt,createLarger:()=>Lp,createLargerEq:()=>kl,createLcm:()=>Gf,createLeafCount:()=>nw,createLeftShift:()=>Ll,createLgamma:()=>js,createLog:()=>Zp,createLog10:()=>Hs,createLog1p:()=>Wf,createLog2:()=>$s,createLoschmidt:()=>On,createLsolve:()=>Jf,createLsolveAll:()=>_d,createLup:()=>Ld,createLusolve:()=>vm,createLyap:()=>bh,createMad:()=>Xm,createMagneticConstant:()=>rn,createMagneticFluxQuantum:()=>ln,createMap:()=>Gs,createMapTransform:()=>Fw,createMatrix:()=>mc,createMatrixClass:()=>Xn,createMatrixFromColumns:()=>Zl,createMatrixFromFunction:()=>gc,createMatrixFromRows:()=>Gp,createMax:()=>Qf,createMaxTransform:()=>Iw,createMean:()=>Um,createMeanTransform:()=>Gw,createMedian:()=>Vm,createMin:()=>Vp,createMinTransform:()=>kw,createMod:()=>Gl,createMode:()=>vc,createMolarMass:()=>Un,createMolarMassC12:()=>jn,createMolarPlanckConstant:()=>qn,createMolarVolume:()=>In,createMultinomial:()=>Dm,createMultiply:()=>Yp,createMultiplyScalar:()=>Ws,createNaN:()=>It,createNeutronMass:()=>bn,createNode:()=>QD,createNorm:()=>oh,createNot:()=>eu,createNthRoot:()=>Yl,createNthRoots:()=>Qp,createNuclearMagneton:()=>pn,createNull:()=>_t,createNumber:()=>ru,createNumeric:()=>wc,createObjectNode:()=>KD,createOct:()=>tu,createOnes:()=>Jl,createOperatorNode:()=>db,createOr:()=>Xp,createParenthesisNode:()=>hb,createParse:()=>Vb,createParser:()=>ww,createParserClass:()=>dw,createPartitionSelect:()=>ef,createPermutations:()=>wm,createPhi:()=>Pt,createPi:()=>zt,createPickRandom:()=>su,createPinv:()=>Zd,createPlanckCharge:()=>Gn,createPlanckConstant:()=>Kt,createPlanckLength:()=>Hn,createPlanckMass:()=>Zn,createPlanckTemperature:()=>Vn,createPlanckTime:()=>$n,createPolynomialRoot:()=>Am,createPow:()=>$d,createPrint:()=>cu,createProd:()=>Ac,createProtonMass:()=>xn,createQr:()=>Xf,createQuantileSeq:()=>rf,createQuantumOfCirculation:()=>wn,createRandom:()=>du,createRandomInt:()=>Ju,createRange:()=>ed,createRangeClass:()=>Kn,createRangeNode:()=>Cb,createRangeTransform:()=>Hw,createRationalize:()=>Ew,createRe:()=>mu,createReducedPlanckConstant:()=>en,createRelationalNode:()=>yb,createReplacer:()=>Ii,createReshape:()=>Cc,createResize:()=>Ql,createResolve:()=>Wb,createResultSet:()=>ei,createReviver:()=>Mb,createRightArithShift:()=>Kl,createRightLogShift:()=>nf,createRotate:()=>hh,createRotationMatrix:()=>ch,createRound:()=>tp,createRow:()=>rd,createRowTransform:()=>Zw,createRydberg:()=>Nn,createSQRT1_2:()=>Zt,createSQRT2:()=>$t,createSackurTetrode:()=>zn,createSchur:()=>fh,createSec:()=>hu,createSech:()=>Xu,createSecondRadiation:()=>kn,createSetCartesian:()=>nd,createSetDifference:()=>Id,createSetDistinct:()=>ad,createSetIntersect:()=>Vd,createSetIsSubset:()=>sd,createSetMultiplicity:()=>kd,createSetPowerset:()=>cd,createSetSize:()=>Cm,createSetSymDifference:()=>Pd,createSetUnion:()=>Yd,createSign:()=>yu,createSimplify:()=>gw,createSimplifyConstant:()=>Xb,createSimplifyCore:()=>aw,createSin:()=>vu,createSinh:()=>ec,createSize:()=>Fc,createSlu:()=>wd,createSmaller:()=>ip,createSmallerEq:()=>of,createSolveODE:()=>Fm,createSort:()=>Ed,createSpaClass:()=>Ud,createSparse:()=>tc,createSparseMatrixClass:()=>xu,createSpeedOfLight:()=>Qt,createSplitUnit:()=>bu,createSqrt:()=>nc,createSqrtm:()=>Qd,createSquare:()=>Nu,createSqueeze:()=>Bc,createStd:()=>eh,createStdTransform:()=>Yw,createStefanBoltzmann:()=>Rn,createStirlingS2:()=>Bm,createString:()=>Au,createSubset:()=>_c,createSubsetTransform:()=>Ow,createSubtract:()=>cf,createSum:()=>Ad,createSumTransform:()=>zw,createSylvester:()=>vh,createSymbolNode:()=>Lb,createSymbolicEqual:()=>vw,createTan:()=>Su,createTanh:()=>ic,createTau:()=>kt,createThomsonCrossSection:()=>En,createTo:()=>op,createTrace:()=>lf,createTranspose:()=>Pc,createTrue:()=>Bt,createTypeOf:()=>Mu,createTyped:()=>Ji,createUnaryMinus:()=>oc,createUnaryPlus:()=>Ta,createUnequal:()=>up,createUnitClass:()=>rm,createUnitFunction:()=>_m,createUppercaseE:()=>Wt,createUppercasePi:()=>Vt,createUsolve:()=>df,createUsolveAll:()=>Cd,createVacuumImpedance:()=>nn,createVariance:()=>Zm,createVarianceTransform:()=>Ww,createVersion:()=>Yt,createWeakMixingAngle:()=>An,createWienDisplacement:()=>Pn,createXgcd:()=>jc,createXor:()=>lp,createZeros:()=>Hc,createZpk2tf:()=>hf});var i=t(7462),a={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function o(e){return"number"==typeof e}function s(e){return!(!e||"object"!=typeof e||"function"!=typeof e.constructor)&&(!0===e.isBigNumber&&"object"==typeof e.constructor.prototype&&!0===e.constructor.prototype.isBigNumber||"function"==typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function u(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function c(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}function l(e){return e&&!0===e.constructor.prototype.isUnit||!1}function p(e){return"string"==typeof e}var f=Array.isArray;function d(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function m(e){return Array.isArray(e)||d(e)}function h(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function g(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function y(e){return e&&!0===e.constructor.prototype.isRange||!1}function v(e){return e&&!0===e.constructor.prototype.isIndex||!1}function x(e){return"boolean"==typeof e}function D(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function b(e){return e&&!0===e.constructor.prototype.isHelp||!1}function w(e){return"function"==typeof e}function N(e){return e instanceof Date}function E(e){return e instanceof RegExp}function A(e){return!(!e||"object"!=typeof e||e.constructor!==Object||u(e)||c(e))}function S(e){return null===e}function C(e){return void 0===e}function M(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function F(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function T(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function B(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function O(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function _(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function q(e){return _(e)||U(e)&&1===e.args.length&&_(e.args[0])&&"-+~".includes(e.op)}function I(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function z(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function k(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function R(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function P(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function U(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function j(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function L(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function H(e){return e&&!0===e.isRelationalNode&&!0===e.constructor.prototype.isNode||!1}function Z(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function $(e){return e&&!0===e.constructor.prototype.isChain||!1}function G(e){var r=typeof e;return"object"===r?null===e?"null":s(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":r}function V(e){var r=typeof e;if("number"===r||"string"===r||"boolean"===r||null==e)return e;if("function"==typeof e.clone)return e.clone();if(Array.isArray(e))return e.map((function(e){return V(e)}));if(e instanceof Date)return new Date(e.valueOf());if(s(e))return e;if(e instanceof RegExp)throw new TypeError("Cannot clone "+e);return W(e,V)}function W(e,r){var t={};for(var n in e)re(e,n)&&(t[n]=r(e[n]));return t}function Y(e,r){for(var t in r)re(r,t)&&(e[t]=r[t]);return e}function J(e,r){if(Array.isArray(r))throw new TypeError("Arrays are not supported by deepExtend");for(var t in r)if(re(r,t)&&!(t in Object.prototype)&&!(t in Function.prototype))if(r[t]&&r[t].constructor===Object)void 0===e[t]&&(e[t]={}),e[t]&&e[t].constructor===Object?J(e[t],r[t]):e[t]=r[t];else{if(Array.isArray(r[t]))throw new TypeError("Arrays are not supported by deepExtend");e[t]=r[t]}return e}function Q(e,r){var t,n,i;if(Array.isArray(e)){if(!Array.isArray(r))return!1;if(e.length!==r.length)return!1;for(n=0,i=e.length;ne[r]))}var ne=["Matrix","Array"],ie=["number","BigNumber","Fraction"];function ae(e,r){function t(t){if(t){var n=W(e,V);oe(t,"matrix",ne),oe(t,"number",ie),J(e,t);var i=W(e,V),a=W(t,V);return r("config",i,n,a),i}return W(e,V)}return t.MATRIX_OPTIONS=ne,t.NUMBER_OPTIONS=ie,Object.keys(a).forEach((r=>{Object.defineProperty(t,r,{get:()=>e[r],enumerable:!0,configurable:!0})})),t}function oe(e,r,t){var n,i;void 0!==e[r]&&(n=t,i=e[r],-1===n.indexOf(i))&&console.warn('Warning: Unknown value "'+e[r]+'" for configuration option "'+r+'". Available options: '+t.map((e=>JSON.stringify(e))).join(", ")+".")}var se=function(e){if(e)throw new Error("The global config is readonly. \nPlease create a mathjs instance if you want to change the default configuration. \nExample:\n\n import { create, all } from 'mathjs';\n const mathjs = create(all);\n mathjs.config({ number: 'BigNumber' });\n");return Object.freeze(a)};(0,i.Z)(se,a,{MATRIX_OPTIONS:ne,NUMBER_OPTIONS:ie});var ue,ce,le=9e15,pe=1e9,fe="0123456789abcdef",de="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",me="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",he={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-le,maxE:le,crypto:!1},ge=!0,ye="[DecimalError] ",ve=ye+"Invalid argument: ",xe=ye+"Precision limit exceeded",De=ye+"crypto unavailable",be="[object Decimal]",we=Math.floor,Ne=Math.pow,Ee=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Ae=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Se=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Ce=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Me=1e7,Fe=7,Te=de.length-1,Be=me.length-1,Oe={toStringTag:be};function _e(e){var r,t,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,r=1;rt)throw Error(ve+e)}function Ie(e,r,t,n){var i,a,o,s;for(a=e[0];a>=10;a/=10)--r;return--r<0?(r+=Fe,i=0):(i=Math.ceil((r+1)/Fe),r%=Fe),a=Ne(10,Fe-r),s=e[i]%a|0,null==n?r<3?(0==r?s=s/100|0:1==r&&(s=s/10|0),o=t<4&&99999==s||t>3&&49999==s||5e4==s||0==s):o=(t<4&&s+1==a||t>3&&s+1==a/2)&&(e[i+1]/a/100|0)==Ne(10,r-2)-1||(s==a/2||0==s)&&0==(e[i+1]/a/100|0):r<4?(0==r?s=s/1e3|0:1==r?s=s/100|0:2==r&&(s=s/10|0),o=(n||t<4)&&9999==s||!n&&t>3&&4999==s):o=((n||t<4)&&s+1==a||!n&&t>3&&s+1==a/2)&&(e[i+1]/a/1e3|0)==Ne(10,r-3)-1,o}function ze(e,r,t){for(var n,i,a=[0],o=0,s=e.length;ot-1&&(void 0===a[n+1]&&(a[n+1]=0),a[n+1]+=a[n]/t|0,a[n]%=t)}return a.reverse()}Oe.absoluteValue=Oe.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Re(e)},Oe.ceil=function(){return Re(new this.constructor(this),this.e+1,2)},Oe.clampedTo=Oe.clamp=function(e,r){var t=this,n=t.constructor;if(e=new n(e),r=new n(r),!e.s||!r.s)return new n(NaN);if(e.gt(r))throw Error(ve+r);return t.cmp(e)<0?e:t.cmp(r)>0?r:new n(t)},Oe.comparedTo=Oe.cmp=function(e){var r,t,n,i,a=this,o=a.d,s=(e=new a.constructor(e)).d,u=a.s,c=e.s;if(!o||!s)return u&&c?u!==c?u:o===s?0:!o^u<0?1:-1:NaN;if(!o[0]||!s[0])return o[0]?u:s[0]?-c:0;if(u!==c)return u;if(a.e!==e.e)return a.e>e.e^u<0?1:-1;for(r=0,t=(n=o.length)<(i=s.length)?n:i;rs[r]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1},Oe.cosine=Oe.cos=function(){var e,r,t=this,n=t.constructor;return t.d?t.d[0]?(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+Fe,n.rounding=1,t=function(e,r){var t,n,i;if(r.isZero())return r;(n=r.d.length)<32?i=(1/er(4,t=Math.ceil(n/3))).toString():(t=16,i="2.3283064365386962890625e-10"),e.precision+=t,r=Ke(e,1,r.times(i),new e(1));for(var a=t;a--;){var o=r.times(r);r=o.times(o).minus(o).times(8).plus(1)}return e.precision-=t,r}(n,rr(n,t)),n.precision=e,n.rounding=r,Re(2==ce||3==ce?t.neg():t,e,r,!0)):new n(1):new n(NaN)},Oe.cubeRoot=Oe.cbrt=function(){var e,r,t,n,i,a,o,s,u,c,l=this,p=l.constructor;if(!l.isFinite()||l.isZero())return new p(l);for(ge=!1,(a=l.s*Ne(l.s*l,1/3))&&Math.abs(a)!=1/0?n=new p(a.toString()):(t=_e(l.d),(a=((e=l.e)-t.length+1)%3)&&(t+=1==a||-2==a?"0":"00"),a=Ne(t,1/3),e=we((e+1)/3)-(e%3==(e<0?-1:2)),(n=new p(t=a==1/0?"5e"+e:(t=a.toExponential()).slice(0,t.indexOf("e")+1)+e)).s=l.s),o=(e=p.precision)+3;;)if(c=(u=(s=n).times(s).times(s)).plus(l),n=ke(c.plus(l).times(s),c.plus(u),o+2,1),_e(s.d).slice(0,o)===(t=_e(n.d)).slice(0,o)){if("9999"!=(t=t.slice(o-3,o+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(Re(n,e+1,1),r=!n.times(n).times(n).eq(l));break}if(!i&&(Re(s,e+1,0),s.times(s).times(s).eq(l))){n=s;break}o+=4,i=1}return ge=!0,Re(n,e,p.rounding,r)},Oe.decimalPlaces=Oe.dp=function(){var e,r=this.d,t=NaN;if(r){if(t=((e=r.length-1)-we(this.e/Fe))*Fe,e=r[e])for(;e%10==0;e/=10)t--;t<0&&(t=0)}return t},Oe.dividedBy=Oe.div=function(e){return ke(this,new this.constructor(e))},Oe.dividedToIntegerBy=Oe.divToInt=function(e){var r=this.constructor;return Re(ke(this,new r(e),0,1,1),r.precision,r.rounding)},Oe.equals=Oe.eq=function(e){return 0===this.cmp(e)},Oe.floor=function(){return Re(new this.constructor(this),this.e+1,3)},Oe.greaterThan=Oe.gt=function(e){return this.cmp(e)>0},Oe.greaterThanOrEqualTo=Oe.gte=function(e){var r=this.cmp(e);return 1==r||0===r},Oe.hyperbolicCosine=Oe.cosh=function(){var e,r,t,n,i,a=this,o=a.constructor,s=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return s;t=o.precision,n=o.rounding,o.precision=t+Math.max(a.e,a.sd())+4,o.rounding=1,(i=a.d.length)<32?r=(1/er(4,e=Math.ceil(i/3))).toString():(e=16,r="2.3283064365386962890625e-10"),a=Ke(o,1,a.times(r),new o(1),!0);for(var u,c=e,l=new o(8);c--;)u=a.times(a),a=s.minus(u.times(l.minus(u.times(l))));return Re(a,o.precision=t,o.rounding=n,!0)},Oe.hyperbolicSine=Oe.sinh=function(){var e,r,t,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(r=a.precision,t=a.rounding,a.precision=r+Math.max(i.e,i.sd())+4,a.rounding=1,(n=i.d.length)<3)i=Ke(a,2,i,i,!0);else{e=(e=1.4*Math.sqrt(n))>16?16:0|e,i=Ke(a,2,i=i.times(1/er(5,e)),i,!0);for(var o,s=new a(5),u=new a(16),c=new a(20);e--;)o=i.times(i),i=i.times(s.plus(o.times(u.times(o).plus(c))))}return a.precision=r,a.rounding=t,Re(i,r,t,!0)},Oe.hyperbolicTangent=Oe.tanh=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+7,n.rounding=1,ke(t.sinh(),t.cosh(),n.precision=e,n.rounding=r)):new n(t.s)},Oe.inverseCosine=Oe.acos=function(){var e,r=this,t=r.constructor,n=r.abs().cmp(1),i=t.precision,a=t.rounding;return-1!==n?0===n?r.isNeg()?Le(t,i,a):new t(0):new t(NaN):r.isZero()?Le(t,i+4,a).times(.5):(t.precision=i+6,t.rounding=1,r=r.asin(),e=Le(t,i+4,a).times(.5),t.precision=i,t.rounding=a,e.minus(r))},Oe.inverseHyperbolicCosine=Oe.acosh=function(){var e,r,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(e=n.precision,r=n.rounding,n.precision=e+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,ge=!1,t=t.times(t).minus(1).sqrt().plus(t),ge=!0,n.precision=e,n.rounding=r,t.ln()):new n(t)},Oe.inverseHyperbolicSine=Oe.asinh=function(){var e,r,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,ge=!1,t=t.times(t).plus(1).sqrt().plus(t),ge=!0,n.precision=e,n.rounding=r,t.ln())},Oe.inverseHyperbolicTangent=Oe.atanh=function(){var e,r,t,n,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,r=a.rounding,n=i.sd(),Math.max(n,e)<2*-i.e-1?Re(new a(i),e,r,!0):(a.precision=t=n-i.e,i=ke(i.plus(1),new a(1).minus(i),t+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=r,i.times(.5))):new a(NaN)},Oe.inverseSine=Oe.asin=function(){var e,r,t,n,i=this,a=i.constructor;return i.isZero()?new a(i):(r=i.abs().cmp(1),t=a.precision,n=a.rounding,-1!==r?0===r?((e=Le(a,t+4,n).times(.5)).s=i.s,e):new a(NaN):(a.precision=t+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=t,a.rounding=n,i.times(2)))},Oe.inverseTangent=Oe.atan=function(){var e,r,t,n,i,a,o,s,u,c=this,l=c.constructor,p=l.precision,f=l.rounding;if(c.isFinite()){if(c.isZero())return new l(c);if(c.abs().eq(1)&&p+4<=Be)return(o=Le(l,p+4,f).times(.25)).s=c.s,o}else{if(!c.s)return new l(NaN);if(p+4<=Be)return(o=Le(l,p+4,f).times(.5)).s=c.s,o}for(l.precision=s=p+10,l.rounding=1,e=t=Math.min(28,s/Fe+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(ge=!1,r=Math.ceil(s/Fe),n=1,u=c.times(c),o=new l(c),i=c;-1!==e;)if(i=i.times(u),a=o.minus(i.div(n+=2)),i=i.times(u),void 0!==(o=a.plus(i.div(n+=2))).d[r])for(e=r;o.d[e]===a.d[e]&&e--;);return t&&(o=o.times(2<this.d.length-2},Oe.isNaN=function(){return!this.s},Oe.isNegative=Oe.isNeg=function(){return this.s<0},Oe.isPositive=Oe.isPos=function(){return this.s>0},Oe.isZero=function(){return!!this.d&&0===this.d[0]},Oe.lessThan=Oe.lt=function(e){return this.cmp(e)<0},Oe.lessThanOrEqualTo=Oe.lte=function(e){return this.cmp(e)<1},Oe.logarithm=Oe.log=function(e){var r,t,n,i,a,o,s,u,c=this,l=c.constructor,p=l.precision,f=l.rounding;if(null==e)e=new l(10),r=!0;else{if(t=(e=new l(e)).d,e.s<0||!t||!t[0]||e.eq(1))return new l(NaN);r=e.eq(10)}if(t=c.d,c.s<0||!t||!t[0]||c.eq(1))return new l(t&&!t[0]?-1/0:1!=c.s?NaN:t?0:1/0);if(r)if(t.length>1)a=!0;else{for(i=t[0];i%10==0;)i/=10;a=1!==i}if(ge=!1,o=Ye(c,s=p+5),n=r?je(l,s+10):Ye(e,s),Ie((u=ke(o,n,s,1)).d,i=p,f))do{if(o=Ye(c,s+=10),n=r?je(l,s+10):Ye(e,s),u=ke(o,n,s,1),!a){+_e(u.d).slice(i+1,i+15)+1==1e14&&(u=Re(u,p+1,0));break}}while(Ie(u.d,i+=10,f));return ge=!0,Re(u,p,f)},Oe.minus=Oe.sub=function(e){var r,t,n,i,a,o,s,u,c,l,p,f,d=this,m=d.constructor;if(e=new m(e),!d.d||!e.d)return d.s&&e.s?d.d?e.s=-e.s:e=new m(e.d||d.s!==e.s?d:NaN):e=new m(NaN),e;if(d.s!=e.s)return e.s=-e.s,d.plus(e);if(c=d.d,f=e.d,s=m.precision,u=m.rounding,!c[0]||!f[0]){if(f[0])e.s=-e.s;else{if(!c[0])return new m(3===u?-0:0);e=new m(d)}return ge?Re(e,s,u):e}if(t=we(e.e/Fe),l=we(d.e/Fe),c=c.slice(),a=l-t){for((p=a<0)?(r=c,a=-a,o=f.length):(r=f,t=l,o=c.length),a>(n=Math.max(Math.ceil(s/Fe),o)+2)&&(a=n,r.length=1),r.reverse(),n=a;n--;)r.push(0);r.reverse()}else{for((p=(n=c.length)<(o=f.length))&&(o=n),n=0;n0;--n)c[o++]=0;for(n=f.length;n>a;){if(c[--n](o=(a=Math.ceil(s/Fe))>o?a+1:o+1)&&(i=o,t.length=1),t.reverse();i--;)t.push(0);t.reverse()}for((o=c.length)-(i=l.length)<0&&(i=o,t=l,l=c,c=t),r=0;i;)r=(c[--i]=c[i]+l[i]+r)/Me|0,c[i]%=Me;for(r&&(c.unshift(r),++n),o=c.length;0==c[--o];)c.pop();return e.d=c,e.e=Ue(c,n),ge?Re(e,s,u):e},Oe.precision=Oe.sd=function(e){var r,t=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(ve+e);return t.d?(r=He(t.d),e&&t.e+1>r&&(r=t.e+1)):r=NaN,r},Oe.round=function(){var e=this,r=e.constructor;return Re(new r(e),e.e+1,r.rounding)},Oe.sine=Oe.sin=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+Fe,n.rounding=1,t=function(e,r){var t,n=r.d.length;if(n<3)return r.isZero()?r:Ke(e,2,r,r);t=(t=1.4*Math.sqrt(n))>16?16:0|t,r=Ke(e,2,r=r.times(1/er(5,t)),r);for(var i,a=new e(5),o=new e(16),s=new e(20);t--;)i=r.times(r),r=r.times(a.plus(i.times(o.times(i).minus(s))));return r}(n,rr(n,t)),n.precision=e,n.rounding=r,Re(ce>2?t.neg():t,e,r,!0)):new n(NaN)},Oe.squareRoot=Oe.sqrt=function(){var e,r,t,n,i,a,o=this,s=o.d,u=o.e,c=o.s,l=o.constructor;if(1!==c||!s||!s[0])return new l(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);for(ge=!1,0==(c=Math.sqrt(+o))||c==1/0?(((r=_e(s)).length+u)%2==0&&(r+="0"),c=Math.sqrt(r),u=we((u+1)/2)-(u<0||u%2),n=new l(r=c==1/0?"5e"+u:(r=c.toExponential()).slice(0,r.indexOf("e")+1)+u)):n=new l(c.toString()),t=(u=l.precision)+3;;)if(n=(a=n).plus(ke(o,a,t+2,1)).times(.5),_e(a.d).slice(0,t)===(r=_e(n.d)).slice(0,t)){if("9999"!=(r=r.slice(t-3,t+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(Re(n,u+1,1),e=!n.times(n).eq(o));break}if(!i&&(Re(a,u+1,0),a.times(a).eq(o))){n=a;break}t+=4,i=1}return ge=!0,Re(n,u,l.rounding,e)},Oe.tangent=Oe.tan=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+10,n.rounding=1,(t=t.sin()).s=1,t=ke(t,new n(1).minus(t.times(t)).sqrt(),e+10,0),n.precision=e,n.rounding=r,Re(2==ce||4==ce?t.neg():t,e,r,!0)):new n(NaN)},Oe.times=Oe.mul=function(e){var r,t,n,i,a,o,s,u,c,l=this,p=l.constructor,f=l.d,d=(e=new p(e)).d;if(e.s*=l.s,!(f&&f[0]&&d&&d[0]))return new p(!e.s||f&&!f[0]&&!d||d&&!d[0]&&!f?NaN:f&&d?0*e.s:e.s/0);for(t=we(l.e/Fe)+we(e.e/Fe),(u=f.length)<(c=d.length)&&(a=f,f=d,d=a,o=u,u=c,c=o),a=[],n=o=u+c;n--;)a.push(0);for(n=c;--n>=0;){for(r=0,i=u+n;i>n;)s=a[i]+d[n]*f[i-n-1]+r,a[i--]=s%Me|0,r=s/Me|0;a[i]=(a[i]+r)%Me|0}for(;!a[--o];)a.pop();return r?++t:a.shift(),e.d=a,e.e=Ue(a,t),ge?Re(e,p.precision,p.rounding):e},Oe.toBinary=function(e,r){return tr(this,2,e,r)},Oe.toDecimalPlaces=Oe.toDP=function(e,r){var t=this,n=t.constructor;return t=new n(t),void 0===e?t:(qe(e,0,pe),void 0===r?r=n.rounding:qe(r,0,8),Re(t,e+t.e+1,r))},Oe.toExponential=function(e,r){var t,n=this,i=n.constructor;return void 0===e?t=Pe(n,!0):(qe(e,0,pe),void 0===r?r=i.rounding:qe(r,0,8),t=Pe(n=Re(new i(n),e+1,r),!0,e+1)),n.isNeg()&&!n.isZero()?"-"+t:t},Oe.toFixed=function(e,r){var t,n,i=this,a=i.constructor;return void 0===e?t=Pe(i):(qe(e,0,pe),void 0===r?r=a.rounding:qe(r,0,8),t=Pe(n=Re(new a(i),e+i.e+1,r),!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+t:t},Oe.toFraction=function(e){var r,t,n,i,a,o,s,u,c,l,p,f,d=this,m=d.d,h=d.constructor;if(!m)return new h(d);if(c=t=new h(1),n=u=new h(0),o=(a=(r=new h(n)).e=He(m)-d.e-1)%Fe,r.d[0]=Ne(10,o<0?Fe+o:o),null==e)e=a>0?r:c;else{if(!(s=new h(e)).isInt()||s.lt(c))throw Error(ve+s);e=s.gt(r)?a>0?r:c:s}for(ge=!1,s=new h(_e(m)),l=h.precision,h.precision=a=m.length*Fe*2;p=ke(s,r,0,1,1),1!=(i=t.plus(p.times(n))).cmp(e);)t=n,n=i,i=c,c=u.plus(p.times(i)),u=i,i=r,r=s.minus(p.times(i)),s=i;return i=ke(e.minus(t),n,0,1,1),u=u.plus(i.times(c)),t=t.plus(i.times(n)),u.s=c.s=d.s,f=ke(c,n,a,1).minus(d).abs().cmp(ke(u,t,a,1).minus(d).abs())<1?[c,n]:[u,t],h.precision=l,ge=!0,f},Oe.toHexadecimal=Oe.toHex=function(e,r){return tr(this,16,e,r)},Oe.toNearest=function(e,r){var t=this,n=t.constructor;if(t=new n(t),null==e){if(!t.d)return t;e=new n(1),r=n.rounding}else{if(e=new n(e),void 0===r?r=n.rounding:qe(r,0,8),!t.d)return e.s?t:e;if(!e.d)return e.s&&(e.s=t.s),e}return e.d[0]?(ge=!1,t=ke(t,e,0,r,1).times(e),ge=!0,Re(t)):(e.s=t.s,t=e),t},Oe.toNumber=function(){return+this},Oe.toOctal=function(e,r){return tr(this,8,e,r)},Oe.toPower=Oe.pow=function(e){var r,t,n,i,a,o,s=this,u=s.constructor,c=+(e=new u(e));if(!(s.d&&e.d&&s.d[0]&&e.d[0]))return new u(Ne(+s,c));if((s=new u(s)).eq(1))return s;if(n=u.precision,a=u.rounding,e.eq(1))return Re(s,n,a);if((r=we(e.e/Fe))>=e.d.length-1&&(t=c<0?-c:c)<=9007199254740991)return i=$e(u,s,t,n),e.s<0?new u(1).div(i):Re(i,n,a);if((o=s.s)<0){if(ru.maxE+1||r0?o/0:0):(ge=!1,u.rounding=s.s=1,t=Math.min(12,(r+"").length),(i=We(e.times(Ye(s,n+t)),n)).d&&Ie((i=Re(i,n+5,1)).d,n,a)&&(r=n+10,+_e((i=Re(We(e.times(Ye(s,r+t)),r),r+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=Re(i,n+1,0))),i.s=o,ge=!0,u.rounding=a,Re(i,n,a))},Oe.toPrecision=function(e,r){var t,n=this,i=n.constructor;return void 0===e?t=Pe(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(qe(e,1,pe),void 0===r?r=i.rounding:qe(r,0,8),t=Pe(n=Re(new i(n),e,r),e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+t:t},Oe.toSignificantDigits=Oe.toSD=function(e,r){var t=this.constructor;return void 0===e?(e=t.precision,r=t.rounding):(qe(e,1,pe),void 0===r?r=t.rounding:qe(r,0,8)),Re(new t(this),e,r)},Oe.toString=function(){var e=this,r=e.constructor,t=Pe(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()&&!e.isZero()?"-"+t:t},Oe.truncated=Oe.trunc=function(){return Re(new this.constructor(this),this.e+1,1)},Oe.valueOf=Oe.toJSON=function(){var e=this,r=e.constructor,t=Pe(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()?"-"+t:t};var ke=function(){function e(e,r,t){var n,i=0,a=e.length;for(e=e.slice();a--;)n=e[a]*r+i,e[a]=n%t|0,i=n/t|0;return i&&e.unshift(i),e}function r(e,r,t,n){var i,a;if(t!=n)a=t>n?1:-1;else for(i=a=0;ir[i]?1:-1;break}return a}function t(e,r,t,n){for(var i=0;t--;)e[t]-=i,i=e[t]1;)e.shift()}return function(n,i,a,o,s,u){var c,l,p,f,d,m,h,g,y,v,x,D,b,w,N,E,A,S,C,M,F=n.constructor,T=n.s==i.s?1:-1,B=n.d,O=i.d;if(!(B&&B[0]&&O&&O[0]))return new F(n.s&&i.s&&(B?!O||B[0]!=O[0]:O)?B&&0==B[0]||!O?0*T:T/0:NaN);for(u?(d=1,l=n.e-i.e):(u=Me,d=Fe,l=we(n.e/d)-we(i.e/d)),C=O.length,A=B.length,v=(y=new F(T)).d=[],p=0;O[p]==(B[p]||0);p++);if(O[p]>(B[p]||0)&&l--,null==a?(w=a=F.precision,o=F.rounding):w=s?a+(n.e-i.e)+1:a,w<0)v.push(1),m=!0;else{if(w=w/d+2|0,p=0,1==C){for(f=0,O=O[0],w++;(p1&&(O=e(O,f,u),B=e(B,f,u),C=O.length,A=B.length),E=C,D=(x=B.slice(0,C)).length;D=u/2&&++S;do{f=0,(c=r(O,x,C,D))<0?(b=x[0],C!=D&&(b=b*u+(x[1]||0)),(f=b/S|0)>1?(f>=u&&(f=u-1),1==(c=r(h=e(O,f,u),x,g=h.length,D=x.length))&&(f--,t(h,C=10;f/=10)p++;y.e=p+l*d-1,Re(y,s?a+y.e+1:a,o,m)}return y}}();function Re(e,r,t,n){var i,a,o,s,u,c,l,p,f,d=e.constructor;e:if(null!=r){if(!(p=e.d))return e;for(i=1,s=p[0];s>=10;s/=10)i++;if((a=r-i)<0)a+=Fe,o=r,u=(l=p[f=0])/Ne(10,i-o-1)%10|0;else if((f=Math.ceil((a+1)/Fe))>=(s=p.length)){if(!n)break e;for(;s++<=f;)p.push(0);l=u=0,i=1,o=(a%=Fe)-Fe+1}else{for(l=s=p[f],i=1;s>=10;s/=10)i++;u=(o=(a%=Fe)-Fe+i)<0?0:l/Ne(10,i-o-1)%10|0}if(n=n||r<0||void 0!==p[f+1]||(o<0?l:l%Ne(10,i-o-1)),c=t<4?(u||n)&&(0==t||t==(e.s<0?3:2)):u>5||5==u&&(4==t||n||6==t&&(a>0?o>0?l/Ne(10,i-o):0:p[f-1])%10&1||t==(e.s<0?8:7)),r<1||!p[0])return p.length=0,c?(r-=e.e+1,p[0]=Ne(10,(Fe-r%Fe)%Fe),e.e=-r||0):p[0]=e.e=0,e;if(0==a?(p.length=f,s=1,f--):(p.length=f+1,s=Ne(10,Fe-a),p[f]=o>0?(l/Ne(10,i-o)%Ne(10,o)|0)*s:0),c)for(;;){if(0==f){for(a=1,o=p[0];o>=10;o/=10)a++;for(o=p[0]+=s,s=1;o>=10;o/=10)s++;a!=s&&(e.e++,p[0]==Me&&(p[0]=1));break}if(p[f]+=s,p[f]!=Me)break;p[f--]=0,s=1}for(a=p.length;0===p[--a];)p.pop()}return ge&&(e.e>d.maxE?(e.d=null,e.e=NaN):e.e0?a=a.charAt(0)+"."+a.slice(1)+Ze(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+Ze(-i-1)+a,t&&(n=t-o)>0&&(a+=Ze(n))):i>=o?(a+=Ze(i+1-o),t&&(n=t-i-1)>0&&(a=a+"."+Ze(n))):((n=i+1)0&&(i+1===o&&(a+="."),a+=Ze(n))),a}function Ue(e,r){var t=e[0];for(r*=Fe;t>=10;t/=10)r++;return r}function je(e,r,t){if(r>Te)throw ge=!0,t&&(e.precision=t),Error(xe);return Re(new e(de),r,1,!0)}function Le(e,r,t){if(r>Be)throw Error(xe);return Re(new e(me),r,t,!0)}function He(e){var r=e.length-1,t=r*Fe+1;if(r=e[r]){for(;r%10==0;r/=10)t--;for(r=e[0];r>=10;r/=10)t++}return t}function Ze(e){for(var r="";e--;)r+="0";return r}function $e(e,r,t,n){var i,a=new e(1),o=Math.ceil(n/Fe+4);for(ge=!1;;){if(t%2&&nr((a=a.times(r)).d,o)&&(i=!0),0===(t=we(t/2))){t=a.d.length-1,i&&0===a.d[t]&&++a.d[t];break}nr((r=r.times(r)).d,o)}return ge=!0,a}function Ge(e){return 1&e.d[e.d.length-1]}function Ve(e,r,t){for(var n,i=new e(r[0]),a=0;++a17)return new f(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==r?(ge=!1,u=m):u=r,s=new f(.03125);e.e>-2;)e=e.times(s),p+=5;for(u+=n=Math.log(Ne(2,p))/Math.LN10*2+5|0,t=a=o=new f(1),f.precision=u;;){if(a=Re(a.times(e),u,1),t=t.times(++l),_e((s=o.plus(ke(a,t,u,1))).d).slice(0,u)===_e(o.d).slice(0,u)){for(i=p;i--;)o=Re(o.times(o),u,1);if(null!=r)return f.precision=m,o;if(!(c<3&&Ie(o.d,u-n,d,c)))return Re(o,f.precision=m,d,ge=!0);f.precision=u+=10,t=a=s=new f(1),l=0,c++}o=s}}function Ye(e,r){var t,n,i,a,o,s,u,c,l,p,f,d=1,m=e,h=m.d,g=m.constructor,y=g.rounding,v=g.precision;if(m.s<0||!h||!h[0]||!m.e&&1==h[0]&&1==h.length)return new g(h&&!h[0]?-1/0:1!=m.s?NaN:h?0:m);if(null==r?(ge=!1,l=v):l=r,g.precision=l+=10,n=(t=_e(h)).charAt(0),!(Math.abs(a=m.e)<15e14))return c=je(g,l+2,v).times(a+""),m=Ye(new g(n+"."+t.slice(1)),l-10).plus(c),g.precision=v,null==r?Re(m,v,y,ge=!0):m;for(;n<7&&1!=n||1==n&&t.charAt(1)>3;)n=(t=_e((m=m.times(e)).d)).charAt(0),d++;for(a=m.e,n>1?(m=new g("0."+t),a++):m=new g(n+"."+t.slice(1)),p=m,u=o=m=ke(m.minus(1),m.plus(1),l,1),f=Re(m.times(m),l,1),i=3;;){if(o=Re(o.times(f),l,1),_e((c=u.plus(ke(o,new g(i),l,1))).d).slice(0,l)===_e(u.d).slice(0,l)){if(u=u.times(2),0!==a&&(u=u.plus(je(g,l+2,v).times(a+""))),u=ke(u,new g(d),l,1),null!=r)return g.precision=v,u;if(!Ie(u.d,l-10,y,s))return Re(u,g.precision=v,y,ge=!0);g.precision=l+=10,c=o=m=ke(p.minus(1),p.plus(1),l,1),f=Re(m.times(m),l,1),i=s=1}u=c,i+=2}}function Je(e){return String(e.s*e.s/0)}function Qe(e,r){var t,n,i;for((t=r.indexOf("."))>-1&&(r=r.replace(".","")),(n=r.search(/e/i))>0?(t<0&&(t=n),t+=+r.slice(n+1),r=r.substring(0,n)):t<0&&(t=r.length),n=0;48===r.charCodeAt(n);n++);for(i=r.length;48===r.charCodeAt(i-1);--i);if(r=r.slice(n,i)){if(i-=n,e.e=t=t-n-1,e.d=[],n=(t+1)%Fe,t<0&&(n+=Fe),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(r=r.replace(/(\d)_(?=\d)/g,"$1"),Ce.test(r))return Qe(e,r)}else if("Infinity"===r||"NaN"===r)return+r||(e.s=NaN),e.e=NaN,e.d=null,e;if(Ae.test(r))t=16,r=r.toLowerCase();else if(Ee.test(r))t=2;else{if(!Se.test(r))throw Error(ve+r);t=8}for((a=r.search(/p/i))>0?(u=+r.slice(a+1),r=r.substring(2,a)):r=r.slice(2),o=(a=r.indexOf("."))>=0,n=e.constructor,o&&(a=(s=(r=r.replace(".","")).length)-a,i=$e(n,new n(t),a,2*a)),a=l=(c=ze(r,t,Me)).length-1;0===c[a];--a)c.pop();return a<0?new n(0*e.s):(e.e=Ue(c,l),e.d=c,ge=!1,o&&(e=ke(e,i,4*s)),u&&(e=e.times(Math.abs(u)<54?Ne(2,u):Zr.pow(2,u))),ge=!0,e)}function Ke(e,r,t,n,i){var a,o,s,u,c=e.precision,l=Math.ceil(c/Fe);for(ge=!1,u=t.times(t),s=new e(n);;){if(o=ke(s.times(u),new e(r++*r++),c,1),s=i?n.plus(o):n.minus(o),n=ke(o.times(u),new e(r++*r++),c,1),void 0!==(o=s.plus(n)).d[l]){for(a=l;o.d[a]===s.d[a]&&a--;);if(-1==a)break}a=s,s=n,n=o,o=a}return ge=!0,o.d.length=l+1,o}function er(e,r){for(var t=e;--r;)t*=e;return t}function rr(e,r){var t,n=r.s<0,i=Le(e,e.precision,1),a=i.times(.5);if((r=r.abs()).lte(a))return ce=n?4:1,r;if((t=r.divToInt(i)).isZero())ce=n?3:2;else{if((r=r.minus(t.times(i))).lte(a))return ce=Ge(t)?n?2:3:n?4:1,r;ce=Ge(t)?n?1:4:n?3:2}return r.minus(i).abs()}function tr(e,r,t,n){var i,a,o,s,u,c,l,p,f,d=e.constructor,m=void 0!==t;if(m?(qe(t,1,pe),void 0===n?n=d.rounding:qe(n,0,8)):(t=d.precision,n=d.rounding),e.isFinite()){for(m?(i=2,16==r?t=4*t-3:8==r&&(t=3*t-2)):i=r,(o=(l=Pe(e)).indexOf("."))>=0&&(l=l.replace(".",""),(f=new d(1)).e=l.length-o,f.d=ze(Pe(f),10,i),f.e=f.d.length),a=u=(p=ze(l,10,i)).length;0==p[--u];)p.pop();if(p[0]){if(o<0?a--:((e=new d(e)).d=p,e.e=a,p=(e=ke(e,f,t,n,0,i)).d,a=e.e,c=ue),o=p[t],s=i/2,c=c||void 0!==p[t+1],c=n<4?(void 0!==o||c)&&(0===n||n===(e.s<0?3:2)):o>s||o===s&&(4===n||c||6===n&&1&p[t-1]||n===(e.s<0?8:7)),p.length=t,c)for(;++p[--t]>i-1;)p[t]=0,t||(++a,p.unshift(1));for(u=p.length;!p[u-1];--u);for(o=0,l="";o1)if(16==r||8==r){for(o=16==r?4:3,--u;u%o;u++)l+="0";for(u=(p=ze(l,i,r)).length;!p[u-1];--u);for(o=1,l="1.";ou)for(a-=u;a--;)l+="0";else ar)return e.length=r,!0}function ir(e){return new this(e).abs()}function ar(e){return new this(e).acos()}function or(e){return new this(e).acosh()}function sr(e,r){return new this(e).plus(r)}function ur(e){return new this(e).asin()}function cr(e){return new this(e).asinh()}function lr(e){return new this(e).atan()}function pr(e){return new this(e).atanh()}function fr(e,r){e=new this(e),r=new this(r);var t,n=this.precision,i=this.rounding,a=n+4;return e.s&&r.s?e.d||r.d?!r.d||e.isZero()?(t=r.s<0?Le(this,n,i):new this(0)).s=e.s:!e.d||r.isZero()?(t=Le(this,a,1).times(.5)).s=e.s:r.s<0?(this.precision=a,this.rounding=1,t=this.atan(ke(e,r,a,1)),r=Le(this,a,1),this.precision=n,this.rounding=i,t=e.s<0?t.minus(r):t.plus(r)):t=this.atan(ke(e,r,a,1)):(t=Le(this,a,1).times(r.s>0?.25:.75)).s=e.s:t=new this(NaN),t}function dr(e){return new this(e).cbrt()}function mr(e){return Re(e=new this(e),e.e+1,2)}function hr(e,r,t){return new this(e).clamp(r,t)}function gr(e){if(!e||"object"!=typeof e)throw Error(ye+"Object expected");var r,t,n,i=!0===e.defaults,a=["precision",1,pe,"rounding",0,8,"toExpNeg",-le,0,"toExpPos",0,le,"maxE",0,le,"minE",-le,0,"modulo",0,9];for(r=0;r=a[r+1]&&n<=a[r+2]))throw Error(ve+t+": "+n);this[t]=n}if(t="crypto",i&&(this[t]=he[t]),void 0!==(n=e[t])){if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(ve+t+": "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(De);this[t]=!0}else this[t]=!1}return this}function yr(e){return new this(e).cos()}function vr(e){return new this(e).cosh()}function xr(e,r){return new this(e).div(r)}function Dr(e){return new this(e).exp()}function br(e){return Re(e=new this(e),e.e+1,3)}function wr(){var e,r,t=new this(0);for(ge=!1,e=0;e=429e7?r[a]=crypto.getRandomValues(new Uint32Array(1))[0]:s[a++]=i%1e7;else{if(!crypto.randomBytes)throw Error(De);for(r=crypto.randomBytes(n*=4);a=214e7?crypto.randomBytes(4).copy(r,a):(s.push(i%1e7),a+=4);a=n/4}else for(;a=10;i/=10)n++;na.maxE?(i.e=NaN,i.d=null):e.e=10;t/=10)r++;return void(ge?r>a.maxE?(i.e=NaN,i.d=null):r!function(e){return e&&"?"===e[0]}(e))).every((e=>void 0!==t[e]))){var n=r.filter((e=>void 0===t[e]));throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(n.map((e=>'"'.concat(e,'"'))).join(", "),"."))}}(e,r,n),t(i)}return i.isFactory=!0,i.fn=e,i.dependencies=r.slice().sort(),n&&(i.meta=n),i}function Vr(e){return"function"==typeof e&&"string"==typeof e.fn&&Array.isArray(e.dependencies)}function Wr(e){return e&&"?"===e[0]?e.slice(1):e}var Yr=Gr("BigNumber",["?on","config"],(e=>{var{on:r,config:t}=e,n=$r.clone({precision:t.precision,modulo:$r.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(e){return new n(e.value)},r&&r("config",(function(e,r){e.precision!==r.precision&&n.config({precision:e.precision})})),n}),{isClass:!0}),Jr=t(1977);function Qr(e){return"boolean"==typeof e||!!isFinite(e)&&e===Math.round(e)}var Xr=Math.sign||function(e){return e>0?1:e<0?-1:0},Kr=Math.log2||function(e){return Math.log(e)/Math.LN2},et=Math.log10||function(e){return Math.log(e)/Math.LN10},rt=Math.log1p||function(e){return Math.log(e+1)},tt=Math.cbrt||function(e){if(0===e)return e;var r,t=e<0;return t&&(e=-e),r=isFinite(e)?(e/((r=Math.exp(Math.log(e)/3))*r)+2*r)/3:e,t?-r:r},nt=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function it(e,r,t){var n={2:"0b",8:"0o",16:"0x"}[r],i="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!Qr(t))throw new Error("size must be an integer");if(e>2**(t-1)-1||e<-(2**(t-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!Qr(e))throw new Error("Value must be an integer");e<0&&(e+=2**t),i="i".concat(t)}var a="";return e<0&&(e=-e,a="-"),"".concat(a).concat(n).concat(e.toString(r)).concat(i)}function at(e,r){if("function"==typeof r)return r(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var t,n,i="auto";if(r&&(r.notation&&(i=r.notation),o(r)?t=r:o(r.precision)&&(t=r.precision),r.wordSize&&"number"!=typeof(n=r.wordSize)))throw new Error('Option "wordSize" must be a number');switch(i){case"fixed":return st(e,t);case"exponential":return ut(e,t);case"engineering":return function(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=ct(ot(e),r),n=t.exponent,i=t.coefficients,a=n%3==0?n:n<0?n-3-n%3:n-n%3;if(o(r))for(;r>i.length||n-a+1>i.length;)i.push(0);else for(var s=Math.abs(n-a)-(i.length-1),u=0;u0;)l++,c--;var p=i.slice(l).join(""),f=o(r)&&p.length||p.match(/[1-9]/)?"."+p:"",d=i.slice(0,l).join("")+f+"e"+(n>=0?"+":"")+a.toString();return t.sign+d}(e,t);case"bin":return it(e,2,n);case"oct":return it(e,8,n);case"hex":return it(e,16,n);case"auto":return function(e,r,t){if(isNaN(e)||!isFinite(e))return String(e);var n=t&&void 0!==t.lowerExp?t.lowerExp:-3,i=t&&void 0!==t.upperExp?t.upperExp:5,a=ot(e),o=r?ct(a,r):a;if(o.exponent=i)return ut(e,r);var s=o.coefficients,u=o.exponent;s.length0?u:0;return c<(s=lt(-u).concat(s)).length-1&&s.splice(c+1,0,"."),o.sign+s.join("")}(e,t,r&&r).replace(/((\.\d*?)(0+))($|e)/,(function(){var e=arguments[2],r=arguments[4];return"."!==e?e+r:r}));default:throw new Error('Unknown notation "'+i+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function ot(e){var r=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!r)throw new SyntaxError("Invalid number "+e);var t=r[1],n=r[2],i=parseFloat(r[4]||"0"),a=n.indexOf(".");i+=-1!==a?a-1:n.length-1;var o=n.replace(".","").replace(/^0*/,(function(e){return i-=e.length,""})).replace(/0*$/,"").split("").map((function(e){return parseInt(e)}));return 0===o.length&&(o.push(0),i++),{sign:t,coefficients:o,exponent:i}}function st(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=ot(e),n="number"==typeof r?ct(t,t.exponent+1+r):t,i=n.coefficients,a=n.exponent+1,o=a+(r||0);return i.length0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function ct(e,r){for(var t={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},n=t.coefficients;r<=0;)n.unshift(0),t.exponent++,r++;if(n.length>r&&n.splice(r,n.length-r)[0]>=5){var i=r-1;for(n[i]++;10===n[i];)n.pop(),0===i&&(n.unshift(0),t.exponent++,i++),n[--i]++}return t}function lt(e){for(var r=[],t=0;t(Object.defineProperty(Jr,"name",{value:"Complex"}),Jr.prototype.constructor=Jr,Jr.prototype.type="Complex",Jr.prototype.isComplex=!0,Jr.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Jr.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Jr.prototype.format=function(e){var r=this.im,t=this.re,n=at(this.re,e),i=at(this.im,e),a=o(e)?e:e?e.precision:null;if(null!==a){var s=Math.pow(10,-a);Math.abs(t/r)r.re?1:e.rer.im?1:e.im1&&void 0!==arguments[1]?arguments[1]:{};return t=null==t?Number.POSITIVE_INFINITY:t,r=null==r?JSON.stringify:r,function n(){"object"!=typeof n.cache&&(n.cache={values:new Map,lru:Dt(t||Number.POSITIVE_INFINITY)});for(var i=[],a=0;a!0)),Ot=Gr("false",[],(()=>!1)),_t=Gr("null",[],(()=>null)),qt=Jt("Infinity",["config","?BigNumber"],(e=>{var{config:r,BigNumber:t}=e;return"BigNumber"===r.number?new t(1/0):1/0})),It=Jt("NaN",["config","?BigNumber"],(e=>{var{config:r,BigNumber:t}=e;return"BigNumber"===r.number?new t(NaN):NaN})),zt=Jt("pi",["config","?BigNumber"],(e=>{var{config:r,BigNumber:t}=e;return"BigNumber"===r.number?At(t):Mt})),kt=Jt("tau",["config","?BigNumber"],(e=>{var{config:r,BigNumber:t}=e;return"BigNumber"===r.number?St(t):Ft})),Rt=Jt("e",["config","?BigNumber"],(e=>{var{config:r,BigNumber:t}=e;return"BigNumber"===r.number?Nt(t):Tt})),Pt=Jt("phi",["config","?BigNumber"],(e=>{var{config:r,BigNumber:t}=e;return"BigNumber"===r.number?Et(t):1.618033988749895})),Ut=Jt("LN2",["config","?BigNumber"],(e=>{var{config:r,BigNumber:t}=e;return"BigNumber"===r.number?new t(2).ln():Math.LN2})),jt=Jt("LN10",["config","?BigNumber"],(e=>{var{config:r,BigNumber:t}=e;return"BigNumber"===r.number?new t(10).ln():Math.LN10})),Lt=Jt("LOG2E",["config","?BigNumber"],(e=>{var{config:r,BigNumber:t}=e;return"BigNumber"===r.number?new t(1).div(new t(2).ln()):Math.LOG2E})),Ht=Jt("LOG10E",["config","?BigNumber"],(e=>{var{config:r,BigNumber:t}=e;return"BigNumber"===r.number?new t(1).div(new t(10).ln()):Math.LOG10E})),Zt=Jt("SQRT1_2",["config","?BigNumber"],(e=>{var{config:r,BigNumber:t}=e;return"BigNumber"===r.number?new t("0.5").sqrt():Math.SQRT1_2})),$t=Jt("SQRT2",["config","?BigNumber"],(e=>{var{config:r,BigNumber:t}=e;return"BigNumber"===r.number?new t(2).sqrt():Math.SQRT2})),Gt=Jt("i",["Complex"],(e=>{var{Complex:r}=e;return r.I})),Vt=Gr("PI",["pi"],(e=>{var{pi:r}=e;return r})),Wt=Gr("E",["e"],(e=>{var{e:r}=e;return r})),Yt=Gr("version",[],(()=>"11.9.1"));function Jt(e,r,t){return Gr(e,r,t,{recreateOnConfigChange:!0})}var Qt=Wn("speedOfLight","299792458","m s^-1"),Xt=Wn("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),Kt=Wn("planckConstant","6.62607015e-34","J s"),en=Wn("reducedPlanckConstant","1.0545718176461565e-34","J s"),rn=Wn("magneticConstant","1.25663706212e-6","N A^-2"),tn=Wn("electricConstant","8.8541878128e-12","F m^-1"),nn=Wn("vacuumImpedance","376.730313667","ohm"),an=Wn("coulomb","8.987551792261171e9","N m^2 C^-2"),on=Wn("elementaryCharge","1.602176634e-19","C"),sn=Wn("bohrMagneton","9.2740100783e-24","J T^-1"),un=Wn("conductanceQuantum","7.748091729863649e-5","S"),cn=Wn("inverseConductanceQuantum","12906.403729652257","ohm"),ln=Wn("magneticFluxQuantum","2.0678338484619295e-15","Wb"),pn=Wn("nuclearMagneton","5.0507837461e-27","J T^-1"),fn=Wn("klitzing","25812.807459304513","ohm"),dn=Wn("bohrRadius","5.29177210903e-11","m"),mn=Wn("classicalElectronRadius","2.8179403262e-15","m"),hn=Wn("electronMass","9.1093837015e-31","kg"),gn=Wn("fermiCoupling","1.1663787e-5","GeV^-2"),yn=Yn("fineStructure",.0072973525693),vn=Wn("hartreeEnergy","4.3597447222071e-18","J"),xn=Wn("protonMass","1.67262192369e-27","kg"),Dn=Wn("deuteronMass","3.3435830926e-27","kg"),bn=Wn("neutronMass","1.6749271613e-27","kg"),wn=Wn("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),Nn=Wn("rydberg","10973731.568160","m^-1"),En=Wn("thomsonCrossSection","6.6524587321e-29","m^2"),An=Yn("weakMixingAngle",.2229),Sn=Yn("efimovFactor",22.7),Cn=Wn("atomicMass","1.66053906660e-27","kg"),Mn=Wn("avogadro","6.02214076e23","mol^-1"),Fn=Wn("boltzmann","1.380649e-23","J K^-1"),Tn=Wn("faraday","96485.33212331001","C mol^-1"),Bn=Wn("firstRadiation","3.7417718521927573e-16","W m^2"),On=Wn("loschmidt","2.686780111798444e25","m^-3"),_n=Wn("gasConstant","8.31446261815324","J K^-1 mol^-1"),qn=Wn("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),In=Wn("molarVolume","0.022413969545014137","m^3 mol^-1"),zn=Yn("sackurTetrode",-1.16487052358),kn=Wn("secondRadiation","0.014387768775039337","m K"),Rn=Wn("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),Pn=Wn("wienDisplacement","2.897771955e-3","m K"),Un=Wn("molarMass","0.99999999965e-3","kg mol^-1"),jn=Wn("molarMassC12","11.9999999958e-3","kg mol^-1"),Ln=Wn("gravity","9.80665","m s^-2"),Hn=Wn("planckLength","1.616255e-35","m"),Zn=Wn("planckMass","2.176435e-8","kg"),$n=Wn("planckTime","5.391245e-44","s"),Gn=Wn("planckCharge","1.87554603778e-18","C"),Vn=Wn("planckTemperature","1.416785e+32","K");function Wn(e,r,t){return Gr(e,["config","Unit","BigNumber"],(e=>{var{config:n,Unit:i,BigNumber:a}=e,o=new i("BigNumber"===n.number?new a(r):parseFloat(r),t);return o.fixPrefix=!0,o}))}function Yn(e,r){return Gr(e,["config","BigNumber"],(e=>{var{config:t,BigNumber:n}=e;return"BigNumber"===t.number?new n(r):r}))}var Jn=t(5628),Qn=Gr("Fraction",[],(()=>(Object.defineProperty(Jn,"name",{value:"Fraction"}),Jn.prototype.constructor=Jn,Jn.prototype.type="Fraction",Jn.prototype.isFraction=!0,Jn.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Jn.fromJSON=function(e){return new Jn(e)},Jn)),{isClass:!0}),Xn=Gr("Matrix",[],(()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(e,r){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(e,r,t){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,r,t){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,r){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,r){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,r){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e}),{isClass:!0}),Kn=Gr("Range",[],(()=>{function e(r,t,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var i=null!=r,a=null!=t,o=null!=n;if(i)if(s(r))r=r.toNumber();else if("number"!=typeof r)throw new TypeError("Parameter start must be a number");if(a)if(s(t))t=t.toNumber();else if("number"!=typeof t)throw new TypeError("Parameter end must be a number");if(o)if(s(n))n=n.toNumber();else if("number"!=typeof n)throw new TypeError("Parameter step must be a number");this.start=i?parseFloat(r):0,this.end=a?parseFloat(t):0,this.step=o?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(r){if("string"!=typeof r)return null;var t=r.split(":").map((function(e){return parseFloat(e)}));if(t.some((function(e){return isNaN(e)})))return null;switch(t.length){case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[2],t[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var e=0,r=this.start,t=this.step,n=this.end-r;return Xr(t)===Xr(n)?e=Math.ceil(n/t):0===n&&(e=0),isNaN(e)&&(e=0),[e]},e.prototype.min=function(){var e=this.size()[0];return e>0?this.step>0?this.start:this.start+(e-1)*this.step:void 0},e.prototype.max=function(){var e=this.size()[0];return e>0?this.step>0?this.start+(e-1)*this.step:this.start:void 0},e.prototype.forEach=function(e){var r=this.start,t=this.step,n=this.end,i=0;if(t>0)for(;rn;)e(r,[i],this),r+=t,i++},e.prototype.map=function(e){var r=[];return this.forEach((function(t,n,i){r[n[0]]=e(t,n,i)})),r},e.prototype.toArray=function(){var e=[];return this.forEach((function(r,t){e[t[0]]=r})),e},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(e){var r=at(this.start,e);return 1!==this.step&&(r+=":"+at(this.step,e)),r+":"+at(this.end,e)},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(r){return new e(r.start,r.end,r.step)},e}),{isClass:!0}),ei=Gr("ResultSet",[],(()=>{function e(r){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=r||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(r){return new e(r.entries)},e}),{isClass:!0});function ri(e,r,t){var n=new(0,e.constructor)(2),i="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!Qr(t))throw new Error("size must be an integer");if(e.greaterThan(n.pow(t-1).sub(1))||e.lessThan(n.pow(t-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(n.pow(t))),i="i".concat(t)}switch(r){case 2:return"".concat(e.toBinary()).concat(i);case 8:return"".concat(e.toOctal()).concat(i);case 16:return"".concat(e.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(r," not supported "))}}function ti(e,r){return void 0!==r?e.toExponential(r-1):e.toExponential()}function ni(e,r){var t=e.length-r.length,n=e.length;return e.substring(t,n)===r}function ii(e,r){var t=function(e,r){return"number"==typeof e?at(e,r):s(e)?function(e,r){if("function"==typeof r)return r(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var t,n,i="auto";if(void 0!==r&&(r.notation&&(i=r.notation),"number"==typeof r?t=r:void 0!==r.precision&&(t=r.precision),r.wordSize&&"number"!=typeof(n=r.wordSize)))throw new Error('Option "wordSize" must be a number');switch(i){case"fixed":return function(e,r){return e.toFixed(r)}(e,t);case"exponential":return ti(e,t);case"engineering":return function(e,r){var t=e.e,n=t%3==0?t:t<0?t-3-t%3:t-t%3,i=e.mul(Math.pow(10,-n)).toPrecision(r);return-1!==i.indexOf("e")&&(i=new(0,e.constructor)(i).toFixed()),i+"e"+(t>=0?"+":"")+n.toString()}(e,t);case"bin":return ri(e,2,n);case"oct":return ri(e,8,n);case"hex":return ri(e,16,n);case"auto":var a=r&&void 0!==r.lowerExp?r.lowerExp:-3,o=r&&void 0!==r.upperExp?r.upperExp:5;if(e.isZero())return"0";var s=e.toSignificantDigits(t),u=s.e;return(u>=a&&u'"'+t+'": '+ii(e[t],r))).join(", ")+"}":String(e)}(e,r);return r&&"object"==typeof r&&"truncate"in r&&t.length>r.truncate?t.substring(0,r.truncate-3)+"...":t}function ai(e){for(var r=String(e),t="",n=0;n/g,">")}function si(e,r){if(Array.isArray(e)){for(var t="[",n=e.length,i=0;ir?1:-1}function ci(e,r,t){if(!(this instanceof ci))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=r,this.relation=t,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(r)?"["+r.join(", ")+"]":r)+")",this.stack=(new Error).stack}function li(e,r,t){if(!(this instanceof li))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=r):(this.min=r,this.max=t),void 0!==this.min&&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}function pi(e){for(var r=[];Array.isArray(e);)r.push(e.length),e=e[0];return r}function fi(e,r,t){var n,i=e.length;if(i!==r[t])throw new ci(i,r[t]);if(t")}function di(e,r){if(0===r.length){if(Array.isArray(e))throw new ci(e.length,0)}else fi(e,r,0)}function mi(e,r){if(!o(e)||!Qr(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof r&&e>=r)throw new li(e,r)}function hi(e,r,t){if(!Array.isArray(e)||!Array.isArray(r))throw new TypeError("Array expected");if(0===r.length)throw new Error("Resizing to scalar is not supported");return r.forEach((function(e){if(!o(e)||!Qr(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+ii(r)+")")})),gi(e,r,0,void 0!==t?t:0),e}function gi(e,r,t,n){var i,a,o=e.length,s=r[t],u=Math.min(o,s);if(e.length=s,t=0){if(r%t!=0)throw new Error("Could not replace wildcard, since "+r+" is no multiple of "+-t);n[i]=-r/t}return n}function xi(e){return e.reduce(((e,r)=>e*r),1)}function Di(e,r){for(var t=r||pi(e);Array.isArray(e)&&1===e.length;)e=e[0],t.shift();for(var n=t.length;1===t[n-1];)n--;return nr.test(e)))}function Fi(e,r){return Array.prototype.join.call(e,r)}function Ti(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(0===e.length)return e;var r=[],t=0;r[0]={value:e[0],identifier:0};for(var n=1;n{var{Matrix:r}=e;function t(e,r){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(r&&!p(r))throw new Error("Invalid datatype: "+r);if(d(e))"DenseMatrix"===e.type?(this._data=V(e._data),this._size=V(e._size),this._datatype=r||e._datatype):(this._data=e.toArray(),this._size=e.size(),this._datatype=r||e._datatype);else if(e&&f(e.data)&&f(e.size))this._data=e.data,this._size=e.size,di(this._data,this._size),this._datatype=r||e.datatype;else if(f(e))this._data=c(e),this._size=pi(this._data),di(this._data,this._size),this._datatype=r;else{if(e)throw new TypeError("Unsupported type of data ("+G(e)+")");this._data=[],this._size=[0],this._datatype=r}}function n(e,r,t,i){var a=i===t-1,o=r.dimension(i);return a?o.map((function(r){return mi(r,e.length),e[r]})).valueOf():o.map((function(a){return mi(a,e.length),n(e[a],r,t,i+1)})).valueOf()}function i(e,r,t,n,a){var o=a===n-1,s=r.dimension(a);o?s.forEach((function(r,n){mi(r),e[r]=t[n[0]]})):s.forEach((function(o,s){mi(o),i(e[o],r,t[s[0]],n,a+1)}))}function a(e,r,t){if(0===r.length){for(var n=e._data;f(n);)n=n[0];return n}return e._size=r.slice(0),e._data=hi(e._data,e._size,t),e}function u(e,r,t){for(var n=e._size.slice(0),i=!1;n.lengthn[o]&&(n[o]=r[o],i=!0);i&&a(e,n,t)}function c(e){for(var r=0,t=e.length;r");var p=r.max().map((function(e){return e+1}));u(e,p,n);var f=o.length;i(e._data,r,t,f,0)}return e}(this,e,r,a);default:throw new SyntaxError("Wrong number of arguments")}},t.prototype.get=function(e){if(!f(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new ci(e.length,this._size.length);for(var r=0;rArray.isArray(e)&&1===e.length?e[0]:e));return a(t?this.clone():this,n,r)},t.prototype.reshape=function(e,r){var t=r?this.clone():this;t._data=yi(t._data,e);var n=t._size.reduce(((e,r)=>e*r));return t._size=vi(e,n),t},t.prototype.clone=function(){return new t({data:V(this._data),size:V(this._size),datatype:this._datatype})},t.prototype.size=function(){return this._size.slice(0)},t.prototype.map=function(e){var r=this,n=wt(e),i=function t(i,a){return f(i)?i.map((function(e,r){return t(e,a.concat(r))})):1===n?e(i):2===n?e(i,a):e(i,a,r)}(this._data,[]);return new t(i,void 0!==this._datatype?Oi(i,G):void 0)},t.prototype.forEach=function(e){var r=this;!function t(n,i){f(n)?n.forEach((function(e,r){t(e,i.concat(r))})):e(n,i,r)}(this._data,[])},t.prototype[Symbol.iterator]=function*(){yield*function*e(r,t){if(f(r))for(var n=0;n[e[n]]));r.push(new t(a,e._datatype))},o=0;o0?e:0,n=e<0?-e:0,i=this._size[0],a=this._size[1],u=Math.min(i-n,a-r),c=[],l=0;l0?n:0,c=n<0?-n:0,l=e[0],p=e[1],m=Math.min(l-c,p-u);if(f(r)){if(r.length!==m)throw new Error("Invalid value array length");a=function(e){return r[e]}}else if(d(r)){var h=r.size();if(1!==h.length||h[0]!==m)throw new Error("Invalid matrix length");a=function(e){return r.get([e])}}else a=function(){return r};i||(i=s(a(0))?a(0).mul(0):0);var g=[];if(e.length>0){g=hi(g,e,i);for(var y=0;yfunction(e,r){return"number"!=typeof r||isFinite(r)&&!isNaN(r)?r:{mathjs:"number",value:String(r)}})),zi=t(4814);function ki(e,r){if(ji(e)&&Pi(e,r))return e[r];if("function"==typeof e[r]&&Ui(e,r))throw new Error('Cannot access method "'+r+'" as a property');throw new Error('No access to property "'+r+'"')}function Ri(e,r,t){if(ji(e)&&Pi(e,r))return e[r]=t,t;throw new Error('No access to property "'+r+'"')}function Pi(e,r){return!(!e||"object"!=typeof e||!re(Li,r)&&(r in Object.prototype||r in Function.prototype))}function Ui(e,r){return!(null==e||"function"!=typeof e[r]||re(e,r)&&Object.getPrototypeOf&&r in Object.getPrototypeOf(e)||!re(Hi,r)&&(r in Object.prototype||r in Function.prototype))}function ji(e){return"object"==typeof e&&e&&e.constructor===Object}var Li={length:!0,name:!0},Hi={toString:!0,valueOf:!0,toLocaleString:!0};class Zi{constructor(e){this.wrappedObject=e}keys(){return Object.keys(this.wrappedObject)}get(e){return ki(this.wrappedObject,e)}set(e,r){return Ri(this.wrappedObject,e,r),this}has(e){return e in this.wrappedObject}}function $i(){return new Map}function Gi(e){if(!e)return $i();if(Vi(e))return e;if(A(e))return new Zi(e);throw new Error("createMap can create maps from objects or Maps")}function Vi(e){return!!e&&(e instanceof Map||e instanceof Zi||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}function Wi(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;np&&/^(?:[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(e)},{name:"string",test:p},{name:"Chain",test:$},{name:"Array",test:f},{name:"Matrix",test:d},{name:"DenseMatrix",test:h},{name:"SparseMatrix",test:g},{name:"Range",test:y},{name:"Index",test:v},{name:"boolean",test:x},{name:"ResultSet",test:D},{name:"Help",test:b},{name:"function",test:w},{name:"Date",test:N},{name:"RegExp",test:E},{name:"null",test:S},{name:"undefined",test:C},{name:"AccessorNode",test:M},{name:"ArrayNode",test:F},{name:"AssignmentNode",test:T},{name:"BlockNode",test:B},{name:"ConditionalNode",test:O},{name:"ConstantNode",test:_},{name:"FunctionNode",test:z},{name:"FunctionAssignmentNode",test:I},{name:"IndexNode",test:k},{name:"Node",test:R},{name:"ObjectNode",test:P},{name:"OperatorNode",test:U},{name:"ParenthesisNode",test:j},{name:"RangeNode",test:L},{name:"RelationalNode",test:H},{name:"SymbolNode",test:Z},{name:"Map",test:Vi},{name:"Object",test:A}]),a.addConversions([{from:"number",to:"BigNumber",convert:function(e){if(r||Qi(e),e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+e+"). Use function bignumber(x) to convert to BigNumber.");return new r(e)}},{from:"number",to:"Complex",convert:function(e){return t||Xi(e),new t(e,0)}},{from:"BigNumber",to:"Complex",convert:function(e){return t||Xi(e),new t(e.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(e){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(e){return t||Xi(e),new t(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){i||Ki(e);var r=new i(e);if(r.valueOf()!==e)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e+"). Use function fraction(x) to convert to Fraction.");return r}},{from:"string",to:"number",convert:function(e){var r=Number(e);if(isNaN(r))throw new Error('Cannot convert "'+e+'" to a number');return r}},{from:"string",to:"BigNumber",convert:function(e){r||Qi(e);try{return new r(e)}catch(r){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(e){i||Ki(e);try{return new i(e)}catch(r){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){t||Xi(e);try{return new t(e)}catch(r){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return r||Qi(e),new r(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return i||Ki(e),new i(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return n||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new n(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}]),a.onMismatch=(e,r,t)=>{var n=a.createError(e,r,t);if(["wrongType","mismatch"].includes(n.data.category)&&1===r.length&&m(r[0])&&t.some((e=>!e.params.includes(",")))){var i=new TypeError("Function '".concat(e,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(e,")'."));throw i.data=n.data,i}throw n},a.onMismatch=(e,r,t)=>{var n=a.createError(e,r,t);if(["wrongType","mismatch"].includes(n.data.category)&&1===r.length&&m(r[0])&&t.some((e=>!e.params.includes(",")))){var i=new TypeError("Function '".concat(e,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(e,")'."));throw i.data=n.data,i}throw n},a}));function Qi(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Xi(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function Ki(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}function ea(e){var r,t,n=e.length,i=e[0].length,a=[];for(t=0;t=n.length)throw new li(r,n.length);return d(e)?e.create(aa(e.valueOf(),r,t)):aa(e,r,t)}function aa(e,r,t){var n,i,a,o;if(r<=0){if(Array.isArray(e[0])){for(o=ea(e),i=[],n=0;n0)return e-r*Math.floor(e/r);if(0===r)return e;throw new Error("Cannot calculate mod for a negative divisor")}function Na(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,t=r<0;if(t&&(r=-r),0===r)throw new Error("Root must be non-zero");if(e<0&&Math.abs(r)%2!=1)throw new Error("Root must be odd when a is negative.");if(0===e)return t?1/0:0;if(!isFinite(e))return t?0:e;var n=Math.pow(Math.abs(e),1/r);return n=e<0?-n:n,t?1/n:n}function Ea(e){return Xr(e)}function Aa(e){return e*e}function Sa(e,r){var t,n,i,a=0,o=1,s=1,u=0;if(!Qr(e)||!Qr(r))throw new Error("Parameters in function xgcd must be integer numbers");for(;r;)i=e-(n=Math.floor(e/r))*r,t=a,a=o-n*a,o=t,t=s,s=u-n*s,u=t,e=r,r=i;return e<0?[-e,-o,-u]:[e,e?o:0,u]}function Ca(e,r){return e*e<1&&r===1/0||e*e>1&&r===-1/0?0:Math.pow(e,r)}function Ma(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!Qr(r)||r<0||r>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(st(e,r))}ca.signature=sa,la.signature=ua,pa.signature=ua,fa.signature=sa,da.signature=sa,ma.signature=sa,ha.signature=sa,ga.signature=sa,ya.signature=sa,va.signature=ua,xa.signature=ua,Da.signature=sa,ba.signature=sa,wa.signature=ua,Ea.signature=sa,Aa.signature=sa,Sa.signature=ua,Ca.signature=ua;var Fa="unaryPlus",Ta=Gr(Fa,["typed","config","BigNumber"],(e=>{var{typed:r,config:t,BigNumber:n}=e;return r(Fa,{number:da,Complex:function(e){return e},BigNumber:function(e){return e},Fraction:function(e){return e},Unit:function(e){return e.clone()},"Array | Matrix":r.referToSelf((e=>r=>na(r,e,!0))),"boolean | string":function(e){return"BigNumber"===t.number?new n(+e):+e}})})),Ba=Gr("abs",["typed"],(e=>{var{typed:r}=e;return r("abs",{number:ca,"Complex | BigNumber | Fraction | Unit":e=>e.abs(),"Array | Matrix":r.referToSelf((e=>r=>na(r,e,!0)))})})),Oa="acos",_a=Gr(Oa,["typed","config","Complex"],(e=>{var{typed:r,config:t,Complex:n}=e;return r(Oa,{number:function(e){return e>=-1&&e<=1||t.predictable?Math.acos(e):new n(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()}})})),qa="number";function Ia(e){return dt(e)}function za(e){return Math.atan(1/e)}function ka(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function Ra(e){return Math.asin(1/e)}function Pa(e){var r=1/e;return Math.log(r+Math.sqrt(r*r+1))}function Ua(e){return Math.acos(1/e)}function ja(e){var r=1/e,t=Math.sqrt(r*r-1);return Math.log(t+r)}function La(e){return mt(e)}function Ha(e){return ht(e)}function Za(e){return 1/Math.tan(e)}function $a(e){var r=Math.exp(2*e);return(r+1)/(r-1)}function Ga(e){return 1/Math.sin(e)}function Va(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*Xr(e)}function Wa(e){return 1/Math.cos(e)}function Ya(e){return 2/(Math.exp(e)+Math.exp(-e))}function Ja(e){return yt(e)}Ia.signature=qa,za.signature=qa,ka.signature=qa,Ra.signature=qa,Pa.signature=qa,Ua.signature=qa,ja.signature=qa,La.signature=qa,Ha.signature=qa,Za.signature=qa,$a.signature=qa,Ga.signature=qa,Va.signature=qa,Wa.signature=qa,Ya.signature=qa,Ja.signature=qa;var Qa="acot",Xa=Gr(Qa,["typed","BigNumber"],(e=>{var{typed:r,BigNumber:t}=e;return r(Qa,{number:za,Complex:function(e){return e.acot()},BigNumber:function(e){return new t(1).div(e).atan()}})})),Ka="acsc",eo=Gr(Ka,["typed","config","Complex","BigNumber"],(e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(Ka,{number:function(e){return e<=-1||e>=1||t.predictable?Ra(e):new n(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new i(1).div(e).asin()}})})),ro="addScalar",to=Gr(ro,["typed"],(e=>{var{typed:r}=e;return r(ro,{"number, number":la,"Complex, Complex":function(e,r){return e.add(r)},"BigNumber, BigNumber":function(e,r){return e.plus(r)},"Fraction, Fraction":function(e,r){return e.add(r)},"Unit, Unit":r.referToSelf((e=>(t,n)=>{if(null===t.value||void 0===t.value)throw new Error("Parameter x contains a unit with undefined value");if(null===n.value||void 0===n.value)throw new Error("Parameter y contains a unit with undefined value");if(!t.equalBase(n))throw new Error("Units do not match");var i=t.clone();return i.value=r.find(e,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i}))})})),no=Gr("arg",["typed"],(e=>{var{typed:r}=e;return r("arg",{number:function(e){return Math.atan2(0,e)},BigNumber:function(e){return e.constructor.atan2(0,e)},Complex:function(e){return e.arg()},"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})})),io="asech",ao=Gr(io,["typed","config","Complex","BigNumber"],(e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(io,{number:function(e){if(e<=1&&e>=-1||t.predictable){var r=1/e;if(r>0||t.predictable)return ja(e);var i=Math.sqrt(r*r-1);return new n(Math.log(i-r),Math.PI)}return new n(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new i(1).div(e).acosh()}})})),oo=Gr("asinh",["typed"],(e=>{var{typed:r}=e;return r("asinh",{number:La,Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()}})})),so=Gr("atan",["typed"],(e=>{var{typed:r}=e;return r("atan",{number:function(e){return Math.atan(e)},Complex:function(e){return e.atan()},BigNumber:function(e){return e.atan()}})})),uo="atanh",co=Gr(uo,["typed","config","Complex"],(e=>{var{typed:r,config:t,Complex:n}=e;return r(uo,{number:function(e){return e<=1&&e>=-1||t.predictable?Ha(e):new n(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()}})})),lo=Gr("bignumber",["typed","BigNumber"],(e=>{var{typed:r,BigNumber:t}=e;return r("bignumber",{"":function(){return new t(0)},number:function(e){return new t(e+"")},string:function(e){var r=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(r){var n=r[2],i=t(r[1]),a=new t(2).pow(Number(n));if(i.gt(a.sub(1)))throw new SyntaxError('String "'.concat(e,'" is out of range'));var o=new t(2).pow(Number(n)-1);return i.gte(o)?i.sub(a):i}return new t(e)},BigNumber:function(e){return e},Unit:r.referToSelf((e=>r=>{var t=r.clone();return t.value=e(r.value),t})),Fraction:function(e){return new t(e.n).div(e.d).times(e.s)},null:function(e){return new t(0)},"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})}));function po(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitAnd");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);if(e.isZero()||r.eq(-1)||e.eq(r))return e;if(r.isZero()||e.eq(-1))return r;if(!e.isFinite()||!r.isFinite()){if(!e.isFinite()&&!r.isFinite())return e.isNegative()===r.isNegative()?e:new t(0);if(!e.isFinite())return r.isNegative()?e:e.isNegative()?new t(0):r;if(!r.isFinite())return e.isNegative()?r:r.isNegative()?new t(0):e}return ho(e,r,(function(e,r){return e&r}))}function fo(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var r=e.constructor,t=r.precision;r.config({precision:1e9});var n=e.plus(new r(1));return n.s=-n.s||null,r.config({precision:t}),n}function mo(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitOr");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);var n=new t(-1);return e.isZero()||r.eq(n)||e.eq(r)?r:r.isZero()||e.eq(n)?e:e.isFinite()&&r.isFinite()?ho(e,r,(function(e,r){return e|r})):!e.isFinite()&&!e.isNegative()&&r.isNegative()||e.isNegative()&&!r.isNegative()&&!r.isFinite()?n:e.isNegative()&&r.isNegative()?e.isFinite()?e:r:e.isFinite()?r:e}function ho(e,r,t){var n,i,a,o,s,u=e.constructor,c=+(e.s<0),l=+(r.s<0);if(c){n=go(fo(e));for(var p=0;p0;)t(a[--d],o[--m])===h&&(g=g.plus(y)),y=y.times(v);for(;m>0;)t(s,o[--m])===h&&(g=g.plus(y)),y=y.times(v);return u.config({precision:x}),0===h&&(g.s=-g.s),g}function go(e){for(var r=e.d,t=r[0]+"",n=1;n0)if(++s>c)for(s-=c;s--;)u+="0";else s1&&(null!==l[d+1]&&void 0!==l[d+1]||(l[d+1]=0),l[d+1]+=l[d]>>1,l[d]&=1)}return l.reverse()}function yo(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitXor");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);if(e.isZero())return r;if(r.isZero())return e;if(e.eq(r))return new t(0);var n=new t(-1);return e.eq(n)?fo(r):r.eq(n)?fo(e):e.isFinite()&&r.isFinite()?ho(e,r,(function(e,r){return e^r})):e.isFinite()||r.isFinite()?new t(e.isNegative()===r.isNegative()?1/0:-1/0):n}function vo(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function leftShift");var t=e.constructor;return e.isNaN()||r.isNaN()||r.isNegative()&&!r.isZero()?new t(NaN):e.isZero()||r.isZero()?e:e.isFinite()||r.isFinite()?r.lt(55)?e.times(Math.pow(2,r.toNumber())+""):e.times(new t(2).pow(r)):new t(NaN)}function xo(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function rightArithShift");var t=e.constructor;return e.isNaN()||r.isNaN()||r.isNegative()&&!r.isZero()?new t(NaN):e.isZero()||r.isZero()?e:r.isFinite()?r.lt(55)?e.div(Math.pow(2,r.toNumber())+"").floor():e.div(new t(2).pow(r)).floor():e.isNegative()?new t(-1):e.isFinite()?new t(0):new t(NaN)}var Do="number, number";function bo(e,r){if(!Qr(e)||!Qr(r))throw new Error("Integers expected in function bitAnd");return e&r}function wo(e){if(!Qr(e))throw new Error("Integer expected in function bitNot");return~e}function No(e,r){if(!Qr(e)||!Qr(r))throw new Error("Integers expected in function bitOr");return e|r}function Eo(e,r){if(!Qr(e)||!Qr(r))throw new Error("Integers expected in function bitXor");return e^r}function Ao(e,r){if(!Qr(e)||!Qr(r))throw new Error("Integers expected in function leftShift");return e<>r}function Co(e,r){if(!Qr(e)||!Qr(r))throw new Error("Integers expected in function rightLogShift");return e>>>r}bo.signature=Do,wo.signature="number",No.signature=Do,Eo.signature=Do,Ao.signature=Do,So.signature=Do,Co.signature=Do;var Mo="bitNot",Fo=Gr(Mo,["typed"],(e=>{var{typed:r}=e;return r(Mo,{number:wo,BigNumber:fo,"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})})),To="boolean",Bo=Gr(To,["typed"],(e=>{var{typed:r}=e;return r(To,{"":function(){return!1},boolean:function(e){return e},number:function(e){return!!e},null:function(e){return!1},BigNumber:function(e){return!e.isZero()},string:function(e){var r=e.toLowerCase();if("true"===r)return!0;if("false"===r)return!1;var t=Number(e);if(""!==e&&!isNaN(t))return!!t;throw new Error('Cannot convert "'+e+'" to a boolean')},"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})})),Oo="clone",_o=Gr(Oo,["typed"],(e=>{var{typed:r}=e;return r(Oo,{any:V})}));function qo(e,r){if(r>1;return qo(e,t)*qo(t+1,r)}function Io(e,r){if(!Qr(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!Qr(r)||r<0)throw new TypeError("Positive integer value expected in function combinations");if(r>e)throw new TypeError("k must be less than or equal to n");for(var t=e-r,n=1,i=2,a=r{var{typed:r}=e;return r(zo,{"number, number":Io,"BigNumber, BigNumber":function(e,r){var t,n,i=e.constructor,a=e.minus(r),o=new i(1);if(!Ro(e)||!Ro(r))throw new TypeError("Positive integer value expected in function combinations");if(r.gt(e))throw new TypeError("k must be less than n in function combinations");if(t=o,r.lt(a))for(n=o;n.lte(a);n=n.plus(o))t=t.times(r.plus(n)).dividedBy(n);else for(n=o;n.lte(r);n=n.plus(o))t=t.times(a.plus(n)).dividedBy(n);return t}})}));function Ro(e){return e.isInteger()&&e.gte(0)}var Po=Gr("complex",["typed","Complex"],(e=>{var{typed:r,Complex:t}=e;return r("complex",{"":function(){return t.ZERO},number:function(e){return new t(e,0)},"number, number":function(e,r){return new t(e,r)},"BigNumber, BigNumber":function(e,r){return new t(e.toNumber(),r.toNumber())},Fraction:function(e){return new t(e.valueOf(),0)},Complex:function(e){return e.clone()},string:function(e){return t(e)},null:function(e){return t(0)},Object:function(e){if("re"in e&&"im"in e)return new t(e.re,e.im);if("r"in e&&"phi"in e||"abs"in e&&"arg"in e)return new t(e);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})})),Uo="conj",jo=Gr(Uo,["typed"],(e=>{var{typed:r}=e;return r(Uo,{"number | BigNumber | Fraction":e=>e,Complex:e=>e.conjugate(),"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})})),Lo="cosh",Ho=Gr(Lo,["typed"],(e=>{var{typed:r}=e;return r(Lo,{number:gt,"Complex | BigNumber":e=>e.cosh()})})),Zo="coth",$o=Gr(Zo,["typed","BigNumber"],(e=>{var{typed:r,BigNumber:t}=e;return r(Zo,{number:$a,Complex:e=>e.coth(),BigNumber:e=>new t(1).div(e.tanh())})})),Go=Gr("trigUnit",["typed"],(e=>{var{typed:r}=e;return{Unit:r.referToSelf((e=>t=>{if(!t.hasBase(t.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return r.find(e,t.valueType())(t.value)}))}})),Vo=Gr("csc",["typed","BigNumber"],(e=>{var{typed:r,BigNumber:t}=e;return r("csc",{number:Ga,Complex:e=>e.csc(),BigNumber:e=>new t(1).div(e.sin())},Go({typed:r}))})),Wo="cube",Yo=Gr(Wo,["typed"],(e=>{var{typed:r}=e;return r(Wo,{number:ha,Complex:function(e){return e.mul(e).mul(e)},BigNumber:function(e){return e.times(e).times(e)},Fraction:function(e){return e.pow(3)},Unit:function(e){return e.pow(3)}})}));function Jo(e,r,t){if(null==t)return e.eq(r);if(e.eq(r))return!0;if(e.isNaN()||r.isNaN())return!1;if(e.isFinite()&&r.isFinite()){var n=e.minus(r).abs();if(n.isZero())return!0;var i=e.constructor.max(e.abs(),r.abs());return n.lte(i.times(t))}return!1}var Qo=Gr("compareUnits",["typed"],(e=>{var{typed:r}=e;return{"Unit, Unit":r.referToSelf((e=>(t,n)=>{if(!t.equalBase(n))throw new Error("Cannot compare units with different base");return r.find(e,[t.valueType(),n.valueType()])(t.value,n.value)}))}})),Xo="equalScalar",Ko=Gr(Xo,["typed","config"],(e=>{var{typed:r,config:t}=e,n=Qo({typed:r});return r(Xo,{"boolean, boolean":function(e,r){return e===r},"number, number":function(e,r){return ft(e,r,t.epsilon)},"BigNumber, BigNumber":function(e,r){return e.eq(r)||Jo(e,r,t.epsilon)},"Fraction, Fraction":function(e,r){return e.equals(r)},"Complex, Complex":function(e,r){return function(e,r,t){return ft(e.re,r.re,t)&&ft(e.im,r.im,t)}(e,r,t.epsilon)}},n)})),es=(Gr(Xo,["typed","config"],(e=>{var{typed:r,config:t}=e;return r(Xo,{"number, number":function(e,r){return ft(e,r,t.epsilon)}})})),Gr("erf",["typed"],(e=>{var{typed:r}=e;return r("name",{number:function(e){var r=Math.abs(e);return r>=as?Xr(e):r<=rs?Xr(e)*function(e){var r,t=e*e,n=ns[0][4]*t,i=t;for(r=0;r<3;r+=1)n=(n+ns[0][r])*t,i=(i+is[0][r])*t;return e*(n+ns[0][3])/(i+is[0][3])}(r):r<=4?Xr(e)*(1-function(e){var r,t=ns[1][8]*e,n=e;for(r=0;r<7;r+=1)t=(t+ns[1][r])*e,n=(n+is[1][r])*e;var i=(t+ns[1][7])/(n+is[1][7]),a=parseInt(16*e)/16,o=(e-a)*(e+a);return Math.exp(-a*a)*Math.exp(-o)*i}(r)):Xr(e)*(1-function(e){var r,t=1/(e*e),n=ns[2][5]*t,i=t;for(r=0;r<4;r+=1)n=(n+ns[2][r])*t,i=(i+is[2][r])*t;var a=t*(n+ns[2][4])/(i+is[2][4]);a=(ts-a)/e;var o=(e-(t=parseInt(16*e)/16))*(e+t);return Math.exp(-t*t)*Math.exp(-o)*a}(r))},"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})}))),rs=.46875,ts=.5641895835477563,ns=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,2.1531153547440383e-8],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],is=[[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]],as=Math.pow(2,53),os=Gr("exp",["typed"],(e=>{var{typed:r}=e;return r("exp",{number:ga,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()}})})),ss="expm1",us=Gr(ss,["typed","Complex"],(e=>{var{typed:r,Complex:t}=e;return r(ss,{number:ya,Complex:function(e){var r=Math.exp(e.re);return new t(r*Math.cos(e.im)-1,r*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)}})}));function cs(e,r,t,n,i){if(zi.isTypedFunction(e)){var a=[r,t,n],o=zi.resolve(e,a);if(o)return p(o.implementation,a);var s=[r,t],u=zi.resolve(e,s);if(u)return p(u.implementation,s);var c=[r],l=zi.resolve(e,c);return l?p(l.implementation,c):p(e,a)}return e(r,t,n);function p(a,o){try{return a.apply(a,o)}catch(a){var s;if(a instanceof TypeError&&"wrongType"===(null===(s=a.data)||void 0===s?void 0:s.category)){var u=[];throw u.push("value: ".concat(G(r))),o.length>=2&&u.push("index: ".concat(G(t))),o.length>=3&&u.push("array: ".concat(G(n))),new TypeError("Function ".concat(i," cannot apply callback arguments ")+"".concat(e.name,"(").concat(u.join(", "),") at index ").concat(JSON.stringify(t)))}throw new TypeError("Function ".concat(i," cannot apply callback arguments ")+"to function ".concat(e.name,": ").concat(a.message))}}}var ls=Gr("filter",["typed"],(e=>{var{typed:r}=e;return r("filter",{"Array, function":ps,"Matrix, function":function(e,r){return e.create(ps(e.toArray(),r))},"Array, RegExp":Mi,"Matrix, RegExp":function(e,r){return e.create(Mi(e.toArray(),r))}})}));function ps(e,r){return Ci(e,(function(e,t,n){return cs(r,e,[t],n,"filter")}))}var fs="forEach",ds=Gr(fs,["typed"],(e=>{var{typed:r}=e;return r(fs,{"Array, function":ms,"Matrix, function":function(e,r){e.forEach(r)}})}));function ms(e,r){!function t(n,i){if(!Array.isArray(n))return cs(r,n,i,e,"forEach");Si(n,(function(e,r){t(e,i.concat(r))}))}(e,[])}var hs="format",gs=Gr(hs,["typed"],(e=>{var{typed:r}=e;return r(hs,{any:ii,"any, Object | function | number":ii})})),ys="getMatrixDataType",vs=Gr(ys,["typed"],(e=>{var{typed:r}=e;return r(ys,{Array:function(e){return Oi(e,G)},Matrix:function(e){return e.getDataType()}})})),xs=Gr("hex",["typed","format"],(e=>{var{typed:r,format:t}=e;return r("hex",{"number | BigNumber":function(e){return t(e,{notation:"hex"})},"number | BigNumber, number":function(e,r){return t(e,{notation:"hex",wordSize:r})}})})),Ds=Gr("im",["typed"],(e=>{var{typed:r}=e;return r("im",{number:()=>0,"BigNumber | Fraction":e=>e.mul(0),Complex:e=>e.im,"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})})),bs="isInteger",ws=Gr(bs,["typed"],(e=>{var{typed:r}=e;return r(bs,{number:Qr,BigNumber:function(e){return e.isInt()},Fraction:function(e){return 1===e.d&&isFinite(e.n)},"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})})),Ns="number";function Es(e){return e<0}function As(e){return e>0}function Ss(e){return 0===e}function Cs(e){return Number.isNaN(e)}Es.signature=Ns,As.signature=Ns,Ss.signature=Ns,Cs.signature=Ns;var Ms="isNegative",Fs=Gr(Ms,["typed"],(e=>{var{typed:r}=e;return r(Ms,{number:Es,BigNumber:function(e){return e.isNeg()&&!e.isZero()&&!e.isNaN()},Fraction:function(e){return e.s<0},Unit:r.referToSelf((e=>t=>r.find(e,t.valueType())(t.value))),"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})})),Ts="isPositive",Bs=Gr(Ts,["typed"],(e=>{var{typed:r}=e;return r(Ts,{number:As,BigNumber:function(e){return!e.isNeg()&&!e.isZero()&&!e.isNaN()},Fraction:function(e){return e.s>0&&e.n>0},Unit:r.referToSelf((e=>t=>r.find(e,t.valueType())(t.value))),"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})})),Os="isZero",_s=Gr(Os,["typed"],(e=>{var{typed:r}=e;return r(Os,{number:Ss,BigNumber:function(e){return e.isZero()},Complex:function(e){return 0===e.re&&0===e.im},Fraction:function(e){return 1===e.d&&0===e.n},Unit:r.referToSelf((e=>t=>r.find(e,t.valueType())(t.value))),"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})}));function qs(e){var r;if(Qr(e))return e<=0?isFinite(e)?1/0:NaN:e>171?1/0:qo(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*qs(1-e));if(e>=171.35)return 1/0;if(e>85){var t=e*e,n=t*e,i=n*e,a=i*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*t)-139/(51840*n)-571/(2488320*i)+163879/(209018880*a)+5246819/(75246796800*a*e))}--e,r=zs[0];for(var o=1;o=1;n--)t+=Rs[n]/(e+n);return ks+(e+.5)*Math.log(r)-r+Math.log(t)}Ps.signature="number";var Us="lgamma",js=Gr(Us,["Complex","typed"],(e=>{var{Complex:r,typed:t}=e,n=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t(Us,{number:Ps,Complex:function e(t){if(t.isNaN())return new r(NaN,NaN);if(0===t.im)return new r(Ps(t.re),0);if(t.re>=7||Math.abs(t.im)>=7)return i(t);if(t.re<=.1){var n=(u=6.283185307179586,(!0^((c=t.im)>0||!(c<0)&&1/c==1/0)?-u:u)*Math.floor(.5*t.re+.25)),o=t.mul(Math.PI).sin().log(),s=e(new r(1-t.re,-t.im));return new r(1.1447298858494002,n).sub(o).sub(s)}return t.im>=0?a(t):a(t.conjugate()).conjugate();var u,c},BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function i(e){for(var t=e.sub(.5).mul(e.log()).sub(e).add(ks),i=new r(1,0).div(e),a=i.div(e),o=n[0],s=n[1],u=2*a.re,c=a.re*a.re+a.im*a.im,l=2;l<8;l++){var p=s;s=-c*o+n[l],o=u*o+p}var f=i.mul(a.mul(o).add(s));return t.add(f)}function a(e){var t=0,n=0,a=e;for(e=e.add(1);e.re<=7;){var o=(a=a.mul(e)).im<0?1:0;0!==o&&0===n&&t++,n=o,e=e.add(1)}return i(e).sub(a.log()).sub(new r(0,2*t*Math.PI*1))}})),Ls="log10",Hs=Gr(Ls,["typed","config","Complex"],(e=>{var{typed:r,config:t,Complex:n}=e;return r(Ls,{number:function(e){return e>=0||t.predictable?Da(e):new n(e,0).log().div(Math.LN10)},Complex:function(e){return new n(e).log().div(Math.LN10)},BigNumber:function(e){return!e.isNegative()||t.predictable?e.log():new n(e.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})})),Zs="log2",$s=Gr(Zs,["typed","config","Complex"],(e=>{var{typed:r,config:t,Complex:n}=e;return r(Zs,{number:function(e){return e>=0||t.predictable?ba(e):i(new n(e,0))},Complex:i,BigNumber:function(e){return!e.isNegative()||t.predictable?e.log(2):i(new n(e.toNumber(),0))},"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))});function i(e){var r=Math.sqrt(e.re*e.re+e.im*e.im);return new n(Math.log2?Math.log2(r):Math.log(r)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}})),Gs=Gr("map",["typed"],(e=>{var{typed:r}=e;return r("map",{"Array, function":Vs,"Matrix, function":function(e,r){return e.map(r)}})}));function Vs(e,r){return function t(n,i){return Array.isArray(n)?n.map((function(e,r){return t(e,i.concat(r))})):cs(r,n,i,e,"map")}(e,[])}var Ws=Gr("multiplyScalar",["typed"],(e=>{var{typed:r}=e;return r("multiplyScalar",{"number, number":pa,"Complex, Complex":function(e,r){return e.mul(r)},"BigNumber, BigNumber":function(e,r){return e.times(r)},"Fraction, Fraction":function(e,r){return e.mul(r)},"number | Fraction | BigNumber | Complex, Unit":(e,r)=>r.multiply(e),"Unit, number | Fraction | BigNumber | Complex | Unit":(e,r)=>e.multiply(r)})})),Ys="number, number";function Js(e){return!e}function Qs(e,r){return!(!e&&!r)}function Xs(e,r){return!!e!=!!r}function Ks(e,r){return!(!e||!r)}Js.signature="number",Qs.signature=Ys,Xs.signature=Ys,Ks.signature=Ys;var eu=Gr("not",["typed"],(e=>{var{typed:r}=e;return r("not",{"null | undefined":()=>!0,number:Js,Complex:function(e){return 0===e.re&&0===e.im},BigNumber:function(e){return e.isZero()||e.isNaN()},Unit:r.referToSelf((e=>t=>r.find(e,t.valueType())(t.value))),"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})})),ru=Gr("number",["typed"],(e=>{var{typed:r}=e,t=r("number",{"":function(){return 0},number:function(e){return e},string:function(e){if("NaN"===e)return NaN;var r,t,n=(t=(r=e).match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/))?{input:r,radix:{"0b":2,"0o":8,"0x":16}[t[1]],integerPart:t[2],fractionalPart:t[3]}:null;if(n)return function(e){for(var r=parseInt(e.integerPart,e.radix),t=0,n=0;n2**i-1)throw new SyntaxError('String "'.concat(e,'" is out of range'));o>=2**(i-1)&&(o-=2**i)}return o},BigNumber:function(e){return e.toNumber()},Fraction:function(e){return e.valueOf()},Unit:r.referToSelf((e=>r=>{var t=r.clone();return t.value=e(r.value),t})),null:function(e){return 0},"Unit, string | Unit":function(e,r){return e.toNumber(r)},"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))});return t.fromJSON=function(e){return parseFloat(e.value)},t})),tu=Gr("oct",["typed","format"],(e=>{var{typed:r,format:t}=e;return r("oct",{"number | BigNumber":function(e){return t(e,{notation:"oct"})},"number | BigNumber, number":function(e,r){return t(e,{notation:"oct",wordSize:r})}})})),nu=t(6377),iu=nu(Date.now());function au(e){var r,t;return r=null===(t=e)?iu:nu(String(t)),function(){return r()}}var ou="pickRandom",su=Gr(ou,["typed","config","?on"],(e=>{var{typed:r,config:t,on:n}=e,i=au(t.randomSeed);return n&&n("config",(function(e,r){e.randomSeed!==r.randomSeed&&(i=au(e.randomSeed))})),r(ou,{"Array | Matrix":function(e){return a(e,{})},"Array | Matrix, Object":function(e,r){return a(e,r)},"Array | Matrix, number":function(e,r){return a(e,{number:r})},"Array | Matrix, Array | Matrix":function(e,r){return a(e,{weights:r})},"Array | Matrix, Array | Matrix, number":function(e,r,t){return a(e,{number:t,weights:r})},"Array | Matrix, number, Array | Matrix":function(e,r,t){return a(e,{number:r,weights:t})}});function a(e,r){var{number:t,weights:n,elementWise:a=!0}=r,s=void 0===t;s&&(t=1);var u=d(e)?e.create:d(n)?n.create:null;e=e.valueOf(),n&&(n=n.valueOf()),!0===a&&(e=Ei(e),n=Ei(n));var c=0;if(void 0!==n){if(n.length!==e.length)throw new Error("Weights must have the same length as possibles");for(var l=0,p=n.length;l{var{typed:r}=e;return r(uu,{"string, Object | Array":lu,"string, Object | Array, number | Object":lu})}));function lu(e,r,t){return e.replace(/\$([\w.]+)/g,(function(e,n){for(var i=n.split("."),a=r[i.shift()];i.length&&void 0!==a;){var o=i.shift();a=o?a[o]:a+"."}return void 0!==a?p(a)?a:ii(a,t):e}))}function pu(e,r){var t=[];if((e=e.slice(0)).length>1)for(var n=0,i=e.shift();n{var{typed:r,config:t,on:n}=e,i=au(t.randomSeed);return n&&n("config",(function(e,r){e.randomSeed!==r.randomSeed&&(i=au(e.randomSeed))})),r(fu,{"":()=>o(0,1),number:e=>o(0,e),"number, number":(e,r)=>o(e,r),"Array | Matrix":e=>a(e,0,1),"Array | Matrix, number":(e,r)=>a(e,0,r),"Array | Matrix, number, number":(e,r,t)=>a(e,r,t)});function a(e,r,t){var n=pu(e.valueOf(),(()=>o(r,t)));return d(e)?e.create(n):n}function o(e,r){return e+i()*(r-e)}})),mu=Gr("re",["typed"],(e=>{var{typed:r}=e;return r("re",{"number | BigNumber | Fraction":e=>e,Complex:e=>e.re,"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})})),hu=Gr("sec",["typed","BigNumber"],(e=>{var{typed:r,BigNumber:t}=e;return r("sec",{number:Wa,Complex:e=>e.sec(),BigNumber:e=>new t(1).div(e.cos())},Go({typed:r}))})),gu="sign",yu=Gr(gu,["typed","BigNumber","Fraction","complex"],(e=>{var{typed:r,BigNumber:t,complex:n,Fraction:i}=e;return r(gu,{number:Ea,Complex:function(e){return 0===e.im?n(Ea(e.re)):e.sign()},BigNumber:function(e){return new t(e.cmp(0))},Fraction:function(e){return new i(e.s,1)},"Array | Matrix":r.referToSelf((e=>r=>na(r,e,!0))),Unit:r.referToSelf((e=>t=>{if(!t._isDerived()&&0!==t.units[0].unit.offset)throw new TypeError("sign is ambiguous for units with offset");return r.find(e,t.valueType())(t.value)}))})})),vu=Gr("sin",["typed"],(e=>{var{typed:r}=e,t=Go({typed:r});return r("sin",{number:Math.sin,"Complex | BigNumber":e=>e.sin()},t)})),xu=Gr("SparseMatrix",["typed","equalScalar","Matrix"],(e=>{var{typed:r,equalScalar:t,Matrix:n}=e;function i(e,r){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(r&&!p(r))throw new Error("Invalid datatype: "+r);if(d(e))!function(e,r,t){"SparseMatrix"===r.type?(e._values=r._values?V(r._values):void 0,e._index=V(r._index),e._ptr=V(r._ptr),e._size=V(r._size),e._datatype=t||r._datatype):a(e,r.valueOf(),t||r._datatype)}(this,e,r);else if(e&&f(e.index)&&f(e.ptr)&&f(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=r||e.datatype;else if(f(e))a(this,e,r);else{if(e)throw new TypeError("Unsupported type of data ("+G(e)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=r}}function a(e,n,i){e._values=[],e._index=[],e._ptr=[],e._datatype=i;var a=n.length,o=0,s=t,u=0;if(p(i)&&(s=r.find(t,[i,i])||t,u=r.convert(0,i)),a>0){var c=0;do{e._ptr.push(e._index.length);for(var l=0;lh){for(l=h;lm){if(d){var g=0;for(l=0;ln-1&&(e._values.splice(f,1),e._index.splice(f,1),v++)}e._ptr[l]=e._values.length}return e._size[0]=n,e._size[1]=i,e}function h(e,r,t,n,i){var a,o,s=n[0],u=n[1],c=[];for(a=0;a");if(1===a.length)r.dimension(0).forEach((function(r,i){mi(r),e.set([r,0],t[i[0]],n)}));else{var c=r.dimension(0),l=r.dimension(1);c.forEach((function(r,i){mi(r),l.forEach((function(a,o){mi(a),e.set([r,a],t[i[0]][o[0]],n)}))}))}}return e}(this,e,r,t);default:throw new SyntaxError("Wrong number of arguments")}},i.prototype.get=function(e){if(!f(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new ci(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var r=e[0],t=e[1];mi(r,this._size[0]),mi(t,this._size[1]);var n=u(r,this._ptr[t],this._ptr[t+1],this._index);return ns-1||o>d-1)&&(l(this,Math.max(a+1,s),Math.max(o+1,d),i),s=this._size[0],d=this._size[1]),mi(a,s),mi(o,d);var g=u(a,this._ptr[o],this._ptr[o+1],this._index);return gArray.isArray(e)&&1===e.length?e[0]:e));if(2!==n.length)throw new Error("Only two dimensions matrix are supported");return n.forEach((function(e){if(!o(e)||!Qr(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+ii(n)+")")})),l(t?this.clone():this,n[0],n[1],r)},i.prototype.reshape=function(e,r){if(!f(e))throw new TypeError("Array expected");if(2!==e.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");e.forEach((function(r){if(!o(r)||!Qr(r)||r<=-2||0===r)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+ii(e)+")")}));var t=this._size[0]*this._size[1];if(t!==(e=vi(e,t))[0]*e[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var n=r?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return n;for(var i=[],a=0;a=0&&b<=a&&g(e._values[D],b-0,y-0)}else{for(var w={},N=v;N "+(this._values?ii(this._values[u],e):"X");return i},i.prototype.toString=function(){return ii(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(e){if(e){if(s(e)&&(e=e.toNumber()),!o(e)||!Qr(e))throw new TypeError("The parameter k must be an integer number")}else e=0;var r=e>0?e:0,t=e<0?-e:0,n=this._size[0],a=this._size[1],u=Math.min(n-t,a-r),c=[],l=[],p=[];p[0]=0;for(var f=r;f0?a:0,y=a<0?-a:0,v=e[0],x=e[1],D=Math.min(v-y,x-g);if(f(n)){if(n.length!==D)throw new Error("Invalid value array length");h=function(e){return n[e]}}else if(d(n)){var b=n.size();if(1!==b.length||b[0]!==D)throw new Error("Invalid matrix length");h=function(e){return n.get([e])}}else h=function(){return n};for(var w=[],N=[],E=[],A=0;A=0&&S=c||i[p]!==r)){var d=n?n[l]:void 0;i.splice(p,0,r),n&&n.splice(p,0,d),i.splice(p<=l?l+1:l,1),n&&n.splice(p<=l?l+1:l,1)}else if(p=c||i[l]!==e)){var m=n?n[p]:void 0;i.splice(l,0,e),n&&n.splice(l,0,m),i.splice(l<=p?p+1:p,1),n&&n.splice(l<=p?p+1:p,1)}}},i}),{isClass:!0}),Du="splitUnit",bu=Gr(Du,["typed"],(e=>{var{typed:r}=e;return r(Du,{"Unit, Array":function(e,r){return e.splitUnit(r)}})})),wu="square",Nu=Gr(wu,["typed"],(e=>{var{typed:r}=e;return r(wu,{number:Aa,Complex:function(e){return e.mul(e)},BigNumber:function(e){return e.times(e)},Fraction:function(e){return e.mul(e)},Unit:function(e){return e.pow(2)}})})),Eu="string",Au=Gr(Eu,["typed"],(e=>{var{typed:r}=e;return r(Eu,{"":function(){return""},number:at,null:function(e){return"null"},boolean:function(e){return e+""},string:function(e){return e},"Array | Matrix":r.referToSelf((e=>r=>na(r,e))),any:function(e){return String(e)}})})),Su=Gr("tan",["typed"],(e=>{var{typed:r}=e,t=Go({typed:r});return r("tan",{number:Math.tan,"Complex | BigNumber":e=>e.tan()},t)})),Cu="typeOf",Mu=Gr(Cu,["typed"],(e=>{var{typed:r}=e;return r(Cu,{any:G})})),Fu="acosh",Tu=Gr(Fu,["typed","config","Complex"],(e=>{var{typed:r,config:t,Complex:n}=e;return r(Fu,{number:function(e){return e>=1||t.predictable?Ia(e):e<=-1?new n(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new n(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()}})})),Bu="acsch",Ou=Gr(Bu,["typed","BigNumber"],(e=>{var{typed:r,BigNumber:t}=e;return r(Bu,{number:Pa,Complex:function(e){return e.acsch()},BigNumber:function(e){return new t(1).div(e).asinh()}})})),_u="apply",qu=Gr(_u,["typed","isInteger"],(e=>{var{typed:r,isInteger:t}=e;return r(_u,{"Array | Matrix, number | BigNumber, function":function(e,r,n){if(!t(r))throw new TypeError("Integer number expected for dimension");var i=Array.isArray(e)?pi(e):e.size();if(r<0||r>=i.length)throw new li(r,i.length);return d(e)?e.create(Iu(e.valueOf(),r,n)):Iu(e,r,n)}})}));function Iu(e,r,t){var n,i,a;if(r<=0){if(Array.isArray(e[0])){for(a=function(e){var r,t,n=e.length,i=e[0].length,a=[];for(t=0;t{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(zu,{number:function(e){return e<=-1||e>=1||t.predictable?Ua(e):new n(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new i(1).div(e).acos()}})})),Ru=Gr("bin",["typed","format"],(e=>{var{typed:r,format:t}=e;return r("bin",{"number | BigNumber":function(e){return t(e,{notation:"bin"})},"number | BigNumber, number":function(e,r){return t(e,{notation:"bin",wordSize:r})}})})),Pu="combinationsWithRep",Uu=Gr(Pu,["typed"],(e=>{var{typed:r}=e;return r(Pu,{"number, number":function(e,r){if(!Qr(e)||e<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Qr(r)||r<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(e<1)throw new TypeError("k must be less than or equal to n + k - 1");return r{var{typed:r}=e,t=Go({typed:r});return r("cos",{number:Math.cos,"Complex | BigNumber":e=>e.cos()},t)})),Hu="csch",Zu=Gr(Hu,["typed","BigNumber"],(e=>{var{typed:r,BigNumber:t}=e;return r(Hu,{number:Va,Complex:e=>e.csch(),BigNumber:e=>new t(1).div(e.sinh())})})),$u="isNaN",Gu=Gr($u,["typed"],(e=>{var{typed:r}=e;return r($u,{number:Cs,BigNumber:function(e){return e.isNaN()},Fraction:function(e){return!1},Complex:function(e){return e.isNaN()},Unit:function(e){return Number.isNaN(e.value)},"Array | Matrix":function(e){return na(e,Number.isNaN)}})})),Vu="isPrime",Wu=Gr(Vu,["typed"],(e=>{var{typed:r}=e;return r(Vu,{number:function(e){if(0*e!=0)return!1;if(e<=3)return e>1;if(e%2==0||e%3==0)return!1;for(var r=5;r*r<=e;r+=6)if(e%r==0||e%(r+2)==0)return!1;return!0},BigNumber:function(e){if(0*e.toNumber()!=0)return!1;if(e.lte(3))return e.gt(1);if(e.mod(2).eq(0)||e.mod(3).eq(0))return!1;if(e.lt(Math.pow(2,32))){for(var r=e.toNumber(),t=5;t*t<=r;t+=6)if(r%t==0||r%(t+2)==0)return!1;return!0}function n(e,r,t){for(var n=1;!r.eq(0);)r.mod(2).eq(0)?(r=r.div(2),e=e.mul(e).mod(t)):(r=r.sub(1),n=e.mul(n).mod(t));return n}for(var i=e.constructor.clone({precision:2*e.toFixed(0).length}),a=0,o=(e=new i(e)).sub(1);o.mod(2).eq(0);)o=o.div(2),a+=1;var s=null;if(e.lt("3317044064679887385961981"))s=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter((r=>rr=>na(r,e)))})})),Yu="randomInt",Ju=Gr(Yu,["typed","config","?on"],(e=>{var{typed:r,config:t,on:n}=e,i=au(t.randomSeed);return n&&n("config",(function(e,r){e.randomSeed!==r.randomSeed&&(i=au(e.randomSeed))})),r(Yu,{"":()=>o(0,1),number:e=>o(0,e),"number, number":(e,r)=>o(e,r),"Array | Matrix":e=>a(e,0,1),"Array | Matrix, number":(e,r)=>a(e,0,r),"Array | Matrix, number, number":(e,r,t)=>a(e,r,t)});function a(e,r,t){var n=pu(e.valueOf(),(()=>o(r,t)));return d(e)?e.create(n):n}function o(e,r){return Math.floor(e+i()*(r-e))}})),Qu="sech",Xu=Gr(Qu,["typed","BigNumber"],(e=>{var{typed:r,BigNumber:t}=e;return r(Qu,{number:Ya,Complex:e=>e.sech(),BigNumber:e=>new t(1).div(e.cosh())})})),Ku="sinh",ec=Gr(Ku,["typed"],(e=>{var{typed:r}=e;return r(Ku,{number:Ja,"Complex | BigNumber":e=>e.sinh()})})),rc="sparse",tc=Gr(rc,["typed","SparseMatrix"],(e=>{var{typed:r,SparseMatrix:t}=e;return r(rc,{"":function(){return new t([])},string:function(e){return new t([],e)},"Array | Matrix":function(e){return new t(e)},"Array | Matrix, string":function(e,r){return new t(e,r)}})})),nc=Gr("sqrt",["config","typed","Complex"],(e=>{var{config:r,typed:t,Complex:n}=e;return t("sqrt",{number:i,Complex:function(e){return e.sqrt()},BigNumber:function(e){return!e.isNegative()||r.predictable?e.sqrt():i(e.toNumber())},Unit:function(e){return e.pow(.5)}});function i(e){return isNaN(e)?NaN:e>=0||r.predictable?Math.sqrt(e):new n(e,0).sqrt()}})),ic=Gr("tanh",["typed"],(e=>{var{typed:r}=e;return r("tanh",{number:vt,"Complex | BigNumber":e=>e.tanh()})})),ac="unaryMinus",oc=Gr(ac,["typed"],(e=>{var{typed:r}=e;return r(ac,{number:fa,"Complex | BigNumber | Fraction":e=>e.neg(),Unit:r.referToSelf((e=>t=>{var n=t.clone();return n.value=r.find(e,n.valueType())(t.value),n})),"Array | Matrix":r.referToSelf((e=>r=>na(r,e,!0)))})})),sc="acoth",uc=Gr(sc,["typed","config","Complex","BigNumber"],(e=>{var{typed:r,config:t,Complex:n,BigNumber:i}=e;return r(sc,{number:function(e){return e>=1||e<=-1||t.predictable?ka(e):new n(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new i(1).div(e).atanh()}})})),cc=Gr("cot",["typed","BigNumber"],(e=>{var{typed:r,BigNumber:t}=e;return r("cot",{number:Za,Complex:e=>e.cot(),BigNumber:e=>new t(1).div(e.tan())},Go({typed:r}))})),lc=Gr("fraction",["typed","Fraction"],(e=>{var{typed:r,Fraction:t}=e;return r("fraction",{number:function(e){if(!isFinite(e)||isNaN(e))throw new Error(e+" cannot be represented as a fraction");return new t(e)},string:function(e){return new t(e)},"number, number":function(e,r){return new t(e,r)},null:function(e){return new t(0)},BigNumber:function(e){return new t(e.toString())},Fraction:function(e){return e},Unit:r.referToSelf((e=>r=>{var t=r.clone();return t.value=e(r.value),t})),Object:function(e){return new t(e)},"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})})),pc="isNumeric",fc=Gr(pc,["typed"],(e=>{var{typed:r}=e;return r(pc,{"number | BigNumber | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})})),dc="matrix",mc=Gr(dc,["typed","Matrix","DenseMatrix","SparseMatrix"],(e=>{var{typed:r,Matrix:t,DenseMatrix:n,SparseMatrix:i}=e;return r(dc,{"":function(){return a([])},string:function(e){return a([],e)},"string, string":function(e,r){return a([],e,r)},Array:function(e){return a(e)},Matrix:function(e){return a(e,e.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(e,r,t){if("dense"===r||"default"===r||void 0===r)return new n(e,t);if("sparse"===r)return new i(e,t);throw new TypeError("Unknown matrix type "+JSON.stringify(r)+".")}})),hc="matrixFromFunction",gc=Gr(hc,["typed","matrix","isZero"],(e=>{var{typed:r,matrix:t,isZero:n}=e;return r(hc,{"Array | Matrix, function, string, string":function(e,r,t,n){return i(e,r,t,n)},"Array | Matrix, function, string":function(e,r,t){return i(e,r,t)},"Matrix, function":function(e,r){return i(e,r,"dense")},"Array, function":function(e,r){return i(e,r,"dense").toArray()},"Array | Matrix, string, function":function(e,r,t){return i(e,t,r)},"Array | Matrix, string, string, function":function(e,r,t,n){return i(e,n,r,t)}});function i(e,r,i,a){var o;return(o=void 0!==a?t(i,a):t(i)).resize(e),o.forEach((function(e,t){var i=r(t);n(i)||o.set(t,i)})),o}})),yc="mode",vc=Gr(yc,["typed","isNaN","isNumeric"],(e=>{var{typed:r,isNaN:t,isNumeric:n}=e;return r(yc,{"Array | Matrix":i,"...":function(e){return i(e)}});function i(e){if(0===(e=Ei(e.valueOf())).length)throw new Error("Cannot calculate mode of an empty array");for(var r={},i=[],a=0,o=0;oa&&(a=r[s],i=[s])}return i}}));function xc(){throw new Error('No "bignumber" implementation available')}function Dc(){throw new Error('No "fraction" implementation available')}function bc(){throw new Error('No "matrix" implementation available')}var wc=Gr("numeric",["number","?bignumber","?fraction"],(e=>{var{number:r,bignumber:t,fraction:n}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:e=>r(e),BigNumber:t?e=>t(e):xc,Fraction:n?e=>n(e):Dc};return function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"number";if(void 0!==(arguments.length>2?arguments[2]:void 0))throw new SyntaxError("numeric() takes one or two arguments");var t=G(e);if(!(t in i))throw new TypeError("Cannot convert "+e+' of type "'+t+'"; valid input types are '+Object.keys(i).join(", "));if(!(r in a))throw new TypeError("Cannot convert "+e+' to type "'+r+'"; valid output types are '+Object.keys(a).join(", "));return r===t?e:a[r](e)}}));function Nc(e,r,t){var n;return-1!==String(e).indexOf("Unexpected type")?(n=arguments.length>2?" (type: "+G(t)+", value: "+JSON.stringify(t)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+r+", unexpected type of argument"+n)):-1!==String(e).indexOf("complex numbers")?(n=arguments.length>2?" (type: "+G(t)+", value: "+JSON.stringify(t)+")":"",new TypeError("Cannot calculate "+r+", no ordering relation is defined for complex numbers"+n)):e}var Ec="prod",Ac=Gr(Ec,["typed","config","multiplyScalar","numeric"],(e=>{var{typed:r,config:t,multiplyScalar:n,numeric:i}=e;return r(Ec,{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,r){throw new Error("prod(A, dim) is not yet supported")},"...":function(e){return a(e)}});function a(e){var r;if(ta(e,(function(e){try{r=void 0===r?e:n(r,e)}catch(r){throw Nc(r,"prod",e)}})),"string"==typeof r&&(r=i(r,t.number)),void 0===r)throw new Error("Cannot calculate prod of an empty array");return r}})),Sc="reshape",Cc=Gr(Sc,["typed","isInteger","matrix"],(e=>{var{typed:r,isInteger:t}=e;return r(Sc,{"Matrix, Array":function(e,r){return e.reshape(r,!0)},"Array, Array":function(e,r){return r.forEach((function(e){if(!t(e))throw new TypeError("Invalid size for dimension: "+e)})),yi(e,r)}})})),Mc="size",Fc=Gr(Mc,["typed","config","?matrix"],(e=>{var{typed:r,config:t,matrix:n}=e;return r(Mc,{Matrix:function(e){return e.create(e.size())},Array:pi,string:function(e){return"Array"===t.matrix?[e.length]:n([e.length])},"number | Complex | BigNumber | Unit | boolean | null":function(e){return"Array"===t.matrix?[]:n?n([]):bc()}})})),Tc="squeeze",Bc=Gr(Tc,["typed","matrix"],(e=>{var{typed:r,matrix:t}=e;return r(Tc,{Array:function(e){return Di(V(e))},Matrix:function(e){var r=Di(e.toArray());return Array.isArray(r)?t(r):r},any:function(e){return V(e)}})})),Oc="subset",_c=Gr(Oc,["typed","matrix"],(e=>{var{typed:r,matrix:t}=e;return r(Oc,{"Array, Index":function(e,r){var n=t(e).subset(r);return r.isScalar()?n:n.valueOf()},"Matrix, Index":function(e,r){return e.subset(r)},"Object, Index":zc,"string, Index":qc,"Array, Index, any":function(e,r,n){return t(V(e)).subset(r,n,void 0).valueOf()},"Array, Index, any, any":function(e,r,n,i){return t(V(e)).subset(r,n,i).valueOf()},"Matrix, Index, any":function(e,r,t){return e.clone().subset(r,t)},"Matrix, Index, any, any":function(e,r,t,n){return e.clone().subset(r,t,n)},"string, Index, string":Ic,"string, Index, string, string":Ic,"Object, Index, any":kc})}));function qc(e,r){if(!v(r))throw new TypeError("Index expected");if(1!==r.size().length)throw new ci(r.size().length,1);var t=e.length;mi(r.min()[0],t),mi(r.max()[0],t);var n=r.dimension(0),i="";return n.forEach((function(r){i+=e.charAt(r)})),i}function Ic(e,r,t,n){if(!r||!0!==r.isIndex)throw new TypeError("Index expected");if(1!==r.size().length)throw new ci(r.size().length,1);if(void 0!==n){if("string"!=typeof n||1!==n.length)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=r.dimension(0);if(i.size()[0]!==t.length)throw new ci(i.size()[0],t.length);var a=e.length;mi(r.min()[0]),mi(r.max()[0]);for(var o=[],s=0;sa)for(var u=a-1,c=o.length;u{var{typed:r,matrix:t}=e;return r(Rc,{Array:e=>n(t(e)).valueOf(),Matrix:n,any:V});function n(e){var r,t=e.size();switch(t.length){case 1:r=e.clone();break;case 2:var n=t[0],i=t[1];if(0===i)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+ii(t)+")");switch(e.storage()){case"dense":r=function(e,r,t){for(var n,i=e._data,a=[],o=0;o{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r(Uc,{"number, number":function(e,r){var i=Sa(e,r);return"Array"===t.matrix?i:n(i)},"BigNumber, BigNumber":function(e,r){var a,o,s,u,c=new i(0),l=new i(1),p=c,f=l,d=l,m=c;if(!e.isInt()||!r.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!r.isZero();)o=e.div(r).floor(),s=e.mod(r),a=p,p=f.minus(o.times(p)),f=a,a=d,d=m.minus(o.times(d)),m=a,e=r,r=s;return u=e.lt(c)?[e.neg(),f.neg(),m.neg()]:[e,e.isZero()?0:f,m],"Array"===t.matrix?u:n(u)}})})),Lc="zeros",Hc=Gr(Lc,["typed","config","matrix","BigNumber"],(e=>{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r(Lc,{"":function(){return"Array"===t.matrix?a([]):a([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){var r=e.pop();return a(e,r)}return"Array"===t.matrix?a(e):a(e,"default")},Array:a,Matrix:function(e){var r=e.storage();return a(e.valueOf(),r)},"Array | Matrix, string":function(e,r){return a(e.valueOf(),r)}});function a(e,r){var t=function(e){var r=!1;return e.forEach((function(e,t,n){s(e)&&(r=!0,n[t]=e.toNumber())})),r}(e),a=t?new i(0):0;if(function(e){e.forEach((function(e){if("number"!=typeof e||!Qr(e)||e<0)throw new Error("Parameters in function zeros must be positive integers")}))}(e),r){var o=n(r);return e.length>0?o.resize(e,a):o}var u=[];return e.length>0?hi(u,e,a):u}})),Zc="asin",$c=Gr(Zc,["typed","config","Complex"],(e=>{var{typed:r,config:t,Complex:n}=e;return r(Zc,{number:function(e){return e>=-1&&e<=1||t.predictable?Math.asin(e):new n(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()}})})),Gc="cbrt",Vc=Gr(Gc,["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],(e=>{var{config:r,typed:t,isNegative:n,unaryMinus:i,matrix:a,Complex:o,BigNumber:l,Fraction:p}=e;return t(Gc,{number:ma,Complex:f,"Complex, boolean":f,BigNumber:function(e){return e.cbrt()},Unit:function(e){if(e.value&&u(e.value)){var r=e.clone();return r.value=1,(r=r.pow(1/3)).value=f(e.value),r}var t,a=n(e.value);a&&(e.value=i(e.value)),t=s(e.value)?new l(1).div(3):c(e.value)?new p(1,3):1/3;var o=e.pow(t);return a&&(o.value=i(o.value)),o}});function f(e,t){var n=e.arg()/3,i=e.abs(),s=new o(ma(i),0).mul(new o(0,n).exp());if(t){var u=[s,new o(ma(i),0).mul(new o(0,n+2*Math.PI/3).exp()),new o(ma(i),0).mul(new o(0,n-2*Math.PI/3).exp())];return"Array"===r.matrix?u:a(u)}return s}})),Wc="concat",Yc=Gr(Wc,["typed","matrix","isInteger"],(e=>{var{typed:r,matrix:t,isInteger:n}=e;return r(Wc,{"...Array | Matrix | number | BigNumber":function(e){var r,i,a=e.length,u=-1,c=!1,l=[];for(r=0;r0&&u>i)throw new li(u,i+1)}else{var f=V(p).valueOf(),m=pi(f);if(l[r]=f,i=u,u=m.length-1,r>0&&u!==i)throw new ci(i+1,u+1)}}if(0===l.length)throw new SyntaxError("At least one matrix expected");for(var h=l.shift();l.length;)h=Jc(h,l.shift(),u,0);return c?t(h):h},"...string":function(e){return e.join("")}})}));function Jc(e,r,t,n){if(n{var{typed:r,size:t,prod:n}=e;return r(Qc,{string:function(e){return e.length},"Matrix | Array":function(e){return n(t(e))}})})),Kc="ctranspose",el=Gr(Kc,["typed","transpose","conj"],(e=>{var{typed:r,transpose:t,conj:n}=e;return r(Kc,{any:function(e){return n(t(e))}})})),rl="diag",tl=Gr(rl,["typed","matrix","DenseMatrix","SparseMatrix"],(e=>{var{typed:r,matrix:t,DenseMatrix:n,SparseMatrix:i}=e;return r(rl,{Array:function(e){return a(e,0,pi(e),null)},"Array, number":function(e,r){return a(e,r,pi(e),null)},"Array, BigNumber":function(e,r){return a(e,r.toNumber(),pi(e),null)},"Array, string":function(e,r){return a(e,0,pi(e),r)},"Array, number, string":function(e,r,t){return a(e,r,pi(e),t)},"Array, BigNumber, string":function(e,r,t){return a(e,r.toNumber(),pi(e),t)},Matrix:function(e){return a(e,0,e.size(),e.storage())},"Matrix, number":function(e,r){return a(e,r,e.size(),e.storage())},"Matrix, BigNumber":function(e,r){return a(e,r.toNumber(),e.size(),e.storage())},"Matrix, string":function(e,r){return a(e,0,e.size(),r)},"Matrix, number, string":function(e,r,t){return a(e,r,e.size(),t)},"Matrix, BigNumber, string":function(e,r,t){return a(e,r.toNumber(),e.size(),t)}});function a(e,r,a,o){if(!Qr(r))throw new TypeError("Second parameter in function diag must be an integer");var s=r>0?r:0,u=r<0?-r:0;switch(a.length){case 1:return function(e,r,t,a,o,s){var u=[a+o,a+s];if(t&&"sparse"!==t&&"dense"!==t)throw new TypeError("Unknown matrix type ".concat(t,'"'));var c="sparse"===t?i.diagonal(u,e,r):n.diagonal(u,e,r);return null!==t?c:c.valueOf()}(e,r,o,a[0],u,s);case 2:return function(e,r,n,i,a,o){if(d(e)){var s=e.diagonal(r);return null!==n?n!==s.storage()?t(s,n):s:s.valueOf()}for(var u=Math.min(i[0]-a,i[1]-o),c=[],l=0;l{var{typed:r,numeric:t}=e;return r(nl,{"number, number":function(e,r){return e/r},"Complex, Complex":function(e,r){return e.div(r)},"BigNumber, BigNumber":function(e,r){return e.div(r)},"Fraction, Fraction":function(e,r){return e.div(r)},"Unit, number | Complex | Fraction | BigNumber | Unit":(e,r)=>e.divide(r),"number | Fraction | Complex | BigNumber, Unit":(e,r)=>r.divideInto(e)})})),al=Gr("matAlgo02xDS0",["typed","equalScalar"],(e=>{var{typed:r,equalScalar:t}=e;return function(e,n,i,a){var o=e._data,s=e._size,u=e._datatype,c=n._values,l=n._index,p=n._ptr,f=n._size,d=n._datatype;if(s.length!==f.length)throw new ci(s.length,f.length);if(s[0]!==f[0]||s[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+f+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var m,h=s[0],g=s[1],y=t,v=0,x=i;"string"==typeof u&&u===d&&(m=u,y=r.find(t,[m,m]),v=r.convert(0,m),x=r.find(i,[m,m]));for(var D=[],b=[],w=[],N=0;N{var{typed:r}=e;return function(e,t,n,i){var a=e._data,o=e._size,s=e._datatype,u=t._values,c=t._index,l=t._ptr,p=t._size,f=t._datatype;if(o.length!==p.length)throw new ci(o.length,p.length);if(o[0]!==p[0]||o[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+p+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var d,m=o[0],h=o[1],g=0,y=n;"string"==typeof s&&s===f&&(d=s,g=r.convert(0,d),y=r.find(n,[d,d]));for(var v=[],x=0;x{var{typed:r,DenseMatrix:t}=e;return function(e,i,a){var o=e._size,s=e._datatype,u=i._size,c=i._datatype;if(o.length!==u.length)throw new ci(o.length,u.length);if(o[0]!==u[0]||o[1]!==u[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+u+")");var l,p,f,d=o[0],m=o[1],h=0,g=a;"string"==typeof s&&s===c&&(l=s,h=r.convert(0,l),g=r.find(a,[l,l]));var y=[];for(p=0;p{var{typed:r,equalScalar:t}=e;return function(e,n,i,a){var o=e._values,s=e._index,u=e._ptr,c=e._size,l=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p,f=c[0],d=c[1],m=t,h=0,g=i;"string"==typeof l&&(p=l,m=r.find(t,[p,p]),h=r.convert(0,p),n=r.convert(n,p),g=r.find(i,[p,p]));for(var y=[],v=[],x=[],D=0;D{var{typed:r,DenseMatrix:t}=e;return function(e,n,i,a){var o=e._values,s=e._index,u=e._ptr,c=e._size,l=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p,f=c[0],d=c[1],m=i;"string"==typeof l&&(p=l,n=r.convert(n,p),m=r.find(i,[p,p]));for(var h=[],g=[],y=[],v=0;v{var{typed:r}=e;return function(e,n,i){var a,o=e._data,s=e._size,u=e._datatype,c=n._data,l=n._size,p=n._datatype,f=[];if(s.length!==l.length)throw new ci(s.length,l.length);for(var d=0;d0?t(m,0,f,f[0],o,c):[];return e.createDenseMatrix({data:h,size:f,datatype:a})};function t(e,r,n,i,a,o){var s=[];if(r===n.length-1)for(var u=0;u{var{typed:r}=e;return function(e,n,i,a){var o,s=e._data,u=e._size,c=e._datatype,l=i;"string"==typeof c&&(o=c,n=r.convert(n,o),l=r.find(i,[o,o]));var p=u.length>0?t(l,0,u,u[0],s,n,a):[];return e.createDenseMatrix({data:p,size:V(u),datatype:o})};function t(e,r,n,i,a,o,s){var u=[];if(r===n.length-1)for(var c=0;c{var{concat:r}=e;return function(e,r){var a=Math.max(e._size.length,r._size.length);if(e._size.length===r._size.length&&e._size.every(((e,t)=>e===r._size[t])))return[e,r];for(var o=t(e._size,a,0),s=t(r._size,a,0),u=[],c=0;c1)throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(t," with size ").concat(e[t]," to size ").concat(r[t]))}})),dl=Gr("matrixAlgorithmSuite",["typed","matrix","concat"],(e=>{var{typed:r,matrix:t,concat:n}=e,i=ll({typed:r}),a=pl({typed:r}),o=fl({concat:n});return function(e){var n,s=e.elop,u=e.SD||e.DS;s?(n={"DenseMatrix, DenseMatrix":(e,r)=>i(...o(e,r),s),"Array, Array":(e,r)=>i(...o(t(e),t(r)),s).valueOf(),"Array, DenseMatrix":(e,r)=>i(...o(t(e),r),s),"DenseMatrix, Array":(e,r)=>i(...o(e,t(r)),s)},e.SS&&(n["SparseMatrix, SparseMatrix"]=(r,t)=>e.SS(...o(r,t),s,!1)),e.DS&&(n["DenseMatrix, SparseMatrix"]=(r,t)=>e.DS(...o(r,t),s,!1),n["Array, SparseMatrix"]=(r,n)=>e.DS(...o(t(r),n),s,!1)),u&&(n["SparseMatrix, DenseMatrix"]=(e,r)=>u(...o(r,e),s,!0),n["SparseMatrix, Array"]=(e,r)=>u(...o(t(r),e),s,!0))):(n={"DenseMatrix, DenseMatrix":r.referToSelf((e=>(r,t)=>i(...o(r,t),e))),"Array, Array":r.referToSelf((e=>(r,n)=>i(...o(t(r),t(n)),e).valueOf())),"Array, DenseMatrix":r.referToSelf((e=>(r,n)=>i(...o(t(r),n),e))),"DenseMatrix, Array":r.referToSelf((e=>(r,n)=>i(...o(r,t(n)),e)))},e.SS&&(n["SparseMatrix, SparseMatrix"]=r.referToSelf((r=>(t,n)=>e.SS(...o(t,n),r,!1)))),e.DS&&(n["DenseMatrix, SparseMatrix"]=r.referToSelf((r=>(t,n)=>e.DS(...o(t,n),r,!1))),n["Array, SparseMatrix"]=r.referToSelf((r=>(n,i)=>e.DS(...o(t(n),i),r,!1)))),u&&(n["SparseMatrix, DenseMatrix"]=r.referToSelf((e=>(r,t)=>u(...o(t,r),e,!0))),n["SparseMatrix, Array"]=r.referToSelf((e=>(r,n)=>u(...o(t(n),r),e,!0)))));var c=e.scalar||"any";(e.Ds||e.Ss)&&(s?(n["DenseMatrix,"+c]=(e,r)=>a(e,r,s,!1),n[c+", DenseMatrix"]=(e,r)=>a(r,e,s,!0),n["Array,"+c]=(e,r)=>a(t(e),r,s,!1).valueOf(),n[c+", Array"]=(e,r)=>a(t(r),e,s,!0).valueOf()):(n["DenseMatrix,"+c]=r.referToSelf((e=>(r,t)=>a(r,t,e,!1))),n[c+", DenseMatrix"]=r.referToSelf((e=>(r,t)=>a(t,r,e,!0))),n["Array,"+c]=r.referToSelf((e=>(r,n)=>a(t(r),n,e,!1).valueOf())),n[c+", Array"]=r.referToSelf((e=>(r,n)=>a(t(n),r,e,!0).valueOf()))));var l=void 0!==e.sS?e.sS:e.Ss;return s?(e.Ss&&(n["SparseMatrix,"+c]=(r,t)=>e.Ss(r,t,s,!1)),l&&(n[c+", SparseMatrix"]=(e,r)=>l(r,e,s,!0))):(e.Ss&&(n["SparseMatrix,"+c]=r.referToSelf((r=>(t,n)=>e.Ss(t,n,r,!1)))),l&&(n[c+", SparseMatrix"]=r.referToSelf((e=>(r,t)=>l(t,r,e,!0))))),s&&s.signatures&&Y(n,s.signatures),n}})),ml="dotDivide",hl=Gr(ml,["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],(e=>{var{typed:r,matrix:t,equalScalar:n,divideScalar:i,DenseMatrix:a,concat:o}=e,s=al({typed:r,equalScalar:n}),u=ol({typed:r}),c=sl({typed:r,DenseMatrix:a}),l=ul({typed:r,equalScalar:n}),p=cl({typed:r,DenseMatrix:a}),f=dl({typed:r,matrix:t,concat:o});return r(ml,f({elop:i,SS:c,DS:u,SD:s,Ss:l,sS:p}))})),gl="equal",yl=Gr(gl,["typed","matrix","equalScalar","DenseMatrix","concat"],(e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,o=ol({typed:r}),s=sl({typed:r,DenseMatrix:i}),u=cl({typed:r,DenseMatrix:i}),c=dl({typed:r,matrix:t,concat:a});return r(gl,vl({typed:r,equalScalar:n}),c({elop:n,SS:s,DS:o,Ss:u}))})),vl=Gr(gl,["typed","equalScalar"],(e=>{var{typed:r,equalScalar:t}=e;return r(gl,{"any, any":function(e,r){return null===e?null===r:null===r?null===e:void 0===e?void 0===r:void 0===r?void 0===e:t(e,r)}})})),xl="flatten",Dl=Gr(xl,["typed","matrix"],(e=>{var{typed:r,matrix:t}=e;return r(xl,{Array:function(e){return Ei(e)},Matrix:function(e){var r=Ei(e.toArray());return t(r)}})})),bl=Gr("matAlgo01xDSid",["typed"],(e=>{var{typed:r}=e;return function(e,t,n,i){var a=e._data,o=e._size,s=e._datatype,u=t._values,c=t._index,l=t._ptr,p=t._size,f=t._datatype;if(o.length!==p.length)throw new ci(o.length,p.length);if(o[0]!==p[0]||o[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+p+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var d,m,h=o[0],g=o[1],y="string"==typeof s&&s===f?s:void 0,v=y?r.find(n,[y,y]):n,x=[];for(d=0;d{var{typed:r,equalScalar:t}=e;return function(e,n,i){var a=e._values,o=e._index,s=e._ptr,u=e._size,c=e._datatype,l=n._values,p=n._index,f=n._ptr,d=n._size,m=n._datatype;if(u.length!==d.length)throw new ci(u.length,d.length);if(u[0]!==d[0]||u[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+d+")");var h,g=u[0],y=u[1],v=t,x=0,D=i;"string"==typeof c&&c===m&&(h=c,v=r.find(t,[h,h]),x=r.convert(0,h),D=r.find(i,[h,h]));var b,w,N,E,A,S=a&&l?[]:void 0,C=[],M=[],F=a&&l?[]:void 0,T=a&&l?[]:void 0,B=[],O=[];for(w=0;w{var{typed:r,DenseMatrix:t}=e;return function(e,n,i,a){var o=e._values,s=e._index,u=e._ptr,c=e._size,l=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p,f=c[0],d=c[1],m=i;"string"==typeof l&&(p=l,n=r.convert(n,p),m=r.find(i,[p,p]));for(var h=[],g=[],y=[],v=0;vArray.isArray(e)))}var Fl=Gr("gcd",Al,(e=>{var{typed:r,matrix:t,equalScalar:n,BigNumber:i,DenseMatrix:a,concat:o}=e,s=bl({typed:r}),u=wl({typed:r,equalScalar:n}),c=Nl({typed:r,DenseMatrix:a});return r("gcd",{"number, number":va,"BigNumber, BigNumber":function(e,r){if(!e.isInt()||!r.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var t=new i(0);!r.isZero();){var n=e.mod(r);e=r,r=n}return e.lt(t)?e.neg():e},"Fraction, Fraction":(e,r)=>e.gcd(r)},dl({typed:r,matrix:t,concat:o})({SS:u,DS:s,Ss:c}),{[Cl]:r.referToSelf((e=>(r,t,n)=>{for(var i=e(r,t),a=0;ar=>{if(1===r.length&&Array.isArray(r[0])&&Ml(r[0]))return e(...r[0]);if(Ml(r))return e(...r);throw new El("gcd() supports only 1d matrices!")})),Matrix:r.referToSelf((e=>r=>e(r.toArray())))})})),Tl="hasNumericValue",Bl=Gr(Tl,["typed","isNumeric"],(e=>{var{typed:r,isNumeric:t}=e;return r(Tl,{boolean:()=>!0,string:function(e){return e.trim().length>0&&!isNaN(Number(e))},any:function(e){return t(e)}})})),Ol="identity",_l=Gr(Ol,["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],(e=>{var{typed:r,config:t,matrix:n,BigNumber:i,DenseMatrix:a,SparseMatrix:o}=e;return r(Ol,{"":function(){return"Matrix"===t.matrix?n([]):[]},string:function(e){return n(e)},"number | BigNumber":function(e){return c(e,e,"Matrix"===t.matrix?"dense":void 0)},"number | BigNumber, string":function(e,r){return c(e,e,r)},"number | BigNumber, number | BigNumber":function(e,r){return c(e,r,"Matrix"===t.matrix?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(e,r,t){return c(e,r,t)},Array:function(e){return u(e)},"Array, string":function(e,r){return u(e,r)},Matrix:function(e){return u(e.valueOf(),e.storage())},"Matrix, string":function(e,r){return u(e.valueOf(),r)}});function u(e,r){switch(e.length){case 0:return r?n(r):[];case 1:return c(e[0],e[0],r);case 2:return c(e[0],e[1],r);default:throw new Error("Vector containing two values expected")}}function c(e,r,t){var n=s(e)||s(r)?i:null;if(s(e)&&(e=e.toNumber()),s(r)&&(r=r.toNumber()),!Qr(e)||e<1)throw new Error("Parameters in function identity must be positive integers");if(!Qr(r)||r<1)throw new Error("Parameters in function identity must be positive integers");var u=n?new i(1):1,c=n?new n(0):0,l=[e,r];if(t){if("sparse"===t)return o.diagonal(l,u,0,c);if("dense"===t)return a.diagonal(l,u,0,c);throw new TypeError('Unknown matrix type "'.concat(t,'"'))}for(var p=hi([],l,c),f=e{var{typed:r,matrix:t,multiplyScalar:n}=e;return r(ql,{"Matrix, Matrix":function(e,r){return t(i(e.toArray(),r.toArray()))},"Matrix, Array":function(e,r){return t(i(e.toArray(),r))},"Array, Matrix":function(e,r){return t(i(e,r.toArray()))},"Array, Array":i});function i(e,r){if(1===pi(e).length&&(e=[e]),1===pi(r).length&&(r=[r]),pi(e).length>2||pi(r).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(e.length)+", y = "+JSON.stringify(r.length)+")");var t=[],i=[];return e.map((function(e){return r.map((function(r){return i=[],t.push(i),e.map((function(e){return r.map((function(r){return i.push(n(e,r))}))}))}))}))&&t}})),zl="largerEq",kl=Gr(zl,["typed","config","matrix","DenseMatrix","concat"],(e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,o=ol({typed:r}),s=sl({typed:r,DenseMatrix:i}),u=cl({typed:r,DenseMatrix:i}),c=dl({typed:r,matrix:n,concat:a}),l=Qo({typed:r});return r(zl,Rl({typed:r,config:t}),{"boolean, boolean":(e,r)=>e>=r,"BigNumber, BigNumber":function(e,r){return e.gte(r)||Jo(e,r,t.epsilon)},"Fraction, Fraction":(e,r)=>-1!==e.compare(r),"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},l,c({SS:s,DS:o,Ss:u}))})),Rl=Gr(zl,["typed","config"],(e=>{var{typed:r,config:t}=e;return r(zl,{"number, number":function(e,r){return e>=r||ft(e,r,t.epsilon)}})})),Pl=Gr("matAlgo08xS0Sid",["typed","equalScalar"],(e=>{var{typed:r,equalScalar:t}=e;return function(e,n,i){var a=e._values,o=e._index,s=e._ptr,u=e._size,c=e._datatype,l=n._values,p=n._index,f=n._ptr,d=n._size,m=n._datatype;if(u.length!==d.length)throw new ci(u.length,d.length);if(u[0]!==d[0]||u[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+d+")");if(!a||!l)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var h,g=u[0],y=u[1],v=t,x=0,D=i;"string"==typeof c&&c===m&&(h=c,v=r.find(t,[h,h]),x=r.convert(0,h),D=r.find(i,[h,h]));for(var b,w,N,E,A=[],S=[],C=[],M=[],F=[],T=0;T{var{typed:r,matrix:t}=e;return{"Array, number":r.referTo("DenseMatrix, number",(e=>(r,n)=>e(t(r),n).valueOf())),"Array, BigNumber":r.referTo("DenseMatrix, BigNumber",(e=>(r,n)=>e(t(r),n).valueOf())),"number, Array":r.referTo("number, DenseMatrix",(e=>(r,n)=>e(r,t(n)).valueOf())),"BigNumber, Array":r.referTo("BigNumber, DenseMatrix",(e=>(r,n)=>e(r,t(n)).valueOf()))}})),jl="leftShift",Ll=Gr(jl,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],(e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,s=bl({typed:r}),u=al({typed:r,equalScalar:n}),c=Pl({typed:r,equalScalar:n}),l=Nl({typed:r,DenseMatrix:a}),p=ul({typed:r,equalScalar:n}),f=pl({typed:r}),d=dl({typed:r,matrix:t,concat:o}),m=Ul({typed:r,matrix:t});return r(jl,{"number, number":Ao,"BigNumber, BigNumber":vo,"SparseMatrix, number | BigNumber":r.referToSelf((e=>(r,t)=>n(t,0)?r.clone():p(r,t,e,!1))),"DenseMatrix, number | BigNumber":r.referToSelf((e=>(r,t)=>n(t,0)?r.clone():f(r,t,e,!1))),"number | BigNumber, SparseMatrix":r.referToSelf((e=>(r,t)=>n(r,0)?i(t.size(),t.storage()):l(t,r,e,!0))),"number | BigNumber, DenseMatrix":r.referToSelf((e=>(r,t)=>n(r,0)?i(t.size(),t.storage()):f(t,r,e,!0)))},m,d({SS:c,DS:s,SD:u}))})),Hl="matrixFromColumns",Zl=Gr(Hl,["typed","matrix","flatten","size"],(e=>{var{typed:r,matrix:t,flatten:n,size:i}=e;return r(Hl,{"...Array":function(e){return a(e)},"...Matrix":function(e){return t(a(e.map((e=>e.toArray()))))}});function a(e){if(0===e.length)throw new TypeError("At least one column is needed to construct a matrix.");for(var r=o(e[0]),t=[],i=0;i{var{typed:r,equalScalar:t}=e;return function(e,n,i){var a=e._values,o=e._index,s=e._ptr,u=e._size,c=e._datatype,l=n._values,p=n._index,f=n._ptr,d=n._size,m=n._datatype;if(u.length!==d.length)throw new ci(u.length,d.length);if(u[0]!==d[0]||u[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+d+")");var h,g=u[0],y=u[1],v=t,x=0,D=i;"string"==typeof c&&c===m&&(h=c,v=r.find(t,[h,h]),x=r.convert(0,h),D=r.find(i,[h,h]));var b,w,N,E,A=a&&l?[]:void 0,S=[],C=[],M=A?[]:void 0,F=A?[]:void 0,T=[],B=[];for(w=0;w{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,o=al({typed:r,equalScalar:n}),s=ol({typed:r}),u=$l({typed:r,equalScalar:n}),c=ul({typed:r,equalScalar:n}),l=cl({typed:r,DenseMatrix:i});return r("mod",{"number, number":wa,"BigNumber, BigNumber":function(e,r){if(r.isNeg())throw new Error("Cannot calculate mod for a negative divisor");return r.isZero()?e:e.mod(r)},"Fraction, Fraction":function(e,r){if(r.compare(0)<0)throw new Error("Cannot calculate mod for a negative divisor");return e.compare(0)>=0?e.mod(r):e.mod(r).add(r).mod(r)}},dl({typed:r,matrix:t,concat:a})({SS:u,DS:s,SD:o,Ss:c,sS:l}))})),Vl=Gr("matAlgo06xS0S0",["typed","equalScalar"],(e=>{var{typed:r,equalScalar:t}=e;return function(e,n,i){var a=e._values,o=e._size,s=e._datatype,u=n._values,c=n._size,l=n._datatype;if(o.length!==c.length)throw new ci(o.length,c.length);if(o[0]!==c[0]||o[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+c+")");var p,f=o[0],d=o[1],m=t,h=0,g=i;"string"==typeof s&&s===l&&(p=s,m=r.find(t,[p,p]),h=r.convert(0,p),g=r.find(i,[p,p]));for(var y=a&&u?[]:void 0,v=[],x=[],D=y?[]:void 0,b=[],w=[],N=0;N{var{typed:r,matrix:t,equalScalar:n,BigNumber:i,concat:a}=e,o=bl({typed:r}),s=al({typed:r,equalScalar:n}),u=Vl({typed:r,equalScalar:n}),c=ul({typed:r,equalScalar:n}),l=dl({typed:r,matrix:t,concat:a});function p(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return r(Wl,{number:Na,"number, number":Na,BigNumber:e=>f(e,new i(2)),"BigNumber, BigNumber":f,Complex:p,"Complex, number":p,Array:r.referTo("DenseMatrix,number",(e=>r=>e(t(r),2).valueOf())),DenseMatrix:r.referTo("DenseMatrix,number",(e=>r=>e(r,2))),SparseMatrix:r.referTo("SparseMatrix,number",(e=>r=>e(r,2))),"SparseMatrix, SparseMatrix":r.referToSelf((e=>(r,t)=>{if(1===t.density())return u(r,t,e);throw new Error("Root must be non-zero")})),"DenseMatrix, SparseMatrix":r.referToSelf((e=>(r,t)=>{if(1===t.density())return o(r,t,e,!1);throw new Error("Root must be non-zero")})),"Array, SparseMatrix":r.referTo("DenseMatrix,SparseMatrix",(e=>(r,n)=>e(t(r),n))),"number | BigNumber, SparseMatrix":r.referToSelf((e=>(r,t)=>{if(1===t.density())return c(t,r,e,!0);throw new Error("Root must be non-zero")}))},l({scalar:"number | BigNumber",SD:s,Ss:c,sS:!1}));function f(e,r){var t=i.precision,n=i.clone({precision:t+2}),a=new i(0),o=new n(1),s=r.isNegative();if(s&&(r=r.neg()),r.isZero())throw new Error("Root must be non-zero");if(e.isNegative()&&!r.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(e.isZero())return s?new n(1/0):0;if(!e.isFinite())return s?a:e;var u=e.abs().pow(o.div(r));return u=e.isNeg()?u.neg():u,new i((s?o.div(u):u).toPrecision(t))}})),Jl=Gr("ones",["typed","config","matrix","BigNumber"],(e=>{var{typed:r,config:t,matrix:n,BigNumber:i}=e;return r("ones",{"":function(){return"Array"===t.matrix?a([]):a([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){var r=e.pop();return a(e,r)}return"Array"===t.matrix?a(e):a(e,"default")},Array:a,Matrix:function(e){var r=e.storage();return a(e.valueOf(),r)},"Array | Matrix, string":function(e,r){return a(e.valueOf(),r)}});function a(e,r){var t=function(e){var r=!1;return e.forEach((function(e,t,n){s(e)&&(r=!0,n[t]=e.toNumber())})),r}(e),a=t?new i(1):1;if(function(e){e.forEach((function(e){if("number"!=typeof e||!Qr(e)||e<0)throw new Error("Parameters in function ones must be positive integers")}))}(e),r){var o=n(r);return e.length>0?o.resize(e,a):o}var u=[];return e.length>0?hi(u,e,a):u}})),Ql=Gr("resize",["config","matrix"],(e=>{var{config:r,matrix:t}=e;return function(e,n,i){if(2!==arguments.length&&3!==arguments.length)throw new El("resize",arguments.length,2,3);if(d(n)&&(n=n.valueOf()),s(n[0])&&(n=n.map((function(e){return s(e)?e.toNumber():e}))),d(e))return e.resize(n,i,!0);if("string"==typeof e)return function(e,r,t){if(void 0!==t){if("string"!=typeof t||1!==t.length)throw new TypeError("Single character expected as defaultValue")}else t=" ";if(1!==r.length)throw new ci(r.length,1);var n=r[0];if("number"!=typeof n||!Qr(n))throw new TypeError("Invalid size, must contain positive integers (size: "+ii(r)+")");if(e.length>n)return e.substring(0,n);if(e.length{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,s=bl({typed:r}),u=al({typed:r,equalScalar:n}),c=Pl({typed:r,equalScalar:n}),l=Nl({typed:r,DenseMatrix:a}),p=ul({typed:r,equalScalar:n}),f=pl({typed:r}),d=dl({typed:r,matrix:t,concat:o}),m=Ul({typed:r,matrix:t});return r(Xl,{"number, number":So,"BigNumber, BigNumber":xo,"SparseMatrix, number | BigNumber":r.referToSelf((e=>(r,t)=>n(t,0)?r.clone():p(r,t,e,!1))),"DenseMatrix, number | BigNumber":r.referToSelf((e=>(r,t)=>n(t,0)?r.clone():f(r,t,e,!1))),"number | BigNumber, SparseMatrix":r.referToSelf((e=>(r,t)=>n(r,0)?i(t.size(),t.storage()):l(t,r,e,!0))),"number | BigNumber, DenseMatrix":r.referToSelf((e=>(r,t)=>n(r,0)?i(t.size(),t.storage()):f(t,r,e,!0)))},m,d({SS:c,DS:s,SD:u}))})),ep="Number of decimals in function round must be an integer",rp="round",tp=Gr(rp,["typed","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],(e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,BigNumber:a,DenseMatrix:o}=e,s=ul({typed:r,equalScalar:n}),u=cl({typed:r,DenseMatrix:o}),c=pl({typed:r});return r(rp,{number:Ma,"number, number":Ma,"number, BigNumber":function(e,r){if(!r.isInteger())throw new TypeError(ep);return new a(e).toDecimalPlaces(r.toNumber())},Complex:function(e){return e.round()},"Complex, number":function(e,r){if(r%1)throw new TypeError(ep);return e.round(r)},"Complex, BigNumber":function(e,r){if(!r.isInteger())throw new TypeError(ep);var t=r.toNumber();return e.round(t)},BigNumber:function(e){return e.toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,r){if(!r.isInteger())throw new TypeError(ep);return e.toDecimalPlaces(r.toNumber())},Fraction:function(e){return e.round()},"Fraction, number":function(e,r){if(r%1)throw new TypeError(ep);return e.round(r)},"Fraction, BigNumber":function(e,r){if(!r.isInteger())throw new TypeError(ep);return e.round(r.toNumber())},"Array | Matrix":r.referToSelf((e=>r=>na(r,e,!0))),"SparseMatrix, number | BigNumber":r.referToSelf((e=>(r,t)=>s(r,t,e,!1))),"DenseMatrix, number | BigNumber":r.referToSelf((e=>(r,t)=>c(r,t,e,!1))),"Array, number | BigNumber":r.referToSelf((e=>(r,n)=>c(t(r),n,e,!1).valueOf())),"number | Complex | BigNumber | Fraction, SparseMatrix":r.referToSelf((e=>(r,t)=>n(r,0)?i(t.size(),t.storage()):u(t,r,e,!0))),"number | Complex | BigNumber | Fraction, DenseMatrix":r.referToSelf((e=>(r,t)=>n(r,0)?i(t.size(),t.storage()):c(t,r,e,!0))),"number | Complex | BigNumber | Fraction, Array":r.referToSelf((e=>(r,n)=>c(t(n),r,e,!0).valueOf()))})})),np="smaller",ip=Gr(np,["typed","config","matrix","DenseMatrix","concat"],(e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,o=ol({typed:r}),s=sl({typed:r,DenseMatrix:i}),u=cl({typed:r,DenseMatrix:i}),c=dl({typed:r,matrix:n,concat:a}),l=Qo({typed:r});return r(np,ap({typed:r,config:t}),{"boolean, boolean":(e,r)=>e-1===e.compare(r),"Complex, Complex":function(e,r){throw new TypeError("No ordering relation is defined for complex numbers")}},l,c({SS:s,DS:o,Ss:u}))})),ap=Gr(np,["typed","config"],(e=>{var{typed:r,config:t}=e;return r(np,{"number, number":function(e,r){return e{var{typed:r,matrix:t,concat:n}=e;return r("to",{"Unit, Unit | string":(e,r)=>e.to(r)},dl({typed:r,matrix:t,concat:n})({Ds:!0}))})),sp="unequal",up=Gr(sp,["typed","config","equalScalar","matrix","DenseMatrix","concat"],(e=>{var{typed:r,config:t,equalScalar:n,matrix:i,DenseMatrix:a,concat:o}=e,s=ol({typed:r}),u=sl({typed:r,DenseMatrix:a}),c=cl({typed:r,DenseMatrix:a}),l=dl({typed:r,matrix:i,concat:o});return r(sp,cp({typed:r,equalScalar:n}),l({elop:function(e,r){return!n(e,r)},SS:u,DS:s,Ss:c}))})),cp=Gr(sp,["typed","equalScalar"],(e=>{var{typed:r,equalScalar:t}=e;return r(sp,{"any, any":function(e,r){return null===e?null!==r:null===r?null!==e:void 0===e?void 0!==r:void 0===r?void 0!==e:!t(e,r)}})})),lp=Gr("xor",["typed","matrix","DenseMatrix","concat"],(e=>{var{typed:r,matrix:t,DenseMatrix:n,concat:i}=e,a=ol({typed:r}),o=sl({typed:r,DenseMatrix:n}),s=cl({typed:r,DenseMatrix:n}),u=dl({typed:r,matrix:t,concat:i});return r("xor",{"number, number":Xs,"Complex, Complex":function(e,r){return(0!==e.re||0!==e.im)!=(0!==r.re||0!==r.im)},"BigNumber, BigNumber":function(e,r){return(!e.isZero()&&!e.isNaN())!=(!r.isZero()&&!r.isNaN())},"Unit, Unit":r.referToSelf((e=>(r,t)=>e(r.value||0,t.value||0)))},u({SS:o,DS:a,Ss:s}))})),pp=Gr("add",["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],(e=>{var{typed:r,matrix:t,addScalar:n,equalScalar:i,DenseMatrix:a,SparseMatrix:o,concat:s}=e,u=bl({typed:r}),c=wl({typed:r,equalScalar:i}),l=Nl({typed:r,DenseMatrix:a}),p=dl({typed:r,matrix:t,concat:s});return r("add",{"any, any":n,"any, any, ...any":r.referToSelf((e=>(r,t,n)=>{for(var i=e(r,t),a=0;a{var{typed:r,matrix:t,equalScalar:n,concat:i}=e,a=al({typed:r,equalScalar:n}),o=Vl({typed:r,equalScalar:n}),s=ul({typed:r,equalScalar:n}),u=dl({typed:r,matrix:t,concat:i});return r(fp,{"number, number":bo,"BigNumber, BigNumber":po},u({SS:o,DS:a,Ss:s}))})),mp="bitXor",hp=Gr(mp,["typed","matrix","DenseMatrix","concat"],(e=>{var{typed:r,matrix:t,DenseMatrix:n,concat:i}=e,a=ol({typed:r}),o=sl({typed:r,DenseMatrix:n}),s=cl({typed:r,DenseMatrix:n}),u=dl({typed:r,matrix:t,concat:i});return r(mp,{"number, number":Eo,"BigNumber, BigNumber":yo},u({SS:o,DS:a,Ss:s}))})),gp="catalan",yp=Gr(gp,["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],(e=>{var{typed:r,addScalar:t,divideScalar:n,multiplyScalar:i,combinations:a,isNegative:o,isInteger:s}=e;return r(gp,{"number | BigNumber":function(e){if(!s(e)||o(e))throw new TypeError("Non-negative integer value expected in function catalan");return n(a(i(e,2),e),t(e,1))}})})),vp="compare",xp=Gr(vp,["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],(e=>{var{typed:r,config:t,equalScalar:n,matrix:i,BigNumber:a,Fraction:o,DenseMatrix:s,concat:u}=e,c=ol({typed:r}),l=$l({typed:r,equalScalar:n}),p=cl({typed:r,DenseMatrix:s}),f=dl({typed:r,matrix:i,concat:u}),d=Qo({typed:r});return r(vp,Dp({typed:r,config:t}),{"boolean, boolean":function(e,r){return e===r?0:e>r?1:-1},"BigNumber, BigNumber":function(e,r){return Jo(e,r,t.epsilon)?new a(0):new a(e.cmp(r))},"Fraction, Fraction":function(e,r){return new o(e.compare(r))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},d,f({SS:l,DS:c,Ss:p}))})),Dp=Gr(vp,["typed","config"],(e=>{var{typed:r,config:t}=e;return r(vp,{"number, number":function(e,r){return ft(e,r,t.epsilon)?0:e>r?1:-1}})})),bp="compareText",wp=["typed","matrix","concat"];ui.signature="any, any";var Np=Gr(bp,wp,(e=>{var{typed:r,matrix:t,concat:n}=e,i=dl({typed:r,matrix:t,concat:n});return r(bp,ui,i({elop:ui,Ds:!0}))})),Ep="cumsum",Ap=Gr(Ep,["typed","add","unaryPlus"],(e=>{var{typed:r,add:t,unaryPlus:n}=e;return r(Ep,{Array:i,Matrix:function(e){return e.create(i(e.valueOf()))},"Array, number | BigNumber":o,"Matrix, number | BigNumber":function(e,r){return e.create(o(e.valueOf(),r))},"...":function(e){if(ra(e))throw new TypeError("All values expected to be scalar in function cumsum");return i(e)}});function i(e){try{return a(e)}catch(e){throw Nc(e,Ep)}}function a(e){if(0===e.length)return[];for(var r=[n(e[0])],i=1;i=t.length)throw new li(r,t.length);try{return s(e,r)}catch(e){throw Nc(e,Ep)}}function s(e,r){var t,n,i;if(r<=0){var o=e[0][0];if(Array.isArray(o)){for(i=ea(e),n=[],t=0;t{var{typed:r,equal:t}=e;return r(Sp,{"any, any":function(e,r){return n(e.valueOf(),r.valueOf())}});function n(e,r){if(Array.isArray(e)){if(Array.isArray(r)){var i=e.length;if(i!==r.length)return!1;for(var a=0;a{var{typed:r,addScalar:t,multiplyScalar:n,conj:i,size:a}=e;return r("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(e,a){var u=o(e,a),c=d(e)?e._data:e,l=d(e)?e._datatype:void 0,p=d(a)?a._data:a,f=d(a)?a._datatype:void 0,m=2===s(e).length,h=2===s(a).length,g=t,y=n;if(l&&f&&l===f&&"string"==typeof l){var v=l;g=r.find(t,[v,v]),y=r.find(n,[v,v])}if(!m&&!h){for(var x=y(i(c[0]),p[0]),D=1;Dh?d++:m===h&&(c=l(c,p(a[f],u[d])),f++,d++)}return c}});function o(e,r){var t,n,i=s(e),a=s(r);if(1===i.length)t=i[0];else{if(2!==i.length||1!==i[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+i.join(", ")+")");t=i[0]}if(1===a.length)n=a[0];else{if(2!==a.length||1!==a[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+a.join(", ")+")");n=a[0]}if(t!==n)throw new RangeError("Vectors must have equal length ("+t+" != "+n+")");if(0===t)throw new RangeError("Cannot calculate the dot product of empty vectors");return t}function s(e){return d(e)?e.size():a(e)}})),Fp="equalText",Tp=Gr(Fp,["typed","compareText","isZero"],(e=>{var{typed:r,compareText:t,isZero:n}=e;return r(Fp,{"any, any":function(e,r){return n(t(e,r))}})})),Bp="floor",Op=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],_p=Gr(Bp,["typed","config","round"],(e=>{var{typed:r,config:t,round:n}=e;return r(Bp,{number:function(e){return ft(e,n(e),t.epsilon)?n(e):Math.floor(e)},"number, number":function(e,r){if(ft(e,n(e,r),t.epsilon))return n(e,r);var[i,a]="".concat(e,"e").split("e"),o=Math.floor(Number("".concat(i,"e").concat(Number(a)+r)));return[i,a]="".concat(o,"e").split("e"),Number("".concat(i,"e").concat(Number(a)-r))}})})),qp=Gr(Bp,Op,(e=>{var{typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:s}=e,u=ul({typed:r,equalScalar:a}),c=cl({typed:r,DenseMatrix:s}),l=pl({typed:r}),p=_p({typed:r,config:t,round:n});return r("floor",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(e){return e.floor()},"Complex, number":function(e,r){return e.floor(r)},"Complex, BigNumber":function(e,r){return e.floor(r.toNumber())},BigNumber:function(e){return Jo(e,n(e),t.epsilon)?n(e):e.floor()},"BigNumber, BigNumber":function(e,r){return Jo(e,n(e,r),t.epsilon)?n(e,r):e.toDecimalPlaces(r.toNumber(),$r.ROUND_FLOOR)},Fraction:function(e){return e.floor()},"Fraction, number":function(e,r){return e.floor(r)},"Fraction, BigNumber":function(e,r){return e.floor(r.toNumber())},"Array | Matrix":r.referToSelf((e=>r=>na(r,e,!0))),"Array, number | BigNumber":r.referToSelf((e=>(r,t)=>na(r,(r=>e(r,t)),!0))),"SparseMatrix, number | BigNumber":r.referToSelf((e=>(r,t)=>u(r,t,e,!1))),"DenseMatrix, number | BigNumber":r.referToSelf((e=>(r,t)=>l(r,t,e,!1))),"number | Complex | Fraction | BigNumber, Array":r.referToSelf((e=>(r,t)=>l(i(t),r,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf((e=>(r,t)=>a(r,0)?o(t.size(),t.storage()):"dense"===t.storage()?l(t,r,e,!0):c(t,r,e,!0)))})})),Ip="hypot",zp=Gr(Ip,["typed","abs","addScalar","divideScalar","multiplyScalar","sqrt","smaller","isPositive"],(e=>{var{typed:r,abs:t,addScalar:n,divideScalar:i,multiplyScalar:a,sqrt:o,smaller:s,isPositive:c}=e;return r(Ip,{"... number | BigNumber":l,Array:l,Matrix:e=>l(Ei(e.toArray()))});function l(e){for(var r=0,l=0,p=0;p{var{smaller:r,DenseMatrix:t}=e;function n(e,r){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(r&&!p(r))throw new Error("Invalid datatype: "+r);if(d(e)||f(e)){var i=new t(e,r);this._data=i._data,this._size=i._size,this._datatype=i._datatype,this._min=null,this._max=null}else if(e&&f(e.data)&&f(e.size))this._data=e.data,this._size=e.size,this._datatype=e.datatype,this._min=void 0!==e.min?e.min:null,this._max=void 0!==e.max?e.max:null;else{if(e)throw new TypeError("Unsupported type of data ("+G(e)+")");this._data=[],this._size=[0],this._datatype=r,this._min=null,this._max=null}}return n.prototype=new t,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(e){switch(arguments.length){case 1:var r=t.prototype.subset.call(this,e);return d(r)?new n({data:r._data,size:r._size,datatype:r._datatype}):r;case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:V(this._data),size:V(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(e){return new n(e)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(null===this._min){var e=null;this.forEach((function(t){(null===e||r(t,e))&&(e=t)})),this._min=null!==e?e:void 0}return this._min},n.prototype.max=function(){if(null===this._max){var e=null;this.forEach((function(t){(null===e||r(e,t))&&(e=t)})),this._max=null!==e?e:void 0}return this._max},n}),{isClass:!0}),Rp=Gr("Index",["ImmutableDenseMatrix"],(e=>{var{ImmutableDenseMatrix:r}=e;function t(e){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._isScalar=!0;for(var r=0,i=arguments.length;r{var{typed:r,config:t,BigNumber:n,xgcd:i,equal:a,smaller:o,mod:s,add:u,isInteger:c}=e;return r(Pp,{"number, number":l,"BigNumber, BigNumber":l});function l(e,r){if(!c(e)||!c(r))throw new Error("Parameters in function invmod must be integer numbers");if(e=s(e,r),a(r,0))throw new Error("Divisor must be non zero");var t=i(e,r);t=t.valueOf();var[l,p]=t;return a(l,n(1))?(p=s(p,r),o(p,n(0))&&(p=u(p,r)),p):NaN}})),jp="larger",Lp=Gr(jp,["typed","config","matrix","DenseMatrix","concat"],(e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,o=ol({typed:r}),s=sl({typed:r,DenseMatrix:i}),u=cl({typed:r,DenseMatrix:i}),c=dl({typed:r,matrix:n,concat:a}),l=Qo({typed:r});return r(jp,Hp({typed:r,config:t}),{"boolean, boolean":(e,r)=>e>r,"BigNumber, BigNumber":function(e,r){return e.gt(r)&&!Jo(e,r,t.epsilon)},"Fraction, Fraction":(e,r)=>1===e.compare(r),"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},l,c({SS:s,DS:o,Ss:u}))})),Hp=Gr(jp,["typed","config"],(e=>{var{typed:r,config:t}=e;return r(jp,{"number, number":function(e,r){return e>r&&!ft(e,r,t.epsilon)}})})),Zp=Gr("log",["config","typed","divideScalar","Complex"],(e=>{var{typed:r,config:t,divideScalar:n,Complex:i}=e;return r("log",{number:function(e){return e>=0||t.predictable?function(e,r){return Math.log(e)}(e):new i(e,0).log()},Complex:function(e){return e.log()},BigNumber:function(e){return!e.isNegative()||t.predictable?e.ln():new i(e.toNumber(),0).log()},"any, any":r.referToSelf((e=>(r,t)=>n(e(r),e(t))))})})),$p="matrixFromRows",Gp=Gr($p,["typed","matrix","flatten","size"],(e=>{var{typed:r,matrix:t,flatten:n,size:i}=e;return r($p,{"...Array":function(e){return a(e)},"...Matrix":function(e){return t(a(e.map((e=>e.toArray()))))}});function a(e){if(0===e.length)throw new TypeError("At least one row is needed to construct a matrix.");var r=o(e[0]),t=[];for(var i of e){var a=o(i);if(a!==r)throw new TypeError("The vectors had different length: "+(0|r)+" ≠ "+(0|a));t.push(n(i))}return t}function o(e){var r=i(e);if(1===r.length)return r[0];if(2===r.length){if(1===r[0])return r[1];if(1===r[1])return r[0];throw new TypeError("At least one of the arguments is not a vector.")}throw new TypeError("Only one- or two-dimensional vectors are supported.")}})),Vp=Gr("min",["typed","config","numeric","smaller"],(e=>{var{typed:r,config:t,numeric:n,smaller:i}=e;return r("min",{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,r){return ia(e,r.valueOf(),a)},"...":function(e){if(ra(e))throw new TypeError("Scalar values expected in function min");return o(e)}});function a(e,r){try{return i(e,r)?e:r}catch(e){throw Nc(e,"min",r)}}function o(e){var r;if(ta(e,(function(e){try{isNaN(e)&&"number"==typeof e?r=NaN:(void 0===r||i(e,r))&&(r=e)}catch(r){throw Nc(r,"min",e)}})),void 0===r)throw new Error("Cannot calculate min of an empty array");return"string"==typeof r&&(r=n(r,t.number)),r}})),Wp="multiply",Yp=Gr(Wp,["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],(e=>{var{typed:r,matrix:t,addScalar:n,multiplyScalar:i,equalScalar:a,dot:o}=e,s=ul({typed:r,equalScalar:a}),u=pl({typed:r});function c(e,r){switch(e.length){case 1:switch(r.length){case 1:if(e[0]!==r[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(e[0]!==r[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+e[0]+") must match Matrix rows ("+r[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+r.length+" dimensions)")}break;case 2:switch(r.length){case 1:if(e[1]!==r[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+e[1]+") must match Vector length ("+r[0]+")");break;case 2:if(e[1]!==r[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+e[1]+") must match Matrix B rows ("+r[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+r.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+e.length+" dimensions)")}}var l=r("_multiplyMatrixVector",{"DenseMatrix, any":function(e,t){var a,o=e._data,s=e._size,u=e._datatype,c=t._data,l=t._datatype,p=s[0],f=s[1],d=n,m=i;u&&l&&u===l&&"string"==typeof u&&(a=u,d=r.find(n,[a,a]),m=r.find(i,[a,a]));for(var h=[],g=0;gS)for(var M=0,F=0;F(r,n)=>{c(pi(r),pi(n));var i=e(t(r),t(n));return d(i)?i.valueOf():i})),"Matrix, Matrix":function(e,t){var a=e.size(),s=t.size();return c(a,s),1===a.length?1===s.length?function(e,r,t){if(0===t)throw new Error("Cannot multiply two empty vectors");return o(e,r)}(e,t,a[0]):function(e,t){if("dense"!==t.storage())throw new Error("Support for SparseMatrix not implemented");return function(e,t){var a,o=e._data,s=e._size,u=e._datatype,c=t._data,l=t._size,p=t._datatype,f=s[0],d=l[1],m=n,h=i;u&&p&&u===p&&"string"==typeof u&&(a=u,m=r.find(n,[a,a]),h=r.find(i,[a,a]));for(var g=[],y=0;y(r,n)=>e(r,t(n)))),"Array, Matrix":r.referToSelf((e=>(r,n)=>e(t(r,n.storage()),n))),"SparseMatrix, any":function(e,r){return s(e,r,i,!1)},"DenseMatrix, any":function(e,r){return u(e,r,i,!1)},"any, SparseMatrix":function(e,r){return s(r,e,i,!0)},"any, DenseMatrix":function(e,r){return u(r,e,i,!0)},"Array, any":function(e,r){return u(t(e),r,i,!1).valueOf()},"any, Array":function(e,r){return u(t(r),e,i,!0).valueOf()},"any, any":i,"any, any, ...any":r.referToSelf((e=>(r,t,n)=>{for(var i=e(r,t),a=0;a{var{typed:r,config:t,divideScalar:n,Complex:i}=e,a=[function(e){return new i(e,0)},function(e){return new i(0,e)},function(e){return new i(-e,0)},function(e){return new i(0,-e)}];function o(e,r){if(r<0)throw new Error("Root must be greater than zero");if(0===r)throw new Error("Root must be non-zero");if(r%1!=0)throw new Error("Root must be an integer");if(0===e||0===e.abs())return[new i(0,0)];var t,n="number"==typeof e;(n||0===e.re||0===e.im)&&(t=n?2*+(e<0):0===e.im?2*+(e.re<0):2*+(e.im<0)+1);for(var o=e.arg(),s=e.abs(),u=[],c=Math.pow(s,1/r),l=0;l{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,o=ol({typed:r}),s=$l({typed:r,equalScalar:n}),u=cl({typed:r,DenseMatrix:i}),c=dl({typed:r,matrix:t,concat:a});return r("or",{"number, number":Qs,"Complex, Complex":function(e,r){return 0!==e.re||0!==e.im||0!==r.re||0!==r.im},"BigNumber, BigNumber":function(e,r){return!e.isZero()&&!e.isNaN()||!r.isZero()&&!r.isNaN()},"Unit, Unit":r.referToSelf((e=>(r,t)=>e(r.value||0,t.value||0)))},c({SS:s,DS:o,Ss:u}))})),Kp="partitionSelect",ef=Gr(Kp,["typed","isNumeric","isNaN","compare"],(e=>{var{typed:r,isNumeric:t,isNaN:n,compare:i}=e,a=i,o=(e,r)=>-i(e,r);return r(Kp,{"Array | Matrix, number":function(e,r){return s(e,r,a)},"Array | Matrix, number, string":function(e,r,t){if("asc"===t)return s(e,r,a);if("desc"===t)return s(e,r,o);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":s});function s(e,r,t){if(!Qr(r)||r<0)throw new Error("k must be a non-negative integer");if(d(e)){if(e.size().length>1)throw new Error("Only one dimensional matrices supported");return u(e.valueOf(),r,t)}if(Array.isArray(e))return u(e,r,t)}function u(e,r,i){if(r>=e.length)throw new Error("k out of bounds");for(var a=0;a=0){var p=e[c];e[c]=e[u],e[u]=p,--c}else++u;i(e[u],l)>0&&--u,r<=u?s=u:o=u+1}return e[r]}})),rf=Gr("quantileSeq",["typed","add","multiply","partitionSelect","compare"],(e=>{var{typed:r,add:t,multiply:n,partitionSelect:i,compare:a}=e;function u(e,r,s){var u=Ei(e),l=u.length;if(0===l)throw new Error("Cannot calculate quantile of an empty sequence");if(o(r)){var p=r*(l-1),f=p%1;if(0===f){var d=s?u[p]:i(u,p);return c(d),d}var m,h,g=Math.floor(p);if(s)m=u[g],h=u[g+1];else{h=i(u,g+1),m=u[g];for(var y=0;y0&&(m=u[y])}return c(m),c(h),t(n(m,1-f),n(h,f))}var v=r.times(l-1);if(v.isInteger()){v=v.toNumber();var x=s?u[v]:i(u,v);return c(x),x}var D,b,w=v.floor(),N=v.minus(w),E=w.toNumber();if(s)D=u[E],b=u[E+1];else{b=i(u,E+1),D=u[E];for(var A=0;A0&&(D=u[A])}c(D),c(b);var S=new N.constructor(1);return t(n(D,S.minus(N)),n(b,N))}var c=r({"number | BigNumber | Unit":function(e){return e}});return function(e,r,t){var n,i,a;if(arguments.length<2||arguments.length>3)throw new SyntaxError("Function quantileSeq requires two or three parameters");if(m(e)){if("boolean"==typeof(t=t||!1)){if(i=e.valueOf(),o(r)){if(r<0)throw new Error("N/prob must be non-negative");if(r<=1)return u(i,r,t);if(r>1){if(!Qr(r))throw new Error("N must be a positive integer");var c=r+1;n=new Array(r);for(var l=0;l4294967295)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=new p(f+1);n=new Array(f);for(var h=0;h1)throw new Error("Probability must be between 0 and 1, inclusive")}else{if(!s(v))throw new TypeError("Unexpected type of argument in function quantileSeq");if(a=new v.constructor(1),v.isNegative()||v.gt(a))throw new Error("Probability must be between 0 and 1, inclusive")}n[y]=u(i,v,t)}return n}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}})),tf="rightLogShift",nf=Gr(tf,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],(e=>{var{typed:r,matrix:t,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e,s=bl({typed:r}),u=al({typed:r,equalScalar:n}),c=Pl({typed:r,equalScalar:n}),l=Nl({typed:r,DenseMatrix:a}),p=ul({typed:r,equalScalar:n}),f=pl({typed:r}),d=dl({typed:r,matrix:t,concat:o}),m=Ul({typed:r,matrix:t});return r(tf,{"number, number":Co,"SparseMatrix, number | BigNumber":r.referToSelf((e=>(r,t)=>n(t,0)?r.clone():p(r,t,e,!1))),"DenseMatrix, number | BigNumber":r.referToSelf((e=>(r,t)=>n(t,0)?r.clone():f(r,t,e,!1))),"number | BigNumber, SparseMatrix":r.referToSelf((e=>(r,t)=>n(r,0)?i(t.size(),t.storage()):l(t,r,e,!0))),"number | BigNumber, DenseMatrix":r.referToSelf((e=>(r,t)=>n(r,0)?i(t.size(),t.storage()):f(t,r,e,!0)))},m,d({SS:c,DS:s,SD:u}))})),af="smallerEq",of=Gr(af,["typed","config","matrix","DenseMatrix","concat"],(e=>{var{typed:r,config:t,matrix:n,DenseMatrix:i,concat:a}=e,o=ol({typed:r}),s=sl({typed:r,DenseMatrix:i}),u=cl({typed:r,DenseMatrix:i}),c=dl({typed:r,matrix:n,concat:a}),l=Qo({typed:r});return r(af,sf({typed:r,config:t}),{"boolean, boolean":(e,r)=>e<=r,"BigNumber, BigNumber":function(e,r){return e.lte(r)||Jo(e,r,t.epsilon)},"Fraction, Fraction":(e,r)=>1!==e.compare(r),"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},l,c({SS:s,DS:o,Ss:u}))})),sf=Gr(af,["typed","config"],(e=>{var{typed:r,config:t}=e;return r(af,{"number, number":function(e,r){return e<=r||ft(e,r,t.epsilon)}})})),uf="subtract",cf=Gr(uf,["typed","matrix","equalScalar","addScalar","unaryMinus","DenseMatrix","concat"],(e=>{var{typed:r,matrix:t,equalScalar:n,addScalar:i,unaryMinus:a,DenseMatrix:o,concat:s}=e,u=bl({typed:r}),c=ol({typed:r}),l=$l({typed:r,equalScalar:n}),p=Nl({typed:r,DenseMatrix:o}),f=cl({typed:r,DenseMatrix:o}),d=dl({typed:r,matrix:t,concat:s});return r(uf,{"number, number":(e,r)=>e-r,"Complex, Complex":(e,r)=>e.sub(r),"BigNumber, BigNumber":(e,r)=>e.minus(r),"Fraction, Fraction":(e,r)=>e.sub(r),"Unit, Unit":r.referToSelf((e=>(t,n)=>{if(null===t.value)throw new Error("Parameter x contains a unit with undefined value");if(null===n.value)throw new Error("Parameter y contains a unit with undefined value");if(!t.equalBase(n))throw new Error("Units do not match");var i=t.clone();return i.value=r.find(e,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i}))},d({SS:l,DS:u,SD:c,Ss:f,sS:p}))})),lf=Gr("trace",["typed","matrix","add"],(e=>{var{typed:r,matrix:t,add:n}=e;return r("trace",{Array:function(e){return i(t(e))},SparseMatrix:function(e){var r=e._values,t=e._index,i=e._ptr,a=e._size,o=a[0],s=a[1];if(o===s){var u=0;if(r.length>0)for(var c=0;cc)break}return u}throw new RangeError("Matrix must be square (size: "+ii(a)+")")},DenseMatrix:i,any:V});function i(e){var r=e._size,t=e._data;switch(r.length){case 1:if(1===r[0])return V(t[0]);throw new RangeError("Matrix must be square (size: "+ii(r)+")");case 2:var i=r[0];if(i===r[1]){for(var a=0,o=0;o{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtract:a,equalScalar:o,DenseMatrix:s}=e,u=pf({DenseMatrix:s});return r(ff,{"SparseMatrix, Array | Matrix":function(e,r){return function(e,r){for(var t=(r=u(e,r,!0))._data,c=e._size[0],l=e._size[1],p=e._values,f=e._index,d=e._ptr,m=[],h=l-1;h>=0;h--){var g=t[h][0]||0;if(o(g,0))m[h]=[0];else{for(var y=0,v=[],x=[],D=d[h],b=d[h+1]-1;b>=D;b--){var w=f[b];w===h?y=p[b]:w=0;d--){var m=t[d][0]||0,h=void 0;if(o(m,0))h=0;else{var g=f[d][d];if(o(g,0))throw new Error("Linear system cannot be solved since matrix is singular");h=n(m,g);for(var y=d-1;y>=0;y--)t[y]=[a(t[y][0]||0,i(h,f[y][d]))]}p[d]=[h]}return new s({data:p,size:[c,1]})}})),mf="zpk2tf",hf=Gr(mf,["typed","add","multiply","Complex","number"],(e=>{var{typed:r,add:t,multiply:n,Complex:i,number:a}=e;return r(mf,{"Array,Array,number":function(e,r,t){return o(e,r,t)},"Array,Array":function(e,r){return o(e,r,1)},"Matrix,Matrix,number":function(e,r,t){return o(e.valueOf(),r.valueOf(),t)},"Matrix,Matrix":function(e,r){return o(e.valueOf(),r.valueOf(),1)}});function o(e,r,t){e.some((e=>"BigNumber"===e.type))&&(e=e.map((e=>a(e)))),r.some((e=>"BigNumber"===e.type))&&(r=r.map((e=>a(e))));for(var o=[i(1,0)],u=[i(1,0)],c=0;c=0&&o-s{var{typed:r,matrix:t,equalScalar:n,zeros:i,not:a,concat:o}=e,s=al({typed:r,equalScalar:n}),u=Vl({typed:r,equalScalar:n}),c=ul({typed:r,equalScalar:n}),l=pl({typed:r}),p=dl({typed:r,matrix:t,concat:o});return r("and",{"number, number":Ks,"Complex, Complex":function(e,r){return!(0===e.re&&0===e.im||0===r.re&&0===r.im)},"BigNumber, BigNumber":function(e,r){return!(e.isZero()||r.isZero()||e.isNaN()||r.isNaN())},"Unit, Unit":r.referToSelf((e=>(r,t)=>e(r.value||0,t.value||0))),"SparseMatrix, any":r.referToSelf((e=>(r,t)=>a(t)?i(r.size(),r.storage()):c(r,t,e,!1))),"DenseMatrix, any":r.referToSelf((e=>(r,t)=>a(t)?i(r.size(),r.storage()):l(r,t,e,!1))),"any, SparseMatrix":r.referToSelf((e=>(r,t)=>a(r)?i(r.size(),r.storage()):c(t,r,e,!0))),"any, DenseMatrix":r.referToSelf((e=>(r,t)=>a(r)?i(r.size(),r.storage()):l(t,r,e,!0))),"Array, any":r.referToSelf((e=>(r,n)=>e(t(r),n).valueOf())),"any, Array":r.referToSelf((e=>(r,n)=>e(r,t(n)).valueOf()))},p({SS:u,DS:s}))})),yf="bitOr",vf=Gr(yf,["typed","matrix","equalScalar","DenseMatrix","concat"],(e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:i,concat:a}=e,o=bl({typed:r}),s=wl({typed:r,equalScalar:n}),u=Nl({typed:r,DenseMatrix:i}),c=dl({typed:r,matrix:t,concat:a});return r(yf,{"number, number":No,"BigNumber, BigNumber":mo},c({SS:s,DS:o,Ss:u}))})),xf="ceil",Df=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],bf=Gr(xf,["typed","config","round"],(e=>{var{typed:r,config:t,round:n}=e;return r(xf,{number:function(e){return ft(e,n(e),t.epsilon)?n(e):Math.ceil(e)},"number, number":function(e,r){if(ft(e,n(e,r),t.epsilon))return n(e,r);var[i,a]="".concat(e,"e").split("e"),o=Math.ceil(Number("".concat(i,"e").concat(Number(a)+r)));return[i,a]="".concat(o,"e").split("e"),Number("".concat(i,"e").concat(Number(a)-r))}})})),wf=Gr(xf,Df,(e=>{var{typed:r,config:t,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:s}=e,u=ul({typed:r,equalScalar:a}),c=cl({typed:r,DenseMatrix:s}),l=pl({typed:r}),p=bf({typed:r,config:t,round:n});return r("ceil",{number:p.signatures.number,"number,number":p.signatures["number,number"],Complex:function(e){return e.ceil()},"Complex, number":function(e,r){return e.ceil(r)},"Complex, BigNumber":function(e,r){return e.ceil(r.toNumber())},BigNumber:function(e){return Jo(e,n(e),t.epsilon)?n(e):e.ceil()},"BigNumber, BigNumber":function(e,r){return Jo(e,n(e,r),t.epsilon)?n(e,r):e.toDecimalPlaces(r.toNumber(),$r.ROUND_CEIL)},Fraction:function(e){return e.ceil()},"Fraction, number":function(e,r){return e.ceil(r)},"Fraction, BigNumber":function(e,r){return e.ceil(r.toNumber())},"Array | Matrix":r.referToSelf((e=>r=>na(r,e,!0))),"Array, number | BigNumber":r.referToSelf((e=>(r,t)=>na(r,(r=>e(r,t)),!0))),"SparseMatrix, number | BigNumber":r.referToSelf((e=>(r,t)=>u(r,t,e,!1))),"DenseMatrix, number | BigNumber":r.referToSelf((e=>(r,t)=>l(r,t,e,!1))),"number | Complex | Fraction | BigNumber, Array":r.referToSelf((e=>(r,t)=>l(i(t),r,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf((e=>(r,t)=>a(r,0)?o(t.size(),t.storage()):"dense"===t.storage()?l(t,r,e,!0):c(t,r,e,!0)))})})),Nf=t(3228),Ef="compareNatural",Af=Gr(Ef,["typed","compare"],(e=>{var{typed:r,compare:t}=e,n=t.signatures["boolean,boolean"];return r(Ef,{"any, any":function e(r,o){var s,u=G(r),c=G(o);if(!("number"!==u&&"BigNumber"!==u&&"Fraction"!==u||"number"!==c&&"BigNumber"!==c&&"Fraction"!==c))return"0"!==(s=t(r,o)).toString()?s>0?1:-1:Nf(u,c);var l=["Array","DenseMatrix","SparseMatrix"];if(l.includes(u)||l.includes(c))return 0!==(s=i(e,r,o))?s:Nf(u,c);if(u!==c)return Nf(u,c);if("Complex"===u)return function(e,r){return e.re>r.re?1:e.rer.im?1:e.imt.length?1:r.length{var{typed:r,addScalar:t,combinations:n,isPositive:i,isNegative:a,isInteger:o,larger:s}=e;return r(Sf,{"number | BigNumber, number | BigNumber":function(e,r){if(!(o(e)&&i(e)&&o(r)&&i(r)))throw new TypeError("Positive integer value expected in function composition");if(s(r,e))throw new TypeError("k must be less than or equal to n in function composition");return n(t(e,-1),t(r,-1))}})})),Mf="cross",Ff=Gr(Mf,["typed","matrix","subtract","multiply"],(e=>{var{typed:r,matrix:t,subtract:n,multiply:i}=e;return r(Mf,{"Matrix, Matrix":function(e,r){return t(a(e.toArray(),r.toArray()))},"Matrix, Array":function(e,r){return t(a(e.toArray(),r))},"Array, Matrix":function(e,r){return t(a(e,r.toArray()))},"Array, Array":a});function a(e,r){var t=Math.max(pi(e).length,pi(r).length);e=Di(e),r=Di(r);var a=pi(e),o=pi(r);if(1!==a.length||1!==o.length||3!==a[0]||3!==o[0])throw new RangeError("Vectors with length 3 expected (Size A = ["+a.join(", ")+"], B = ["+o.join(", ")+"])");var s=[n(i(e[1],r[2]),i(e[2],r[1])),n(i(e[2],r[0]),i(e[0],r[2])),n(i(e[0],r[1]),i(e[1],r[0]))];return t>1?[s]:s}})),Tf=Gr("det",["typed","matrix","subtract","multiply","divideScalar","isZero","unaryMinus"],(e=>{var{typed:r,matrix:t,subtract:n,multiply:i,divideScalar:a,isZero:o,unaryMinus:s}=e;return r("det",{any:function(e){return V(e)},"Array | Matrix":function(e){var r;switch((r=d(e)?e.size():Array.isArray(e)?(e=t(e)).size():[]).length){case 0:return V(e);case 1:if(1===r[0])return V(e.valueOf()[0]);if(0===r[0])return 1;throw new RangeError("Matrix must be square (size: "+ii(r)+")");case 2:var u=r[0],c=r[1];if(u===c)return function(e,r,t){if(1===r)return V(e[0][0]);if(2===r)return n(i(e[0][0],e[1][1]),i(e[1][0],e[0][1]));for(var u=!1,c=new Array(r).fill(0).map(((e,r)=>r)),l=0;l{var{typed:r,matrix:t,subtract:n,number:i}=e;return r(Bf,{"Array | Matrix":function(e){return d(e)?t(o(e.toArray())):o(e)},"Array | Matrix, number":function(e,r){if(!Qr(r))throw new RangeError("Dimension must be a whole number");return d(e)?t(a(e.toArray(),r)):a(e,r)},"Array, BigNumber":r.referTo("Array,number",(e=>(r,t)=>e(r,i(t)))),"Matrix, BigNumber":r.referTo("Matrix,number",(e=>(r,t)=>e(r,i(t))))});function a(e,r){if(d(e)&&(e=e.toArray()),!Array.isArray(e))throw RangeError("Array/Matrix does not have that many dimensions");if(r>0){var t=[];return e.forEach((e=>{t.push(a(e,r-1))})),t}if(0===r)return o(e);throw RangeError("Cannot have negative dimension")}function o(e){for(var r=[],t=e.length,n=1;n{var{typed:r,addScalar:t,subtract:n,multiplyScalar:i,divideScalar:a,deepEqual:o,sqrt:u,abs:c}=e;return r(_f,{"Array, Array, Array":function(e,r,t){if(2===e.length&&2===r.length&&2===t.length){if(!p(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!p(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!p(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(o(r,t))throw new TypeError("LinePoint1 should not be same with LinePoint2");var a=n(t[1],r[1]),s=n(r[0],t[0]),u=n(i(t[0],r[1]),i(r[0],t[1]));return g(e[0],e[1],a,s,u)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(e,r,t){if(2===Object.keys(e).length&&2===Object.keys(r).length&&2===Object.keys(t).length){if(!p(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!p(r))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!p(t))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(o(h(r),h(t)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in e&&"pointY"in e&&"lineOnePtX"in r&&"lineOnePtY"in r&&"lineTwoPtX"in t&&"lineTwoPtY"in t){var a=n(t.lineTwoPtY,r.lineOnePtY),s=n(r.lineOnePtX,t.lineTwoPtX),u=n(i(t.lineTwoPtX,r.lineOnePtY),i(r.lineOnePtX,t.lineTwoPtY));return g(e.pointX,e.pointY,a,s,u)}throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(e,r){if(2===e.length&&3===r.length){if(!p(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(r))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return g(e[0],e[1],r[0],r[1],r[2])}if(3===e.length&&6===r.length){if(!f(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!m(r))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return y(e[0],e[1],e[2],r[0],r[1],r[2],r[3],r[4],r[5])}if(e.length===r.length&&e.length>0){if(!d(e))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!d(r))throw new TypeError("All values of an array should be numbers or BigNumbers");return v(e,r)}throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(e,r){if(2===Object.keys(e).length&&3===Object.keys(r).length){if(!p(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(r))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"xCoeffLine"in r&&"yCoeffLine"in r&&"constant"in r)return g(e.pointX,e.pointY,r.xCoeffLine,r.yCoeffLine,r.constant);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&6===Object.keys(r).length){if(!f(e))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!m(r))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in e&&"pointY"in e&&"x0"in r&&"y0"in r&&"z0"in r&&"a"in r&&"b"in r&&"c"in r)return y(e.pointX,e.pointY,e.pointZ,r.x0,r.y0,r.z0,r.a,r.b,r.c);throw new TypeError("Key names do not match")}if(2===Object.keys(e).length&&2===Object.keys(r).length){if(!p(e))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!p(r))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointTwoX"in r&&"pointTwoY"in r)return v([e.pointOneX,e.pointOneY],[r.pointTwoX,r.pointTwoY]);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&3===Object.keys(r).length){if(!f(e))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!f(r))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in e&&"pointOneY"in e&&"pointOneZ"in e&&"pointTwoX"in r&&"pointTwoY"in r&&"pointTwoZ"in r)return v([e.pointOneX,e.pointOneY,e.pointOneZ],[r.pointTwoX,r.pointTwoY,r.pointTwoZ]);throw new TypeError("Key names do not match")}throw new TypeError("Invalid Arguments: Try again")},Array:function(e){if(!function(e){if(2===e[0].length&&l(e[0][0])&&l(e[0][1])){if(e.some((e=>2!==e.length||!l(e[0])||!l(e[1]))))return!1}else{if(!(3===e[0].length&&l(e[0][0])&&l(e[0][1])&&l(e[0][2])))return!1;if(e.some((e=>3!==e.length||!l(e[0])||!l(e[1])||!l(e[2]))))return!1}return!0}(e))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return function(e){for(var r=[],t=[],n=[],i=0;i{var{typed:r,equalScalar:t}=e;return function(e,n,i){var a=e._values,o=e._index,s=e._ptr,u=e._size,c=e._datatype,l=n._values,p=n._index,f=n._ptr,d=n._size,m=n._datatype;if(u.length!==d.length)throw new ci(u.length,d.length);if(u[0]!==d[0]||u[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+d+")");var h,g=u[0],y=u[1],v=t,x=0,D=i;"string"==typeof c&&c===m&&(h=c,v=r.find(t,[h,h]),x=r.convert(0,h),D=r.find(i,[h,h]));var b,w,N,E,A,S=a&&l?[]:void 0,C=[],M=[],F=S?[]:void 0,T=[];for(w=0;w{var{typed:r,matrix:t,equalScalar:n,multiplyScalar:i,concat:a}=e,o=al({typed:r,equalScalar:n}),s=If({typed:r,equalScalar:n}),u=ul({typed:r,equalScalar:n}),c=dl({typed:r,matrix:t,concat:a});return r(zf,c({elop:i,SS:s,DS:o,Ss:u}))})),Rf=Gr("FibonacciHeap",["smaller","larger"],(e=>{var{smaller:r,larger:t}=e,n=1/Math.log((1+Math.sqrt(5))/2);function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}function a(e,r,t){r.left.right=r.right,r.right.left=r.left,t.degree--,t.child===r&&(t.child=r.right),0===t.degree&&(t.child=null),r.left=e,r.right=e.right,e.right=r,r.right.left=r,r.parent=null,r.mark=!1}function o(e,r){var t=r.parent;t&&(r.mark?(a(e,r,t),o(t)):r.mark=!0)}i.prototype.type="FibonacciHeap",i.prototype.isFibonacciHeap=!0,i.prototype.insert=function(e,t){var n={key:e,value:t,degree:0};if(this._minimum){var i=this._minimum;n.left=i,n.right=i.right,i.right=n,n.right.left=n,r(e,i.key)&&(this._minimum=n)}else n.left=n,n.right=n,this._minimum=n;return this._size++,n},i.prototype.size=function(){return this._size},i.prototype.clear=function(){this._minimum=null,this._size=0},i.prototype.isEmpty=function(){return 0===this._size},i.prototype.extractMinimum=function(){var e=this._minimum;if(null===e)return e;for(var i=this._minimum,a=e.degree,o=e.child;a>0;){var u=o.right;o.left.right=o.right,o.right.left=o.left,o.left=i,o.right=i.right,i.right=o,o.right.left=o,o.parent=null,o=u,a--}return e.left.right=e.right,e.right.left=e.left,i=e===e.right?null:function(e,i){var a,o=Math.floor(Math.log(i)*n)+1,u=new Array(o),c=0,l=e;if(l)for(c++,l=l.right;l!==e;)c++,l=l.right;for(;c>0;){for(var p=l.degree,f=l.right;a=u[p];){if(t(l.key,a.key)){var d=a;a=l,l=d}s(a,l),u[p]=null,p++}u[p]=l,l=f,c--}e=null;for(var m=0;m{var{typed:r,ceil:t,floor:n}=e;return r(Pf,{number:function(e){return e>0?n(e):t(e)},"number, number":function(e,r){return e>0?n(e,r):t(e,r)}})})),Lf=Gr(Pf,Uf,(e=>{var{typed:r,Complex:t,matrix:n,ceil:i,floor:a,equalScalar:o,zeros:s,DenseMatrix:u}=e,c=cl({typed:r,DenseMatrix:u}),l=pl({typed:r}),p=jf({typed:r,ceil:i,floor:a});return r("fix",{number:p.signatures.number,"number, number | BigNumber":p.signatures["number,number"],Complex:function(e){return new t(e.re>0?Math.floor(e.re):Math.ceil(e.re),e.im>0?Math.floor(e.im):Math.ceil(e.im))},"Complex, number":function(e,r){return new t(e.re>0?a(e.re,r):i(e.re,r),e.im>0?a(e.im,r):i(e.im,r))},"Complex, BigNumber":function(e,r){var n=r.toNumber();return new t(e.re>0?a(e.re,n):i(e.re,n),e.im>0?a(e.im,n):i(e.im,n))},BigNumber:function(e){return e.isNegative()?i(e):a(e)},"BigNumber, number | BigNumber":function(e,r){return e.isNegative()?i(e,r):a(e,r)},Fraction:function(e){return e.s<0?e.ceil():e.floor()},"Fraction, number | BigNumber":function(e,r){return e.s<0?i(e,r):a(e,r)},"Array | Matrix":r.referToSelf((e=>r=>na(r,e,!0))),"Array | Matrix, number | BigNumber":r.referToSelf((e=>(r,t)=>na(r,(r=>e(r,t)),!0))),"number | Complex | Fraction | BigNumber, Array":r.referToSelf((e=>(r,t)=>l(n(t),r,e,!0).valueOf())),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf((e=>(r,t)=>o(r,0)?s(t.size(),t.storage()):"dense"===t.storage()?l(t,r,e,!0):c(t,r,e,!0)))})})),Hf="index",Zf=Gr(Hf,["typed","Index"],(e=>{var{typed:r,Index:t}=e;return r(Hf,{"...number | string | BigNumber | Range | Array | Matrix":function(e){var r=e.map((function(e){return s(e)?e.toNumber():Array.isArray(e)||d(e)?e.map((function(e){return s(e)?e.toNumber():e})):e})),n=new t;return t.apply(n,r),n}})})),$f=Gr("intersect",["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten","isZero","isNumeric"],(e=>{var{typed:r,config:t,abs:n,add:i,addScalar:a,matrix:o,multiply:s,multiplyScalar:u,divideScalar:c,subtract:l,smaller:p,equalScalar:f,flatten:d,isZero:m,isNumeric:h}=e;return r("intersect",{"Array, Array, Array":g,"Array, Array, Array, Array":y,"Matrix, Matrix, Matrix":function(e,r,t){var n=g(e.valueOf(),r.valueOf(),t.valueOf());return null===n?null:o(n)},"Matrix, Matrix, Matrix, Matrix":function(e,r,t,n){var i=y(e.valueOf(),r.valueOf(),t.valueOf(),n.valueOf());return null===i?null:o(i)}});function g(e,r,t){if(e=v(e),r=v(r),t=v(t),!D(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!D(r))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!function(e){return 4===e.length&&h(e[0])&&h(e[1])&&h(e[2])&&h(e[3])}(t))throw new TypeError("Array with 4 numbers expected as third argument");return function(e,r,t,n,i,o,s,p,f,d){var m=u(e,s),h=u(n,s),g=u(r,p),y=u(i,p),v=u(t,f),x=u(o,f),D=l(l(l(d,m),g),v),b=l(l(l(a(a(h,y),x),m),g),v),w=c(D,b);return[a(e,u(w,l(n,e))),a(r,u(w,l(i,r))),a(t,u(w,l(o,t)))]}(e[0],e[1],e[2],r[0],r[1],r[2],t[0],t[1],t[2],t[3])}function y(e,r,o,d){if(e=v(e),r=v(r),o=v(o),d=v(d),2===e.length){if(!x(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!x(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!x(o))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!x(d))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return function(e,r,o,f){var d=e,h=o,g=l(d,r),y=l(h,f),v=l(u(g[0],y[1]),u(y[0],g[1]));if(m(v))return null;if(p(n(v),t.epsilon))return null;var x=u(y[0],d[1]),D=u(y[1],d[0]),b=u(y[0],h[1]),w=u(y[1],h[0]),N=c(a(l(l(x,D),b),w),v);return i(s(g,N),d)}(e,r,o,d)}if(3===e.length){if(!D(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!D(r))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!D(o))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!D(d))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return function(e,r,t,n,i,o,s,p,d,h,g,y){var v=b(e,s,h,s,r,p,g,p,t,d,y,d),x=b(h,s,n,e,g,p,i,r,y,d,o,t),D=b(e,s,n,e,r,p,i,r,t,d,o,t),w=b(h,s,h,s,g,p,g,p,y,d,y,d),N=b(n,e,n,e,i,r,i,r,o,t,o,t),E=l(u(v,x),u(D,w)),A=l(u(N,w),u(x,x));if(m(A))return null;var S=c(E,A),C=c(a(v,u(S,x)),w),M=a(e,u(S,l(n,e))),F=a(r,u(S,l(i,r))),T=a(t,u(S,l(o,t))),B=a(s,u(C,l(h,s))),O=a(p,u(C,l(g,p))),_=a(d,u(C,l(y,d)));return f(M,B)&&f(F,O)&&f(T,_)?[M,F,T]:null}(e[0],e[1],e[2],r[0],r[1],r[2],o[0],o[1],o[2],d[0],d[1],d[2])}throw new TypeError("Arrays with two or thee dimensional points expected")}function v(e){return 1===e.length?e[0]:e.length>1&&Array.isArray(e[0])&&e.every((e=>Array.isArray(e)&&1===e.length))?d(e):e}function x(e){return 2===e.length&&h(e[0])&&h(e[1])}function D(e){return 3===e.length&&h(e[0])&&h(e[1])&&h(e[2])}function b(e,r,t,n,i,o,s,c,p,f,d,m){var h=u(l(e,r),l(t,n)),g=u(l(i,o),l(s,c)),y=u(l(p,f),l(d,m));return a(a(h,g),y)}})),Gf=Gr("lcm",["typed","matrix","equalScalar","concat"],(e=>{var{typed:r,matrix:t,equalScalar:n,concat:i}=e,a=al({typed:r,equalScalar:n}),o=Vl({typed:r,equalScalar:n}),s=ul({typed:r,equalScalar:n}),u=dl({typed:r,matrix:t,concat:i}),c="number | BigNumber | Fraction | Matrix | Array",l={};return l["".concat(c,", ").concat(c,", ...").concat(c)]=r.referToSelf((e=>(r,t,n)=>{for(var i=e(r,t),a=0;ae.lcm(r)},u({SS:o,DS:a,Ss:s}),l)})),Vf="log1p",Wf=Gr(Vf,["typed","config","divideScalar","log","Complex"],(e=>{var{typed:r,config:t,divideScalar:n,log:i,Complex:a}=e;return r(Vf,{number:function(e){return e>=-1||t.predictable?rt(e):o(new a(e,0))},Complex:o,BigNumber:function(e){var r=e.plus(1);return!r.isNegative()||t.predictable?r.ln():o(new a(e.toNumber(),0))},"Array | Matrix":r.referToSelf((e=>r=>na(r,e))),"any, any":r.referToSelf((e=>(r,t)=>n(e(r),i(t))))});function o(e){var r=e.re+1;return new a(Math.log(Math.sqrt(r*r+e.im*e.im)),Math.atan2(e.im,r))}})),Yf="lsolve",Jf=Gr(Yf,["typed","matrix","divideScalar","multiplyScalar","subtract","equalScalar","DenseMatrix"],(e=>{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtract:a,equalScalar:o,DenseMatrix:s}=e,u=pf({DenseMatrix:s});return r(Yf,{"SparseMatrix, Array | Matrix":function(e,r){return function(e,r){for(var t=(r=u(e,r,!0))._data,c=e._size[0],l=e._size[1],p=e._values,f=e._index,d=e._ptr,m=[],h=0;hh&&(v.push(p[w]),x.push(N))}if(o(y,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var E=n(g,y),A=0,S=x.length;A{var{typed:r,config:t,numeric:n,larger:i}=e;return r("max",{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,r){return ia(e,r.valueOf(),a)},"...":function(e){if(ra(e))throw new TypeError("Scalar values expected in function max");return o(e)}});function a(e,r){try{return i(e,r)?e:r}catch(e){throw Nc(e,"max",r)}}function o(e){var r;if(ta(e,(function(e){try{isNaN(e)&&"number"==typeof e?r=NaN:(void 0===r||i(e,r))&&(r=e)}catch(r){throw Nc(r,"max",e)}})),void 0===r)throw new Error("Cannot calculate max of an empty array");return"string"==typeof r&&(r=n(r,t.number)),r}})),Xf=Gr("qr",["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtract","complex"],(e=>{var{typed:r,matrix:t,zeros:n,identity:a,isZero:o,equal:s,sign:u,sqrt:c,conj:l,unaryMinus:p,addScalar:f,divideScalar:d,multiplyScalar:m,subtract:h,complex:g}=e;return(0,i.Z)(r("qr",{DenseMatrix:function(e){return v(e)},SparseMatrix:function(e){return function(e){throw new Error("qr not implemented for sparse matrices yet")}()},Array:function(e){var r=v(t(e));return{Q:r.Q.valueOf(),R:r.R.valueOf()}}}),{_denseQRimpl:y});function y(e){var r,t,i,g=e._size[0],y=e._size[1],v=a([g],"dense"),x=v._data,D=e.clone(),b=D._data,w=n([g],"");for(i=0;i0)for(var n="Complex"===t[0][0].type?g(0):0,i=0;i{var{typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:s,largerEq:u,add:c,isPositive:l}=e;return r(Kf,{string:f,"string, boolean":f,"number, number":function(e,r){return p(d(e,r,1,!1))},"number, number, number":function(e,r,t){return p(d(e,r,t,!1))},"number, number, boolean":function(e,r,t){return p(d(e,r,1,t))},"number, number, number, boolean":function(e,r,t,n){return p(d(e,r,t,n))},"BigNumber, BigNumber":function(e,r){return p(d(e,r,new(0,e.constructor)(1),!1))},"BigNumber, BigNumber, BigNumber":function(e,r,t){return p(d(e,r,t,!1))},"BigNumber, BigNumber, boolean":function(e,r,t){return p(d(e,r,new(0,e.constructor)(1),t))},"BigNumber, BigNumber, BigNumber, boolean":function(e,r,t,n){return p(d(e,r,t,n))},"Unit, Unit, Unit":function(e,r,t){return p(d(e,r,t,!1))},"Unit, Unit, Unit, boolean":function(e,r,t,n){return p(d(e,r,t,n))}});function p(e){return"Matrix"===t.matrix?n?n(e):bc():e}function f(e,r){var n=function(e){var r=e.split(":").map((function(e){return Number(e)}));if(r.some((function(e){return isNaN(e)})))return null;switch(r.length){case 2:return{start:r[0],end:r[1],step:1};case 3:return{start:r[0],end:r[2],step:r[1]};default:return null}}(e);if(!n)throw new SyntaxError('String "'+e+'" is no valid range');return"BigNumber"===t.number?(void 0===i&&xc(),p(d(i(n.start),i(n.end),i(n.step)))):p(d(n.start,n.end,n.step,r))}function d(e,r,t,n){for(var i=[],p=l(t)?n?o:a:n?u:s,f=e;p(f,r);)i.push(f),f=c(f,t);return i}})),rd=Gr("row",["typed","Index","matrix","range"],(e=>{var{typed:r,Index:t,matrix:n,range:i}=e;return r("row",{"Matrix, number":a,"Array, number":function(e,r){return a(n(V(e)),r).valueOf()}});function a(e,r){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");mi(r,e.size()[0]);var a=i(0,e.size()[1]),o=new t(r,a),s=e.subset(o);return d(s)?s:n([[s]])}})),td="setCartesian",nd=Gr(td,["typed","size","subset","compareNatural","Index","DenseMatrix"],(e=>{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return r(td,{"Array | Matrix, Array | Matrix":function(e,r){var s=[];if(0!==n(t(e),new a(0))&&0!==n(t(r),new a(0))){var u=Ei(Array.isArray(e)?e:e.toArray()).sort(i),c=Ei(Array.isArray(r)?r:r.toArray()).sort(i);s=[];for(var l=0;l{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return r(id,{"Array | Matrix":function(e){var r;if(0===n(t(e),new a(0)))r=[];else{var s=Ei(Array.isArray(e)?e:e.toArray()).sort(i);(r=[]).push(s[0]);for(var u=1;u{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(od,{"Array | Matrix, Array | Matrix":function(e,r){if(0===n(t(e),new a(0)))return!0;if(0===n(t(r),new a(0)))return!1;for(var o,s=Ti(Ei(Array.isArray(e)?e:e.toArray()).sort(i)),u=Ti(Ei(Array.isArray(r)?r:r.toArray()).sort(i)),c=0;c{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(ud,{"Array | Matrix":function(e){if(0===n(t(e),new a(0)))return[];for(var r=Ei(Array.isArray(e)?e:e.toArray()).sort(i),s=[],u=0;u.toString(2).length<=r.length;)s.push(o(r,u.toString(2).split("").reverse())),u++;return function(e){for(var r=[],t=e.length-1;t>0;t--)for(var n=0;ne[n+1].length&&(r=e[n],e[n]=e[n+1],e[n+1]=r);return e}(s)}});function o(e,r){for(var t=[],n=0;n=0;){var u=t[o+s],c=t[n+u];-1===c?(s--,a[r++]=u):(t[n+u]=t[i+c],t[o+ ++s]=c)}return r}function pd(e){return-e-2}var fd=Gr("csAmd",["add","multiply","transpose"],(e=>{var{add:r,multiply:t,transpose:n}=e;return function(e,o){if(!o||e<=0||e>3)return null;var s=o._size,u=s[0],c=s[1],l=0,p=Math.max(16,10*Math.sqrt(c)),f=function(e,i,a,o,s){var u=n(i);if(1===e&&o===a)return r(i,u);if(2===e){for(var c=u._index,l=u._ptr,p=0,f=0;fs))for(var m=l[f+1];do)t[s+f]=0,t[i+f]=-1,p++,r[f]=pd(e),t[s+e]++;else{var m=t[u+d];-1!==m&&(c[m]=f),t[l+f]=t[u+d],t[u+d]=f}}return p}(c,T,_,R,k,P,p,q,z,j,I),Z=0;H$?(v=h,x=W,D=_[0+h]-$):(x=T[v=F[W++]],D=_[0+v]),y=1;y<=D;y++)(b=_[q+(d=F[x++])])<=0||(V+=b,_[q+d]=-b,F[J++]=d,-1!==_[I+d]&&(j[_[I+d]]=j[d]),-1!==j[d]?_[I+j[d]]=_[I+d]:_[z+_[R+d]]=_[I+d]);v!==h&&(T[v]=pd(h),_[P+v]=0)}for(0!==$&&(B=J),_[R+h]=V,T[h]=Y,_[0+h]=J-Y,_[k+h]=-2,L=i(L,l,_,P,c),w=Y;w=L?_[P+v]-=b:0!==_[P+v]&&(_[P+v]=_[R+v]+Q)}for(w=Y;w0?(M+=X,F[S++]=v,C+=v):(T[v]=pd(h),_[P+v]=0)}_[k+d]=S-E+1;var K=S,ee=E+_[0+d];for(W=A+1;W=0))for(d=_[U+(C=j[d])],_[U+C]=-1;-1!==d&&-1!==_[I+d];d=_[I+d],L++){for(D=_[0+d],N=_[k+d],W=T[d]+1;W<=T[d]+D-1;W++)_[P+F[W]]=L;var te=d;for(m=_[I+d];-1!==m;){var ne=_[0+m]===D&&_[k+m]===N;for(W=T[m]+1;ne&&W<=T[m]+D-1;W++)_[P+F[W]]!==L&&(ne=0);ne?(T[m]=pd(d),_[q+d]+=_[q+m],_[q+m]=0,_[k+m]=-1,m=_[I+m],_[I+te]=m):(te=m,m=_[I+m])}}for(W=Y,w=Y;w=0;m--)_[q+m]>0||(_[I+m]=_[z+T[m]],_[z+T[m]]=m);for(v=c;v>=0;v--)_[q+v]<=0||-1!==T[v]&&(_[I+v]=_[z+T[v]],_[z+T[v]]=v);for(h=0,d=0;d<=c;d++)-1===T[d]&&(h=ld(d,h,_,z,I,O,P));return O.splice(O.length-1,1),O};function i(e,r,t,n,i){if(e<2||e+r<0){for(var a=0;a{var{transpose:r}=e;return function(e,t,n,i){if(!e||!t||!n)return null;var a,o,s,u,c,l,p,f=e._size,d=f[0],m=f[1],h=4*m+(i?m+d+1:0),g=[],y=m,v=2*m,x=3*m,D=4*m,b=5*m+1;for(s=0;s=1&&w[o]++,2===S.jleaf&&w[S.q]--}-1!==t[o]&&(g[0+o]=t[o])}for(o=0;o{var{add:r,multiply:t,transpose:n}=e,i=fd({add:r,multiply:t,transpose:n}),a=md({transpose:n});return function(e,r,t){var n,o=r._ptr,s=r._size[1],u={};if(u.q=i(e,r),e&&!u.q)return null;if(t){var c=e?function(e,r,t,n){for(var i=e._values,a=e._index,o=e._ptr,s=e._size,u=e._datatype,c=s[0],l=s[1],p=null,f=[],d=[],m=0,h=0;h=0;t--)-1!==e[t]&&(a[o+t]=a[0+e[t]],a[0+e[t]]=t);for(t=0;t=0;u--)for(l=t[u],p=t[u+1],c=l;c=0;s--)d[s]=-1,-1!==(u=m[s])&&(0==h[v+u]++&&(h[y+u]=s),h[0+s]=h[g+u],h[g+u]=s);for(r.lnz=0,r.m2=a,u=0;u=0;){e=n[p];var f=i?i[e]:e;gd(c,e)||(yd(c,e),n[l+p]=f<0?0:vd(c[f]));var d=1;for(o=n[l+p],s=f<0?0:vd(c[f+1]);o{var{divideScalar:r,multiply:t,subtract:n}=e;return function(e,i,a,o,s,u,c){var l,p,f,d,m=e._values,h=e._index,g=e._ptr,y=e._size[1],v=i._values,x=i._index,D=i._ptr,b=function(e,r,t,n,i){var a,o,s,u=e._ptr,c=e._size,l=r._index,p=r._ptr,f=c[1],d=f;for(o=p[t],s=p[t+1],a=o;a{var{abs:r,divideScalar:t,multiply:n,subtract:i,larger:a,largerEq:o,SparseMatrix:s}=e,u=Dd({divideScalar:t,multiply:n,subtract:i});return function(e,i,c){if(!e)return null;var l,p=e._size[1],f=100,d=100;i&&(l=i.q,f=i.lnz||f,d=i.unz||d);var m,h,g=[],y=[],v=[],x=new s({values:g,index:y,ptr:v,size:[p,p]}),D=[],b=[],w=[],N=new s({values:D,index:b,ptr:w,size:[p,p]}),E=[],A=[],S=[];for(m=0;m{var{typed:r,abs:t,add:n,multiply:i,transpose:a,divideScalar:o,subtract:s,larger:u,largerEq:c,SparseMatrix:l}=e,p=hd({add:n,multiply:i,transpose:a}),f=bd({abs:t,divideScalar:o,multiply:i,subtract:s,larger:u,largerEq:c,SparseMatrix:l});return r("slu",{"SparseMatrix, number, number":function(e,r,t){if(!Qr(r)||r<0||r>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(t<0||t>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var n=p(r,e,!1),i=f(e,n,t);return{L:i.L,U:i.U,p:i.pinv,q:n.q,toString:function(){return"L: "+this.L.toString()+"\nU: "+this.U.toString()+"\np: "+this.p.toString()+(this.q?"\nq: "+this.q.toString():"")+"\n"}}}})})),Nd="sort",Ed=Gr(Nd,["typed","matrix","compare","compareNatural"],(e=>{var{typed:r,matrix:t,compare:n,compareNatural:i}=e,a=n,o=(e,r)=>-n(e,r);return r(Nd,{Array:function(e){return u(e),e.sort(a)},Matrix:function(e){return c(e),t(e.toArray().sort(a),e.storage())},"Array, function":function(e,r){return u(e),e.sort(r)},"Matrix, function":function(e,r){return c(e),t(e.toArray().sort(r),e.storage())},"Array, string":function(e,r){return u(e),e.sort(s(r))},"Matrix, string":function(e,r){return c(e),t(e.toArray().sort(s(r)),e.storage())}});function s(e){if("asc"===e)return a;if("desc"===e)return o;if("natural"===e)return i;throw new Error('String "asc", "desc", or "natural" expected')}function u(e){if(1!==pi(e).length)throw new Error("One dimensional array expected")}function c(e){if(1!==e.size().length)throw new Error("One dimensional matrix expected")}})),Ad=Gr("sum",["typed","config","add","numeric"],(e=>{var{typed:r,config:t,add:n,numeric:i}=e;return r("sum",{"Array | Matrix":a,"Array | Matrix, number | BigNumber":function(e,r){try{return ia(e,r,n)}catch(e){throw Nc(e,"sum")}},"...":function(e){if(ra(e))throw new TypeError("Scalar values expected in function sum");return a(e)}});function a(e){var r;return ta(e,(function(e){try{r=void 0===r?e:n(r,e)}catch(r){throw Nc(r,"sum",e)}})),void 0===r&&(r=i(0,t.number)),"string"==typeof r&&(r=i(r,t.number)),r}})),Sd="usolveAll",Cd=Gr(Sd,["typed","matrix","divideScalar","multiplyScalar","subtract","equalScalar","DenseMatrix"],(e=>{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtract:a,equalScalar:o,DenseMatrix:s}=e,u=pf({DenseMatrix:s});return r(Sd,{"SparseMatrix, Array | Matrix":function(e,r){return function(e,r){for(var t=[u(e,r,!0)._data.map((e=>e[0]))],c=e._size[0],l=e._size[1],p=e._values,f=e._index,d=e._ptr,m=l-1;m>=0;m--)for(var h=t.length,g=0;g=D;w--){var N=f[w];N===m?b=p[w]:Nnew s({data:e.map((e=>[e])),size:[c,1]})))}(e,r)},"DenseMatrix, Array | Matrix":function(e,r){return c(e,r)},"Array, Array | Matrix":function(e,r){return c(t(e),r).map((e=>e.valueOf()))}});function c(e,r){for(var t=[u(e,r,!0)._data.map((e=>e[0]))],c=e._data,l=e._size[0],p=e._size[1]-1;p>=0;p--)for(var f=t.length,d=0;d=0;g--)h[g]=a(h[g],c[g][p]);t.push(h)}}else{if(0===d)return[];t.splice(d,1),d-=1,f-=1}else{m[p]=n(m[p],c[p][p]);for(var y=p-1;y>=0;y--)m[y]=a(m[y],i(m[p],c[y][p]))}}return t.map((e=>new s({data:e.map((e=>[e])),size:[l,1]})))}})),Md="atan2",Fd=Gr(Md,["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],(e=>{var{typed:r,matrix:t,equalScalar:n,BigNumber:i,DenseMatrix:a,concat:o}=e,s=al({typed:r,equalScalar:n}),u=ol({typed:r}),c=If({typed:r,equalScalar:n}),l=ul({typed:r,equalScalar:n}),p=cl({typed:r,DenseMatrix:a}),f=dl({typed:r,matrix:t,concat:o});return r(Md,{"number, number":Math.atan2,"BigNumber, BigNumber":(e,r)=>i.atan2(e,r)},f({scalar:"number | BigNumber",SS:c,DS:u,SD:s,Ss:l,sS:p}))})),Td="column",Bd=Gr(Td,["typed","Index","matrix","range"],(e=>{var{typed:r,Index:t,matrix:n,range:i}=e;return r(Td,{"Matrix, number":a,"Array, number":function(e,r){return a(n(V(e)),r).valueOf()}});function a(e,r){if(2!==e.size().length)throw new Error("Only two dimensional matrix is supported");mi(r,e.size()[1]);var a=i(0,e.size()[0]),o=new t(a,r),s=e.subset(o);return d(s)?s:n([[s]])}})),Od="lsolveAll",_d=Gr(Od,["typed","matrix","divideScalar","multiplyScalar","subtract","equalScalar","DenseMatrix"],(e=>{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:i,subtract:a,equalScalar:o,DenseMatrix:s}=e,u=pf({DenseMatrix:s});return r(Od,{"SparseMatrix, Array | Matrix":function(e,r){return function(e,r){for(var t=[u(e,r,!0)._data.map((e=>e[0]))],c=e._size[0],l=e._size[1],p=e._values,f=e._index,d=e._ptr,m=0;mm&&(v.push(p[N]),x.push(E))}if(o(w,0))if(o(y[m],0)){if(0===g){var A=[...y];A[m]=1;for(var S=0,C=x.length;Snew s({data:e.map((e=>[e])),size:[c,1]})))}(e,r)},"DenseMatrix, Array | Matrix":function(e,r){return c(e,r)},"Array, Array | Matrix":function(e,r){return c(t(e),r).map((e=>e.valueOf()))}});function c(e,r){for(var t=[u(e,r,!0)._data.map((e=>e[0]))],c=e._data,l=e._size[0],p=e._size[1],f=0;fnew s({data:e.map((e=>[e])),size:[l,1]})))}})),qd="setDifference",Id=Gr(qd,["typed","size","subset","compareNatural","Index","DenseMatrix"],(e=>{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return r(qd,{"Array | Matrix, Array | Matrix":function(e,r){var s;if(0===n(t(e),new a(0)))s=[];else{if(0===n(t(r),new a(0)))return Ei(e.toArray());var u,c=Ti(Ei(Array.isArray(e)?e:e.toArray()).sort(i)),l=Ti(Ei(Array.isArray(r)?r:r.toArray()).sort(i));s=[];for(var p=0;p{var{typed:r,size:t,subset:n,compareNatural:i,Index:a}=e;return r(zd,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(e,r){if(0===n(t(r),new a(0)))return 0;for(var o=Ei(Array.isArray(r)?r:r.toArray()),s=0,u=0;u{var{typed:r,size:t,concat:n,subset:i,setDifference:a,Index:o}=e;return r(Rd,{"Array | Matrix, Array | Matrix":function(e,r){if(0===i(t(e),new o(0)))return Ei(r);if(0===i(t(r),new o(0)))return Ei(e);var s=Ei(e),u=Ei(r);return n(a(s,u),a(u,s))}})})),Ud=Gr("Spa",["addScalar","equalScalar","FibonacciHeap"],(e=>{var{addScalar:r,equalScalar:t,FibonacciHeap:n}=e;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(e,r){if(this._values[e])this._values[e].value=r;else{var t=this._heap.insert(e,r);this._values[e]=t}},i.prototype.get=function(e){var r=this._values[e];return r?r.value:0},i.prototype.accumulate=function(e,t){var n=this._values[e];n?n.value=r(n.value,t):(n=this._heap.insert(e,t),this._values[e]=n)},i.prototype.forEach=function(e,r,n){var i=this._heap,a=this._values,o=[],s=i.extractMinimum();for(s&&o.push(s);s&&s.key<=r;)s.key>=e&&(t(s.value,0)||n(s.key,s.value,this)),(s=i.extractMinimum())&&o.push(s);for(var u=0;u{var{typed:r,matrix:t,divideScalar:n,addScalar:i,multiply:a,unaryMinus:o,det:s,identity:u,abs:c}=e;return r("inv",{"Array | Matrix":function(e){var r=d(e)?e.size():pi(e);switch(r.length){case 1:if(1===r[0])return d(e)?t([n(1,e.valueOf()[0])]):[n(1,e[0])];throw new RangeError("Matrix must be square (size: "+ii(r)+")");case 2:var i=r[0],a=r[1];if(i===a)return d(e)?t(l(e.valueOf(),i,a),e.storage()):l(e,i,a);throw new RangeError("Matrix must be square (size: "+ii(r)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+ii(r)+")")}},any:function(e){return n(1,e)}});function l(e,r,t){var l,p,f,d,m;if(1===r){if(0===(d=e[0][0]))throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,d)]]}if(2===r){var h=s(e);if(0===h)throw Error("Cannot calculate inverse, determinant is zero");return[[n(e[1][1],h),n(o(e[0][1]),h)],[n(o(e[1][0]),h),n(e[0][0],h)]]}var g=e.concat();for(l=0;lx&&(x=c(g[l][v]),D=l),l++;if(0===x)throw Error("Cannot calculate inverse, determinant is zero");(l=D)!==v&&(m=g[v],g[v]=g[l],g[l]=m,m=y[v],y[v]=y[l],y[l]=m);var b=g[v],w=y[v];for(l=0;l{var{typed:r,matrix:t,abs:n,addScalar:i,divideScalar:a,multiplyScalar:o,subtract:s,larger:u,equalScalar:c,unaryMinus:l,DenseMatrix:p,SparseMatrix:f,Spa:d}=e;return r("lup",{DenseMatrix:function(e){return m(e)},SparseMatrix:function(e){return function(e){var r,t,i,s=e._size[0],p=e._size[1],m=Math.min(s,p),h=e._values,g=e._index,y=e._ptr,v=[],x=[],D=[],b=[s,m],w=[],N=[],E=[],A=[m,p],S=[],C=[];for(r=0;r0&&e.forEach(0,t-1,(function(r,t){f._forEachRow(r,v,x,D,(function(n,i){n>r&&e.accumulate(n,l(o(i,t)))}))}));var M,F,T,B,O=t,_=e.get(t),q=n(_);e.forEach(t+1,s-1,(function(e,r){var t=n(r);u(t,q)&&(O=e,q=t,_=r)})),t!==O&&(f._swapRows(t,O,b[1],v,x,D),f._swapRows(t,O,A[1],w,N,E),e.swap(t,O),F=O,T=C[M=t],B=C[F],S[T]=F,S[B]=M,C[M]=B,C[F]=T),e.forEach(0,s-1,(function(e,r){e<=t?(w.push(r),N.push(e)):(r=a(r,_),c(r,0)||(v.push(r),x.push(e)))}))};for(t=0;t0)for(r=0;r{var{typed:r,matrix:t,inv:n,deepEqual:i,equal:a,dotDivide:o,dot:s,ctranspose:u,divideScalar:c,multiply:l,add:p,Complex:f}=e;return r(Hd,{"Array | Matrix":function(e){var r=d(e)?e.size():pi(e);switch(r.length){case 1:return g(e)?u(e):1===r[0]?n(e):o(u(e),s(e,e));case 2:if(g(e))return u(e);var i=r[0],a=r[1];if(i===a)try{return n(e)}catch(e){if(!(e instanceof Error&&e.message.match(/Cannot calculate inverse, determinant is zero/)))throw e}return d(e)?t(m(e.valueOf(),i,a),e.storage()):m(e,i,a);default:throw new RangeError("Matrix must be two dimensional (size: "+ii(r)+")")}},any:function(e){return a(e,0)?V(e):c(1,e)}});function m(e,r,t){var{C:i,F:a}=function(e,r,t){var n=function(e,r,t){for(var n=V(e),i=0,a=0;ae.filter(((e,t)=>t!h(s(n[r],n[r]))));return{C:i,F:a}}(e,r,t),c=l(n(l(u(i),i)),u(i)),f=l(u(a),n(l(a,u(a))));return l(f,c)}function h(e){return a(p(e,f(1,1)),p(0,f(1,1)))}function g(e){return i(p(e,f(1,1)),p(l(e,0),f(1,1)))}})),$d=Gr("pow",["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],(e=>{var{typed:r,config:t,identity:n,multiply:i,matrix:a,inv:o,number:s,fraction:u,Complex:c}=e;return r("pow",{"number, number":l,"Complex, Complex":function(e,r){return e.pow(r)},"BigNumber, BigNumber":function(e,r){return r.isInteger()||e>=0||t.predictable?e.pow(r):new c(e.toNumber(),0).pow(r.toNumber(),0)},"Fraction, Fraction":function(e,r){var n=e.pow(r);if(null!=n)return n;if(t.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return l(e.valueOf(),r.valueOf())},"Array, number":p,"Array, BigNumber":function(e,r){return p(e,r.toNumber())},"Matrix, number":f,"Matrix, BigNumber":function(e,r){return f(e,r.toNumber())},"Unit, number | BigNumber":function(e,r){return e.pow(r)}});function l(e,r){if(t.predictable&&!Qr(r)&&e<0)try{var n=u(r),i=s(n);if((r===i||Math.abs((r-i)/r)<1e-14)&&n.d%2==1)return(n.n%2==0?1:-1)*Math.pow(-e,r)}catch(e){}return t.predictable&&(e<-1&&r===1/0||e>-1&&e<0&&r===-1/0)?NaN:Qr(r)||e>=0||t.predictable?Ca(e,r):e*e<1&&r===1/0||e*e>1&&r===-1/0?0:new c(e,0).pow(r,0)}function p(e,r){if(!Qr(r))throw new TypeError("For A^b, b must be an integer (value is "+r+")");var t=pi(e);if(2!==t.length)throw new Error("For A^b, A must be 2 dimensional (A has "+t.length+" dimensions)");if(t[0]!==t[1])throw new Error("For A^b, A must be square (size is "+t[0]+"x"+t[1]+")");if(r<0)try{return p(o(e),-r)}catch(e){if("Cannot calculate inverse, determinant is zero"===e.message)throw new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+r+")");throw e}for(var a=n(t[0]).valueOf(),s=e;r>=1;)1==(1&r)&&(a=i(s,a)),r>>=1,s=i(s,s);return a}function f(e,r){return a(p(e.valueOf(),r))}})),Gd="setIntersect",Vd=Gr(Gd,["typed","size","subset","compareNatural","Index","DenseMatrix"],(e=>{var{typed:r,size:t,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return r(Gd,{"Array | Matrix, Array | Matrix":function(e,r){var s;if(0===n(t(e),new a(0))||0===n(t(r),new a(0)))s=[];else{var u=Ti(Ei(Array.isArray(e)?e:e.toArray()).sort(i)),c=Ti(Ei(Array.isArray(r)?r:r.toArray()).sort(i));s=[];for(var l=0;l{var{typed:r,size:t,concat:n,subset:i,setIntersect:a,setSymDifference:o,Index:s}=e;return r(Wd,{"Array | Matrix, Array | Matrix":function(e,r){if(0===i(t(e),new s(0)))return Ei(r);if(0===i(t(r),new s(0)))return Ei(e);var u=Ei(e),c=Ei(r);return n(o(u,c),a(u,c))}})})),Jd="sqrtm",Qd=Gr(Jd,["typed","abs","add","multiply","map","sqrt","subtract","inv","size","max","identity"],(e=>{var{typed:r,abs:t,add:n,multiply:i,map:a,sqrt:o,subtract:s,inv:u,size:c,max:l,identity:p}=e,f=1e-6;function m(e){var r,a=0,o=e,d=p(c(e));do{var m=o;if(o=i(.5,n(m,u(d))),d=i(.5,n(d,u(m))),(r=l(t(s(o,m))))>f&&++a>1e3)throw new Error("computing square root of matrix: iterative method could not converge")}while(r>f);return o}return r(Jd,{"Array | Matrix":function(e){var r=d(e)?e.size():pi(e);switch(r.length){case 1:if(1===r[0])return a(e,o);throw new RangeError("Matrix must be square (size: "+ii(r)+")");case 2:if(r[0]===r[1])return m(e);throw new RangeError("Matrix must be square (size: "+ii(r)+")");default:throw new RangeError("Matrix must be at most two dimensional (size: "+ii(r)+")")}}})})),Xd=t(4572);function Kd(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function em(e){for(var r=1;r{var r,t,n,{on:a,config:o,addScalar:s,subtract:c,multiplyScalar:p,divideScalar:f,pow:d,abs:m,fix:h,round:g,equal:y,isNumeric:v,format:x,number:D,Complex:b,BigNumber:w,Fraction:N}=e,E=D;function A(e,r){if(!(this instanceof A))throw new Error("Constructor must be called with the new operator");if(null!=e&&!v(e)&&!u(e))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,void 0===r)this.units=[],this.dimensions=z.map((e=>0));else if("string"==typeof r){var t=A.parse(r);this.units=t.units,this.dimensions=t.dimensions}else{if(!l(r)||null!==r.value)throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.fixPrefix=r.fixPrefix,this.skipAutomaticSimplification=r.skipAutomaticSimplification,this.dimensions=r.dimensions.slice(0),this.units=r.units.map((e=>(0,i.Z)({},e)))}this.value=this._normalize(e)}function S(){for(;" "===n||"\t"===n;)M()}function C(e){return e>="0"&&e<="9"}function M(){t++,n=r.charAt(t)}function F(e){t=e,n=r.charAt(t)}function T(){var e="",r=t;if("+"===n?M():"-"===n&&(e+=n,M()),!function(e){return e>="0"&&e<="9"||"."===e}(n))return F(r),null;if("."===n){if(e+=n,M(),!C(n))return F(r),null}else{for(;C(n);)e+=n,M();"."===n&&(e+=n,M())}for(;C(n);)e+=n,M();if("E"===n||"e"===n){var i="",a=t;if(i+=n,M(),"+"!==n&&"-"!==n||(i+=n,M()),!C(n))return F(a),e;for(e+=i;C(n);)e+=n,M()}return e}function B(){for(var e="";C(n)||A.isValidAlpha(n);)e+=n,M();var r=e.charAt(0);return A.isValidAlpha(r)?e:null}function O(e){return n===e?(M(),e):null}Object.defineProperty(A,"name",{value:"Unit"}),A.prototype.constructor=A,A.prototype.type="Unit",A.prototype.isUnit=!0,A.parse=function(e,i){if(i=i||{},t=-1,n="","string"!=typeof(r=e))throw new TypeError("Invalid argument in Unit.parse, string expected");var a=new A;a.units=[];var s=1,u=!1;M(),S();var c=T(),l=null;if(c){if("BigNumber"===o.number)l=new w(c);else if("Fraction"===o.number)try{l=new N(c)}catch(e){l=parseFloat(c)}else l=parseFloat(c);S(),O("*")?(s=1,u=!0):O("/")&&(s=-1,u=!0)}for(var p=[],f=1;;){for(S();"("===n;)p.push(s),f*=s,s=1,M(),S();var d;if(!n)break;var m=n;if(null===(d=B()))throw new SyntaxError('Unexpected "'+m+'" in "'+r+'" at index '+t.toString());var h=_(d);if(null===h)throw new SyntaxError('Unit "'+d+'" not found.');var g=s*f;if(S(),O("^")){S();var y=T();if(null===y)throw new SyntaxError('In "'+e+'", "^" must be followed by a floating-point number');g*=y}a.units.push({unit:h.unit,prefix:h.prefix,power:g});for(var v=0;v1||Math.abs(this.units[0].power-1)>1e-15)},A.prototype._normalize=function(e){if(null==e||0===this.units.length)return e;for(var r=e,t=A._getNumberConverter(G(e)),n=0;n{if(re(U,e)){var r=U[e];return{unit:r,prefix:r.prefixes[""]}}for(var t in U)if(re(U,t)&&ni(e,t)){var n=U[t],i=e.length-t.length,a=e.substring(0,i),o=re(n.prefixes,a)?n.prefixes[a]:void 0;if(void 0!==o)return{unit:n,prefix:o}}return null}),{hasher:e=>e[0],limit:100});function q(e){return e.equalBase(k.NONE)&&null!==e.value&&!o.predictable?e.value:e}A.isValuelessUnit=function(e){return null!==_(e)},A.prototype.hasBase=function(e){if("string"==typeof e&&(e=k[e]),!e)return!1;for(var r=0;r1e-12)return!1;return!0},A.prototype.equalBase=function(e){for(var r=0;r1e-12)return!1;return!0},A.prototype.equals=function(e){return this.equalBase(e)&&y(this.value,e.value)},A.prototype.multiply=function(e){for(var r=this.clone(),t=l(e)?e:new A(e),n=0;n1e-12&&(re(Z,s)?n.push({unit:Z[s].unit,prefix:Z[s].prefix,power:t.dimensions[o]||0}):a=!0)}n.length1e-12){if(!re(H.si,n))throw new Error("Cannot express custom unit "+n+" in SI units");r.push({unit:H.si[n].unit,prefix:H.si[n].prefix,power:e.dimensions[t]||0})}}return e.units=r,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,e},A.prototype.formatUnits=function(){for(var e="",r="",t=0,n=0,i=0;i0?(t++,e+=" "+this.units[i].prefix.name+this.units[i].unit.name,Math.abs(this.units[i].power-1)>1e-15&&(e+="^"+this.units[i].power)):this.units[i].power<0&&n++;if(n>0)for(var a=0;a0?(r+=" "+this.units[a].prefix.name+this.units[a].unit.name,Math.abs(this.units[a].power+1)>1e-15&&(r+="^"+-this.units[a].power)):(r+=" "+this.units[a].prefix.name+this.units[a].unit.name,r+="^"+this.units[a].power));e=e.substr(1),r=r.substr(1),t>1&&n>0&&(e="("+e+")"),n>1&&t>0&&(r="("+r+")");var o=e;return t>0&&n>0&&(o+=" / "),o+r},A.prototype.format=function(e){var r=this.skipAutomaticSimplification||null===this.value?this.clone():this.simplify(),t=!1;for(var n in void 0!==r.value&&null!==r.value&&u(r.value)&&(t=Math.abs(r.value.re)<1e-14),r.units)re(r.units,n)&&r.units[n].unit&&("VA"===r.units[n].unit.name&&t?r.units[n].unit=U.VAR:"VAR"!==r.units[n].unit.name||t||(r.units[n].unit=U.VA));1!==r.units.length||r.fixPrefix||Math.abs(r.units[0].power-Math.round(r.units[0].power))<1e-14&&(r.units[0].prefix=r._bestPrefix());var i=r._denormalize(r.value),a=null!==r.value?x(i,e||{}):"",o=r.formatUnits();return r.value&&u(r.value)&&(a="("+a+")"),o.length>0&&a.length>0&&(a+=" "),a+o},A.prototype._bestPrefix=function(){if(1!==this.units.length)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 e=null!==this.value?m(this.value):0,r=m(this.units[0].unit.value),t=this.units[0].prefix;if(0===e)return t;var n=this.units[0].power,i=Math.log(e/Math.pow(t.value*r,n))/Math.LN10-1.2;if(i>-2.200001&&i<1.800001)return t;i=Math.abs(i);var a=this.units[0].unit.prefixes;for(var o in a)if(re(a,o)){var s=a[o];if(s.scientific){var u=Math.abs(Math.log(e/Math.pow(s.value*r,n))/Math.LN10-1.2);(u0))},U={meter:{name:"meter",base:k.LENGTH,prefixes:I.LONG,value:1,offset:0},inch:{name:"inch",base:k.LENGTH,prefixes:I.NONE,value:.0254,offset:0},foot:{name:"foot",base:k.LENGTH,prefixes:I.NONE,value:.3048,offset:0},yard:{name:"yard",base:k.LENGTH,prefixes:I.NONE,value:.9144,offset:0},mile:{name:"mile",base:k.LENGTH,prefixes:I.NONE,value:1609.344,offset:0},link:{name:"link",base:k.LENGTH,prefixes:I.NONE,value:.201168,offset:0},rod:{name:"rod",base:k.LENGTH,prefixes:I.NONE,value:5.0292,offset:0},chain:{name:"chain",base:k.LENGTH,prefixes:I.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:k.LENGTH,prefixes:I.NONE,value:1e-10,offset:0},m:{name:"m",base:k.LENGTH,prefixes:I.SHORT,value:1,offset:0},in:{name:"in",base:k.LENGTH,prefixes:I.NONE,value:.0254,offset:0},ft:{name:"ft",base:k.LENGTH,prefixes:I.NONE,value:.3048,offset:0},yd:{name:"yd",base:k.LENGTH,prefixes:I.NONE,value:.9144,offset:0},mi:{name:"mi",base:k.LENGTH,prefixes:I.NONE,value:1609.344,offset:0},li:{name:"li",base:k.LENGTH,prefixes:I.NONE,value:.201168,offset:0},rd:{name:"rd",base:k.LENGTH,prefixes:I.NONE,value:5.02921,offset:0},ch:{name:"ch",base:k.LENGTH,prefixes:I.NONE,value:20.1168,offset:0},mil:{name:"mil",base:k.LENGTH,prefixes:I.NONE,value:254e-7,offset:0},m2:{name:"m2",base:k.SURFACE,prefixes:I.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:k.SURFACE,prefixes:I.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:k.SURFACE,prefixes:I.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:k.SURFACE,prefixes:I.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:k.SURFACE,prefixes:I.NONE,value:2589988.110336,offset:0},sqrd:{name:"sqrd",base:k.SURFACE,prefixes:I.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:k.SURFACE,prefixes:I.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:k.SURFACE,prefixes:I.NONE,value:6.4516e-10,offset:0},acre:{name:"acre",base:k.SURFACE,prefixes:I.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:k.SURFACE,prefixes:I.NONE,value:1e4,offset:0},m3:{name:"m3",base:k.VOLUME,prefixes:I.CUBIC,value:1,offset:0},L:{name:"L",base:k.VOLUME,prefixes:I.SHORT,value:.001,offset:0},l:{name:"l",base:k.VOLUME,prefixes:I.SHORT,value:.001,offset:0},litre:{name:"litre",base:k.VOLUME,prefixes:I.LONG,value:.001,offset:0},cuin:{name:"cuin",base:k.VOLUME,prefixes:I.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:k.VOLUME,prefixes:I.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:k.VOLUME,prefixes:I.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:k.VOLUME,prefixes:I.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:k.VOLUME,prefixes:I.NONE,value:15e-6,offset:0},drop:{name:"drop",base:k.VOLUME,prefixes:I.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:k.VOLUME,prefixes:I.NONE,value:5e-8,offset:0},minim:{name:"minim",base:k.VOLUME,prefixes:I.NONE,value:6.161152e-8,offset:0},fluiddram:{name:"fluiddram",base:k.VOLUME,prefixes:I.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:k.VOLUME,prefixes:I.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:k.VOLUME,prefixes:I.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:k.VOLUME,prefixes:I.NONE,value:1e-6,offset:0},cup:{name:"cup",base:k.VOLUME,prefixes:I.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:k.VOLUME,prefixes:I.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:k.VOLUME,prefixes:I.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:k.VOLUME,prefixes:I.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:k.VOLUME,prefixes:I.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:k.VOLUME,prefixes:I.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:k.VOLUME,prefixes:I.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:k.VOLUME,prefixes:I.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:k.VOLUME,prefixes:I.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:k.VOLUME,prefixes:I.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:k.VOLUME,prefixes:I.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:k.VOLUME,prefixes:I.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:k.VOLUME,prefixes:I.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:k.VOLUME,prefixes:I.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:k.VOLUME,prefixes:I.NONE,value:.1173478,offset:0},obl:{name:"obl",base:k.VOLUME,prefixes:I.NONE,value:.1589873,offset:0},g:{name:"g",base:k.MASS,prefixes:I.SHORT,value:.001,offset:0},gram:{name:"gram",base:k.MASS,prefixes:I.LONG,value:.001,offset:0},ton:{name:"ton",base:k.MASS,prefixes:I.SHORT,value:907.18474,offset:0},t:{name:"t",base:k.MASS,prefixes:I.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:k.MASS,prefixes:I.LONG,value:1e3,offset:0},grain:{name:"grain",base:k.MASS,prefixes:I.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:k.MASS,prefixes:I.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:k.MASS,prefixes:I.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:k.MASS,prefixes:I.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:k.MASS,prefixes:I.NONE,value:45.359237,offset:0},stick:{name:"stick",base:k.MASS,prefixes:I.NONE,value:.115,offset:0},stone:{name:"stone",base:k.MASS,prefixes:I.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:k.MASS,prefixes:I.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:k.MASS,prefixes:I.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:k.MASS,prefixes:I.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:k.MASS,prefixes:I.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:k.MASS,prefixes:I.NONE,value:45.359237,offset:0},s:{name:"s",base:k.TIME,prefixes:I.SHORT,value:1,offset:0},min:{name:"min",base:k.TIME,prefixes:I.NONE,value:60,offset:0},h:{name:"h",base:k.TIME,prefixes:I.NONE,value:3600,offset:0},second:{name:"second",base:k.TIME,prefixes:I.LONG,value:1,offset:0},sec:{name:"sec",base:k.TIME,prefixes:I.LONG,value:1,offset:0},minute:{name:"minute",base:k.TIME,prefixes:I.NONE,value:60,offset:0},hour:{name:"hour",base:k.TIME,prefixes:I.NONE,value:3600,offset:0},day:{name:"day",base:k.TIME,prefixes:I.NONE,value:86400,offset:0},week:{name:"week",base:k.TIME,prefixes:I.NONE,value:604800,offset:0},month:{name:"month",base:k.TIME,prefixes:I.NONE,value:2629800,offset:0},year:{name:"year",base:k.TIME,prefixes:I.NONE,value:31557600,offset:0},decade:{name:"decade",base:k.TIME,prefixes:I.NONE,value:315576e3,offset:0},century:{name:"century",base:k.TIME,prefixes:I.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:k.TIME,prefixes:I.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:k.FREQUENCY,prefixes:I.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:k.FREQUENCY,prefixes:I.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:k.ANGLE,prefixes:I.SHORT,value:1,offset:0},radian:{name:"radian",base:k.ANGLE,prefixes:I.LONG,value:1,offset:0},deg:{name:"deg",base:k.ANGLE,prefixes:I.SHORT,value:null,offset:0},degree:{name:"degree",base:k.ANGLE,prefixes:I.LONG,value:null,offset:0},grad:{name:"grad",base:k.ANGLE,prefixes:I.SHORT,value:null,offset:0},gradian:{name:"gradian",base:k.ANGLE,prefixes:I.LONG,value:null,offset:0},cycle:{name:"cycle",base:k.ANGLE,prefixes:I.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:k.ANGLE,prefixes:I.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:k.ANGLE,prefixes:I.NONE,value:null,offset:0},A:{name:"A",base:k.CURRENT,prefixes:I.SHORT,value:1,offset:0},ampere:{name:"ampere",base:k.CURRENT,prefixes:I.LONG,value:1,offset:0},K:{name:"K",base:k.TEMPERATURE,prefixes:I.SHORT,value:1,offset:0},degC:{name:"degC",base:k.TEMPERATURE,prefixes:I.SHORT,value:1,offset:273.15},degF:{name:"degF",base:k.TEMPERATURE,prefixes:I.SHORT,value:new N(5,9),offset:459.67},degR:{name:"degR",base:k.TEMPERATURE,prefixes:I.SHORT,value:new N(5,9),offset:0},kelvin:{name:"kelvin",base:k.TEMPERATURE,prefixes:I.LONG,value:1,offset:0},celsius:{name:"celsius",base:k.TEMPERATURE,prefixes:I.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:k.TEMPERATURE,prefixes:I.LONG,value:new N(5,9),offset:459.67},rankine:{name:"rankine",base:k.TEMPERATURE,prefixes:I.LONG,value:new N(5,9),offset:0},mol:{name:"mol",base:k.AMOUNT_OF_SUBSTANCE,prefixes:I.SHORT,value:1,offset:0},mole:{name:"mole",base:k.AMOUNT_OF_SUBSTANCE,prefixes:I.LONG,value:1,offset:0},cd:{name:"cd",base:k.LUMINOUS_INTENSITY,prefixes:I.SHORT,value:1,offset:0},candela:{name:"candela",base:k.LUMINOUS_INTENSITY,prefixes:I.LONG,value:1,offset:0},N:{name:"N",base:k.FORCE,prefixes:I.SHORT,value:1,offset:0},newton:{name:"newton",base:k.FORCE,prefixes:I.LONG,value:1,offset:0},dyn:{name:"dyn",base:k.FORCE,prefixes:I.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:k.FORCE,prefixes:I.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:k.FORCE,prefixes:I.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:k.FORCE,prefixes:I.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:k.FORCE,prefixes:I.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:k.FORCE,prefixes:I.NONE,value:9.80665,offset:0},J:{name:"J",base:k.ENERGY,prefixes:I.SHORT,value:1,offset:0},joule:{name:"joule",base:k.ENERGY,prefixes:I.SHORT,value:1,offset:0},erg:{name:"erg",base:k.ENERGY,prefixes:I.NONE,value:1e-7,offset:0},Wh:{name:"Wh",base:k.ENERGY,prefixes:I.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:k.ENERGY,prefixes:I.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:k.ENERGY,prefixes:I.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:k.ENERGY,prefixes:I.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:k.POWER,prefixes:I.SHORT,value:1,offset:0},watt:{name:"watt",base:k.POWER,prefixes:I.LONG,value:1,offset:0},hp:{name:"hp",base:k.POWER,prefixes:I.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:k.POWER,prefixes:I.SHORT,value:b.I,offset:0},VA:{name:"VA",base:k.POWER,prefixes:I.SHORT,value:1,offset:0},Pa:{name:"Pa",base:k.PRESSURE,prefixes:I.SHORT,value:1,offset:0},psi:{name:"psi",base:k.PRESSURE,prefixes:I.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:k.PRESSURE,prefixes:I.NONE,value:101325,offset:0},bar:{name:"bar",base:k.PRESSURE,prefixes:I.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:k.PRESSURE,prefixes:I.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:k.PRESSURE,prefixes:I.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:k.PRESSURE,prefixes:I.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:k.PRESSURE,prefixes:I.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:k.ELECTRIC_CHARGE,prefixes:I.LONG,value:1,offset:0},C:{name:"C",base:k.ELECTRIC_CHARGE,prefixes:I.SHORT,value:1,offset:0},farad:{name:"farad",base:k.ELECTRIC_CAPACITANCE,prefixes:I.LONG,value:1,offset:0},F:{name:"F",base:k.ELECTRIC_CAPACITANCE,prefixes:I.SHORT,value:1,offset:0},volt:{name:"volt",base:k.ELECTRIC_POTENTIAL,prefixes:I.LONG,value:1,offset:0},V:{name:"V",base:k.ELECTRIC_POTENTIAL,prefixes:I.SHORT,value:1,offset:0},ohm:{name:"ohm",base:k.ELECTRIC_RESISTANCE,prefixes:I.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:k.ELECTRIC_INDUCTANCE,prefixes:I.LONG,value:1,offset:0},H:{name:"H",base:k.ELECTRIC_INDUCTANCE,prefixes:I.SHORT,value:1,offset:0},siemens:{name:"siemens",base:k.ELECTRIC_CONDUCTANCE,prefixes:I.LONG,value:1,offset:0},S:{name:"S",base:k.ELECTRIC_CONDUCTANCE,prefixes:I.SHORT,value:1,offset:0},weber:{name:"weber",base:k.MAGNETIC_FLUX,prefixes:I.LONG,value:1,offset:0},Wb:{name:"Wb",base:k.MAGNETIC_FLUX,prefixes:I.SHORT,value:1,offset:0},tesla:{name:"tesla",base:k.MAGNETIC_FLUX_DENSITY,prefixes:I.LONG,value:1,offset:0},T:{name:"T",base:k.MAGNETIC_FLUX_DENSITY,prefixes:I.SHORT,value:1,offset:0},b:{name:"b",base:k.BIT,prefixes:I.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:k.BIT,prefixes:I.BINARY_LONG,value:1,offset:0},B:{name:"B",base:k.BIT,prefixes:I.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:k.BIT,prefixes:I.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 L(e){if("BigNumber"===e.number){var r=At(w);U.rad.value=new w(1),U.deg.value=r.div(180),U.grad.value=r.div(200),U.cycle.value=r.times(2),U.arcsec.value=r.div(648e3),U.arcmin.value=r.div(10800)}else U.rad.value=1,U.deg.value=Math.PI/180,U.grad.value=Math.PI/200,U.cycle.value=2*Math.PI,U.arcsec.value=Math.PI/648e3,U.arcmin.value=Math.PI/10800;U.radian.value=U.rad.value,U.degree.value=U.deg.value,U.gradian.value=U.grad.value}L(o),a&&a("config",(function(e,r){e.number!==r.number&&L(e)}));var H={si:{NONE:{unit:P,prefix:I.NONE[""]},LENGTH:{unit:U.m,prefix:I.SHORT[""]},MASS:{unit:U.g,prefix:I.SHORT.k},TIME:{unit:U.s,prefix:I.SHORT[""]},CURRENT:{unit:U.A,prefix:I.SHORT[""]},TEMPERATURE:{unit:U.K,prefix:I.SHORT[""]},LUMINOUS_INTENSITY:{unit:U.cd,prefix:I.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:U.mol,prefix:I.SHORT[""]},ANGLE:{unit:U.rad,prefix:I.SHORT[""]},BIT:{unit:U.bits,prefix:I.SHORT[""]},FORCE:{unit:U.N,prefix:I.SHORT[""]},ENERGY:{unit:U.J,prefix:I.SHORT[""]},POWER:{unit:U.W,prefix:I.SHORT[""]},PRESSURE:{unit:U.Pa,prefix:I.SHORT[""]},ELECTRIC_CHARGE:{unit:U.C,prefix:I.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:U.F,prefix:I.SHORT[""]},ELECTRIC_POTENTIAL:{unit:U.V,prefix:I.SHORT[""]},ELECTRIC_RESISTANCE:{unit:U.ohm,prefix:I.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:U.H,prefix:I.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:U.S,prefix:I.SHORT[""]},MAGNETIC_FLUX:{unit:U.Wb,prefix:I.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:U.T,prefix:I.SHORT[""]},FREQUENCY:{unit:U.Hz,prefix:I.SHORT[""]}}};H.cgs=JSON.parse(JSON.stringify(H.si)),H.cgs.LENGTH={unit:U.m,prefix:I.SHORT.c},H.cgs.MASS={unit:U.g,prefix:I.SHORT[""]},H.cgs.FORCE={unit:U.dyn,prefix:I.SHORT[""]},H.cgs.ENERGY={unit:U.erg,prefix:I.NONE[""]},H.us=JSON.parse(JSON.stringify(H.si)),H.us.LENGTH={unit:U.ft,prefix:I.NONE[""]},H.us.MASS={unit:U.lbm,prefix:I.NONE[""]},H.us.TEMPERATURE={unit:U.degF,prefix:I.NONE[""]},H.us.FORCE={unit:U.lbf,prefix:I.NONE[""]},H.us.ENERGY={unit:U.BTU,prefix:I.BTU[""]},H.us.POWER={unit:U.hp,prefix:I.NONE[""]},H.us.PRESSURE={unit:U.psi,prefix:I.NONE[""]},H.auto=JSON.parse(JSON.stringify(H.si));var Z=H.auto;for(var $ in A.setUnitSystem=function(e){if(!re(H,e))throw new Error("Unit system "+e+" does not exist. Choices are: "+Object.keys(H).join(", "));Z=H[e]},A.getUnitSystem=function(){for(var e in H)if(re(H,e)&&H[e]===Z)return e},A.typeConverters={BigNumber:function(e){return null!=e&&e.isFraction?new w(e.n).div(e.d).times(e.s):new w(e+"")},Fraction:function(e){return new N(e)},Complex:function(e){return e},number:function(e){return null!=e&&e.isFraction?D(e):e}},A.prototype._numberConverter=function(){var e=A.typeConverters[this.valueType()];if(e)return e;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},A._getNumberConverter=function(e){if(!A.typeConverters[e])throw new TypeError('Unsupported type "'+e+'"');return A.typeConverters[e]},U)if(re(U,$)){var W=U[$];W.dimensions=W.base.dimensions}for(var Y in j)if(re(j,Y)){var J=U[j[Y]],Q={};for(var X in J)re(J,X)&&(Q[X]=J[X]);Q.name=Y,U[Y]=Q}return A.isValidAlpha=function(e){return/^[a-zA-Z]$/.test(e)},A.createUnit=function(e,r){if("object"!=typeof e)throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(r&&r.override)for(var t in e)if(re(e,t)&&A.deleteUnit(t),e[t].aliases)for(var n=0;n0&&!A.isValidAlpha(n)&&!C(n))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+e+'"')}}(e);var t,i,a,o=null,s=[],u=0;if(r&&"Unit"===r.type)o=r.clone();else if("string"==typeof r)""!==r&&(t=r);else{if("object"!=typeof r)throw new TypeError('Cannot create unit "'+e+'" from "'+r.toString()+'": expecting "string" or "Unit" or "Object"');t=r.definition,i=r.prefixes,u=r.offset,a=r.baseName,r.aliases&&(s=r.aliases.valueOf())}if(s)for(var c=0;c1e-12){d=!1;break}if(d){p=!0,l.base=k[f];break}}if(!p){a=a||e+"_STUFF";var h={dimensions:o.dimensions.slice(0)};h.key=a,k[a]=h,Z[a]={unit:l,prefix:I.NONE[""]},l.base=k[a]}}else{if(a=a||e+"_STUFF",z.indexOf(a)>=0)throw new Error('Cannot create new base unit "'+e+'": a base unit with that name already exists (and cannot be overridden)');for(var g in z.push(a),k)re(k,g)&&(k[g].dimensions[z.length-1]=0);for(var y={dimensions:[]},v=0;v{var{typed:r,Unit:t}=e;return r(tm,{"Object, Object":function(e,r){return t.createUnit(e,r)},Object:function(e){return t.createUnit(e,{})},"string, Unit | string | Object, Object":function(e,r,n){var i={};return i[e]=r,t.createUnit(i,n)},"string, Unit | string | Object":function(e,r){var n={};return n[e]=r,t.createUnit(n,{})},string:function(e){var r={};return r[e]={},t.createUnit(r,{})}})})),im="dotPow",am=Gr(im,["typed","equalScalar","matrix","pow","DenseMatrix","concat"],(e=>{var{typed:r,equalScalar:t,matrix:n,pow:i,DenseMatrix:a,concat:o}=e,s=ol({typed:r}),u=sl({typed:r,DenseMatrix:a}),c=ul({typed:r,equalScalar:t}),l=cl({typed:r,DenseMatrix:a}),p=dl({typed:r,matrix:n,concat:o}),f={};for(var d in i.signatures)Object.prototype.hasOwnProperty.call(i.signatures,d)&&(d.includes("Matrix")||d.includes("Array")||(f[d]=i.signatures[d]));var m=r(f);return r(im,p({elop:m,SS:u,DS:s,Ss:c,sS:l}))})),om="expm",sm=Gr(om,["typed","abs","add","identity","inv","multiply"],(e=>{var{typed:r,abs:t,add:n,identity:i,inv:a,multiply:o}=e;return r(om,{Matrix:function(e){var r=e.size();if(2!==r.length||r[0]!==r[1])throw new RangeError("Matrix must be square (size: "+ii(r)+")");for(var u=r[0],c=function(e){for(var r=e.size()[0],n=0,i=0;i1&&(v=o(v,d),x=-x),m=n(m,o(y=y*(p-D+1)/((2*p-D+1)*D),v)),h=n(h,o(y*x,v));for(var b=o(a(h),m),w=0;w{var{typed:r,matrix:t,addScalar:n,multiplyScalar:i,divideScalar:a,exp:o,tau:s,i:u,dotDivide:c,conj:l,pow:p,ceil:f,log2:d}=e;return r("fft",{Array:m,Matrix:function(e){return e.create(m(e.toArray()))}});function m(e){var r=pi(e);return 1===r.length?g(e,r[0]):h(e.map((e=>m(e,r.slice(1)))),0)}function h(e,r){var t=pi(e);if(0!==r)return new Array(t[0]).fill(0).map(((t,n)=>h(e[n],r-1)));if(1===t.length)return g(e);function n(e){var r=pi(e);return new Array(r[1]).fill(0).map(((t,n)=>new Array(r[0]).fill(0).map(((r,t)=>e[t][n]))))}return n(h(n(e),1))}function g(e){var r=e.length;if(1===r)return[e[0]];if(r%2==0){for(var t=[...g(e.filter(((e,r)=>r%2==0))),...g(e.filter(((e,r)=>r%2==1)))],h=0;hi(e[a],n[r-1+a]))),...new Array(y-r).fill(0)],x=[...new Array(r+r-1).fill(0).map(((e,r)=>a(1,n[r]))),...new Array(y-(r+r-1)).fill(0)],D=g(v),b=g(x),w=new Array(y).fill(0).map(((e,r)=>i(D[r],b[r]))),N=c(l(m(l(w))),y),E=[],A=r-1;A{var{typed:r,config:t,multiplyScalar:n,pow:i,BigNumber:a,Complex:o}=e;return r(cm,{number:qs,Complex:function e(r){if(0===r.im)return qs(r.re);if(r.re<.5){var t=new o(1-r.re,-r.im),n=new o(Math.PI*r.re,Math.PI*r.im);return new o(Math.PI).div(n.sin()).div(e(t))}r=new o(r.re-1,r.im);for(var i=new o(zs[0],0),a=1;a2;)u+=i-=2,o=o.times(u);return new a(o.toPrecision(a.precision))}})),pm="ifft",fm=Gr(pm,["typed","fft","dotDivide","conj"],(e=>{var{typed:r,fft:t,dotDivide:n,conj:i}=e;return r(pm,{"Array | Matrix":function(e){var r=d(e)?e.size():pi(e);return n(i(t(i(e))),r.reduce(((e,r)=>e*r),1))}})})),dm=Gr("divide",["typed","matrix","multiply","equalScalar","divideScalar","inv"],(e=>{var{typed:r,matrix:t,multiply:n,equalScalar:i,divideScalar:a,inv:o}=e,s=ul({typed:r,equalScalar:i}),u=pl({typed:r});return r("divide",Y({"Array | Matrix, Array | Matrix":function(e,r){return n(e,o(r))},"DenseMatrix, any":function(e,r){return u(e,r,a,!1)},"SparseMatrix, any":function(e,r){return s(e,r,a,!1)},"Array, any":function(e,r){return u(t(e),r,a,!1).valueOf()},"any, Array | Matrix":function(e,r){return n(e,o(r))}},a.signatures))})),mm="factorial",hm=Gr(mm,["typed","gamma"],(e=>{var{typed:r,gamma:t}=e;return r(mm,{number:function(e){if(e<0)throw new Error("Value must be non-negative");return t(e+1)},BigNumber:function(e){if(e.isNegative())throw new Error("Value must be non-negative");return t(e.plus(1))},"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})}));function gm(e,r){var t,n=r.length,i=[];if(e)for(t=0;t{var{typed:r,matrix:t,lup:n,slu:i,usolve:a,lsolve:o,DenseMatrix:s}=e,u=pf({DenseMatrix:s});return r(ym,{"Array, Array | Matrix":function(e,r){e=t(e);var i=n(e);return l(i.L,i.U,i.p,null,r).valueOf()},"DenseMatrix, Array | Matrix":function(e,r){var t=n(e);return l(t.L,t.U,t.p,null,r)},"SparseMatrix, Array | Matrix":function(e,r){var t=n(e);return l(t.L,t.U,t.p,null,r)},"SparseMatrix, Array | Matrix, number, number":function(e,r,t,n){var a=i(e,t,n);return l(a.L,a.U,a.p,a.q,r)},"Object, Array | Matrix":function(e,r){return l(e.L,e.U,e.p,e.q,r)}});function c(e){if(d(e))return e;if(f(e))return t(e);throw new TypeError("Invalid Matrix LU decomposition")}function l(e,r,t,n,i){e=c(e),r=c(r),t&&((i=u(e,i,!0))._data=gm(t,i._data));var s=o(e,i),l=a(r,s);return n&&(l._data=gm(n,l._data)),l}})),xm="multinomial",Dm=Gr(xm,["typed","add","divide","multiply","factorial","isInteger","isPositive"],(e=>{var{typed:r,add:t,divide:n,multiply:i,factorial:a,isInteger:o,isPositive:s}=e;return r(xm,{"Array | Matrix":function(e){var r=0,u=1;return ta(e,(function(e){if(!o(e)||!s(e))throw new TypeError("Positive integer value expected in function multinomial");r=t(r,e),u=i(u,a(e))})),n(a(r),u)}})})),bm="permutations",wm=Gr(bm,["typed","factorial"],(e=>{var{typed:r,factorial:t}=e;return r(bm,{"number | BigNumber":t,"number, number":function(e,r){if(!Qr(e)||e<0)throw new TypeError("Positive integer value expected in function permutations");if(!Qr(r)||r<0)throw new TypeError("Positive integer value expected in function permutations");if(r>e)throw new TypeError("second argument k must be less than or equal to first argument n");return qo(e-r+1,e)},"BigNumber, BigNumber":function(e,r){var t,n;if(!Nm(e)||!Nm(r))throw new TypeError("Positive integer value expected in function permutations");if(r.gt(e))throw new TypeError("second argument k must be less than or equal to first argument n");for(t=e.mul(0).add(1),n=e.minus(r).plus(1);n.lte(e);n=n.plus(1))t=t.times(n);return t}})}));function Nm(e){return e.isInteger()&&e.gte(0)}var Em="polynomialRoot",Am=Gr(Em,["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],(e=>{var{typed:r,isZero:t,equalScalar:n,add:i,subtract:a,multiply:o,divide:s,sqrt:u,unaryMinus:c,cbrt:l,typeOf:p,im:f,re:d}=e;return r(Em,{"number|Complex, ...number|Complex":(e,r)=>{for(var m=[e,...r];m.length>0&&t(m[m.length-1]);)m.pop();if(m.length<2)throw new RangeError("Polynomial [".concat(e,", ").concat(r,"] must have a non-zero non-constant coefficient"));switch(m.length){case 2:return[c(s(m[0],m[1]))];case 3:var[h,g,y]=m,v=o(2,y),x=o(g,g),D=o(4,y,h);if(n(x,D))return[s(c(g),v)];var b=u(a(x,D));return[s(a(b,g),v),s(a(c(b),g),v)];case 4:var[w,N,E,A]=m,S=c(o(3,A)),C=o(E,E),M=o(3,A,N),F=i(o(2,E,E,E),o(27,A,A,w)),T=o(9,A,E,N);if(n(C,M)&&n(F,T))return[s(E,S)];var B,O=a(C,M),_=a(F,T),q=i(o(18,A,E,N,w),o(E,E,N,N)),I=i(o(4,E,E,E,w),o(4,A,N,N,N),o(27,A,A,w,w));return n(q,I)?[s(a(o(4,A,E,N),i(o(9,A,A,w),o(E,E,E))),o(A,O)),s(a(o(9,A,w),o(E,N)),o(2,O))]:(B=n(C,M)?_:s(i(_,u(a(o(_,_),o(4,O,O,O)))),2),l(B,!0).toArray().map((e=>s(i(E,e,s(O,e)),S))).map((e=>"Complex"===p(e)&&n(d(e),d(e)+f(e))?d(e):e)));default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(m))}}})})),Sm="setSize",Cm=Gr(Sm,["typed","compareNatural"],(e=>{var{typed:r,compareNatural:t}=e;return r(Sm,{"Array | Matrix":function(e){return Array.isArray(e)?Ei(e).length:Ei(e.toArray()).length},"Array | Matrix, boolean":function(e,r){if(!1===r||0===e.length)return Array.isArray(e)?Ei(e).length:Ei(e.toArray()).length;for(var n=Ei(Array.isArray(e)?e:e.toArray()).sort(t),i=1,a=1;a{var{typed:r,add:t,subtract:n,multiply:i,divide:a,max:u,map:c,abs:p,isPositive:f,isNegative:d,larger:m,smaller:h,matrix:g,bignumber:y,unaryMinus:v}=e;function x(e){return function(r,o,g,x){if(2!==o.length||!o.every(N)&&!o.every(l))throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var D=o[0],b=o[1],w=m(b,D),E=x.firstStep;if(void 0!==E&&!f(E))throw new Error('"firstStep" must be positive');var A=x.maxStep;if(void 0!==A&&!f(A))throw new Error('"maxStep" must be positive');var S=x.minStep;if(S&&d(S))throw new Error('"minStep" must be positive or zero');var C=[D,b,E,S,A].filter((e=>void 0!==e));if(!C.every(N)&&!C.every(l))throw new Error('Inconsistent type of "t" dependant variables');for(var M=x.tol?x.tol:1e-4,F=x.minDelta?x.minDelta:.2,T=x.maxDelta?x.maxDelta:5,B=x.maxIter?x.maxIter:1e4,O=[D,b,...g,A,S].some(s),[_,q,I,z]=O?[y(e.a),y(e.c),y(e.b),y(e.bp)]:[e.a,e.c,e.b,e.bp],k=E?w?E:v(E):a(n(b,D),1),R=[D],P=[g],U=n(I,z),j=0,L=0,H=function(e){return e?h:m}(w),Z=function(e){var r=e?m:h;return function(e,i,a){var o=t(e,a);return r(o,i)?n(i,e):a}}(w);H(R[j],b);){var $=[];k=Z(R[j],b,k),$.push(r(R[j],P[j]));for(var G=1;Gl(e)?e.value:e))));V1/4&&(R.push(t(R[j],k)),P.push(t(P[j],i(k,I,$))),j++);var W=.84*(M/V)**.2;if(h(W,F)?W=F:m(W,T)&&(W=T),W=O?y(W):W,k=i(k,W),A&&m(p(k),A)?k=w?A:v(A):S&&h(p(k),S)&&(k=w?S:v(S)),++L>B)throw new Error("Maximum number of iterations reached, try changing options")}return{t:R,y:P}}}function D(e,r,t,n){return x({a:[[],[.5],[0,3/4],[2/9,1/3,4/9]],c:[null,.5,3/4,1],b:[2/9,1/3,4/9,0],bp:[7/24,1/4,1/3,1/8]})(e,r,t,n)}function b(e,r,t,n){return x({a:[[],[.2],[3/40,9/40],[44/45,-56/15,32/9],[19372/6561,-25360/2187,64448/6561,-212/729],[9017/3168,-355/33,46732/5247,49/176,-5103/18656],[35/384,0,500/1113,125/192,-2187/6784,11/84]],c:[null,.2,.3,.8,8/9,1,1],b:[35/384,0,500/1113,125/192,-2187/6784,11/84,0],bp:[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40]})(e,r,t,n)}function w(e,r,t,n){var i=n.method?n.method:"RK45",a={RK23:D,RK45:b};if(i.toUpperCase()in a){var o=function(e){for(var r=1;r'"'.concat(e,'"'))),u="".concat(s.slice(0,-1).join(", ")," and ").concat(s.slice(-1));throw new Error('Unavailable method "'.concat(i,'". Available methods are ').concat(u))}function N(e){return s(e)||o(e)}function E(e,r,t,n){var i=w(e,r.toArray(),t.toArray(),n);return{t:g(i.t),y:g(i.y)}}return r("solveODE",{"function, Array, Array, Object":w,"function, Matrix, Matrix, Object":E,"function, Array, Array":(e,r,t)=>w(e,r,t,{}),"function, Matrix, Matrix":(e,r,t)=>E(e,r,t,{}),"function, Array, number | BigNumber | Unit":(e,r,t)=>{var n=w(e,r,[t],{});return{t:n.t,y:n.y.map((e=>e[0]))}},"function, Matrix, number | BigNumber | Unit":(e,r,t)=>{var n=w(e,r.toArray(),[t],{});return{t:g(n.t),y:g(n.y.map((e=>e[0])))}},"function, Array, number | BigNumber | Unit, Object":(e,r,t,n)=>{var i=w(e,r,[t],n);return{t:i.t,y:i.y.map((e=>e[0]))}},"function, Matrix, number | BigNumber | Unit, Object":(e,r,t,n)=>{var i=w(e,r.toArray(),[t],n);return{t:g(i.t),y:g(i.y.map((e=>e[0])))}}})})),Tm="stirlingS2",Bm=Gr(Tm,["typed","addScalar","subtract","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],(e=>{var{typed:r,addScalar:t,subtract:n,multiplyScalar:i,divideScalar:a,pow:s,factorial:u,combinations:c,isNegative:l,isInteger:p,number:f,bignumber:d,larger:m}=e,h=[],g=[];return r(Tm,{"number | BigNumber, number | BigNumber":function(e,r){if(!p(e)||l(e)||!p(r)||l(r))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(m(r,e))throw new TypeError("k must be less than or equal to n in function stirlingS2");var n=!(o(e)&&o(r)),a=n?g:h,s=n?d:f,u=f(e),c=f(r);if(a[u]&&a[u].length>c)return a[u][c];for(var y=0;y<=u;++y)if(a[y]||(a[y]=[s(0===y?1:0)]),0!==y)for(var v=a[y],x=a[y-1],D=v.length;D<=y&&D<=c;++D)v[D]=D===y?1:t(i(s(D),x[D]),x[D-1]);return a[u][c]}})})),Om="unit",_m=Gr(Om,["typed","Unit"],(e=>{var{typed:r,Unit:t}=e;return r(Om,{Unit:function(e){return e.clone()},string:function(e){return t.isValuelessUnit(e)?new t(null,e):t.parse(e,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(e,r){return new t(e,r)},"number | BigNumber | Fraction":function(e){return new t(e)},"Array | Matrix":r.referToSelf((e=>r=>na(r,e)))})})),qm="bellNumbers",Im=Gr(qm,["typed","addScalar","isNegative","isInteger","stirlingS2"],(e=>{var{typed:r,addScalar:t,isNegative:n,isInteger:i,stirlingS2:a}=e;return r(qm,{"number | BigNumber":function(e){if(!i(e)||n(e))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var r=0,o=0;o<=e;o++)r=t(r,a(e,o));return r}})}));var zm=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],km=Gr("eigs",zm,(e=>{var{config:r,typed:t,matrix:n,addScalar:i,subtract:a,equal:l,abs:p,atan:f,cos:d,sin:m,multiplyScalar:h,divideScalar:g,inv:y,bignumber:v,multiply:x,add:D,larger:b,column:w,flatten:N,number:E,complex:A,sqrt:S,diag:C,qr:M,usolve:F,usolveAll:T,im:B,re:O,smaller:_,matrixFromColumns:q,dot:I}=e,z=function(e){var{config:r,addScalar:t,subtract:n,abs:i,atan:a,cos:o,sin:s,multiplyScalar:u,inv:c,bignumber:l,multiply:p,add:f}=e;function d(e,r,t,n){for(var i=e.length,a=Math.cos(r),o=Math.sin(r),s=D(i,0),u=D(i,0),c=0;c2&&void 0!==arguments[2]?arguments[2]:r.epsilon,s=arguments.length>3?arguments[3]:void 0;if("number"===s)return function(e,t){for(var n,i=e.length,a=Math.abs(t/i),o=new Array(i),s=0;s=Math.abs(a);){var m=f[0][0],h=f[0][1];e=g(e,(u=e[m][m],c=e[h][h],l=e[m][h],p=void 0,p=c-u,n=Math.abs(p)<=r.epsilon?Math.PI/4:.5*Math.atan(2*l/(c-u))),m,h),o=d(o,n,m,h),f=y(e)}for(var v=D(i,0),b=0;b=i(f);){var A=E[0][0],S=E[0][1];e=h(e,(y=e[A][A],b=e[S][S],w=e[A][S],N=void 0,N=n(b,y),o=i(N)<=r.epsilon?l(-1).acos().div(4):u(.5,a(p(2,w,c(N))))),A,S),d=m(d,o,A,S),E=v(e)}for(var C=D(s,0),M=0;M=5)return null;for(s=0;;){var u=d(e,a);if(v(C(S(a,[u])),n))break;if(++s>=10)return null;a=M(u)}return a}function A(e,r,t){var n="BigNumber"===t,i="Complex"===t,a=Array(e).fill(0).map((e=>2*Math.random()-1));return n&&(a=a.map((e=>c(e)))),i&&(a=a.map((e=>g(e)))),M(a=S(a,r),t)}function S(e,r){for(var n of r)e=t(e,i(o(D(n,e),D(n,n)),n));return e}function C(e){return u(s(D(e,e)))}function M(e,r){var t="Complex"===r,n="BigNumber"===r?c(1):t?g(1):1;return i(o(n,C(e)),e)}return function(e,d,D,A,S){void 0===S&&(S=!0);var C=function(e,t,n,i,s){var p,f="BigNumber"===i,d="Complex"===i,m=f?c(0):0,x=f?c(1):d?g(1):1,D=f?c(1):1,b=f?c(10):2,w=a(b,b);s&&(p=Array(t).fill(x));for(var N=!1;!N;){N=!0;for(var E=0;E1&&(q=l(Array(B-1).fill(y)))),B-=1,F.pop();for(var U=0;U2&&(q=l(Array(B-2).fill(y)))),B-=2,F.pop(),F.pop();for(var L=0;L+t(u(e),u(r)))),I>100){var H=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+T.join(", "));throw H.values=T,H.vectors=[],H}var Z=d?i(_,function(e,r){for(var t=[],n=0;ni(d,e))),M.push(...c.map((e=>n(e))))},q=0;q{var{typed:r,add:t,divide:n}=e;return r(Rm,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(e,r){try{var i=ia(e,r,t),a=Array.isArray(e)?pi(e):e.size();return n(i,a[r])}catch(e){throw Nc(e,"mean")}},"...":function(e){if(ra(e))throw new TypeError("Scalar values expected in function mean");return i(e)}});function i(e){var r,i=0;if(ta(e,(function(e){try{r=void 0===r?e:t(r,e),i++}catch(r){throw Nc(r,"mean",e)}})),0===i)throw new Error("Cannot calculate the mean of an empty array");return n(r,i)}})),jm="unbiased",Lm="variance",Hm=["typed","add","subtract","multiply","divide","apply","isNaN"],Zm=Gr(Lm,Hm,(e=>{var{typed:r,add:t,subtract:n,multiply:i,divide:a,apply:o,isNaN:u}=e;return r(Lm,{"Array | Matrix":function(e){return c(e,jm)},"Array | Matrix, string":c,"Array | Matrix, number | BigNumber":function(e,r){return l(e,r,jm)},"Array | Matrix, number | BigNumber, string":l,"...":function(e){return c(e,jm)}});function c(e,r){var o,c=0;if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(ta(e,(function(e){try{o=void 0===o?e:t(o,e),c++}catch(r){throw Nc(r,"variance",e)}})),0===c)throw new Error("Cannot calculate variance of an empty array");var l=a(o,c);if(o=void 0,ta(e,(function(e){var r=n(e,l);o=void 0===o?i(r,r):t(o,i(r,r))})),u(o))return o;switch(r){case"uncorrected":return a(o,c);case"biased":return a(o,c+1);case"unbiased":var p=s(o)?o.mul(0):0;return 1===c?p:a(o,c-1);default:throw new Error('Unknown normalization "'+r+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function l(e,r,t){try{if(0===e.length)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return o(e,r,(e=>c(e,t)))}catch(e){throw Nc(e,"variance")}}})),$m="median",Gm=["typed","add","divide","compare","partitionSelect"],Vm=Gr($m,Gm,(e=>{var{typed:r,add:t,divide:n,compare:i,partitionSelect:a}=e;function o(e){try{var r=(e=Ei(e.valueOf())).length;if(0===r)throw new Error("Cannot calculate median of an empty array");if(r%2==0){for(var t=r/2-1,n=a(e,t+1),o=e[t],c=0;c0&&(o=e[c]);return u(o,n)}var l=a(e,(r-1)/2);return s(l)}catch(e){throw Nc(e,"median")}}var s=r({"number | BigNumber | Complex | Unit":function(e){return e}}),u=r({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(e,r){return n(t(e,r),2)}});return r($m,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(e,r){throw new Error("median(A, dim) is not yet supported")},"...":function(e){if(ra(e))throw new TypeError("Scalar values expected in function median");return o(e)}})})),Wm="kldivergence",Ym=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],Jm=Gr(Wm,Ym,(e=>{var{typed:r,matrix:t,divide:n,sum:i,multiply:a,map:o,dotDivide:s,log:u,isNumeric:c}=e;return r(Wm,{"Array, Array":function(e,r){return l(t(e),t(r))},"Matrix, Array":function(e,r){return l(e,t(r))},"Array, Matrix":function(e,r){return l(t(e),r)},"Matrix, Matrix":function(e,r){return l(e,r)}});function l(e,r){var t=r.size().length,l=e.size().length;if(t>1)throw new Error("first object must be one dimensional");if(l>1)throw new Error("second object must be one dimensional");if(t!==l)throw new Error("Length of two vectors must be equal");if(0===i(e))throw new Error("Sum of elements in first object must be non zero");if(0===i(r))throw new Error("Sum of elements in second object must be non zero");var p=n(e,i(e)),f=n(r,i(r)),d=i(a(p,o(s(p,f),(e=>u(e)))));return c(d)?d:Number.NaN}})),Qm=["typed","abs","map","median","subtract"],Xm=Gr("mad",Qm,(e=>{var{typed:r,abs:t,map:n,median:i,subtract:a}=e;return r("mad",{"Array | Matrix":o,"...":function(e){return o(e)}});function o(e){if(0===(e=Ei(e.valueOf())).length)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var r=i(e);return i(n(e,(function(e){return t(a(e,r))})))}catch(e){throw e instanceof TypeError&&-1!==e.message.indexOf("median")?new TypeError(e.message.replace("median","mad")):Nc(e,"mad")}}})),Km=["typed","map","sqrt","variance"],eh=Gr("std",Km,(e=>{var{typed:r,map:t,sqrt:n,variance:i}=e;return r("std",{"Array | Matrix":a,"Array | Matrix, string":a,"Array | Matrix, number | BigNumber":a,"Array | Matrix, number | BigNumber, string":a,"...":function(e){return a(e)}});function a(e,r){if(0===e.length)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var a=i.apply(null,arguments);return m(a)?t(a,n):n(a)}catch(e){throw e instanceof TypeError&&-1!==e.message.indexOf(" variance")?new TypeError(e.message.replace(" variance"," std")):e}}})),rh="freqz",th=["typed","add","multiply","Complex","divide","matrix"],nh=Gr(rh,th,(e=>{var{typed:r,add:t,multiply:n,Complex:i,divide:a,matrix:o}=e;return r(rh,{"Array, Array":function(e,r){return s(e,r,u(512))},"Array, Array, Array":function(e,r,t){return s(e,r,t)},"Array, Array, number":function(e,r,t){if(t<0)throw new Error("w must be a positive number");return s(e,r,u(t))},"Matrix, Matrix":function(e,r){var t=u(512),{w:n,h:i}=s(e.valueOf(),r.valueOf(),t);return{w:o(n),h:o(i)}},"Matrix, Matrix, Matrix":function(e,r,t){var{h:n}=s(e.valueOf(),r.valueOf(),t.valueOf());return{h:o(n),w:o(t)}},"Matrix, Matrix, number":function(e,r,t){if(t<0)throw new Error("w must be a positive number");var n=u(t),{h:i}=s(e.valueOf(),r.valueOf(),n);return{h:o(i),w:o(n)}}});function s(e,r,o){for(var s=[],u=[],c=0;c{var{typed:r,abs:t,add:n,pow:i,conj:a,sqrt:o,multiply:s,equalScalar:u,larger:c,smaller:l,matrix:p,ctranspose:f,eigs:d}=e;return r(ih,{number:Math.abs,Complex:function(e){return e.abs()},BigNumber:function(e){return e.abs()},boolean:function(e){return Math.abs(e)},Array:function(e){return m(p(e),2)},Matrix:function(e){return m(e,2)},"Array, number | BigNumber | string":function(e,r){return m(p(e),r)},"Matrix, number | BigNumber | string":function(e,r){return m(e,r)}});function m(e,r){var p=e.size();if(1===p.length)return function(e,r){if(r===Number.POSITIVE_INFINITY||"inf"===r)return function(e){var r=0;return e.forEach((function(e){var n=t(e);c(n,r)&&(r=n)}),!0),r}(e);if(r===Number.NEGATIVE_INFINITY||"-inf"===r)return function(e){var r;return e.forEach((function(e){var n=t(e);r&&!l(n,r)||(r=n)}),!0),r||0}(e);if("fro"===r)return m(e,2);if("number"==typeof r&&!isNaN(r)){if(!u(r,0)){var a=0;return e.forEach((function(e){a=n(i(t(e),r),a)}),!0),i(a,1/r)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}(e,r);if(2===p.length){if(p[0]&&p[1])return function(e,r){if(1===r)return function(e){var r=[],i=0;return e.forEach((function(e,a){var o=a[1],s=n(r[o]||0,t(e));c(s,i)&&(i=s),r[o]=s}),!0),i}(e);if(r===Number.POSITIVE_INFINITY||"inf"===r)return function(e){var r=[],i=0;return e.forEach((function(e,a){var o=a[0],s=n(r[o]||0,t(e));c(s,i)&&(i=s),r[o]=s}),!0),i}(e);if("fro"===r)return function(e){var r=0;return e.forEach((function(e,t){r=n(r,s(e,a(e)))})),t(o(r))}(e);if(2===r)return function(e){var r=e.size();if(r[0]!==r[1])throw new RangeError("Invalid matrix dimensions");var n=f(e),i=s(n,e),a=d(i).values.toArray(),u=a[a.length-1];return t(o(u))}(e);throw new Error("Unsupported parameter value "+r)}(e,r);throw new RangeError("Invalid matrix dimensions")}}})),sh="rotationMatrix",uh=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],ch=Gr(sh,uh,(e=>{var{typed:r,config:t,multiplyScalar:n,addScalar:i,unaryMinus:a,norm:o,BigNumber:u,matrix:c,DenseMatrix:l,SparseMatrix:p,cos:f,sin:d}=e;return r(sh,{"":function(){return"Matrix"===t.matrix?c([]):[]},string:function(e){return c(e)},"number | BigNumber | Complex | Unit":function(e){return m(e,"Matrix"===t.matrix?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(e,r){return m(e,r)},"number | BigNumber | Complex | Unit, Array":function(e,r){var t=c(r);return h(t),v(e,t,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(e,r){h(r);var n=r.storage()||("Matrix"===t.matrix?"dense":void 0);return v(e,r,n)},"number | BigNumber | Complex | Unit, Array, string":function(e,r,t){var n=c(r);return h(n),v(e,n,t)},"number | BigNumber | Complex | Unit, Matrix, string":function(e,r,t){return h(r),v(e,r,t)}});function m(e,r){var t=s(e)?new u(-1):-1,i=f(e),a=d(e);return y([[i,n(t,a)],[a,i]],r)}function h(e){var r=e.size();if(r.length<1||3!==r[0])throw new RangeError("Vector must be of dimensions 1x3")}function g(e){return e.reduce(((e,r)=>n(e,r)))}function y(e,r){if(r){if("sparse"===r)return new p(e);if("dense"===r)return new l(e);throw new TypeError('Unknown matrix type "'.concat(r,'"'))}return e}function v(e,r,t){var n=o(r);if(0===n)throw new RangeError("Rotation around zero vector");var c=s(e)?u:null,l=c?new c(1):1,p=c?new c(-1):-1,m=c?new c(r.get([0])/n):r.get([0])/n,h=c?new c(r.get([1])/n):r.get([1])/n,v=c?new c(r.get([2])/n):r.get([2])/n,x=f(e),D=i(l,a(x)),b=d(e);return y([[i(x,g([m,m,D])),i(g([m,h,D]),g([p,v,b])),i(g([m,v,D]),g([h,b]))],[i(g([m,h,D]),g([v,b])),i(x,g([h,h,D])),i(g([h,v,D]),g([p,m,b]))],[i(g([m,v,D]),g([p,h,b])),i(g([h,v,D]),g([m,b])),i(x,g([v,v,D]))]],t)}})),lh="schur",ph=["typed","matrix","identity","multiply","qr","norm","subtract"],fh=Gr(lh,ph,(e=>{var{typed:r,matrix:t,identity:n,multiply:i,qr:a,norm:o,subtract:s}=e;return r(lh,{Array:function(e){var r=u(t(e));return{U:r.U.valueOf(),T:r.T.valueOf()}},Matrix:function(e){return u(e)}});function u(e){var r,t=e.size()[0],u=e,c=n(t),l=0;do{r=u;var p=a(u),f=p.Q,d=p.R;if(u=i(d,f),c=i(c,f),l++>100)break}while(o(s(u,r))>1e-4);return{U:c,T:u}}})),dh="rotate",mh=["typed","multiply","rotationMatrix"],hh=Gr(dh,mh,(e=>{var{typed:r,multiply:t,rotationMatrix:n}=e;return r(dh,{"Array , number | BigNumber | Complex | Unit":function(e,r){return i(e,2),t(n(r),e).toArray()},"Matrix , number | BigNumber | Complex | Unit":function(e,r){return i(e,2),t(n(r),e)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(e,r,a){return i(e,3),t(n(r,a),e)},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(e,r,a){return i(e,3),t(n(r,a),e)}});function i(e,r){var t=Array.isArray(e)?pi(e):e.size();if(t.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(r));if(2===t.length&&1!==t[1])throw new RangeError("Vector must be of dimensions 1x".concat(r));if(t[0]!==r)throw new RangeError("Vector must be of dimensions 1x".concat(r))}})),gh="sylvester",yh=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],vh=Gr(gh,yh,(e=>{var{typed:r,schur:t,matrixFromColumns:n,matrix:i,multiply:a,range:o,concat:s,transpose:u,index:c,subset:l,add:p,subtract:f,identity:d,lusolve:m,abs:h}=e;return r(gh,{"Matrix, Matrix, Matrix":g,"Array, Matrix, Matrix":function(e,r,t){return g(i(e),r,t)},"Array, Array, Matrix":function(e,r,t){return g(i(e),i(r),t)},"Array, Matrix, Array":function(e,r,t){return g(i(e),r,i(t))},"Matrix, Array, Matrix":function(e,r,t){return g(e,i(r),t)},"Matrix, Array, Array":function(e,r,t){return g(e,i(r),i(t))},"Matrix, Matrix, Array":function(e,r,t){return g(e,r,i(t))},"Array, Array, Array":function(e,r,t){return g(i(e),i(r),i(t)).toArray()}});function g(e,r,g){for(var y=r.size()[0],v=e.size()[0],x=t(e),D=x.T,b=x.U,w=t(a(-1,r)),N=w.T,E=w.U,A=a(a(u(b),g),E),S=o(0,v),C=[],M=(e,r)=>s(e,r,1),F=(e,r)=>s(e,r,0),T=0;T1e-5){for(var B=F(l(A,c(S,T)),l(A,c(S,T+1))),O=0;O{var{typed:r,matrix:t,sylvester:n,multiply:i,transpose:a}=e;return r(xh,{"Matrix, Matrix":function(e,r){return n(e,a(e),i(-1,r))},"Array, Matrix":function(e,r){return n(t(e),a(t(e)),i(-1,r))},"Matrix, Array":function(e,r){return n(e,a(t(e)),t(i(-1,r)))},"Array, Array":function(e,r){return n(t(e),a(t(e)),t(i(-1,r))).toArray()}})})),wh=Yr({config:se}),Nh=xt({}),Eh=Rt({BigNumber:wh,config:se}),Ah=Ot({}),Sh=yn({BigNumber:wh,config:se}),Ch=Qn({}),Mh=Gt({Complex:Nh}),Fh=qt({BigNumber:wh,config:se}),Th=jt({BigNumber:wh,config:se}),Bh=Ht({BigNumber:wh,config:se}),Oh=Xn({}),_h=It({BigNumber:wh,config:se}),qh=_t({}),Ih=Pt({BigNumber:wh,config:se}),zh=Kn({}),kh=ei({}),Rh=Zt({BigNumber:wh,config:se}),Ph=zn({BigNumber:wh,config:se}),Uh=kt({BigNumber:wh,config:se}),jh=Bt({}),Lh=Yt({}),Hh=qi({Matrix:Oh}),Zh=Sn({BigNumber:wh,config:se}),$h=Ut({BigNumber:wh,config:se}),Gh=zt({BigNumber:wh,config:se}),Vh=Ii({}),Wh=$t({BigNumber:wh,config:se}),Yh=Ji({BigNumber:wh,Complex:Nh,DenseMatrix:Hh,Fraction:Ch}),Jh=Ta({BigNumber:wh,config:se,typed:Yh}),Qh=An({BigNumber:wh,config:se}),Xh=Ba({typed:Yh}),Kh=_a({Complex:Nh,config:se,typed:Yh}),eg=Xa({BigNumber:wh,typed:Yh}),rg=eo({BigNumber:wh,Complex:Nh,config:se,typed:Yh}),tg=to({typed:Yh}),ng=no({typed:Yh}),ig=ao({BigNumber:wh,Complex:Nh,config:se,typed:Yh}),ag=oo({typed:Yh}),og=so({typed:Yh}),sg=co({Complex:Nh,config:se,typed:Yh}),ug=lo({BigNumber:wh,typed:Yh}),cg=Fo({typed:Yh}),lg=Bo({typed:Yh}),pg=_o({typed:Yh}),fg=ko({typed:Yh}),dg=Po({Complex:Nh,typed:Yh}),mg=jo({typed:Yh}),hg=Ho({typed:Yh}),gg=$o({BigNumber:wh,typed:Yh}),yg=Vo({BigNumber:wh,typed:Yh}),vg=Yo({typed:Yh}),xg=Ko({config:se,typed:Yh}),Dg=es({typed:Yh}),bg=os({typed:Yh}),wg=us({Complex:Nh,typed:Yh}),Ng=ls({typed:Yh}),Eg=ds({typed:Yh}),Ag=gs({typed:Yh}),Sg=vs({typed:Yh}),Cg=xs({format:Ag,typed:Yh}),Mg=Ds({typed:Yh}),Fg=ws({typed:Yh}),Tg=Fs({typed:Yh}),Bg=Bs({typed:Yh}),Og=_s({typed:Yh}),_g=Lt({BigNumber:wh,config:se}),qg=js({Complex:Nh,typed:Yh}),Ig=Hs({Complex:Nh,config:se,typed:Yh}),zg=$s({Complex:Nh,config:se,typed:Yh}),kg=Gs({typed:Yh}),Rg=Ws({typed:Yh}),Pg=eu({typed:Yh}),Ug=ru({typed:Yh}),jg=tu({format:Ag,typed:Yh}),Lg=su({config:se,typed:Yh}),Hg=cu({typed:Yh}),Zg=du({config:se,typed:Yh}),$g=mu({typed:Yh}),Gg=hu({BigNumber:wh,typed:Yh}),Vg=yu({BigNumber:wh,Fraction:Ch,complex:dg,typed:Yh}),Wg=vu({typed:Yh}),Yg=xu({Matrix:Oh,equalScalar:xg,typed:Yh}),Jg=bu({typed:Yh}),Qg=Nu({typed:Yh}),Xg=Au({typed:Yh}),Kg=Su({typed:Yh}),ey=Mu({typed:Yh}),ry=Tu({Complex:Nh,config:se,typed:Yh}),ty=Ou({BigNumber:wh,typed:Yh}),ny=qu({isInteger:Fg,typed:Yh}),iy=ku({BigNumber:wh,Complex:Nh,config:se,typed:Yh}),ay=Ru({format:Ag,typed:Yh}),oy=Uu({typed:Yh}),sy=Lu({typed:Yh}),uy=Zu({BigNumber:wh,typed:Yh}),cy=Gu({typed:Yh}),ly=Wu({typed:Yh}),py=Ju({config:se,typed:Yh}),fy=Xu({BigNumber:wh,typed:Yh}),dy=ec({typed:Yh}),my=tc({SparseMatrix:Yg,typed:Yh}),hy=nc({Complex:Nh,config:se,typed:Yh}),gy=ic({typed:Yh}),yy=oc({typed:Yh}),vy=uc({BigNumber:wh,Complex:Nh,config:se,typed:Yh}),xy=cc({BigNumber:wh,typed:Yh}),Dy=lc({Fraction:Ch,typed:Yh}),by=fc({typed:Yh}),wy=mc({DenseMatrix:Hh,Matrix:Oh,SparseMatrix:Yg,typed:Yh}),Ny=gc({isZero:Og,matrix:wy,typed:Yh}),Ey=vc({isNaN:cy,isNumeric:by,typed:Yh}),Ay=wc({bignumber:ug,fraction:Dy,number:Ug}),Sy=Ac({config:se,multiplyScalar:Rg,numeric:Ay,typed:Yh}),Cy=Cc({isInteger:Fg,matrix:wy,typed:Yh}),My=Fc({matrix:wy,config:se,typed:Yh}),Fy=Bc({matrix:wy,typed:Yh}),Ty=_c({matrix:wy,typed:Yh}),By=Pc({matrix:wy,typed:Yh}),Oy=jc({BigNumber:wh,config:se,matrix:wy,typed:Yh}),_y=Hc({BigNumber:wh,config:se,matrix:wy,typed:Yh}),qy=$c({Complex:Nh,config:se,typed:Yh}),Iy=Vc({BigNumber:wh,Complex:Nh,Fraction:Ch,config:se,isNegative:Tg,matrix:wy,typed:Yh,unaryMinus:yy}),zy=Yc({isInteger:Fg,matrix:wy,typed:Yh}),ky=Xc({prod:Sy,size:My,typed:Yh}),Ry=el({conj:mg,transpose:By,typed:Yh}),Py=tl({DenseMatrix:Hh,SparseMatrix:Yg,matrix:wy,typed:Yh}),Uy=il({numeric:Ay,typed:Yh}),jy=hl({DenseMatrix:Hh,concat:zy,divideScalar:Uy,equalScalar:xg,matrix:wy,typed:Yh}),Ly=yl({DenseMatrix:Hh,concat:zy,equalScalar:xg,matrix:wy,typed:Yh}),Hy=Dl({matrix:wy,typed:Yh}),Zy=Fl({BigNumber:wh,DenseMatrix:Hh,concat:zy,equalScalar:xg,matrix:wy,typed:Yh}),$y=Bl({isNumeric:by,typed:Yh}),Gy=_l({BigNumber:wh,DenseMatrix:Hh,SparseMatrix:Yg,config:se,matrix:wy,typed:Yh}),Vy=Il({matrix:wy,multiplyScalar:Rg,typed:Yh}),Wy=kl({DenseMatrix:Hh,concat:zy,config:se,matrix:wy,typed:Yh}),Yy=Ll({DenseMatrix:Hh,concat:zy,equalScalar:xg,matrix:wy,typed:Yh,zeros:_y}),Jy=Zl({flatten:Hy,matrix:wy,size:My,typed:Yh}),Qy=Gl({DenseMatrix:Hh,concat:zy,equalScalar:xg,matrix:wy,typed:Yh}),Xy=Yl({BigNumber:wh,concat:zy,equalScalar:xg,matrix:wy,typed:Yh}),Ky=Jl({BigNumber:wh,config:se,matrix:wy,typed:Yh}),ev=Ql({config:se,matrix:wy}),rv=Kl({DenseMatrix:Hh,concat:zy,equalScalar:xg,matrix:wy,typed:Yh,zeros:_y}),tv=tp({BigNumber:wh,DenseMatrix:Hh,equalScalar:xg,matrix:wy,typed:Yh,zeros:_y}),nv=ip({DenseMatrix:Hh,concat:zy,config:se,matrix:wy,typed:Yh}),iv=op({concat:zy,matrix:wy,typed:Yh}),av=up({DenseMatrix:Hh,concat:zy,config:se,equalScalar:xg,matrix:wy,typed:Yh}),ov=lp({DenseMatrix:Hh,concat:zy,matrix:wy,typed:Yh}),sv=pp({DenseMatrix:Hh,SparseMatrix:Yg,addScalar:tg,concat:zy,equalScalar:xg,matrix:wy,typed:Yh}),uv=dp({concat:zy,equalScalar:xg,matrix:wy,typed:Yh}),cv=hp({DenseMatrix:Hh,concat:zy,matrix:wy,typed:Yh}),lv=yp({addScalar:tg,combinations:fg,divideScalar:Uy,isInteger:Fg,isNegative:Tg,multiplyScalar:Rg,typed:Yh}),pv=xp({BigNumber:wh,DenseMatrix:Hh,Fraction:Ch,concat:zy,config:se,equalScalar:xg,matrix:wy,typed:Yh}),fv=Np({concat:zy,matrix:wy,typed:Yh}),dv=Ap({add:sv,typed:Yh,unaryPlus:Jh}),mv=Cp({equal:Ly,typed:Yh}),hv=Mp({addScalar:tg,conj:mg,multiplyScalar:Rg,size:My,typed:Yh}),gv=Tp({compareText:fv,isZero:Og,typed:Yh}),yv=qp({DenseMatrix:Hh,config:se,equalScalar:xg,matrix:wy,round:tv,typed:Yh,zeros:_y}),vv=zp({abs:Xh,addScalar:tg,divideScalar:Uy,isPositive:Bg,multiplyScalar:Rg,smaller:nv,sqrt:hy,typed:Yh}),xv=kp({DenseMatrix:Hh,smaller:nv}),Dv=Rp({ImmutableDenseMatrix:xv}),bv=Up({BigNumber:wh,add:sv,config:se,equal:Ly,isInteger:Fg,mod:Qy,smaller:nv,typed:Yh,xgcd:Oy}),wv=Lp({DenseMatrix:Hh,concat:zy,config:se,matrix:wy,typed:Yh}),Nv=Zp({Complex:Nh,config:se,divideScalar:Uy,typed:Yh}),Ev=Gp({flatten:Hy,matrix:wy,size:My,typed:Yh}),Av=Vp({config:se,numeric:Ay,smaller:nv,typed:Yh}),Sv=Yp({addScalar:tg,dot:hv,equalScalar:xg,matrix:wy,multiplyScalar:Rg,typed:Yh}),Cv=Qp({Complex:Nh,config:se,divideScalar:Uy,typed:Yh}),Mv=Xp({DenseMatrix:Hh,concat:zy,equalScalar:xg,matrix:wy,typed:Yh}),Fv=ef({compare:pv,isNaN:cy,isNumeric:by,typed:Yh}),Tv=rf({add:sv,compare:pv,multiply:Sv,partitionSelect:Fv,typed:Yh}),Bv=nf({DenseMatrix:Hh,concat:zy,equalScalar:xg,matrix:wy,typed:Yh,zeros:_y}),Ov=of({DenseMatrix:Hh,concat:zy,config:se,matrix:wy,typed:Yh}),_v=cf({DenseMatrix:Hh,addScalar:tg,concat:zy,equalScalar:xg,matrix:wy,typed:Yh,unaryMinus:yy}),qv=lf({add:sv,matrix:wy,typed:Yh}),Iv=df({DenseMatrix:Hh,divideScalar:Uy,equalScalar:xg,matrix:wy,multiplyScalar:Rg,subtract:_v,typed:Yh}),zv=hf({Complex:Nh,add:sv,multiply:Sv,number:Ug,typed:Yh}),kv=gf({concat:zy,equalScalar:xg,matrix:wy,not:Pg,typed:Yh,zeros:_y}),Rv=vf({DenseMatrix:Hh,concat:zy,equalScalar:xg,matrix:wy,typed:Yh}),Pv=wf({DenseMatrix:Hh,config:se,equalScalar:xg,matrix:wy,round:tv,typed:Yh,zeros:_y}),Uv=Af({compare:pv,typed:Yh}),jv=Cf({addScalar:tg,combinations:fg,isInteger:Fg,isNegative:Tg,isPositive:Bg,larger:wv,typed:Yh}),Lv=Ff({matrix:wy,multiply:Sv,subtract:_v,typed:Yh}),Hv=Tf({divideScalar:Uy,isZero:Og,matrix:wy,multiply:Sv,subtract:_v,typed:Yh,unaryMinus:yy}),Zv=Of({matrix:wy,number:Ug,subtract:_v,typed:Yh}),$v=qf({abs:Xh,addScalar:tg,deepEqual:mv,divideScalar:Uy,multiplyScalar:Rg,sqrt:hy,subtract:_v,typed:Yh}),Gv=kf({concat:zy,equalScalar:xg,matrix:wy,multiplyScalar:Rg,typed:Yh}),Vv=Rf({larger:wv,smaller:nv}),Wv=Lf({Complex:Nh,DenseMatrix:Hh,ceil:Pv,equalScalar:xg,floor:yv,matrix:wy,typed:Yh,zeros:_y}),Yv=Zf({Index:Dv,typed:Yh}),Jv=$f({abs:Xh,add:sv,addScalar:tg,config:se,divideScalar:Uy,equalScalar:xg,flatten:Hy,isNumeric:by,isZero:Og,matrix:wy,multiply:Sv,multiplyScalar:Rg,smaller:nv,subtract:_v,typed:Yh}),Qv=Gf({concat:zy,equalScalar:xg,matrix:wy,typed:Yh}),Xv=Wf({Complex:Nh,config:se,divideScalar:Uy,log:Nv,typed:Yh}),Kv=Jf({DenseMatrix:Hh,divideScalar:Uy,equalScalar:xg,matrix:wy,multiplyScalar:Rg,subtract:_v,typed:Yh}),ex=Qf({config:se,larger:wv,numeric:Ay,typed:Yh}),rx=Xf({addScalar:tg,complex:dg,conj:mg,divideScalar:Uy,equal:Ly,identity:Gy,isZero:Og,matrix:wy,multiplyScalar:Rg,sign:Vg,sqrt:hy,subtract:_v,typed:Yh,unaryMinus:yy,zeros:_y}),tx=ed({bignumber:ug,matrix:wy,add:sv,config:se,isPositive:Bg,larger:wv,largerEq:Wy,smaller:nv,smallerEq:Ov,typed:Yh}),nx=rd({Index:Dv,matrix:wy,range:tx,typed:Yh}),ix=nd({DenseMatrix:Hh,Index:Dv,compareNatural:Uv,size:My,subset:Ty,typed:Yh}),ax=ad({DenseMatrix:Hh,Index:Dv,compareNatural:Uv,size:My,subset:Ty,typed:Yh}),ox=sd({Index:Dv,compareNatural:Uv,size:My,subset:Ty,typed:Yh}),sx=cd({Index:Dv,compareNatural:Uv,size:My,subset:Ty,typed:Yh}),ux=wd({SparseMatrix:Yg,abs:Xh,add:sv,divideScalar:Uy,larger:wv,largerEq:Wy,multiply:Sv,subtract:_v,transpose:By,typed:Yh}),cx=Ed({compare:pv,compareNatural:Uv,matrix:wy,typed:Yh}),lx=Ad({add:sv,config:se,numeric:Ay,typed:Yh}),px=Cd({DenseMatrix:Hh,divideScalar:Uy,equalScalar:xg,matrix:wy,multiplyScalar:Rg,subtract:_v,typed:Yh}),fx=Fd({BigNumber:wh,DenseMatrix:Hh,concat:zy,equalScalar:xg,matrix:wy,typed:Yh}),dx=Bd({Index:Dv,matrix:wy,range:tx,typed:Yh}),mx=_d({DenseMatrix:Hh,divideScalar:Uy,equalScalar:xg,matrix:wy,multiplyScalar:Rg,subtract:_v,typed:Yh}),hx=Id({DenseMatrix:Hh,Index:Dv,compareNatural:Uv,size:My,subset:Ty,typed:Yh}),gx=kd({Index:Dv,compareNatural:Uv,size:My,subset:Ty,typed:Yh}),yx=Pd({Index:Dv,concat:zy,setDifference:hx,size:My,subset:Ty,typed:Yh}),vx=Ud({FibonacciHeap:Vv,addScalar:tg,equalScalar:xg}),xx=jd({abs:Xh,addScalar:tg,det:Hv,divideScalar:Uy,identity:Gy,matrix:wy,multiply:Sv,typed:Yh,unaryMinus:yy}),Dx=Ld({DenseMatrix:Hh,Spa:vx,SparseMatrix:Yg,abs:Xh,addScalar:tg,divideScalar:Uy,equalScalar:xg,larger:wv,matrix:wy,multiplyScalar:Rg,subtract:_v,typed:Yh,unaryMinus:yy}),bx=Zd({Complex:Nh,add:sv,ctranspose:Ry,deepEqual:mv,divideScalar:Uy,dot:hv,dotDivide:jy,equal:Ly,inv:xx,matrix:wy,multiply:Sv,typed:Yh}),wx=$d({Complex:Nh,config:se,fraction:Dy,identity:Gy,inv:xx,matrix:wy,multiply:Sv,number:Ug,typed:Yh}),Nx=Vd({DenseMatrix:Hh,Index:Dv,compareNatural:Uv,size:My,subset:Ty,typed:Yh}),Ex=Yd({Index:Dv,concat:zy,setIntersect:Nx,setSymDifference:yx,size:My,subset:Ty,typed:Yh}),Ax=Qd({abs:Xh,add:sv,identity:Gy,inv:xx,map:kg,max:ex,multiply:Sv,size:My,sqrt:hy,subtract:_v,typed:Yh}),Sx=rm({BigNumber:wh,Complex:Nh,Fraction:Ch,abs:Xh,addScalar:tg,config:se,divideScalar:Uy,equal:Ly,fix:Wv,format:Ag,isNumeric:by,multiplyScalar:Rg,number:Ug,pow:wx,round:tv,subtract:_v}),Cx=nn({BigNumber:wh,Unit:Sx,config:se}),Mx=Pn({BigNumber:wh,Unit:Sx,config:se}),Fx=Cn({BigNumber:wh,Unit:Sx,config:se}),Tx=sn({BigNumber:wh,Unit:Sx,config:se}),Bx=Fn({BigNumber:wh,Unit:Sx,config:se}),Ox=un({BigNumber:wh,Unit:Sx,config:se}),_x=nm({Unit:Sx,typed:Yh}),qx=Dn({BigNumber:wh,Unit:Sx,config:se}),Ix=am({DenseMatrix:Hh,concat:zy,equalScalar:xg,matrix:wy,pow:wx,typed:Yh}),zx=tn({BigNumber:wh,Unit:Sx,config:se}),kx=on({BigNumber:wh,Unit:Sx,config:se}),Rx=sm({abs:Xh,add:sv,identity:Gy,inv:xx,multiply:Sv,typed:Yh}),Px=Tn({BigNumber:wh,Unit:Sx,config:se}),Ux=um({addScalar:tg,ceil:Pv,conj:mg,divideScalar:Uy,dotDivide:jy,exp:bg,i:Mh,log2:zg,matrix:wy,multiplyScalar:Rg,pow:wx,tau:Uh,typed:Yh}),jx=lm({BigNumber:wh,Complex:Nh,config:se,multiplyScalar:Rg,pow:wx,typed:Yh}),Lx=Xt({BigNumber:wh,Unit:Sx,config:se}),Hx=vn({BigNumber:wh,Unit:Sx,config:se}),Zx=fm({conj:mg,dotDivide:jy,fft:Ux,typed:Yh}),$x=fn({BigNumber:wh,Unit:Sx,config:se}),Gx=On({BigNumber:wh,Unit:Sx,config:se}),Vx=rn({BigNumber:wh,Unit:Sx,config:se}),Wx=Un({BigNumber:wh,Unit:Sx,config:se}),Yx=qn({BigNumber:wh,Unit:Sx,config:se}),Jx=bn({BigNumber:wh,Unit:Sx,config:se}),Qx=pn({BigNumber:wh,Unit:Sx,config:se}),Xx=Gn({BigNumber:wh,Unit:Sx,config:se}),Kx=Hn({BigNumber:wh,Unit:Sx,config:se}),eD=Vn({BigNumber:wh,Unit:Sx,config:se}),rD=xn({BigNumber:wh,Unit:Sx,config:se}),tD=en({BigNumber:wh,Unit:Sx,config:se}),nD=Nn({BigNumber:wh,Unit:Sx,config:se}),iD=kn({BigNumber:wh,Unit:Sx,config:se}),aD=Qt({BigNumber:wh,Unit:Sx,config:se}),oD=Rn({BigNumber:wh,Unit:Sx,config:se}),sD=En({BigNumber:wh,Unit:Sx,config:se}),uD=Mn({BigNumber:wh,Unit:Sx,config:se}),cD=dn({BigNumber:wh,Unit:Sx,config:se}),lD=an({BigNumber:wh,Unit:Sx,config:se}),pD=dm({divideScalar:Uy,equalScalar:xg,inv:xx,matrix:wy,multiply:Sv,typed:Yh}),fD=hn({BigNumber:wh,Unit:Sx,config:se}),dD=hm({gamma:jx,typed:Yh}),mD=Bn({BigNumber:wh,Unit:Sx,config:se}),hD=Ln({BigNumber:wh,Unit:Sx,config:se}),gD=cn({BigNumber:wh,Unit:Sx,config:se}),yD=vm({DenseMatrix:Hh,lsolve:Kv,lup:Dx,matrix:wy,slu:ux,typed:Yh,usolve:Iv}),vD=ln({BigNumber:wh,Unit:Sx,config:se}),xD=jn({BigNumber:wh,Unit:Sx,config:se}),DD=Dm({add:sv,divide:pD,factorial:dD,isInteger:Fg,isPositive:Bg,multiply:Sv,typed:Yh}),bD=wm({factorial:dD,typed:Yh}),wD=Zn({BigNumber:wh,Unit:Sx,config:se}),ND=Am({add:sv,cbrt:Iy,divide:pD,equalScalar:xg,im:Mg,isZero:Og,multiply:Sv,re:$g,sqrt:hy,subtract:_v,typeOf:ey,typed:Yh,unaryMinus:yy}),ED=Cm({compareNatural:Uv,typed:Yh}),AD=Fm({abs:Xh,add:sv,bignumber:ug,divide:pD,isNegative:Tg,isPositive:Bg,larger:wv,map:kg,matrix:wy,max:ex,multiply:Sv,smaller:nv,subtract:_v,typed:Yh,unaryMinus:yy}),SD=Bm({bignumber:ug,addScalar:tg,combinations:fg,divideScalar:Uy,factorial:dD,isInteger:Fg,isNegative:Tg,larger:wv,multiplyScalar:Rg,number:Ug,pow:wx,subtract:_v,typed:Yh}),CD=_m({Unit:Sx,typed:Yh}),MD=Im({addScalar:tg,isInteger:Fg,isNegative:Tg,stirlingS2:SD,typed:Yh}),FD=km({abs:Xh,add:sv,addScalar:tg,atan:og,bignumber:ug,column:dx,complex:dg,config:se,cos:sy,diag:Py,divideScalar:Uy,dot:hv,equal:Ly,flatten:Hy,im:Mg,inv:xx,larger:wv,matrix:wy,matrixFromColumns:Jy,multiply:Sv,multiplyScalar:Rg,number:Ug,qr:rx,re:$g,sin:Wg,smaller:nv,sqrt:hy,subtract:_v,typed:Yh,usolve:Iv,usolveAll:px}),TD=gn({BigNumber:wh,Unit:Sx,config:se}),BD=_n({BigNumber:wh,Unit:Sx,config:se}),OD=Um({add:sv,divide:pD,typed:Yh}),_D=In({BigNumber:wh,Unit:Sx,config:se}),qD=Kt({BigNumber:wh,Unit:Sx,config:se}),ID=wn({BigNumber:wh,Unit:Sx,config:se}),zD=Zm({add:sv,apply:ny,divide:pD,isNaN:cy,multiply:Sv,subtract:_v,typed:Yh}),kD=mn({BigNumber:wh,Unit:Sx,config:se}),RD=Vm({add:sv,compare:pv,divide:pD,partitionSelect:Fv,typed:Yh}),PD=Jm({divide:pD,dotDivide:jy,isNumeric:by,log:Nv,map:kg,matrix:wy,multiply:Sv,sum:lx,typed:Yh}),UD=Xm({abs:Xh,map:kg,median:RD,subtract:_v,typed:Yh}),jD=eh({map:kg,sqrt:hy,typed:Yh,variance:zD}),LD=nh({Complex:Nh,add:sv,divide:pD,matrix:wy,multiply:Sv,typed:Yh}),HD=oh({abs:Xh,add:sv,conj:mg,ctranspose:Ry,eigs:FD,equalScalar:xg,larger:wv,matrix:wy,multiply:Sv,pow:wx,smaller:nv,sqrt:hy,typed:Yh}),ZD=ch({BigNumber:wh,DenseMatrix:Hh,SparseMatrix:Yg,addScalar:tg,config:se,cos:sy,matrix:wy,multiplyScalar:Rg,norm:HD,sin:Wg,typed:Yh,unaryMinus:yy}),$D=$n({BigNumber:wh,Unit:Sx,config:se}),GD=fh({identity:Gy,matrix:wy,multiply:Sv,norm:HD,qr:rx,subtract:_v,typed:Yh}),VD=hh({multiply:Sv,rotationMatrix:ZD,typed:Yh}),WD=vh({abs:Xh,add:sv,concat:zy,identity:Gy,index:Yv,lusolve:yD,matrix:wy,matrixFromColumns:Jy,multiply:Sv,range:tx,schur:GD,subset:Ty,subtract:_v,transpose:By,typed:Yh}),YD=bh({matrix:wy,multiply:Sv,sylvester:WD,transpose:By,typed:Yh}),JD=new Set(["end"]),QD=Gr("Node",["mathWithTransform"],(e=>{var{mathWithTransform:r}=e;return class{get type(){return"Node"}get isNode(){return!0}evaluate(e){return this.compile().evaluate(e)}compile(){var e=this._compile(r,{}),t={};return{evaluate:function(r){var n=Gi(r);return function(e){for(var r of[...JD])if(e.has(r))throw new Error('Scope contains an illegal symbol, "'+r+'" is a reserved keyword')}(n),e(n,t,null)}}}_compile(e,r){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(e){throw new Error("Cannot run forEach on a Node interface")}map(e){throw new Error("Cannot run map on a Node interface")}_ifNode(e){if(!R(e))throw new TypeError("Callback function must return a Node");return e}traverse(e){e(this,null,null),function e(r,t){r.forEach((function(r,n,i){t(r,n,i),e(r,t)}))}(this,e)}transform(e){return function r(t,n,i){var a=e(t,n,i);return a!==t?a:t.map(r)}(this,null,null)}filter(e){var r=[];return this.traverse((function(t,n,i){e(t,n,i)&&r.push(t)})),r}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map((function(e){return e.cloneDeep()}))}equals(e){return!!e&&this.type===e.type&&Q(this,e)}toString(e){var r=this._getCustomString(e);return void 0!==r?r:this._toString(e)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(e){var r=this._getCustomString(e);return void 0!==r?r:this.toHTML(e)}_toString(){throw new Error("_toString not implemented for "+this.type)}toTex(e){var r=this._getCustomString(e);return void 0!==r?r:this._toTex(e)}_toTex(e){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(e){if(e&&"object"==typeof e)switch(typeof e.handler){case"object":case"undefined":return;case"function":return e.handler(this,e);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}}),{isClass:!0,isNode:!0}),XD="ObjectNode",KD=Gr(XD,["Node"],(e=>{var{Node:r}=e;class t extends r{constructor(e){if(super(),this.properties=e||{},e&&("object"!=typeof e||!Object.keys(e).every((function(r){return R(e[r])}))))throw new TypeError("Object containing Nodes expected")}get type(){return XD}get isObjectNode(){return!0}_compile(e,r){var t={};for(var n in this.properties)if(re(this.properties,n)){var i=ai(n),a=JSON.parse(i),o=ki(this.properties,n);t[a]=o._compile(e,r)}return function(e,r,n){var i={};for(var a in t)re(t,a)&&(i[a]=t[a](e,r,n));return i}}forEach(e){for(var r in this.properties)re(this.properties,r)&&e(this.properties[r],"properties["+ai(r)+"]",this)}map(e){var r={};for(var n in this.properties)re(this.properties,n)&&(r[n]=this._ifNode(e(this.properties[n],"properties["+ai(n)+"]",this)));return new t(r)}clone(){var e={};for(var r in this.properties)re(this.properties,r)&&(e[r]=this.properties[r]);return new t(e)}_toString(e){var r=[];for(var t in this.properties)re(this.properties,t)&&r.push(ai(t)+": "+this.properties[t].toString(e));return"{"+r.join(", ")+"}"}toJSON(){return{mathjs:XD,properties:this.properties}}static fromJSON(e){return new t(e.properties)}toHTML(e){var r=[];for(var t in this.properties)re(this.properties,t)&&r.push(''+oi(t)+':'+this.properties[t].toHTML(e));return'{'+r.join(',')+'}'}_toTex(e){var r=[];for(var t in this.properties)re(this.properties,t)&&r.push("\\mathbf{"+t+":} & "+this.properties[t].toTex(e)+"\\\\");return"\\left\\{\\begin{array}{ll}"+r.join("\n")+"\\end{array}\\right\\}"}}return(0,Xd.Z)(t,"name",XD),t}),{isClass:!0,isNode:!0}),eb=[{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 rb(e,r){if(!r||"auto"!==r)return e;for(var t=e;j(t);)t=t.content;return t}function tb(e,r,t,n){var i=e;"keep"!==r&&(i=e.getContent());for(var a=i.getIdentifier(),o=null,s=0;s>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},ub={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(sb.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(sb.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(sb.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(sb.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(sb.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(sb.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(sb.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(sb.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(sb.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(sb.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(sb.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(sb.bitAnd,"${args[1]}\\right)")},bitNot:{1:sb.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(sb.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(sb.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(sb.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(sb.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(sb.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(sb.and,"${args[1]}\\right)")},not:{1:sb.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(sb.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(sb.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(sb.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(sb.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(sb.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(sb.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(sb.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(sb.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(sb.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(sb.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(sb.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(sb.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(sb.to,"${args[1]}\\right)")},numeric:function(e,r){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(ob.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)"}},cb={deg:"^\\circ"};function lb(e){return ab(e,{preserveFormatting:!0})}function pb(e,r){return(r=void 0!==r&&r)?re(cb,e)?cb[e]:"\\mathrm{"+lb(e)+"}":re(ob,e)?ob[e]:lb(e)}var fb="OperatorNode",db=Gr(fb,["Node"],(e=>{var{Node:r}=e;function t(e,r){var n=e;if("auto"===r)for(;j(n);)n=n.content;return!!_(n)||!!U(n)&&t(n.args[0],r)}function n(e,r,n,i,a){var o,s=tb(e,r,n),u=nb(e,r);if("all"===r||i.length>2&&"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier())return i.map((function(e){switch(e.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}}));switch(i.length){case 0:o=[];break;case 1:var c=tb(i[0],r,n,e);if(a&&null!==c){var l,p;if("keep"===r?(l=i[0].getIdentifier(),p=e.getIdentifier()):(l=i[0].getContent().getIdentifier(),p=e.getContent().getIdentifier()),!1===eb[s][p].latexLeftParens){o=[!1];break}if(!1===eb[c][l].latexParens){o=[!1];break}}if(null===c){o=[!1];break}if(c<=s){o=[!0];break}o=[!1];break;case 2:var f,d,m=tb(i[0],r,n,e),h=ib(e,i[0],r);f=null!==m&&(m===s&&"right"===u&&!h||m=2&&"OperatorNode:multiply"===e.getIdentifier()&&e.implicit&&"all"!==r&&"hide"===n)for(var b=1;b2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var p=i.map((function(r,t){return r=r.toString(e),a[t]&&(r="("+r+")"),r}));return this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===t?p.join(" "):p.join(" "+this.op+" ")}return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:fb,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(e){return new i(e.op,e.fn,e.args,e.implicit,e.isPercentage)}toHTML(e){var r=e&&e.parenthesis?e.parenthesis:"keep",t=e&&e.implicit?e.implicit:"hide",i=this.args,a=n(this,r,t,i,!1);if(1===i.length){var o=nb(this,r),s=i[0].toHTML(e);return a[0]&&(s='('+s+')'),"right"===o?''+oi(this.op)+""+s:s+''+oi(this.op)+""}if(2===i.length){var u=i[0].toHTML(e),c=i[1].toHTML(e);return a[0]&&(u='('+u+')'),a[1]&&(c='('+c+')'),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===t?u+''+c:u+''+oi(this.op)+""+c}var l=i.map((function(r,t){return r=r.toHTML(e),a[t]&&(r='('+r+')'),r}));return i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===t?l.join(''):l.join(''+oi(this.op)+""):''+oi(this.fn)+'('+l.join(',')+')'}_toTex(e){var r=e&&e.parenthesis?e.parenthesis:"keep",t=e&&e.implicit?e.implicit:"hide",i=this.args,a=n(this,r,t,i,!0),o=sb[this.fn];if(o=void 0===o?this.op:o,1===i.length){var s=nb(this,r),u=i[0].toTex(e);return a[0]&&(u="\\left(".concat(u,"\\right)")),"right"===s?o+u:u+o}if(2===i.length){var c=i[0],l=c.toTex(e);a[0]&&(l="\\left(".concat(l,"\\right)"));var p,f=i[1].toTex(e);switch(a[1]&&(f="\\left(".concat(f,"\\right)")),p="keep"===r?c.getIdentifier():c.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return o+"{"+l+"}{"+f+"}";case"OperatorNode:pow":switch(l="{"+l+"}",f="{"+f+"}",p){case"ConditionalNode":case"OperatorNode:divide":l="\\left(".concat(l,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&"hide"===t)return l+"~"+f}return l+o+f}if(i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var d=i.map((function(r,t){return r=r.toTex(e),a[t]&&(r="\\left(".concat(r,"\\right)")),r}));return"OperatorNode:multiply"===this.getIdentifier()&&this.implicit&&"hide"===t?d.join("~"):d.join(o)}return"\\mathrm{"+this.fn+"}\\left("+i.map((function(r){return r.toTex(e)})).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return(0,Xd.Z)(i,"name",fb),i}),{isClass:!0,isNode:!0}),mb="ParenthesisNode",hb=Gr(mb,["Node"],(e=>{var{Node:r}=e;class t extends r{constructor(e){if(super(),!R(e))throw new TypeError('Node expected for parameter "content"');this.content=e}get type(){return mb}get isParenthesisNode(){return!0}_compile(e,r){return this.content._compile(e,r)}getContent(){return this.content.getContent()}forEach(e){e(this.content,"content",this)}map(e){var r=e(this.content,"content",this);return new t(r)}clone(){return new t(this.content)}_toString(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"("+this.content.toString(e)+")":this.content.toString(e)}toJSON(){return{mathjs:mb,content:this.content}}static fromJSON(e){return new t(e.content)}toHTML(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?'('+this.content.toHTML(e)+')':this.content.toHTML(e)}_toTex(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"\\left(".concat(this.content.toTex(e),"\\right)"):this.content.toTex(e)}}return(0,Xd.Z)(t,"name",mb),t}),{isClass:!0,isNode:!0}),gb="RelationalNode",yb=Gr(gb,["Node"],(e=>{var{Node:r}=e,t={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends r{constructor(e,r){if(super(),!Array.isArray(e))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(r))throw new TypeError("Parameter params must be an array");if(e.length!==r.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=e,this.params=r}get type(){return gb}get isRelationalNode(){return!0}_compile(e,r){var t=this,n=this.params.map((t=>t._compile(e,r)));return function(r,i,a){for(var o,s=n[0](r,i,a),u=0;ue(r,"params["+t+"]",this)),this)}map(e){return new n(this.conditionals.slice(),this.params.map(((r,t)=>this._ifNode(e(r,"params["+t+"]",this))),this))}clone(){return new n(this.conditionals,this.params)}_toString(e){for(var r=e&&e.parenthesis?e.parenthesis:"keep",n=tb(this,r,e&&e.implicit),i=this.params.map((function(t,i){var a=tb(t,r,e&&e.implicit);return"all"===r||null!==a&&a<=n?"("+t.toString(e)+")":t.toString(e)})),a=i[0],o=0;o('+t.toHTML(e)+')':t.toHTML(e)})),a=i[0],o=0;o'+oi(t[this.conditionals[o]])+""+i[o+1];return a}_toTex(e){for(var r=e&&e.parenthesis?e.parenthesis:"keep",t=tb(this,r,e&&e.implicit),n=this.params.map((function(n,i){var a=tb(n,r,e&&e.implicit);return"all"===r||null!==a&&a<=t?"\\left("+n.toTex(e)+"\right)":n.toTex(e)})),i=n[0],a=0;a{var{Node:r}=e;class t extends r{constructor(e){if(super(),this.items=e||[],!Array.isArray(this.items)||!this.items.every(R))throw new TypeError("Array containing Nodes expected")}get type(){return vb}get isArrayNode(){return!0}_compile(e,r){var t=Ai(this.items,(function(t){return t._compile(e,r)}));if("Array"!==e.config.matrix){var n=e.matrix;return function(e,r,i){return n(Ai(t,(function(t){return t(e,r,i)})))}}return function(e,r,n){return Ai(t,(function(t){return t(e,r,n)}))}}forEach(e){for(var r=0;r['+this.items.map((function(r){return r.toHTML(e)})).join(',')+']'}_toTex(e){return function r(t,n){var i=t.some(F)&&!t.every(F),a=n||i,o=a?"&":"\\\\",s=t.map((function(t){return t.items?r(t.items,!n):t.toTex(e)})).join(o);return i||!a||a&&!n?"\\begin{bmatrix}"+s+"\\end{bmatrix}":s}(this.items,!1)}}return(0,Xd.Z)(t,"name",vb),t}),{isClass:!0,isNode:!0}),Db="BlockNode",bb=Gr(Db,["ResultSet","Node"],(e=>{var{ResultSet:r,Node:t}=e;class n extends t{constructor(e){if(super(),!Array.isArray(e))throw new Error("Array expected");this.blocks=e.map((function(e){var r=e&&e.node,t=!e||void 0===e.visible||e.visible;if(!R(r))throw new TypeError('Property "node" must be a Node');if("boolean"!=typeof t)throw new TypeError('Property "visible" must be a boolean');return{node:r,visible:t}}))}get type(){return Db}get isBlockNode(){return!0}_compile(e,t){var n=Ai(this.blocks,(function(r){return{evaluate:r.node._compile(e,t),visible:r.visible}}));return function(e,t,i){var a=[];return Si(n,(function(r){var n=r.evaluate(e,t,i);r.visible&&a.push(n)})),new r(a)}}forEach(e){for(var r=0;r;')})).join('
')}_toTex(e){return this.blocks.map((function(r){return r.node.toTex(e)+(r.visible?"":";")})).join("\\;\\;\n")}}return(0,Xd.Z)(n,"name",Db),n}),{isClass:!0,isNode:!0}),wb="ConditionalNode",Nb=Gr(wb,["Node"],(e=>{var{Node:r}=e;class t extends r{constructor(e,r,t){if(super(),!R(e))throw new TypeError("Parameter condition must be a Node");if(!R(r))throw new TypeError("Parameter trueExpr must be a Node");if(!R(t))throw new TypeError("Parameter falseExpr must be a Node");this.condition=e,this.trueExpr=r,this.falseExpr=t}get type(){return wb}get isConditionalNode(){return!0}_compile(e,r){var t=this.condition._compile(e,r),n=this.trueExpr._compile(e,r),i=this.falseExpr._compile(e,r);return function(e,r,a){return function(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e)return!!e;if(e){if(s(e))return!e.isZero();if(u(e))return!(!e.re&&!e.im);if(l(e))return!!e.value}if(null==e)return!1;throw new TypeError('Unsupported type of condition "'+G(e)+'"')}(t(e,r,a))?n(e,r,a):i(e,r,a)}}forEach(e){e(this.condition,"condition",this),e(this.trueExpr,"trueExpr",this),e(this.falseExpr,"falseExpr",this)}map(e){return new t(this._ifNode(e(this.condition,"condition",this)),this._ifNode(e(this.trueExpr,"trueExpr",this)),this._ifNode(e(this.falseExpr,"falseExpr",this)))}clone(){return new t(this.condition,this.trueExpr,this.falseExpr)}_toString(e){var r=e&&e.parenthesis?e.parenthesis:"keep",t=tb(this,r,e&&e.implicit),n=this.condition.toString(e),i=tb(this.condition,r,e&&e.implicit);("all"===r||"OperatorNode"===this.condition.type||null!==i&&i<=t)&&(n="("+n+")");var a=this.trueExpr.toString(e),o=tb(this.trueExpr,r,e&&e.implicit);("all"===r||"OperatorNode"===this.trueExpr.type||null!==o&&o<=t)&&(a="("+a+")");var s=this.falseExpr.toString(e),u=tb(this.falseExpr,r,e&&e.implicit);return("all"===r||"OperatorNode"===this.falseExpr.type||null!==u&&u<=t)&&(s="("+s+")"),n+" ? "+a+" : "+s}toJSON(){return{mathjs:wb,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(e){return new t(e.condition,e.trueExpr,e.falseExpr)}toHTML(e){var r=e&&e.parenthesis?e.parenthesis:"keep",t=tb(this,r,e&&e.implicit),n=this.condition.toHTML(e),i=tb(this.condition,r,e&&e.implicit);("all"===r||"OperatorNode"===this.condition.type||null!==i&&i<=t)&&(n='('+n+')');var a=this.trueExpr.toHTML(e),o=tb(this.trueExpr,r,e&&e.implicit);("all"===r||"OperatorNode"===this.trueExpr.type||null!==o&&o<=t)&&(a='('+a+')');var s=this.falseExpr.toHTML(e),u=tb(this.falseExpr,r,e&&e.implicit);return("all"===r||"OperatorNode"===this.falseExpr.type||null!==u&&u<=t)&&(s='('+s+')'),n+'?'+a+':'+s}_toTex(e){return"\\begin{cases} {"+this.trueExpr.toTex(e)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(e)+"}\\\\{"+this.falseExpr.toTex(e)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return(0,Xd.Z)(t,"name",wb),t}),{isClass:!0,isNode:!0}),Eb="ConstantNode",Ab=Gr(Eb,["Node"],(e=>{var{Node:r}=e;class t extends r{constructor(e){super(),this.value=e}get type(){return Eb}get isConstantNode(){return!0}_compile(e,r){var t=this.value;return function(){return t}}forEach(e){}map(e){return this.clone()}clone(){return new t(this.value)}_toString(e){return ii(this.value,e)}toHTML(e){var r=this._toString(e);switch(G(this.value)){case"number":case"BigNumber":case"Fraction":return''+r+"";case"string":return''+r+"";case"boolean":return''+r+"";case"null":return''+r+"";case"undefined":return''+r+"";default:return''+r+""}}toJSON(){return{mathjs:Eb,value:this.value}}static fromJSON(e){return new t(e.value)}_toTex(e){var r=this._toString(e);switch(G(this.value)){case"string":return"\\mathtt{"+lb(r)+"}";case"number":case"BigNumber":if(!isFinite(this.value))return this.value.valueOf()<0?"-\\infty":"\\infty";var t=r.toLowerCase().indexOf("e");return-1!==t?r.substring(0,t)+"\\cdot10^{"+r.substring(t+1)+"}":r;case"Fraction":return this.value.toLatex();default:return r}}}return(0,Xd.Z)(t,"name",Eb),t}),{isClass:!0,isNode:!0}),Sb="RangeNode",Cb=Gr(Sb,["Node"],(e=>{var{Node:r}=e;function t(e,r,t){var n=tb(e,r,t),i={},a=tb(e.start,r,t);if(i.start=null!==a&&a<=n||"all"===r,e.step){var o=tb(e.step,r,t);i.step=null!==o&&o<=n||"all"===r}var s=tb(e.end,r,t);return i.end=null!==s&&s<=n||"all"===r,i}class n extends r{constructor(e,r,t){if(super(),!R(e))throw new TypeError("Node expected");if(!R(r))throw new TypeError("Node expected");if(t&&!R(t))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=e,this.end=r,this.step=t||null}get type(){return Sb}get isRangeNode(){return!0}needsEnd(){return this.filter((function(e){return Z(e)&&"end"===e.name})).length>0}_compile(e,r){var t=e.range,n=this.start._compile(e,r),i=this.end._compile(e,r);if(this.step){var a=this.step._compile(e,r);return function(e,r,o){return t(n(e,r,o),i(e,r,o),a(e,r,o))}}return function(e,r,a){return t(n(e,r,a),i(e,r,a))}}forEach(e){e(this.start,"start",this),e(this.end,"end",this),this.step&&e(this.step,"step",this)}map(e){return new n(this._ifNode(e(this.start,"start",this)),this._ifNode(e(this.end,"end",this)),this.step&&this._ifNode(e(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(e){var r,n=t(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),i=this.start.toString(e);if(n.start&&(i="("+i+")"),r=i,this.step){var a=this.step.toString(e);n.step&&(a="("+a+")"),r+=":"+a}var o=this.end.toString(e);return n.end&&(o="("+o+")"),r+":"+o}toJSON(){return{mathjs:Sb,start:this.start,end:this.end,step:this.step}}static fromJSON(e){return new n(e.start,e.end,e.step)}toHTML(e){var r,n=t(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),i=this.start.toHTML(e);if(n.start&&(i='('+i+')'),r=i,this.step){var a=this.step.toHTML(e);n.step&&(a='('+a+')'),r+=':'+a}var o=this.end.toHTML(e);return n.end&&(o='('+o+')'),r+':'+o}_toTex(e){var r=t(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),n=this.start.toTex(e);if(r.start&&(n="\\left(".concat(n,"\\right)")),this.step){var i=this.step.toTex(e);r.step&&(i="\\left(".concat(i,"\\right)")),n+=":"+i}var a=this.end.toTex(e);return r.end&&(a="\\left(".concat(a,"\\right)")),n+":"+a}}return(0,Xd.Z)(n,"name",Sb),n}),{isClass:!0,isNode:!0}),Mb=Gr("reviver",["classes"],(e=>{var{classes:r}=e;return function(e,t){var n=r[t&&t.mathjs];return n&&"function"==typeof n.fromJSON?n.fromJSON(t):t}})),Fb=Gr("Chain",["?on","math","typed"],(e=>{var{on:r,math:t,typed:n}=e;function i(e){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");$(e)?this.value=e.value:this.value=e}function a(e,r){ee(i.prototype,e,(function(){var e=r();if("function"==typeof e)return o(e)}))}function o(e){return function(){if(0===arguments.length)return new i(e(this.value));for(var r=[this.value],t=0;te[r]))};for(var n in e)t(n)}var u,c};var s={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return i.createProxy(t),r&&r("import",(function(e,r,t){t||a(e,r)})),i}),{isClass:!0}),Tb="FunctionAssignmentNode",Bb=Gr(Tb,["typed","Node"],(e=>{var{typed:r,Node:t}=e;function n(e,r,t){var n=tb(e,r,t),i=tb(e.expr,r,t);return"all"===r||null!==i&&i<=n}class i extends t{constructor(e,r,t){if(super(),"string"!=typeof e)throw new TypeError('String expected for parameter "name"');if(!Array.isArray(r))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!R(t))throw new TypeError('Node expected for parameter "expr"');if(JD.has(e))throw new Error('Illegal function name, "'+e+'" is a reserved keyword');var n=new Set;for(var i of r){var a="string"==typeof i?i:i.name;if(n.has(a))throw new Error('Duplicate parameter name "'.concat(a,'"'));n.add(a)}this.name=e,this.params=r.map((function(e){return e&&e.name||e})),this.types=r.map((function(e){return e&&e.type||"any"})),this.expr=t}get type(){return Tb}get isFunctionAssignmentNode(){return!0}_compile(e,t){var n=Object.create(t);Si(this.params,(function(e){n[e]=!0}));var i=this.expr._compile(e,n),a=this.name,o=this.params,s=Fi(this.types,","),u=a+"("+Fi(this.params,", ")+")";return function(e,t,n){var c={};c[s]=function(){for(var r=Object.create(t),a=0;a'+oi(this.params[i])+"");var a=this.expr.toHTML(e);return n(this,r,e&&e.implicit)&&(a='('+a+')'),''+oi(this.name)+'('+t.join(',')+')='+a}_toTex(e){var r=e&&e.parenthesis?e.parenthesis:"keep",t=this.expr.toTex(e);return n(this,r,e&&e.implicit)&&(t="\\left(".concat(t,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(pb).join(",")+"\\right):="+t}}return(0,Xd.Z)(i,"name",Tb),i}),{isClass:!0,isNode:!0}),Ob="chain",_b=Gr(Ob,["typed","Chain"],(e=>{var{typed:r,Chain:t}=e;return r(Ob,{"":function(){return new t},any:function(e){return new t(e)}})}));function qb(e){return e&&e.isIndexError?new li(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e}function Ib(e){var{subset:r}=e;return function(e,t){try{if(Array.isArray(e))return r(e,t);if(e&&"function"==typeof e.subset)return e.subset(t);if("string"==typeof e)return r(e,t);if("object"==typeof e){if(!t.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return ki(e,t.getObjectProperty())}throw new TypeError("Cannot apply index: unsupported type of object")}catch(e){throw qb(e)}}}var zb="AccessorNode",kb=Gr(zb,["subset","Node"],(e=>{var{subset:r,Node:t}=e,n=Ib({subset:r});function i(e){return!(M(e)||F(e)||_(e)||z(e)||P(e)||j(e)||Z(e))}class a extends t{constructor(e,r){if(super(),!R(e))throw new TypeError('Node expected for parameter "object"');if(!k(r))throw new TypeError('IndexNode expected for parameter "index"');this.object=e,this.index=r}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return zb}get isAccessorNode(){return!0}_compile(e,r){var t=this.object._compile(e,r),i=this.index._compile(e,r);if(this.index.isObjectProperty()){var a=this.index.getObjectProperty();return function(e,r,n){return ki(t(e,r,n),a)}}return function(e,r,a){var o=t(e,r,a),s=i(e,r,o);return n(o,s)}}forEach(e){e(this.object,"object",this),e(this.index,"index",this)}map(e){return new a(this._ifNode(e(this.object,"object",this)),this._ifNode(e(this.index,"index",this)))}clone(){return new a(this.object,this.index)}_toString(e){var r=this.object.toString(e);return i(this.object)&&(r="("+r+")"),r+this.index.toString(e)}toHTML(e){var r=this.object.toHTML(e);return i(this.object)&&(r='('+r+')'),r+this.index.toHTML(e)}_toTex(e){var r=this.object.toTex(e);return i(this.object)&&(r="\\left(' + object + '\\right)"),r+this.index.toTex(e)}toJSON(){return{mathjs:zb,object:this.object,index:this.index}}static fromJSON(e){return new a(e.object,e.index)}}return(0,Xd.Z)(a,"name",zb),a}),{isClass:!0,isNode:!0}),Rb="IndexNode",Pb=Gr(Rb,["Node","size"],(e=>{var{Node:r,size:t}=e;class n extends r{constructor(e,r){if(super(),this.dimensions=e,this.dotNotation=r||!1,!Array.isArray(e)||!e.every(R))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 Rb}get isIndexNode(){return!0}_compile(e,r){var n=Ai(this.dimensions,(function(n,i){if(n.filter((e=>e.isSymbolNode&&"end"===e.name)).length>0){var a=Object.create(r);a.end=!0;var o=n._compile(e,a);return function(e,r,n){if(!d(n)&&!f(n)&&!p(n))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+G(n));var a=t(n).valueOf(),s=Object.create(r);return s.end=a[i],o(e,s,n)}}return n._compile(e,r)})),i=ki(e,"index");return function(e,r,t){var a=Ai(n,(function(n){return n(e,r,t)}));return i(...a)}}forEach(e){for(var r=0;r.'+oi(this.getObjectProperty())+"":'['+r.join(',')+']'}_toTex(e){var r=this.dimensions.map((function(r){return r.toTex(e)}));return this.dotNotation?"."+this.getObjectProperty():"_{"+r.join(",")+"}"}}return(0,Xd.Z)(n,"name",Rb),n}),{isClass:!0,isNode:!0}),Ub="AssignmentNode",jb=Gr(Ub,["subset","?matrix","Node"],(e=>{var{subset:r,matrix:t,Node:n}=e,i=Ib({subset:r}),a=function(e){var{subset:r,matrix:t}=e;return function(e,n,i){try{if(Array.isArray(e))return t(e).subset(n,i).valueOf();if(e&&"function"==typeof e.subset)return e.subset(n,i);if("string"==typeof e)return r(e,n,i);if("object"==typeof e){if(!n.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return Ri(e,n.getObjectProperty(),i),e}throw new TypeError("Cannot apply index: unsupported type of object")}catch(e){throw qb(e)}}}({subset:r,matrix:t});function o(e,r,t){r||(r="keep");var n=tb(e,r,t),i=tb(e.value,r,t);return"all"===r||null!==i&&i<=n}class s extends n{constructor(e,r,t){if(super(),this.object=e,this.index=t?r:null,this.value=t||r,!Z(e)&&!M(e))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(Z(e)&&"end"===e.name)throw new Error('Cannot assign to symbol "end"');if(this.index&&!k(this.index))throw new TypeError('IndexNode expected as "index"');if(!R(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 Ub}get isAssignmentNode(){return!0}_compile(e,r){var t=this.object._compile(e,r),n=this.index?this.index._compile(e,r):null,o=this.value._compile(e,r),s=this.object.name;if(this.index){if(this.index.isObjectProperty()){var u=this.index.getObjectProperty();return function(e,r,n){var i=t(e,r,n),a=o(e,r,n);return Ri(i,u,a),a}}if(Z(this.object))return function(e,r,i){var u=t(e,r,i),c=o(e,r,i),l=n(e,r,u);return e.set(s,a(u,l,c)),c};var c=this.object.object._compile(e,r);if(this.object.index.isObjectProperty()){var l=this.object.index.getObjectProperty();return function(e,r,t){var i=c(e,r,t),s=ki(i,l),u=n(e,r,s),p=o(e,r,t);return Ri(i,l,a(s,u,p)),p}}var p=this.object.index._compile(e,r);return function(e,r,t){var s=c(e,r,t),u=p(e,r,s),l=i(s,u),f=n(e,r,l),d=o(e,r,t);return a(s,u,a(l,f,d)),d}}if(!Z(this.object))throw new TypeError("SymbolNode expected as object");return function(e,r,t){var n=o(e,r,t);return e.set(s,n),n}}forEach(e){e(this.object,"object",this),this.index&&e(this.index,"index",this),e(this.value,"value",this)}map(e){var r=this._ifNode(e(this.object,"object",this)),t=this.index?this._ifNode(e(this.index,"index",this)):null,n=this._ifNode(e(this.value,"value",this));return new s(r,t,n)}clone(){return new s(this.object,this.index,this.value)}_toString(e){var r=this.object.toString(e),t=this.index?this.index.toString(e):"",n=this.value.toString(e);return o(this,e&&e.parenthesis,e&&e.implicit)&&(n="("+n+")"),r+t+" = "+n}toJSON(){return{mathjs:Ub,object:this.object,index:this.index,value:this.value}}static fromJSON(e){return new s(e.object,e.index,e.value)}toHTML(e){var r=this.object.toHTML(e),t=this.index?this.index.toHTML(e):"",n=this.value.toHTML(e);return o(this,e&&e.parenthesis,e&&e.implicit)&&(n='('+n+')'),r+t+'='+n}_toTex(e){var r=this.object.toTex(e),t=this.index?this.index.toTex(e):"",n=this.value.toTex(e);return o(this,e&&e.parenthesis,e&&e.implicit)&&(n="\\left(".concat(n,"\\right)")),r+t+":="+n}}return(0,Xd.Z)(s,"name",Ub),s}),{isClass:!0,isNode:!0}),Lb=Gr("SymbolNode",["math","?Unit","Node"],(e=>{var{math:r,Unit:t,Node:n}=e;function i(e){return!!t&&t.isValuelessUnit(e)}class a extends n{constructor(e){if(super(),"string"!=typeof e)throw new TypeError('String expected for parameter "name"');this.name=e}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(e,r){var n=this.name;if(!0===r[n])return function(e,r,t){return ki(r,n)};if(n in e)return function(r,t,i){return r.has(n)?r.get(n):ki(e,n)};var o=i(n);return function(e,r,i){return e.has(n)?e.get(n):o?new t(null,n):a.onUndefinedSymbol(n)}}forEach(e){}map(e){return this.clone()}static onUndefinedSymbol(e){throw new Error("Undefined symbol "+e)}clone(){return new a(this.name)}_toString(e){return this.name}toHTML(e){var r=oi(this.name);return"true"===r||"false"===r?''+r+"":"i"===r?''+r+"":"Infinity"===r?''+r+"":"NaN"===r?''+r+"":"null"===r?''+r+"":"undefined"===r?''+r+"":''+r+""}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(e){return new a(e.name)}_toTex(e){var t=!1;void 0===r[this.name]&&i(this.name)&&(t=!0);var n=pb(this.name,t);return"\\"===n[0]?n:" "+n}}return a}),{isClass:!0,isNode:!0});function Hb(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n{var{math:r,Node:t,SymbolNode:n}=e,i=e=>ii(e,{truncate:78});function a(e,r,t){for(var n,i="",a=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,o=0;null!==(n=a.exec(e));)if(i+=e.substring(o,n.index),o=n.index,"$$"===n[0])i+="$",o++;else{o+=n[0].length;var s=r[n[1]];if(!s)throw new ReferenceError("Template: Property "+n[1]+" does not exist.");if(void 0===n[2])switch(typeof s){case"string":i+=s;break;case"object":if(R(s))i+=s.toTex(t);else{if(!Array.isArray(s))throw new TypeError("Template: "+n[1]+" has to be a Node, String or array of Nodes");i+=s.map((function(e,r){if(R(e))return e.toTex(t);throw new TypeError("Template: "+n[1]+"["+r+"] is not a Node.")})).join(",")}break;default:throw new TypeError("Template: "+n[1]+" has to be a Node, String or array of Nodes")}else{if(!R(s[n[2]]&&s[n[2]]))throw new TypeError("Template: "+n[1]+"["+n[2]+"] is not a Node.");i+=s[n[2]].toTex(t)}}return i+e.slice(o)}class o extends t{constructor(e,r){if(super(),"string"==typeof e&&(e=new n(e)),!R(e))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(r)||!r.every(R))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=e,this.args=r||[]}get name(){return this.fn.name||""}get type(){return Zb}get isFunctionNode(){return!0}_compile(e,r){var t=this.args.map((t=>t._compile(e,r)));if(!Z(this.fn)){if(M(this.fn)&&k(this.fn.index)&&this.fn.index.isObjectProperty()){var n=this.fn.object._compile(e,r),a=this.fn.index.getObjectProperty(),s=this.args;return function(r,i,o){var u=n(r,i,o),c=function(e,r){if(!Ui(e,r))throw new Error('No access to method "'+r+'"');return e[r]}(u,a);if(null!=c&&c.rawArgs)return c(s,e,Hb(r,i),r);var l=t.map((e=>e(r,i,o)));return c.apply(u,l)}}var u=this.fn.toString(),c=this.fn._compile(e,r),l=this.args;return function(r,n,a){var o=c(r,n,a);if("function"!=typeof o)throw new TypeError("Expression '".concat(u,"' did not evaluate to a function; value is:")+"\n ".concat(i(o)));if(o.rawArgs)return o(l,e,Hb(r,n),r);var s=t.map((e=>e(r,n,a)));return o.apply(o,s)}}var p=this.fn.name;if(r[p]){var f=this.args;return function(r,n,a){var o=ki(n,p);if("function"!=typeof o)throw new TypeError("Argument '".concat(p,"' was not a function; received: ").concat(i(o)));if(o.rawArgs)return o(f,e,Hb(r,n),r);var s=t.map((e=>e(r,n,a)));return o.apply(o,s)}}var d=p in e?ki(e,p):void 0,m="function"==typeof d&&!0===d.rawArgs,h=r=>{var t;if(r.has(p))t=r.get(p);else{if(!(p in e))return o.onUndefinedFunction(p);t=ki(e,p)}if("function"==typeof t)return t;throw new TypeError("'".concat(p,"' is not a function; its value is:\n ").concat(i(t)))};if(m){var g=this.args;return function(r,t,n){return h(r)(g,e,Hb(r,t),r)}}switch(t.length){case 0:return function(e,r,t){return h(e)()};case 1:return function(e,r,n){return h(e)((0,t[0])(e,r,n))};case 2:return function(e,r,n){var i=h(e),a=t[0],o=t[1];return i(a(e,r,n),o(e,r,n))};default:return function(e,r,n){return h(e)(...t.map((t=>t(e,r,n))))}}}forEach(e){e(this.fn,"fn",this);for(var r=0;r'+oi(this.fn)+'('+r.join(',')+')'}toTex(e){var r;return e&&"object"==typeof e.handler&&re(e.handler,this.name)&&(r=e.handler[this.name](this,e)),void 0!==r?r:super.toTex(e)}_toTex(e){var t,n,i=this.args.map((function(r){return r.toTex(e)}));switch(ub[this.name]&&(t=ub[this.name]),!r[this.name]||"function"!=typeof r[this.name].toTex&&"object"!=typeof r[this.name].toTex&&"string"!=typeof r[this.name].toTex||(t=r[this.name].toTex),typeof t){case"function":n=t(this,e);break;case"string":n=a(t,this,e);break;case"object":switch(typeof t[i.length]){case"function":n=t[i.length](this,e);break;case"string":n=a(t[i.length],this,e)}}return void 0!==n?n:a("\\mathrm{${name}}\\left(${args}\\right)",this,e)}getIdentifier(){return this.type+":"+this.name}}return(0,Xd.Z)(o,"name",Zb),(0,Xd.Z)(o,"onUndefinedFunction",(function(e){throw new Error("Undefined function "+e)})),(0,Xd.Z)(o,"fromJSON",(function(e){return new o(e.fn,e.args)})),o}),{isClass:!0,isNode:!0}),Gb="parse",Vb=Gr(Gb,["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],(e=>{var{typed:r,numeric:t,config:n,AccessorNode:a,ArrayNode:o,AssignmentNode:s,BlockNode:u,ConditionalNode:c,ConstantNode:l,FunctionAssignmentNode:p,FunctionNode:f,IndexNode:d,ObjectNode:m,OperatorNode:h,ParenthesisNode:g,RangeNode:y,RelationalNode:v,SymbolNode:x}=e,D=r(Gb,{string:function(e){return j(e,{})},"Array | Matrix":function(e){return b(e,{})},"string, Object":function(e,r){return j(e,void 0!==r.nodes?r.nodes:{})},"Array | Matrix, Object":b});function b(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=void 0!==r.nodes?r.nodes:{};return na(e,(function(e){if("string"!=typeof e)throw new TypeError("String expected");return j(e,t)}))}var w={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},N={",":!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},E={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},A={true:!0,false:!1,null:null,undefined:void 0},S=["NaN","Infinity"];function C(e,r){return e.expression.substr(e.index,r)}function F(e){return C(e,1)}function T(e){e.index++}function B(e){return e.expression.charAt(e.index-1)}function O(e){return e.expression.charAt(e.index+1)}function I(e){for(e.tokenType=w.NULL,e.token="",e.comment="";;){if("#"===F(e))for(;"\n"!==F(e)&&""!==F(e);)e.comment+=F(e),T(e);if(!D.isWhitespace(F(e),e.nestingLevel))break;T(e)}if(""!==F(e)){if("\n"===F(e)&&!e.nestingLevel)return e.tokenType=w.DELIMITER,e.token=F(e),void T(e);var r=F(e),t=C(e,2),n=C(e,3);if(3===n.length&&N[n])return e.tokenType=w.DELIMITER,e.token=n,T(e),T(e),void T(e);if(2===t.length&&N[t])return e.tokenType=w.DELIMITER,e.token=t,T(e),void T(e);if(N[r])return e.tokenType=w.DELIMITER,e.token=r,void T(e);if(D.isDigitDot(r)){e.tokenType=w.NUMBER;var i=C(e,2);if("0b"===i||"0o"===i||"0x"===i){for(e.token+=F(e),T(e),e.token+=F(e),T(e);D.isHexDigit(F(e));)e.token+=F(e),T(e);if("."===F(e))for(e.token+=".",T(e);D.isHexDigit(F(e));)e.token+=F(e),T(e);else if("i"===F(e))for(e.token+="i",T(e);D.isDigit(F(e));)e.token+=F(e),T(e);return}if("."===F(e)){if(e.token+=F(e),T(e),!D.isDigit(F(e)))return void(e.tokenType=w.DELIMITER)}else{for(;D.isDigit(F(e));)e.token+=F(e),T(e);D.isDecimalMark(F(e),O(e))&&(e.token+=F(e),T(e))}for(;D.isDigit(F(e));)e.token+=F(e),T(e);if("E"===F(e)||"e"===F(e))if(D.isDigit(O(e))||"-"===O(e)||"+"===O(e)){if(e.token+=F(e),T(e),"+"!==F(e)&&"-"!==F(e)||(e.token+=F(e),T(e)),!D.isDigit(F(e)))throw pe(e,'Digit expected, got "'+F(e)+'"');for(;D.isDigit(F(e));)e.token+=F(e),T(e);if(D.isDecimalMark(F(e),O(e)))throw pe(e,'Digit expected, got "'+F(e)+'"')}else if("."===O(e))throw T(e),pe(e,'Digit expected, got "'+F(e)+'"')}else{if(!D.isAlpha(F(e),B(e),O(e))){for(e.tokenType=w.UNKNOWN;""!==F(e);)e.token+=F(e),T(e);throw pe(e,'Syntax error in part "'+e.token+'"')}for(;D.isAlpha(F(e),B(e),O(e))||D.isDigit(F(e));)e.token+=F(e),T(e);re(E,e.token)?e.tokenType=w.DELIMITER:e.tokenType=w.SYMBOL}}else e.tokenType=w.DELIMITER}function k(e){do{I(e)}while("\n"===e.token)}function R(e){e.nestingLevel++}function P(e){e.nestingLevel--}function j(e,r){var t={extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:w.NULL,nestingLevel:0,conditionalLevel:null};(0,i.Z)(t,{expression:e,extraNodes:r}),I(t);var n=function(e){var r,t,n=[];for(""!==e.token&&"\n"!==e.token&&";"!==e.token&&(r=L(e),e.comment&&(r.comment=e.comment));"\n"===e.token||";"===e.token;)0===n.length&&r&&(t=";"!==e.token,n.push({node:r,visible:t})),I(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&(r=L(e),e.comment&&(r.comment=e.comment),t=";"!==e.token,n.push({node:r,visible:t}));return n.length>0?new u(n):(r||(r=new l(void 0),e.comment&&(r.comment=e.comment)),r)}(t);if(""!==t.token)throw t.tokenType===w.DELIMITER?fe(t,"Unexpected operator "+t.token):pe(t,'Unexpected part "'+t.token+'"');return n}function L(e){var r,t,n,i,a=function(e){for(var r=function(e){for(var r=H(e);"or"===e.token;)k(e),r=new h("or","or",[r,H(e)]);return r}(e);"?"===e.token;){var t=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,k(e);var n=r,i=L(e);if(":"!==e.token)throw pe(e,"False part of conditional expression expected");e.conditionalLevel=null,k(e);var a=L(e);r=new c(n,i,a),e.conditionalLevel=t}return r}(e);if("="===e.token){if(Z(a))return r=a.name,k(e),n=L(e),new s(new x(r),n);if(M(a))return k(e),n=L(e),new s(a.object,a.index,n);if(z(a)&&Z(a.fn)&&(i=!0,t=[],r=a.name,a.args.forEach((function(e,r){Z(e)?t[r]=e.name:i=!1})),i))return k(e),n=L(e),new p(r,t,n);throw pe(e,"Invalid left hand side of assignment operator =")}return a}function H(e){for(var r=$(e);"xor"===e.token;)k(e),r=new h("xor","xor",[r,$(e)]);return r}function $(e){for(var r=G(e);"and"===e.token;)k(e),r=new h("and","and",[r,G(e)]);return r}function G(e){for(var r=V(e);"|"===e.token;)k(e),r=new h("|","bitOr",[r,V(e)]);return r}function V(e){for(var r=W(e);"^|"===e.token;)k(e),r=new h("^|","bitXor",[r,W(e)]);return r}function W(e){for(var r=Y(e);"&"===e.token;)k(e),r=new h("&","bitAnd",[r,Y(e)]);return r}function Y(e){for(var r=[J(e)],t=[],n={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};re(n,e.token);){var i={name:e.token,fn:n[e.token]};t.push(i),k(e),r.push(J(e))}return 1===r.length?r[0]:2===r.length?new h(t[0].name,t[0].fn,r):new v(t.map((e=>e.fn)),r)}function J(e){var r,t,n,i;r=Q(e);for(var a={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};re(a,e.token);)n=a[t=e.token],k(e),i=[r,Q(e)],r=new h(t,n,i);return r}function Q(e){var r,t,n,i;r=X(e);for(var a={to:"to",in:"to"};re(a,e.token);)n=a[t=e.token],k(e),"in"===t&&""===e.token?r=new h("*","multiply",[r,new x("in")],!0):(i=[r,X(e)],r=new h(t,n,i));return r}function X(e){var r,t=[];if(r=":"===e.token?new l(1):K(e),":"===e.token&&e.conditionalLevel!==e.nestingLevel){for(t.push(r);":"===e.token&&t.length<3;)k(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?t.push(new x("end")):t.push(K(e));r=3===t.length?new y(t[0],t[2],t[1]):new y(t[0],t[1])}return r}function K(e){var r,t,n,i;r=ee(e);for(var a={"+":"add","-":"subtract"};re(a,e.token);){n=a[t=e.token],k(e);var o=ee(e);i=o.isPercentage?[r,new h("*","multiply",[r,o])]:[r,o],r=new h(t,n,i)}return r}function ee(e){var r,t,n,i;t=r=te(e);for(var a={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};re(a,e.token);)i=a[n=e.token],k(e),t=te(e),r=new h(n,i,[r,t]);return r}function te(e){var r,t;for(t=r=ne(e);e.tokenType===w.SYMBOL||"in"===e.token&&_(r)||!(e.tokenType!==w.NUMBER||_(t)||U(t)&&"!"!==t.op)||"("===e.token;)t=ne(e),r=new h("*","multiply",[r,t],!0);return r}function ne(e){for(var r=ie(e),t=r,n=[];"/"===e.token&&q(t);){if(n.push((0,i.Z)({},e)),k(e),e.tokenType!==w.NUMBER){(0,i.Z)(e,n.pop());break}if(n.push((0,i.Z)({},e)),k(e),e.tokenType!==w.SYMBOL&&"("!==e.token){n.pop(),(0,i.Z)(e,n.pop());break}(0,i.Z)(e,n.pop()),n.pop(),t=ie(e),r=new h("/","divide",[r,t])}return r}function ie(e){var r,t,n,i;r=ae(e);for(var a={"%":"mod",mod:"mod"};re(a,e.token);)n=a[t=e.token],k(e),"%"===t&&e.tokenType===w.DELIMITER&&"("!==e.token?r=new h("/","divide",[r,new l(100)],!1,!0):(i=[r,ae(e)],r=new h(t,n,i));return r}function ae(e){var r,i,a,s={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return re(s,e.token)?(a=s[e.token],r=e.token,k(e),i=[ae(e)],new h(r,a,i)):function(e){var r,i,a,s;return r=function(e){var r,i,a;r=function(e){var r=[];if(e.tokenType===w.SYMBOL&&re(e.extraNodes,e.token)){var i=e.extraNodes[e.token];if(I(e),"("===e.token){if(r=[],R(e),I(e),")"!==e.token)for(r.push(L(e));","===e.token;)I(e),r.push(L(e));if(")"!==e.token)throw pe(e,"Parenthesis ) expected");P(e),I(e)}return new i(r)}return function(e){var r;return e.tokenType===w.SYMBOL||e.tokenType===w.DELIMITER&&e.token in E?(r=e.token,I(e),oe(e,re(A,r)?new l(A[r]):-1!==S.indexOf(r)?new l(t(r,"number")):new x(r))):function(e){var r;return'"'===e.token?(r=se(e),oe(e,new l(r))):function(e){var r;return"'"===e.token?(r=ue(e),oe(e,new l(r))):function(e){var r,i,a,s;if("["===e.token){if(R(e),I(e),"]"!==e.token){var u=ce(e);if(";"===e.token){for(a=1,i=[u];";"===e.token;)I(e),i[a]=ce(e),a++;if("]"!==e.token)throw pe(e,"End of matrix ] expected");P(e),I(e),s=i[0].items.length;for(var c=1;c0},D.isDecimalMark=function(e,r){return"."===e&&"/"!==r&&"*"!==r&&"^"!==r},D.isDigitDot=function(e){return e>="0"&&e<="9"||"."===e},D.isDigit=function(e){return e>="0"&&e<="9"},D.isHexDigit=function(e){return e>="0"&&e<="9"||e>="a"&&e<="f"||e>="A"&&e<="F"},r.addConversion({from:"string",to:"Node",convert:D}),D})),Wb=Gr("resolve",["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],(e=>{var{typed:r,parse:t,ConstantNode:n,FunctionNode:i,OperatorNode:a,ParenthesisNode:o}=e;function s(e,r){var u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;if(!r)return e;if(Z(e)){if(u.has(e.name)){var c=Array.from(u).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(c,"}"))}var l=r.get(e.name);if(R(l)){var p=new Set(u);return p.add(e.name),s(l,r,p)}return"number"==typeof l?t(String(l)):void 0!==l?new n(l):e}if(U(e)){var f=e.args.map((function(e){return s(e,r,u)}));return new a(e.op,e.fn,f,e.implicit)}if(j(e))return new o(s(e.content,r,u));if(z(e)){var d=e.args.map((function(e){return s(e,r,u)}));return new i(e.name,d)}return e.map((e=>s(e,r,u)))}return r("resolve",{Node:s,"Node, Map | null | undefined":s,"Node, Object":(e,r)=>s(e,Gi(r)),"Array | Matrix":r.referToSelf((e=>r=>r.map((r=>e(r))))),"Array | Matrix, null | undefined":r.referToSelf((e=>r=>r.map((r=>e(r))))),"Array, Object":r.referTo("Array,Map",(e=>(r,t)=>e(r,Gi(t)))),"Matrix, Object":r.referTo("Matrix,Map",(e=>(r,t)=>e(r,Gi(t)))),"Array | Matrix, Map":r.referToSelf((e=>(r,t)=>r.map((r=>e(r,t)))))})}));function Yb(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function Jb(e){for(var r=1;r{var{FunctionNode:r,OperatorNode:t,SymbolNode:n}=e,i=!0,a=!1,o="defaultF",s={add:{trivial:i,total:i,commutative:i,associative:i},unaryPlus:{trivial:i,total:i,commutative:i,associative:i},subtract:{trivial:a,total:i,commutative:a,associative:a},multiply:{trivial:i,total:i,commutative:i,associative:i},divide:{trivial:a,total:i,commutative:a,associative:a},paren:{trivial:i,total:i,commutative:i,associative:a},defaultF:{trivial:a,total:i,commutative:a,associative:a}};function u(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:s,n=o;if("string"==typeof e?n=e:U(e)?n=e.fn.toString():z(e)?n=e.name:j(e)&&(n="paren"),re(t,n)){var i=t[n];if(re(i,r))return i[r];if(re(s,n))return s[n][r]}if(re(t,o)){var a=t[o];return re(a,r)?a[r]:s[o][r]}if(re(s,n)){var u=s[n];if(re(u,r))return u[r]}return s[o][r]}function c(e){return u(e,"associative",arguments.length>1&&void 0!==arguments[1]?arguments[1]:s)}function l(e,r){var t,n=[];return c(e,r)?(t=e.op,function e(r){for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:s)},isAssociative:c,mergeContext:function(e,r){var t=Jb({},e);for(var n in r)re(e,n)?t[n]=Jb(Jb({},r[n]),e[n]):t[n]=r[n];return t},flatten:function e(r,t){if(!r.args||0===r.args.length)return r;r.args=l(r,t);for(var n=0;n2&&c(r,t)){for(var o=r.args.pop();r.args.length>0;)o=n([r.args.pop(),o]);r.args=o.args}}},unflattenl:function e(r,t){if(r.args&&0!==r.args.length){for(var n=p(r),i=r.args.length,a=0;a2&&c(r,t)){for(var o=r.args.shift();r.args.length>0;)o=n([o,r.args.shift()]);r.args=o.args}}},defaultContext:s,realContext:{divide:{total:a},log:{total:a}},positiveContext:{subtract:{total:a},abs:{trivial:i},log:{total:i}}}})),Xb=Gr("simplifyConstant",["typed","config","mathWithTransform","matrix","?fraction","?bignumber","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode"],(e=>{var{typed:r,config:t,mathWithTransform:n,matrix:i,fraction:a,bignumber:o,AccessorNode:s,ArrayNode:u,ConstantNode:l,FunctionNode:p,IndexNode:f,ObjectNode:m,OperatorNode:h,SymbolNode:g}=e,{isCommutative:y,isAssociative:v,allChildren:x,createMakeNodeFunction:D}=Qb({FunctionNode:p,OperatorNode:h,SymbolNode:g}),b=r("simplifyConstant",{Node:e=>A(B(e,{})),"Node, Object":function(e,r){return A(B(e,r))}});function w(e){return c(e)?e.valueOf():e instanceof Array?e.map(w):d(e)?i(w(e.valueOf())):e}function N(e,r,t){try{return n[e].apply(null,r)}catch(i){return r=r.map(w),C(n[e].apply(null,r),t)}}var E=r({Fraction:function(e){var r,t=e.s*e.n;return r=t<0?new h("-","unaryMinus",[new l(-t)]):new l(t),1===e.d?r:new h("/","divide",[r,new l(e.d)])},number:function(e){return e<0?M(new l(-e)):new l(e)},BigNumber:function(e){return e<0?M(new l(-e)):new l(e)},Complex:function(e){throw new Error("Cannot convert Complex number to Node")},string:function(e){return new l(e)},Matrix:function(e){return new u(e.valueOf().map((e=>E(e))))}});function A(e){return R(e)?e:E(e)}function S(e,r){if(r&&!1!==r.exactFractions&&isFinite(e)&&a){var t=a(e),n=r&&"number"==typeof r.fractionsLimit?r.fractionsLimit:1/0;if(t.valueOf()===e&&t.n{if(!R(i)){var a=r.pop();if(R(a))return[a,i];try{return r.push(N(e,[a,i],n)),r}catch(e){r.push(a)}}r.push(A(r.pop()));var o=1===r.length?r[0]:t(r);return[t([o,A(i)])]}),[i]);return 1===a.length?a[0]:t([a[0],E(a[1])])}function B(e,r){switch(e.type){case"SymbolNode":return e;case"ConstantNode":switch(typeof e.value){case"number":return C(e.value,r);case"string":return e.value;default:if(!isNaN(e.value))return C(e.value,r)}return e;case"FunctionNode":if(n[e.name]&&n[e.name].rawArgs)return e;if(-1===["add","multiply"].indexOf(e.name)){var t=e.args.map((e=>B(e,r)));if(!t.some(R))try{return N(e.name,t,r)}catch(e){}if("size"===e.name&&1===t.length&&F(t[0])){for(var a=[],o=t[0];F(o);)a.push(o.items.length),o=o.items[0];return i(a)}return new p(e.name,t.map(A))}case"OperatorNode":var c,h,g=e.fn.toString(),w=D(e);if(U(e)&&e.isUnary())h=R((c=[B(e.args[0],r)])[0])?w(c):N(g,c,r);else if(v(e,r.context))if(c=(c=x(e,r.context)).map((e=>B(e,r))),y(g,r.context)){for(var E=[],S=[],M=0;M1?(h=T(g,E,w,r),S.unshift(h),h=T(g,S,w,r)):h=T(g,c,w,r)}else h=T(g,c,w,r);else c=e.args.map((e=>B(e,r))),h=T(g,c,w,r);return h;case"ParenthesisNode":return B(e.content,r);case"AccessorNode":return function(e,r,t){if(!k(r))return new s(A(e),A(r));if(F(e)||d(e)){for(var n=Array.from(r.dimensions);n.length>0;)if(_(n[0])&&"string"!=typeof n[0].value){var a=C(n.shift().value,t);F(e)?e=e.items[a-1]:(e=e.valueOf()[a-1])instanceof Array&&(e=i(e))}else{if(!(n.length>1&&_(n[1])&&"string"!=typeof n[1].value))break;var o=C(n[1].value,t),c=[],p=F(e)?e.items:e.valueOf();for(var m of p)if(F(m))c.push(m.items[o-1]);else{if(!d(e))break;c.push(m[o-1])}if(c.length!==p.length)break;e=F(e)?new u(c):i(c),n.splice(1,1)}return n.length===r.dimensions.length?new s(A(e),r):n.length>0?(r=new f(n),new s(A(e),r)):e}if(P(e)&&1===r.dimensions.length&&_(r.dimensions[0])){var h=r.dimensions[0].value;return h in e.properties?e.properties[h]:new l}return new s(A(e),r)}(B(e.object,r),B(e.index,r),r);case"ArrayNode":var O=e.items.map((e=>B(e,r)));return O.some(R)?new u(O.map(A)):i(O);case"IndexNode":return new f(e.dimensions.map((e=>b(e,r))));case"ObjectNode":var q={};for(var I in e.properties)q[I]=b(e.properties[I],r);return new m(q);default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(e.type))}}return b})),Kb="compile",ew=Gr(Kb,["typed","parse"],(e=>{var{typed:r,parse:t}=e;return r(Kb,{string:function(e){return t(e).compile()},"Array | Matrix":function(e){return na(e,(function(e){return t(e).compile()}))}})})),rw=Gr("Help",["parse"],(e=>{var{parse:r}=e;function t(e){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(!e)throw new Error('Argument "doc" missing');this.doc=e}return t.prototype.type="Help",t.prototype.isHelp=!0,t.prototype.toString=function(){var e=this.doc||{},t="\n";if(e.name&&(t+="Name: "+e.name+"\n\n"),e.category&&(t+="Category: "+e.category+"\n\n"),e.description&&(t+="Description:\n "+e.description+"\n\n"),e.syntax&&(t+="Syntax:\n "+e.syntax.join("\n ")+"\n\n"),e.examples){t+="Examples:\n";for(var n={},i=0;i"mathjs"!==e)).forEach((t=>{r[t]=e[t]})),new t(r)},t.prototype.valueOf=t.prototype.toString,t}),{isClass:!0}),tw="leafCount",nw=Gr(tw,["parse","typed"],(e=>{var{parse:r,typed:t}=e;function n(e){var r=0;return e.forEach((e=>{r+=n(e)})),r||1}return t(tw,{Node:function(e){return n(e)}})})),iw="simplifyCore",aw=Gr(iw,["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],(e=>{var{typed:r,parse:t,equal:n,isZero:i,add:a,subtract:o,multiply:s,divide:u,pow:c,AccessorNode:l,ArrayNode:p,ConstantNode:f,FunctionNode:d,IndexNode:m,ObjectNode:h,OperatorNode:g,ParenthesisNode:y,SymbolNode:v}=e,x=new f(0),D=new f(1),b=new f(!0),w=new f(!1);function N(e){return U(e)&&["and","not","or"].includes(e.op)}var{hasProperty:E,isCommutative:A}=Qb({FunctionNode:d,OperatorNode:g,SymbolNode:v});function S(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=r?r.context:void 0;if(E(e,"trivial",t)){if(z(e)&&1===e.args.length)return S(e.args[0],r);var a=!1,o=0;if(e.forEach((e=>{1==++o&&(a=S(e,r))})),1===o)return a}var s=e;if(z(s)){var u=function(e){var r="OperatorNode:"+e;for(var t of eb)if(r in t)return t[r].op;return null}(s.name);if(!u)return new d(S(s.fn),s.args.map((e=>S(e,r))));if(s.args.length>2&&E(s,"associative",t))for(;s.args.length>2;){var c=s.args.pop(),f=s.args.pop();s.args.push(new g(u,s.name,[c,f]))}s=new g(u,s.name,s.args)}if(U(s)&&s.isUnary()){var y=S(s.args[0],r);if("~"===s.op&&U(y)&&y.isUnary()&&"~"===y.op)return y.args[0];if("not"===s.op&&U(y)&&y.isUnary()&&"not"===y.op&&N(y.args[0]))return y.args[0];var v=!0;if("-"===s.op&&U(y)&&(y.isBinary()&&"subtract"===y.fn&&(s=new g("-","subtract",[y.args[1],y.args[0]]),v=!1),y.isUnary()&&"-"===y.op))return y.args[0];if(v)return new g(s.op,s.fn,[y])}if(U(s)&&s.isBinary()){var C=S(s.args[0],r),T=S(s.args[1],r);if("+"===s.op){if(_(C)&&i(C.value))return T;if(_(T)&&i(T.value))return C;U(T)&&T.isUnary()&&"-"===T.op&&(T=T.args[0],s=new g("-","subtract",[C,T]))}if("-"===s.op)return U(T)&&T.isUnary()&&"-"===T.op?S(new g("+","add",[C,T.args[0]]),r):_(C)&&i(C.value)?S(new g("-","unaryMinus",[T])):_(T)&&i(T.value)?C:new g(s.op,s.fn,[C,T]);if("*"===s.op){if(_(C)){if(i(C.value))return x;if(n(C.value,1))return T}if(_(T)){if(i(T.value))return x;if(n(T.value,1))return C;if(A(s,t))return new g(s.op,s.fn,[T,C],s.implicit)}return new g(s.op,s.fn,[C,T],s.implicit)}if("/"===s.op)return _(C)&&i(C.value)?x:_(T)&&n(T.value,1)?C:new g(s.op,s.fn,[C,T]);if("^"===s.op&&_(T)){if(i(T.value))return D;if(n(T.value,1))return C}if("and"===s.op){if(_(C)){if(!C.value)return w;if(N(T))return T}if(_(T)){if(!T.value)return w;if(N(C))return C}}if("or"===s.op){if(_(C)){if(C.value)return b;if(N(T))return T}if(_(T)){if(T.value)return b;if(N(C))return C}}return new g(s.op,s.fn,[C,T])}if(U(s))return new g(s.op,s.fn,s.args.map((e=>S(e,r))));if(F(s))return new p(s.items.map((e=>S(e,r))));if(M(s))return new l(S(s.object,r),S(s.index,r));if(k(s))return new m(s.dimensions.map((e=>S(e,r))));if(P(s)){var B={};for(var O in s.properties)B[O]=S(s.properties[O],r);return new h(B)}return s}return r(iw,{Node:S,"Node,Object":S})})),ow="evaluate",sw=Gr(ow,["typed","parse"],(e=>{var{typed:r,parse:t}=e;return r(ow,{string:function(e){var r=$i();return t(e).compile().evaluate(r)},"string, Map | Object":function(e,r){return t(e).compile().evaluate(r)},"Array | Matrix":function(e){var r=$i();return na(e,(function(e){return t(e).compile().evaluate(r)}))},"Array | Matrix, Map | Object":function(e,r){return na(e,(function(e){return t(e).compile().evaluate(r)}))}})})),uw={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"]},cw={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"]},lw={bignumber:{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"]},boolean:{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"]},complex:{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"]},createUnit:{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"]},fraction:{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"]},index:{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:["[1, 2, 3]","A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = ones(2, 2)"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]},matrix:{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"]},number:{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"]},sparse:{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"]},splitUnit:{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"]},string:{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"]},unit:{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"]},e:uw,E:uw,false:{name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]},i:{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:[]},Infinity:{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:[]},LN2:{name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},LN10:{name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},LOG2E:{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:[]},LOG10E:{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:[]},NaN:{name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},null:{name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},pi:cw,PI:cw,phi:{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:[]},SQRT1_2:{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:[]},SQRT2:{name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]},tau:{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"]},true:{name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]},version:{name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]},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:{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"]},lsolve:{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"]},lsolveAll:{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"]},lup:{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"]},lusolve:{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"]},leafCount:{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"]},polynomialRoot:{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"]},resolve:{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"]},simplify:{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"]},simplifyConstant:{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"]},simplifyCore:{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"]},symbolicEqual:{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"]},rationalize:{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"]},slu:{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"]},usolve:{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"]},usolveAll:{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"]},qr:{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"]},abs:{name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]},add:{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"]},cbrt:{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"]},ceil:{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"]},cube:{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"]},divide:{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"]},dotDivide:{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"]},dotMultiply:{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"]},dotPow:{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"]},exp:{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"]},expm:{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"]},expm1:{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"]},fix:{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"]},floor:{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"]},gcd:{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"]},hypot:{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"]},lcm:{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"]},log:{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"]},log2:{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"]},log1p:{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"]},log10:{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"]},mod:{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"]},multiply:{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"]},norm:{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")']},nthRoot:{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"]},nthRoots:{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"]},pow:{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"]},round:{name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)"],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)"],seealso:["ceil","floor","fix"]},sign:{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"]},sqrt:{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"]},sqrtm:{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"]},square:{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"]},subtract:{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"]},unaryMinus:{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"]},unaryPlus:{name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]},xgcd:{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"]},invmod:{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"]},bitAnd:{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"]},bitNot:{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"]},bitOr:{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"]},bitXor:{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"]},leftShift:{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"]},rightArithShift:{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"]},rightLogShift:{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"]},bellNumbers:{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"]},catalan:{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"]},composition:{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"]},stirlingS2:{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"]},config:{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:[]},import:{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:[]},typed:{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:[]},arg:{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"]},conj:{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"]},re:{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"]},im:{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"]},evaluate:{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:[]},help:{name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]},distance:{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:[]},intersect:{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:[]},and:{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"]},not:{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"]},or:{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"]},xor:{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"]},concat:{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"]},count:{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"]},cross:{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"]},column:{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"]},ctranspose:{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"]},det:{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"]},diag:{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"]},diff:{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"]},dot:{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"]},getMatrixDataType:{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"]},identity:{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"]},filter:{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"]},flatten:{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"]},forEach:{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"]},inv:{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"]},pinv:{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"]},eigs:{name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and eigenvectors of a real symmetric matrix",examples:["eigs([[5, 2.3], [2.3, 1]])"],seealso:["inv"]},kron:{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"]},matrixFromFunction:{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"]},matrixFromRows:{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"]},matrixFromColumns:{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"]},map:{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"]},ones:{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"]},partitionSelect:{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"]},range:{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"]},resize:{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"]},reshape:{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"]},rotate:{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"]},rotationMatrix:{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"]},row:{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"]},size:{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"]},sort:{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"]},squeeze:{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"]},subset:{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"]},trace:{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"]},transpose:{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"]},zeros:{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"]},fft:{name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]},ifft:{name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]},sylvester:{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"]},schur:{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"]},lyap:{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"]},solveODE:{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"]},combinations:{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"]},combinationsWithRep:{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"]},factorial:{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"]},gamma:{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"]},kldivergence:{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:[]},lgamma:{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"]},multinomial:{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"]},permutations:{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"]},pickRandom:{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"]},random:{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"]},randomInt:{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"]},compare:{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"]},compareNatural:{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"]},compareText:{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"]},deepEqual:{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"]},equal:{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"]},equalText:{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"]},larger:{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"]},largerEq:{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"]},smaller:{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"]},smallerEq:{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"]},unequal:{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"]},setCartesian:{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"]},setDifference:{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"]},setDistinct:{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"]},setIntersect:{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"]},setIsSubset:{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"]},setMultiplicity:{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"]},setPowerset:{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"]},setSize:{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"]},setSymDifference:{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"]},setUnion:{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"]},zpk2tf:{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:[]},freqz:{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:[]},erf:{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:[]},cumsum:{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"]},mad:{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"]},max:{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"]},mean:{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"]},median:{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"]},min:{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"]},mode:{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"]},prod:{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"]},quantileSeq:{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. \n\nIn 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"]},std:{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"]},sum:{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"]},variance:{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"]},acos:{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"]},acosh:{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"]},acot:{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"]},acoth:{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"]},acsc:{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"]},acsch:{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"]},asec:{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"]},asech:{name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},asin:{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"]},asinh:{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"]},atan:{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"]},atanh:{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"]},atan2:{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"]},cos:{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"]},cosh:{name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},cot:{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"]},coth:{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"]},csc:{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"]},csch:{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"]},sec:{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"]},sech:{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"]},sin:{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"]},sinh:{name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},tan:{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"]},tanh:{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"]},to:{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:[]},clone:{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:[]},format:{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"]},bin:{name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]},oct:{name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]},hex:{name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]},isNaN:{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"]},isInteger:{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"]},isNegative:{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"]},isNumeric:{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"]},hasNumericValue:{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"]},isPositive:{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"]},isPrime:{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"]},isZero:{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"]},print:{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: $0, $1, $2", [6, 9, 4])'],seealso:["format"]},typeOf:{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"]},numeric:{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"]}},pw="help",fw=Gr(pw,["typed","mathWithTransform","Help"],(e=>{var{typed:r,mathWithTransform:t,Help:n}=e;return r(pw,{any:function(e){var r,i=e;if("string"!=typeof e)for(r in t)if(re(t,r)&&e===t[r]){i=r;break}var a=ki(lw,i);if(!a){var o="function"==typeof i?i.name:i;throw new Error('No documentation found on "'+o+'"')}return new n(a)}})})),dw=Gr("Parser",["evaluate"],(e=>{var{evaluate:r}=e;function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:$i(),writable:!1})}return t.prototype.type="Parser",t.prototype.isParser=!0,t.prototype.evaluate=function(e){return r(e,this.scope)},t.prototype.get=function(e){if(this.scope.has(e))return this.scope.get(e)},t.prototype.getAll=function(){return function(e){if(e instanceof Zi)return e.wrappedObject;var r={};for(var t of e.keys())Ri(r,t,e.get(t));return r}(this.scope)},t.prototype.getAllAsMap=function(){return this.scope},t.prototype.set=function(e,r){return this.scope.set(e,r),r},t.prototype.remove=function(e){this.scope.delete(e)},t.prototype.clear=function(){this.scope.clear()},t}),{isClass:!0});function mw(e){return _(e)||U(e)&&e.isUnary()&&_(e.args[0])}function hw(e){return!!_(e)||!(!z(e)&&!U(e)||!e.args.every(hw))||!(!j(e)||!hw(e.content))}var gw=Gr("simplify",["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"],(e=>{var{config:r,typed:t,parse:n,add:i,subtract:a,multiply:o,divide:s,pow:u,isZero:c,equal:l,resolve:p,simplifyConstant:f,simplifyCore:d,fraction:m,bignumber:h,mathWithTransform:g,matrix:y,AccessorNode:v,ArrayNode:x,ConstantNode:D,FunctionNode:b,IndexNode:w,ObjectNode:N,OperatorNode:E,ParenthesisNode:A,SymbolNode:S}=e,{hasProperty:C,isCommutative:M,isAssociative:F,mergeContext:T,flatten:B,unflattenr:O,unflattenl:q,createMakeNodeFunction:I,defaultContext:z,realContext:k,positiveContext:R}=Qb({FunctionNode:b,OperatorNode:E,SymbolNode:S});t.addConversion({from:"Object",to:"Map",convert:Gi});var P=t("simplify",{Node:V,"Node, Map":(e,r)=>V(e,!1,r),"Node, Map, Object":(e,r,t)=>V(e,!1,r,t),"Node, Array":V,"Node, Array, Map":V,"Node, Array, Map, Object":V});function U(e){return e.transform((function(e,r,t){return j(e)?U(e.content):e}))}t.removeConversion({from:"Object",to:"Map",convert:Gi}),P.defaultContext=z,P.realContext=k,P.positiveContext=R;var L={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};function H(e,r){var t={};if(e.s){var i=e.s.split("->");if(2!==i.length)throw SyntaxError("Could not parse rule: "+e.s);t.l=i[0],t.r=i[1]}else t.l=e.l,t.r=e.r;for(var a of(t.l=U(n(t.l)),t.r=U(n(t.r)),["imposeContext","repeat","assuming"]))a in e&&(t[a]=e[a]);if(e.evaluate&&(t.evaluate=n(e.evaluate)),F(t.l,r)){var o,s=!M(t.l,r);s&&(o=G());var u=I(t.l),c=G();t.expanded={},t.expanded.l=u([t.l,c]),B(t.expanded.l,r),O(t.expanded.l,r),t.expanded.r=u([t.r,c]),s&&(t.expandedNC1={},t.expandedNC1.l=u([o,t.l]),t.expandedNC1.r=u([o,t.r]),t.expandedNC2={},t.expandedNC2.l=u([o,t.expanded.l]),t.expandedNC2.r=u([o,t.expanded.r]))}return t}P.rules=[d,{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}}},f,{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}}},f,{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"}];var $=0;function G(){return new S("_p"+$++)}function V(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:$i(),n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=n.consoleDebug;r=function(e,r){for(var t=[],n=0;n ").concat(r[c].r.toString()))),i){var f=a.toString({parenthesis:"all"});f!==u&&(console.log("Applying",l,"produced",f),u=f)}q(a,n.context)}s=a.toString({parenthesis:"all"})}return a}function W(e,r,t){var n=e;if(e)for(var i=0;i=2&&2===e.args.length){for(var a=function(e,r){var t,n,i=[],a=I(e);if(M(e,r))for(var o=0;o1&&(u=a(e.args.slice(0,s))),t=1===(n=e.args.slice(s)).length?n[0]:a(n),i.push(a([u,t]))}return i}(r,t),o=[],s=0;s2)throw Error("Unexpected non-binary associative function: "+e.toString());return[]}for(var c=[],p=0;p2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var d=X(e.args[0],r.args[1],t);if(0===d.length)return[];var m=X(e.args[1],r.args[0],t);if(0===m.length)return[];c=[d,m]}i=function(e){if(0===e.length)return e;for(var r=e.reduce(Q),t=[],n={},i=0;i="a"&&e.name[1]<="z"?e.name.substring(0,2):e.name[0]){case"n":case"_p":i[0].placeholders[e.name]=r;break;case"c":case"cl":if(!_(r))return[];i[0].placeholders[e.name]=r;break;case"v":if(_(r))return[];i[0].placeholders[e.name]=r;break;case"vl":if(!Z(r))return[];i[0].placeholders[e.name]=r;break;case"cd":if(!mw(r))return[];i[0].placeholders[e.name]=r;break;case"vd":if(mw(r))return[];i[0].placeholders[e.name]=r;break;case"ce":if(!hw(r))return[];i[0].placeholders[e.name]=r;break;case"ve":if(hw(r))return[];i[0].placeholders[e.name]=r;break;default:throw new Error("Invalid symbol in rule: "+e.name)}}else{if(!(e instanceof D))return[];if(!l(e.value,r.value))return[]}return i}function K(e,r){if(e instanceof D&&r instanceof D){if(!l(e.value,r.value))return!1}else if(e instanceof S&&r instanceof S){if(e.name!==r.name)return!1}else{if(!(e instanceof E&&r instanceof E||e instanceof b&&r instanceof b))return!1;if(e instanceof E){if(e.op!==r.op||e.fn!==r.fn)return!1}else if(e instanceof b&&e.name!==r.name)return!1;if(e.args.length!==r.args.length)return!1;for(var t=0;t{var{parse:r,simplify:t,typed:n,OperatorNode:i}=e;function a(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=new i("-","subtract",[e,r]),o=t(a,{},n);return _(o)&&!o.value}return n(yw,{"Node, Node":a,"Node, Node, Object":a})})),xw="derivative",Dw=Gr(xw,["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],(e=>{var{typed:r,config:t,parse:n,simplify:i,equal:a,isZero:o,numeric:s,ConstantNode:u,FunctionNode:c,OperatorNode:l,ParenthesisNode:p,SymbolNode:f}=e;function d(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{simplify:!0},n={};g(n,e,r.name);var a=y(e,n);return t.simplify?i(a):a}r.addConversion({from:"identifier",to:"SymbolNode",convert:n});var m=r(xw,{"Node, SymbolNode":d,"Node, SymbolNode, Object":d});r.removeConversion({from:"identifier",to:"SymbolNode",convert:n}),m._simplify=!0,m.toTex=function(e){return h.apply(null,e.args)};var h=r("_derivTex",{"Node, SymbolNode":function(e,r){return _(e)&&"string"===G(e.value)?h(n(e.value).toString(),r.toString(),1):h(e.toTex(),r.toString(),1)},"Node, ConstantNode":function(e,r){if("string"===G(r.value))return h(e,n(r.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(e,r,t){return h(e.toString(),r.name,t.value)},"string, string, number":function(e,r,t){return(1===t?"{d\\over d"+r+"}":"{d^{"+t+"}\\over d"+r+"^{"+t+"}}")+"\\left[".concat(e,"\\right]")}}),g=r("constTag",{"Object, ConstantNode, string":function(e,r){return e[r]=!0,!0},"Object, SymbolNode, string":function(e,r,t){return r.name!==t&&(e[r]=!0,!0)},"Object, ParenthesisNode, string":function(e,r,t){return g(e,r.content,t)},"Object, FunctionAssignmentNode, string":function(e,r,t){return-1===r.params.indexOf(t)?(e[r]=!0,!0):g(e,r.expr,t)},"Object, FunctionNode | OperatorNode, string":function(e,r,t){if(r.args.length>0){for(var n=g(e,r.args[0],t),i=1;i0){var n=e.args.filter((function(e){return void 0===r[e]})),i=1===n.length?n[0]:new l("*","multiply",n),s=t.concat(y(i,r));return new l("*","multiply",s)}return new l("+","add",e.args.map((function(t){return new l("*","multiply",e.args.map((function(e){return e===t?y(e,r):e.clone()})))})))}if("/"===e.op&&e.isBinary()){var u=e.args[0],p=e.args[1];return void 0!==r[p]?new l("/","divide",[y(u,r),p]):void 0!==r[u]?new l("*","multiply",[new l("-","unaryMinus",[u]),new l("/","divide",[y(p,r),new l("^","pow",[p.clone(),v(2)])])]):new l("/","divide",[new l("-","subtract",[new l("*","multiply",[y(u,r),p.clone()]),new l("*","multiply",[u.clone(),y(p,r)])]),new l("^","pow",[p.clone(),v(2)])])}if("^"===e.op&&e.isBinary()){var f=e.args[0],d=e.args[1];if(void 0!==r[f])return _(f)&&(o(f.value)||a(f.value,1))?v(0):new l("*","multiply",[e,new l("*","multiply",[new c("log",[f.clone()]),y(d.clone(),r)])]);if(void 0!==r[d]){if(_(d)){if(o(d.value))return v(0);if(a(d.value,1))return y(f,r)}var m=new l("^","pow",[f.clone(),new l("-","subtract",[d,v(1)])]);return new l("*","multiply",[d.clone(),new l("*","multiply",[y(f,r),m])])}return new l("*","multiply",[new l("^","pow",[f.clone(),d.clone()]),new l("+","add",[new l("*","multiply",[y(f,r),new l("/","divide",[d.clone(),f.clone()])]),new l("*","multiply",[y(d,r),new c("log",[f.clone()])])])])}throw new Error('Operator "'+e.op+'" is not supported by derivative, or a wrong number of arguments is passed')}});function v(e,r){return new u(s(e,r||t.number))}return m})),bw="parser",ww=Gr(bw,["typed","Parser"],(e=>{var{typed:r,Parser:t}=e;return r(bw,{"":function(){return new t}})})),Nw="rationalize",Ew=Gr(Nw,["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"],(e=>{var{config:r,typed:t,equal:n,isZero:i,add:a,subtract:o,multiply:s,divide:u,pow:c,parse:l,simplifyConstant:p,simplifyCore:f,simplify:d,fraction:m,bignumber:h,mathWithTransform:g,matrix:y,AccessorNode:v,ArrayNode:x,ConstantNode:D,FunctionNode:b,IndexNode:w,ObjectNode:N,OperatorNode:E,SymbolNode:A,ParenthesisNode:S}=e;function C(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=function(){var e=[f,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},p,{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"1*n",r:"n"}],r=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],t=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],n={};return n.firstRules=e.concat(r,t),n.distrDivRules=[{l:"(n1/n2 + n3/n4)",r:"((n1*n4 + n3*n2)/(n2*n4))"},{l:"(n1/n2 + n3)",r:"((n1 + n3*n2)/n2)"},{l:"(n1 + n2/n3)",r:"((n1*n3 + n2)/n3)"}],n.sucDivRules=t,n.firstRulesAgain=e.concat(r),n.finalRules=[f,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},p,{l:"n*-n^n1",r:"-n^(n1+1)"},{l:"n*n^n1",r:"n^(n1+1)"},{l:"n^n1*-n^n2",r:"-n^(n1+n2)"},{l:"n^n1*n^n2",r:"n^(n1+n2)"},{l:"n^n1*-n",r:"-n^(n1+1)"},{l:"n^n1*n",r:"n^(n1+1)"},{l:"n^n1/-n",r:"-n^(n1-1)"},{l:"n^n1/n",r:"n^(n1-1)"},{l:"n/-n^n1",r:"-n^(1-n1)"},{l:"n/n^n1",r:"n^(1-n1)"},{l:"n^n1/-n^n2",r:"n^(n1-n2)"},{l:"n^n1/n^n2",r:"n^(n1-n2)"},{l:"n1+(-n2*n3)",r:"n1-n2*n3"},{l:"v*(-c)",r:"-c*v"},{l:"n1+-n2",r:"n1-n2"},{l:"v*c",r:"c*v"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"}],n}(),i=function(e,r,t,n){var i=[],a=d(e,n,r,{exactFractions:!1}),o="+-*"+((t=!!t)?"/":"");!function e(r){var t=r.type;if("FunctionNode"===t)throw new Error("There is an unsolved function call");if("OperatorNode"===t)if("^"===r.op){if("ConstantNode"!==r.args[1].type||!Qr(parseFloat(r.args[1].value)))throw new Error("There is a non-integer exponent");e(r.args[0])}else{if(-1===o.indexOf(r.op))throw new Error("Operator "+r.op+" invalid in polynomial expression");for(var n=0;n=1){var u,c;e=M(e);var l,m=!0,h=!1;for(e=d(e,n.firstRules,{},o);c=m?n.distrDivRules:n.sucDivRules,m=!m,(l=(e=d(e,c,{},s)).toString())!==u;)h=!0,u=l;h&&(e=d(e,n.firstRulesAgain,{},o)),e=d(e,n.finalRules,{},o)}var g=[],y={};return"OperatorNode"===e.type&&e.isBinary()&&"/"===e.op?(1===a&&(e.args[0]=F(e.args[0],g),e.args[1]=F(e.args[1])),t&&(y.numerator=e.args[0],y.denominator=e.args[1])):(1===a&&(e=F(e,g)),t&&(y.numerator=e,y.denominator=null)),t?(y.coefficients=g,y.variables=i.variables,y.expression=e,y):e}return t(Nw,{Node:C,"Node, boolean":(e,r)=>C(e,{},r),"Node, Object":C,"Node, Object, boolean":C});function M(e,r,t){var n=e.type,i=arguments.length>1;if("OperatorNode"===n&&e.isBinary()){var a,o=!1;if("^"===e.op&&("ParenthesisNode"!==e.args[0].type&&"OperatorNode"!==e.args[0].type||"ConstantNode"!==e.args[1].type||(o=(a=parseFloat(e.args[1].value))>=2&&Qr(a))),o){if(a>2){var s=e.args[0],u=new E("^","pow",[e.args[0].cloneDeep(),new D(a-1)]);e=new E("*","multiply",[s,u])}else e=new E("*","multiply",[e.args[0],e.args[0].cloneDeep()]);i&&("content"===t?r.content=e:r.args[t]=e)}}if("ParenthesisNode"===n)M(e.content,e,"content");else if("ConstantNode"!==n&&"SymbolNode"!==n)for(var c=0;ct&&(r[c]=0),r[c]+=o.cte*("+"===o.oper?1:-1),void(t=Math.max(c,t))}o.cte=c,""===o.fire&&(r[0]+=o.cte*("+"===o.oper?1:-1))}}(e,null,{cte:1,oper:"+",fire:""});for(var i,a=!0,o=t=r.length-1;o>=0;o--)if(0!==r[o]){var s=new D(a?r[o]:Math.abs(r[o])),u=r[o]<0?"-":"+";if(o>0){var c=new A(n);if(o>1){var l=new D(o);c=new E("^","pow",[c,l])}s=-1===r[o]&&a?new E("-","unaryMinus",[c]):1===Math.abs(r[o])?c:new E("*","multiply",[s,c])}i=a?s:"+"===u?new E("+","add",[i,s]):new E("-","subtract",[i,s]),a=!1}return a?new D(0):i}}));function Aw(e,r,t){var n=e.filter((function(e){return Z(e)&&!(e.name in r)&&!t.has(e.name)}))[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var i=n.name,a=Hb(t),o=e.compile();return function(e){return a.set(i,e),o.evaluate(a)}}var Sw=Gr("filter",["typed"],(e=>{var{typed:r}=e;function t(e,r,t){var i,a;return e[0]&&(i=e[0].compile().evaluate(t)),e[1]&&(a=Z(e[1])||I(e[1])?e[1].compile().evaluate(t):Aw(e[1],r,t)),n(i,a)}t.rawArgs=!0;var n=r("filter",{"Array, function":Cw,"Matrix, function":function(e,r){return e.create(Cw(e.toArray(),r))},"Array, RegExp":Mi,"Matrix, RegExp":function(e,r){return e.create(Mi(e.toArray(),r))}});return t}),{isTransformFunction:!0});function Cw(e,r){return Ci(e,(function(e,t,n){return cs(r,e,[t+1],n,"filter")}))}var Mw=Gr("forEach",["typed"],(e=>{var{typed:r}=e;function t(e,r,t){var i,a;return e[0]&&(i=e[0].compile().evaluate(t)),e[1]&&(a=Z(e[1])||I(e[1])?e[1].compile().evaluate(t):Aw(e[1],r,t)),n(i,a)}t.rawArgs=!0;var n=r("forEach",{"Array | Matrix, function":function(e,r){!function t(n,i){if(!Array.isArray(n))return cs(r,n,i,e,"forEach");Si(n,(function(e,r){t(e,i.concat(r+1))}))}(e.valueOf(),[])}});return t}),{isTransformFunction:!0}),Fw=Gr("map",["typed"],(e=>{var{typed:r}=e;function t(e,r,t){var i,a;return e[0]&&(i=e[0].compile().evaluate(t)),e[1]&&(a=Z(e[1])||I(e[1])?e[1].compile().evaluate(t):Aw(e[1],r,t)),n(i,a)}t.rawArgs=!0;var n=r("map",{"Array, function":function(e,r){return Tw(e,r,e)},"Matrix, function":function(e,r){return e.create(Tw(e.valueOf(),r,e))}});return t}),{isTransformFunction:!0});function Tw(e,r,t){return function e(n,i){return Array.isArray(n)?Ai(n,(function(r,t){return e(r,i.concat(t+1))})):cs(r,n,i,t,"map")}(e,[])}var Bw=Gr("apply",["typed","isInteger"],(e=>{var{typed:r,isInteger:t}=e,n=qu({typed:r,isInteger:t});return r("apply",{"...any":function(e){var r=e[1];o(r)?e[1]=r-1:s(r)&&(e[1]=r.minus(1));try{return n.apply(null,e)}catch(e){throw qb(e)}}})}),{isTransformFunction:!0}),Ow=Gr("subset",["typed","matrix"],(e=>{var{typed:r,matrix:t}=e,n=_c({typed:r,matrix:t});return r("subset",{"...any":function(e){try{return n.apply(null,e)}catch(e){throw qb(e)}}})}),{isTransformFunction:!0}),_w=Gr("concat",["typed","matrix","isInteger"],(e=>{var{typed:r,matrix:t,isInteger:n}=e,i=Yc({typed:r,matrix:t,isInteger:n});return r("concat",{"...any":function(e){var r=e.length-1,t=e[r];o(t)?e[r]=t-1:s(t)&&(e[r]=t.minus(1));try{return i.apply(null,e)}catch(e){throw qb(e)}}})}),{isTransformFunction:!0});function qw(e){if(2===e.length&&m(e[0])){var r=(e=e.slice())[1];o(r)?e[1]=r-1:s(r)&&(e[1]=r.minus(1))}return e}var Iw=Gr("max",["typed","config","numeric","larger"],(e=>{var{typed:r,config:t,numeric:n,larger:i}=e,a=Qf({typed:r,config:t,numeric:n,larger:i});return r("max",{"...any":function(e){e=qw(e);try{return a.apply(null,e)}catch(e){throw qb(e)}}})}),{isTransformFunction:!0}),zw=Gr("sum",["typed","config","add","numeric"],(e=>{var{typed:r,config:t,add:n,numeric:i}=e,a=Ad({typed:r,config:t,add:n,numeric:i});return r("sum",{"...any":function(e){e=qw(e);try{return a.apply(null,e)}catch(e){throw qb(e)}}})}),{isTransformFunction:!0}),kw=Gr("min",["typed","config","numeric","smaller"],(e=>{var{typed:r,config:t,numeric:n,smaller:i}=e,a=Vp({typed:r,config:t,numeric:n,smaller:i});return r("min",{"...any":function(e){e=qw(e);try{return a.apply(null,e)}catch(e){throw qb(e)}}})}),{isTransformFunction:!0}),Rw="cumsum",Pw=Gr(Rw,["typed","add","unaryPlus"],(e=>{var{typed:r,add:t,unaryPlus:n}=e,i=Ap({typed:r,add:t,unaryPlus:n});return r(Rw,{"...any":function(e){if(2===e.length&&m(e[0])){var r=e[1];o(r)?e[1]=r-1:s(r)&&(e[1]=r.minus(1))}try{return i.apply(null,e)}catch(e){throw qb(e)}}})}),{isTransformFunction:!0}),Uw="diff",jw=Gr(Uw,["typed","matrix","subtract","number","bignumber"],(e=>{var{typed:r,matrix:t,subtract:n,number:i,bignumber:a}=e,o=Of({typed:r,matrix:t,subtract:n,number:i,bignumber:a});return r(Uw,{"...any":function(e){e=qw(e);try{return o.apply(null,e)}catch(e){throw qb(e)}}})}),{isTransformFunction:!0}),Lw=Gr("index",["Index"],(e=>{var{Index:r}=e;return function(){for(var e=[],t=0,n=arguments.length;t0?0:2;else if(i&&!0===i.isSet)i=i.map((function(e){return e-1}));else if(f(i)||d(i))i=i.map((function(e){return e-1}));else if(o(i))i--;else if(s(i))i=i.toNumber()-1;else if("string"!=typeof i)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");e[t]=i}var a=new r;return r.apply(a,e),a}}),{isTransformFunction:!0}),Hw=Gr("range",["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],(e=>{var{typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:s,largerEq:u,add:c,isPositive:l}=e,p=ed({typed:r,config:t,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:s,largerEq:u,add:c,isPositive:l});return r("range",{"...any":function(e){return"boolean"!=typeof e[e.length-1]&&e.push(!0),p.apply(null,e)}})}),{isTransformFunction:!0}),Zw=Gr("row",["typed","Index","matrix","range"],(e=>{var{typed:r,Index:t,matrix:n,range:i}=e,a=rd({typed:r,Index:t,matrix:n,range:i});return r("row",{"...any":function(e){var r=e.length-1,t=e[r];o(t)&&(e[r]=t-1);try{return a.apply(null,e)}catch(e){throw qb(e)}}})}),{isTransformFunction:!0}),$w=Gr("column",["typed","Index","matrix","range"],(e=>{var{typed:r,Index:t,matrix:n,range:i}=e,a=Bd({typed:r,Index:t,matrix:n,range:i});return r("column",{"...any":function(e){var r=e.length-1,t=e[r];o(t)&&(e[r]=t-1);try{return a.apply(null,e)}catch(e){throw qb(e)}}})}),{isTransformFunction:!0}),Gw=Gr("mean",["typed","add","divide"],(e=>{var{typed:r,add:t,divide:n}=e,i=Um({typed:r,add:t,divide:n});return r("mean",{"...any":function(e){e=qw(e);try{return i.apply(null,e)}catch(e){throw qb(e)}}})}),{isTransformFunction:!0}),Vw="variance",Ww=Gr(Vw,["typed","add","subtract","multiply","divide","apply","isNaN"],(e=>{var{typed:r,add:t,subtract:n,multiply:i,divide:a,apply:o,isNaN:s}=e,u=Zm({typed:r,add:t,subtract:n,multiply:i,divide:a,apply:o,isNaN:s});return r(Vw,{"...any":function(e){e=qw(e);try{return u.apply(null,e)}catch(e){throw qb(e)}}})}),{isTransformFunction:!0}),Yw=Gr("std",["typed","map","sqrt","variance"],(e=>{var{typed:r,map:t,sqrt:n,variance:i}=e,a=eh({typed:r,map:t,sqrt:n,variance:i});return r("std",{"...any":function(e){e=qw(e);try{return a.apply(null,e)}catch(e){throw qb(e)}}})}),{isTransformFunction:!0}),Jw={},Qw={},Xw={},Kw=QD({mathWithTransform:Qw}),eN=KD({Node:Kw}),rN=db({Node:Kw}),tN=hb({Node:Kw}),nN=yb({Node:Kw}),iN=xb({Node:Kw}),aN=bb({Node:Kw,ResultSet:kh}),oN=Nb({Node:Kw}),sN=Ab({Node:Kw}),uN=Cb({Node:Kw}),cN=Mb({classes:Xw}),lN=Fb({math:Jw,typed:Yh}),pN=Bb({Node:Kw,typed:Yh}),fN=_b({Chain:lN,typed:Yh}),dN=kb({Node:Kw,subset:Ty}),mN=Pb({Node:Kw,size:My}),hN=jb({matrix:wy,Node:Kw,subset:Ty}),gN=Lb({Unit:Sx,Node:Kw,math:Jw}),yN=$b({Node:Kw,SymbolNode:gN,math:Jw}),vN=Vb({AccessorNode:dN,ArrayNode:iN,AssignmentNode:hN,BlockNode:aN,ConditionalNode:oN,ConstantNode:sN,FunctionAssignmentNode:pN,FunctionNode:yN,IndexNode:mN,ObjectNode:eN,OperatorNode:rN,ParenthesisNode:tN,RangeNode:uN,RelationalNode:nN,SymbolNode:gN,config:se,numeric:Ay,typed:Yh}),xN=Wb({ConstantNode:sN,FunctionNode:yN,OperatorNode:rN,ParenthesisNode:tN,parse:vN,typed:Yh}),DN=Xb({bignumber:ug,fraction:Dy,AccessorNode:dN,ArrayNode:iN,ConstantNode:sN,FunctionNode:yN,IndexNode:mN,ObjectNode:eN,OperatorNode:rN,SymbolNode:gN,config:se,mathWithTransform:Qw,matrix:wy,typed:Yh}),bN=ew({parse:vN,typed:Yh}),wN=rw({parse:vN}),NN=nw({parse:vN,typed:Yh}),EN=aw({AccessorNode:dN,ArrayNode:iN,ConstantNode:sN,FunctionNode:yN,IndexNode:mN,ObjectNode:eN,OperatorNode:rN,ParenthesisNode:tN,SymbolNode:gN,add:sv,divide:pD,equal:Ly,isZero:Og,multiply:Sv,parse:vN,pow:wx,subtract:_v,typed:Yh}),AN=sw({parse:vN,typed:Yh}),SN=fw({Help:wN,mathWithTransform:Qw,typed:Yh}),CN=dw({evaluate:AN}),MN=gw({bignumber:ug,fraction:Dy,AccessorNode:dN,ArrayNode:iN,ConstantNode:sN,FunctionNode:yN,IndexNode:mN,ObjectNode:eN,OperatorNode:rN,ParenthesisNode:tN,SymbolNode:gN,add:sv,config:se,divide:pD,equal:Ly,isZero:Og,mathWithTransform:Qw,matrix:wy,multiply:Sv,parse:vN,pow:wx,resolve:xN,simplifyConstant:DN,simplifyCore:EN,subtract:_v,typed:Yh}),FN=vw({OperatorNode:rN,parse:vN,simplify:MN,typed:Yh}),TN=Dw({ConstantNode:sN,FunctionNode:yN,OperatorNode:rN,ParenthesisNode:tN,SymbolNode:gN,config:se,equal:Ly,isZero:Og,numeric:Ay,parse:vN,simplify:MN,typed:Yh}),BN=ww({Parser:CN,typed:Yh}),ON=Ew({bignumber:ug,fraction:Dy,AccessorNode:dN,ArrayNode:iN,ConstantNode:sN,FunctionNode:yN,IndexNode:mN,ObjectNode:eN,OperatorNode:rN,ParenthesisNode:tN,SymbolNode:gN,add:sv,config:se,divide:pD,equal:Ly,isZero:Og,mathWithTransform:Qw,matrix:wy,multiply:Sv,parse:vN,pow:wx,simplify:MN,simplifyConstant:DN,simplifyCore:EN,subtract:_v,typed:Yh});(0,i.Z)(Jw,{e:Eh,false:Ah,fineStructure:Sh,i:Mh,Infinity:Fh,LN10:Th,LOG10E:Bh,NaN:_h,null:qh,phi:Ih,SQRT1_2:Rh,sackurTetrode:Ph,tau:Uh,true:jh,E:Eh,version:Lh,efimovFactor:Zh,LN2:$h,pi:Gh,replacer:Vh,reviver:cN,SQRT2:Wh,typed:Yh,unaryPlus:Jh,PI:Gh,weakMixingAngle:Qh,abs:Xh,acos:Kh,acot:eg,acsc:rg,addScalar:tg,arg:ng,asech:ig,asinh:ag,atan:og,atanh:sg,bignumber:ug,bitNot:cg,boolean:lg,clone:pg,combinations:fg,complex:dg,conj:mg,cosh:hg,coth:gg,csc:yg,cube:vg,equalScalar:xg,erf:Dg,exp:bg,expm1:wg,filter:Ng,forEach:Eg,format:Ag,getMatrixDataType:Sg,hex:Cg,im:Mg,isInteger:Fg,isNegative:Tg,isPositive:Bg,isZero:Og,LOG2E:_g,lgamma:qg,log10:Ig,log2:zg,map:kg,multiplyScalar:Rg,not:Pg,number:Ug,oct:jg,pickRandom:Lg,print:Hg,random:Zg,re:$g,sec:Gg,sign:Vg,sin:Wg,splitUnit:Jg,square:Qg,string:Xg,tan:Kg,typeOf:ey,acosh:ry,acsch:ty,apply:ny,asec:iy,bin:ay,chain:fN,combinationsWithRep:oy,cos:sy,csch:uy,isNaN:cy,isPrime:ly,randomInt:py,sech:fy,sinh:dy,sparse:my,sqrt:hy,tanh:gy,unaryMinus:yy,acoth:vy,cot:xy,fraction:Dy,isNumeric:by,matrix:wy,matrixFromFunction:Ny,mode:Ey,numeric:Ay,prod:Sy,reshape:Cy,size:My,squeeze:Fy,subset:Ty,transpose:By,xgcd:Oy,zeros:_y,asin:qy,cbrt:Iy,concat:zy,count:ky,ctranspose:Ry,diag:Py,divideScalar:Uy,dotDivide:jy,equal:Ly,flatten:Hy,gcd:Zy,hasNumericValue:$y,identity:Gy,kron:Vy,largerEq:Wy,leftShift:Yy,matrixFromColumns:Jy,mod:Qy,nthRoot:Xy,ones:Ky,resize:ev,rightArithShift:rv,round:tv,smaller:nv,to:iv,unequal:av,xor:ov,add:sv,bitAnd:uv,bitXor:cv,catalan:lv,compare:pv,compareText:fv,cumsum:dv,deepEqual:mv,dot:hv,equalText:gv,floor:yv,hypot:vv,invmod:bv,larger:wv,log:Nv,matrixFromRows:Ev,min:Av,multiply:Sv,nthRoots:Cv,or:Mv,partitionSelect:Fv,quantileSeq:Tv,rightLogShift:Bv,smallerEq:Ov,subtract:_v,trace:qv,usolve:Iv,zpk2tf:zv,and:kv,bitOr:Rv,ceil:Pv,compareNatural:Uv,composition:jv,cross:Lv,det:Hv,diff:Zv,distance:$v,dotMultiply:Gv,fix:Wv,index:Yv,intersect:Jv,lcm:Qv,log1p:Xv,lsolve:Kv,max:ex,qr:rx,range:tx,row:nx,setCartesian:ix,setDistinct:ax,setIsSubset:ox,setPowerset:sx,slu:ux,sort:cx,sum:lx,usolveAll:px,atan2:fx,column:dx,lsolveAll:mx,setDifference:hx,setMultiplicity:gx,setSymDifference:yx,inv:xx,lup:Dx,pinv:bx,pow:wx,setIntersect:Nx,setUnion:Ex,sqrtm:Ax,vacuumImpedance:Cx,wienDisplacement:Mx,atomicMass:Fx,bohrMagneton:Tx,boltzmann:Bx,conductanceQuantum:Ox,createUnit:_x,deuteronMass:qx,dotPow:Ix,electricConstant:zx,elementaryCharge:kx,expm:Rx,faraday:Px,fft:Ux,gamma:jx,gravitationConstant:Lx,hartreeEnergy:Hx,ifft:Zx,klitzing:$x,loschmidt:Gx,magneticConstant:Vx,molarMass:Wx,molarPlanckConstant:Yx,neutronMass:Jx,nuclearMagneton:Qx,planckCharge:Xx,planckLength:Kx,planckTemperature:eD,protonMass:rD,reducedPlanckConstant:tD,rydberg:nD,secondRadiation:iD,speedOfLight:aD,stefanBoltzmann:oD,thomsonCrossSection:sD,avogadro:uD,bohrRadius:cD,coulomb:lD,divide:pD,electronMass:fD,factorial:dD,firstRadiation:mD,gravity:hD,inverseConductanceQuantum:gD,lusolve:yD,magneticFluxQuantum:vD,molarMassC12:xD,multinomial:DD,parse:vN,permutations:bD,planckMass:wD,polynomialRoot:ND,resolve:xN,setSize:ED,simplifyConstant:DN,solveODE:AD,stirlingS2:SD,unit:CD,bellNumbers:MD,compile:bN,eigs:FD,fermiCoupling:TD,gasConstant:BD,leafCount:NN,mean:OD,molarVolume:_D,planckConstant:qD,quantumOfCirculation:ID,simplifyCore:EN,variance:zD,classicalElectronRadius:kD,evaluate:AN,help:SN,median:RD,simplify:MN,symbolicEqual:FN,derivative:TN,kldivergence:PD,mad:UD,parser:BN,rationalize:ON,std:jD,freqz:LD,norm:HD,rotationMatrix:ZD,planckTime:$D,schur:GD,rotate:VD,sylvester:WD,lyap:YD,config:se}),(0,i.Z)(Qw,Jw,{filter:Sw({typed:Yh}),forEach:Mw({typed:Yh}),map:Fw({typed:Yh}),apply:Bw({isInteger:Fg,typed:Yh}),subset:Ow({matrix:wy,typed:Yh}),concat:_w({isInteger:Fg,matrix:wy,typed:Yh}),max:Iw({config:se,larger:wv,numeric:Ay,typed:Yh}),sum:zw({add:sv,config:se,numeric:Ay,typed:Yh}),min:kw({config:se,numeric:Ay,smaller:nv,typed:Yh}),cumsum:Pw({add:sv,typed:Yh,unaryPlus:Jh}),diff:jw({bignumber:ug,matrix:wy,number:Ug,subtract:_v,typed:Yh}),index:Lw({Index:Dv}),range:Hw({bignumber:ug,matrix:wy,add:sv,config:se,isPositive:Bg,larger:wv,largerEq:Wy,smaller:nv,smallerEq:Ov,typed:Yh}),row:Zw({Index:Dv,matrix:wy,range:tx,typed:Yh}),column:$w({Index:Dv,matrix:wy,range:tx,typed:Yh}),mean:Gw({add:sv,divide:pD,typed:Yh}),variance:Ww({add:sv,apply:ny,divide:pD,isNaN:cy,multiply:Sv,subtract:_v,typed:Yh}),std:Yw({map:kg,sqrt:hy,typed:Yh,variance:zD})}),(0,i.Z)(Xw,{BigNumber:wh,Complex:Nh,Fraction:Ch,Matrix:Oh,Node:Kw,ObjectNode:eN,OperatorNode:rN,ParenthesisNode:tN,Range:zh,RelationalNode:nN,ResultSet:kh,ArrayNode:iN,BlockNode:aN,ConditionalNode:oN,ConstantNode:sN,DenseMatrix:Hh,RangeNode:uN,Chain:lN,FunctionAssignmentNode:pN,SparseMatrix:Yg,AccessorNode:dN,IndexNode:mN,AssignmentNode:hN,ImmutableDenseMatrix:xv,Index:Dv,FibonacciHeap:Vv,Spa:vx,Unit:Sx,SymbolNode:gN,FunctionNode:yN,Help:wN,Parser:CN}),lN.createProxy(Jw);var _N={createBigNumberClass:Yr},qN={createComplexClass:xt},IN={createMatrixClass:Xn},zN={MatrixDependencies:IN,createDenseMatrixClass:qi},kN={createFractionClass:Qn},RN={BigNumberDependencies:_N,ComplexDependencies:qN,DenseMatrixDependencies:zN,FractionDependencies:kN,createTyped:Ji},PN={typedDependencies:RN,createAbs:Ba},UN={createNode:QD},jN={typedDependencies:RN,createEqualScalar:Ko},LN={MatrixDependencies:IN,equalScalarDependencies:jN,typedDependencies:RN,createSparseMatrixClass:xu},HN={DenseMatrixDependencies:zN,MatrixDependencies:IN,SparseMatrixDependencies:LN,typedDependencies:RN,createMatrix:mc},ZN={matrixDependencies:HN,typedDependencies:RN,createSubset:_c},$N={NodeDependencies:UN,subsetDependencies:ZN,createAccessorNode:kb},GN={ComplexDependencies:qN,typedDependencies:RN,createAcos:_a},VN={ComplexDependencies:qN,typedDependencies:RN,createAcosh:Tu},WN={BigNumberDependencies:_N,typedDependencies:RN,createAcot:Xa},YN={BigNumberDependencies:_N,ComplexDependencies:qN,typedDependencies:RN,createAcoth:uc},JN={BigNumberDependencies:_N,ComplexDependencies:qN,typedDependencies:RN,createAcsc:eo},QN={BigNumberDependencies:_N,typedDependencies:RN,createAcsch:Ou},XN={typedDependencies:RN,createAddScalar:to},KN={typedDependencies:RN,createIsInteger:ws},eE={isIntegerDependencies:KN,matrixDependencies:HN,typedDependencies:RN,createConcat:Yc},rE={DenseMatrixDependencies:zN,SparseMatrixDependencies:LN,addScalarDependencies:XN,concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,createAdd:pp},tE={typedDependencies:RN,createNot:eu},nE={BigNumberDependencies:_N,matrixDependencies:HN,typedDependencies:RN,createZeros:Hc},iE={concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,notDependencies:tE,typedDependencies:RN,zerosDependencies:nE,createAnd:gf},aE={isIntegerDependencies:KN,typedDependencies:RN,createApply:qu},oE={isIntegerDependencies:KN,typedDependencies:RN,createApplyTransform:Bw},sE={typedDependencies:RN,createArg:no},uE={NodeDependencies:UN,createArrayNode:xb},cE={BigNumberDependencies:_N,ComplexDependencies:qN,typedDependencies:RN,createAsec:ku},lE={BigNumberDependencies:_N,ComplexDependencies:qN,typedDependencies:RN,createAsech:ao},pE={ComplexDependencies:qN,typedDependencies:RN,createAsin:$c},fE={typedDependencies:RN,createAsinh:oo},dE={matrixDependencies:HN,NodeDependencies:UN,subsetDependencies:ZN,createAssignmentNode:jb},mE={typedDependencies:RN,createAtan:so},hE={BigNumberDependencies:_N,DenseMatrixDependencies:zN,concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,createAtan2:Fd},gE={ComplexDependencies:qN,typedDependencies:RN,createAtanh:co},yE={BigNumberDependencies:_N,typedDependencies:RN,createBignumber:lo},vE={FractionDependencies:kN,typedDependencies:RN,createFraction:lc},xE={typedDependencies:RN,createNumber:ru},DE={bignumberDependencies:yE,fractionDependencies:vE,numberDependencies:xE,createNumeric:wc},bE={numericDependencies:DE,typedDependencies:RN,createDivideScalar:il},wE={DenseMatrixDependencies:zN,concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,createEqual:yl},NE={BigNumberDependencies:_N,DenseMatrixDependencies:zN,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,zerosDependencies:nE,createRound:tp},EE={DenseMatrixDependencies:zN,equalScalarDependencies:jN,matrixDependencies:HN,roundDependencies:NE,typedDependencies:RN,zerosDependencies:nE,createCeil:wf},AE={DenseMatrixDependencies:zN,equalScalarDependencies:jN,matrixDependencies:HN,roundDependencies:NE,typedDependencies:RN,zerosDependencies:nE,createFloor:qp},SE={ComplexDependencies:qN,DenseMatrixDependencies:zN,ceilDependencies:EE,equalScalarDependencies:jN,floorDependencies:AE,matrixDependencies:HN,typedDependencies:RN,zerosDependencies:nE,createFix:Lf},CE={typedDependencies:RN,createFormat:gs},ME={typedDependencies:RN,createIsNumeric:fc},FE={typedDependencies:RN,createMultiplyScalar:Ws},TE={BigNumberDependencies:_N,DenseMatrixDependencies:zN,SparseMatrixDependencies:LN,matrixDependencies:HN,typedDependencies:RN,createIdentity:_l},BE={typedDependencies:RN,createIsZero:_s},OE={typedDependencies:RN,createConj:jo},_E={matrixDependencies:HN,typedDependencies:RN,createSize:Fc},qE={addScalarDependencies:XN,conjDependencies:OE,multiplyScalarDependencies:FE,sizeDependencies:_E,typedDependencies:RN,createDot:Mp},IE={addScalarDependencies:XN,dotDependencies:qE,equalScalarDependencies:jN,matrixDependencies:HN,multiplyScalarDependencies:FE,typedDependencies:RN,createMultiply:Yp},zE={typedDependencies:RN,createUnaryMinus:oc},kE={DenseMatrixDependencies:zN,addScalarDependencies:XN,concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,unaryMinusDependencies:zE,createSubtract:cf},RE={divideScalarDependencies:bE,isZeroDependencies:BE,matrixDependencies:HN,multiplyDependencies:IE,subtractDependencies:kE,typedDependencies:RN,unaryMinusDependencies:zE,createDet:Tf},PE={absDependencies:PN,addScalarDependencies:XN,detDependencies:RE,divideScalarDependencies:bE,identityDependencies:TE,matrixDependencies:HN,multiplyDependencies:IE,typedDependencies:RN,unaryMinusDependencies:zE,createInv:jd},UE={ComplexDependencies:qN,fractionDependencies:vE,identityDependencies:TE,invDependencies:PE,matrixDependencies:HN,multiplyDependencies:IE,numberDependencies:xE,typedDependencies:RN,createPow:$d},jE={BigNumberDependencies:_N,ComplexDependencies:qN,FractionDependencies:kN,absDependencies:PN,addScalarDependencies:XN,divideScalarDependencies:bE,equalDependencies:wE,fixDependencies:SE,formatDependencies:CE,isNumericDependencies:ME,multiplyScalarDependencies:FE,numberDependencies:xE,powDependencies:UE,roundDependencies:NE,subtractDependencies:kE,createUnitClass:rm},LE={BigNumberDependencies:_N,UnitDependencies:jE,createAtomicMass:Cn},HE={BigNumberDependencies:_N,UnitDependencies:jE,createAvogadro:Mn},ZE={typedDependencies:RN,createIsNegative:Fs},$E={typedDependencies:RN,createCombinations:ko},GE={BigNumberDependencies:_N,ComplexDependencies:qN,multiplyScalarDependencies:FE,powDependencies:UE,typedDependencies:RN,createGamma:lm},VE={gammaDependencies:GE,typedDependencies:RN,createFactorial:hm},WE={DenseMatrixDependencies:zN,concatDependencies:eE,matrixDependencies:HN,typedDependencies:RN,createLarger:Lp},YE={bignumberDependencies:yE,addScalarDependencies:XN,combinationsDependencies:$E,divideScalarDependencies:bE,factorialDependencies:VE,isIntegerDependencies:KN,isNegativeDependencies:ZE,largerDependencies:WE,multiplyScalarDependencies:FE,numberDependencies:xE,powDependencies:UE,subtractDependencies:kE,typedDependencies:RN,createStirlingS2:Bm},JE={addScalarDependencies:XN,isIntegerDependencies:KN,isNegativeDependencies:ZE,stirlingS2Dependencies:YE,typedDependencies:RN,createBellNumbers:Im},QE={formatDependencies:CE,typedDependencies:RN,createBin:Ru},XE={concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,createBitAnd:dp},KE={typedDependencies:RN,createBitNot:Fo},eA={DenseMatrixDependencies:zN,concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,createBitOr:vf},rA={DenseMatrixDependencies:zN,concatDependencies:eE,matrixDependencies:HN,typedDependencies:RN,createBitXor:hp},tA={createResultSet:ei},nA={NodeDependencies:UN,ResultSetDependencies:tA,createBlockNode:bb},iA={BigNumberDependencies:_N,UnitDependencies:jE,createBohrMagneton:sn},aA={BigNumberDependencies:_N,UnitDependencies:jE,createBohrRadius:dn},oA={BigNumberDependencies:_N,UnitDependencies:jE,createBoltzmann:Fn},sA={typedDependencies:RN,createBoolean:Bo},uA={addScalarDependencies:XN,combinationsDependencies:$E,divideScalarDependencies:bE,isIntegerDependencies:KN,isNegativeDependencies:ZE,multiplyScalarDependencies:FE,typedDependencies:RN,createCatalan:yp},cA={BigNumberDependencies:_N,ComplexDependencies:qN,FractionDependencies:kN,isNegativeDependencies:ZE,matrixDependencies:HN,typedDependencies:RN,unaryMinusDependencies:zE,createCbrt:Vc},lA={typedDependencies:RN,createChainClass:Fb},pA={ChainDependencies:lA,typedDependencies:RN,createChain:_b},fA={BigNumberDependencies:_N,UnitDependencies:jE,createClassicalElectronRadius:mn},dA={typedDependencies:RN,createClone:_o},mA={DenseMatrixDependencies:zN,concatDependencies:eE,matrixDependencies:HN,typedDependencies:RN,createSmaller:ip},hA={DenseMatrixDependencies:zN,smallerDependencies:mA,createImmutableDenseMatrixClass:kp},gA={ImmutableDenseMatrixDependencies:hA,createIndexClass:Rp},yA={typedDependencies:RN,createIsPositive:Bs},vA={DenseMatrixDependencies:zN,concatDependencies:eE,matrixDependencies:HN,typedDependencies:RN,createLargerEq:kl},xA={DenseMatrixDependencies:zN,concatDependencies:eE,matrixDependencies:HN,typedDependencies:RN,createSmallerEq:of},DA={bignumberDependencies:yE,matrixDependencies:HN,addDependencies:rE,isPositiveDependencies:yA,largerDependencies:WE,largerEqDependencies:vA,smallerDependencies:mA,smallerEqDependencies:xA,typedDependencies:RN,createRange:ed},bA={IndexDependencies:gA,matrixDependencies:HN,rangeDependencies:DA,typedDependencies:RN,createColumn:Bd},wA={IndexDependencies:gA,matrixDependencies:HN,rangeDependencies:DA,typedDependencies:RN,createColumnTransform:$w},NA={typedDependencies:RN,createCombinationsWithRep:Uu},EA={BigNumberDependencies:_N,DenseMatrixDependencies:zN,FractionDependencies:kN,concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,createCompare:xp},AA={compareDependencies:EA,typedDependencies:RN,createCompareNatural:Af},SA={concatDependencies:eE,matrixDependencies:HN,typedDependencies:RN,createCompareText:Np},CA={NodeDependencies:UN,createConditionalNode:Nb},MA={NodeDependencies:UN,createConstantNode:Ab},FA={NodeDependencies:UN,typedDependencies:RN,createFunctionAssignmentNode:Bb},TA={UnitDependencies:jE,NodeDependencies:UN,createSymbolNode:Lb},BA={NodeDependencies:UN,SymbolNodeDependencies:TA,createFunctionNode:$b},OA={NodeDependencies:UN,sizeDependencies:_E,createIndexNode:Pb},_A={NodeDependencies:UN,createObjectNode:KD},qA={NodeDependencies:UN,createOperatorNode:db},IA={NodeDependencies:UN,createParenthesisNode:hb},zA={NodeDependencies:UN,createRangeNode:Cb},kA={NodeDependencies:UN,createRelationalNode:yb},RA={AccessorNodeDependencies:$N,ArrayNodeDependencies:uE,AssignmentNodeDependencies:dE,BlockNodeDependencies:nA,ConditionalNodeDependencies:CA,ConstantNodeDependencies:MA,FunctionAssignmentNodeDependencies:FA,FunctionNodeDependencies:BA,IndexNodeDependencies:OA,ObjectNodeDependencies:_A,OperatorNodeDependencies:qA,ParenthesisNodeDependencies:IA,RangeNodeDependencies:zA,RelationalNodeDependencies:kA,SymbolNodeDependencies:TA,numericDependencies:DE,typedDependencies:RN,createParse:Vb},PA={parseDependencies:RA,typedDependencies:RN,createCompile:ew},UA={ComplexDependencies:qN,typedDependencies:RN,createComplex:Po},jA={addScalarDependencies:XN,combinationsDependencies:$E,isIntegerDependencies:KN,isNegativeDependencies:ZE,isPositiveDependencies:yA,largerDependencies:WE,typedDependencies:RN,createComposition:Cf},LA={isIntegerDependencies:KN,matrixDependencies:HN,typedDependencies:RN,createConcatTransform:_w},HA={BigNumberDependencies:_N,UnitDependencies:jE,createConductanceQuantum:un},ZA={typedDependencies:RN,createCos:Lu},$A={typedDependencies:RN,createCosh:Ho},GA={BigNumberDependencies:_N,typedDependencies:RN,createCot:cc},VA={BigNumberDependencies:_N,typedDependencies:RN,createCoth:$o},WA={BigNumberDependencies:_N,UnitDependencies:jE,createCoulomb:an},YA={multiplyScalarDependencies:FE,numericDependencies:DE,typedDependencies:RN,createProd:Ac},JA={prodDependencies:YA,sizeDependencies:_E,typedDependencies:RN,createCount:Xc},QA={UnitDependencies:jE,typedDependencies:RN,createCreateUnit:nm},XA={matrixDependencies:HN,multiplyDependencies:IE,subtractDependencies:kE,typedDependencies:RN,createCross:Ff},KA={BigNumberDependencies:_N,typedDependencies:RN,createCsc:Vo},eS={BigNumberDependencies:_N,typedDependencies:RN,createCsch:Zu},rS={matrixDependencies:HN,typedDependencies:RN,createTranspose:Pc},tS={conjDependencies:OE,transposeDependencies:rS,typedDependencies:RN,createCtranspose:el},nS={typedDependencies:RN,createCube:Yo},iS={BigNumberDependencies:_N,typedDependencies:RN,createUnaryPlus:Ta},aS={addDependencies:rE,typedDependencies:RN,unaryPlusDependencies:iS,createCumSum:Ap},oS={addDependencies:rE,typedDependencies:RN,unaryPlusDependencies:iS,createCumSumTransform:Pw},sS={equalDependencies:wE,typedDependencies:RN,createDeepEqual:Cp},uS={divideScalarDependencies:bE,equalScalarDependencies:jN,invDependencies:PE,matrixDependencies:HN,multiplyDependencies:IE,typedDependencies:RN,createDivide:dm},cS={ConstantNodeDependencies:MA,FunctionNodeDependencies:BA,OperatorNodeDependencies:qA,ParenthesisNodeDependencies:IA,parseDependencies:RA,typedDependencies:RN,createResolve:Wb},lS={bignumberDependencies:yE,fractionDependencies:vE,AccessorNodeDependencies:$N,ArrayNodeDependencies:uE,ConstantNodeDependencies:MA,FunctionNodeDependencies:BA,IndexNodeDependencies:OA,ObjectNodeDependencies:_A,OperatorNodeDependencies:qA,SymbolNodeDependencies:TA,matrixDependencies:HN,typedDependencies:RN,createSimplifyConstant:Xb},pS={AccessorNodeDependencies:$N,ArrayNodeDependencies:uE,ConstantNodeDependencies:MA,FunctionNodeDependencies:BA,IndexNodeDependencies:OA,ObjectNodeDependencies:_A,OperatorNodeDependencies:qA,ParenthesisNodeDependencies:IA,SymbolNodeDependencies:TA,addDependencies:rE,divideDependencies:uS,equalDependencies:wE,isZeroDependencies:BE,multiplyDependencies:IE,parseDependencies:RA,powDependencies:UE,subtractDependencies:kE,typedDependencies:RN,createSimplifyCore:aw},fS={bignumberDependencies:yE,fractionDependencies:vE,AccessorNodeDependencies:$N,ArrayNodeDependencies:uE,ConstantNodeDependencies:MA,FunctionNodeDependencies:BA,IndexNodeDependencies:OA,ObjectNodeDependencies:_A,OperatorNodeDependencies:qA,ParenthesisNodeDependencies:IA,SymbolNodeDependencies:TA,addDependencies:rE,divideDependencies:uS,equalDependencies:wE,isZeroDependencies:BE,matrixDependencies:HN,multiplyDependencies:IE,parseDependencies:RA,powDependencies:UE,resolveDependencies:cS,simplifyConstantDependencies:lS,simplifyCoreDependencies:pS,subtractDependencies:kE,typedDependencies:RN,createSimplify:gw},dS={ConstantNodeDependencies:MA,FunctionNodeDependencies:BA,OperatorNodeDependencies:qA,ParenthesisNodeDependencies:IA,SymbolNodeDependencies:TA,equalDependencies:wE,isZeroDependencies:BE,numericDependencies:DE,parseDependencies:RA,simplifyDependencies:fS,typedDependencies:RN,createDerivative:Dw},mS={BigNumberDependencies:_N,UnitDependencies:jE,createDeuteronMass:Dn},hS={DenseMatrixDependencies:zN,SparseMatrixDependencies:LN,matrixDependencies:HN,typedDependencies:RN,createDiag:tl},gS={matrixDependencies:HN,numberDependencies:xE,subtractDependencies:kE,typedDependencies:RN,createDiff:Of},yS={bignumberDependencies:yE,matrixDependencies:HN,numberDependencies:xE,subtractDependencies:kE,typedDependencies:RN,createDiffTransform:jw},vS={ComplexDependencies:qN,typedDependencies:RN,createSqrt:nc},xS={absDependencies:PN,addScalarDependencies:XN,deepEqualDependencies:sS,divideScalarDependencies:bE,multiplyScalarDependencies:FE,sqrtDependencies:vS,subtractDependencies:kE,typedDependencies:RN,createDistance:qf},DS={DenseMatrixDependencies:zN,concatDependencies:eE,divideScalarDependencies:bE,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,createDotDivide:hl},bS={concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,multiplyScalarDependencies:FE,typedDependencies:RN,createDotMultiply:kf},wS={DenseMatrixDependencies:zN,concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,powDependencies:UE,typedDependencies:RN,createDotPow:am},NS={BigNumberDependencies:_N,createE:Rt},ES={BigNumberDependencies:_N,createEfimovFactor:Sn},AS={matrixDependencies:HN,typedDependencies:RN,createFlatten:Dl},SS={typedDependencies:RN,createIm:Ds},CS={flattenDependencies:AS,matrixDependencies:HN,sizeDependencies:_E,typedDependencies:RN,createMatrixFromColumns:Zl},MS={BigNumberDependencies:_N,FractionDependencies:kN,complexDependencies:UA,typedDependencies:RN,createSign:yu},FS={addScalarDependencies:XN,complexDependencies:UA,conjDependencies:OE,divideScalarDependencies:bE,equalDependencies:wE,identityDependencies:TE,isZeroDependencies:BE,matrixDependencies:HN,multiplyScalarDependencies:FE,signDependencies:MS,sqrtDependencies:vS,subtractDependencies:kE,typedDependencies:RN,unaryMinusDependencies:zE,zerosDependencies:nE,createQr:Xf},TS={typedDependencies:RN,createRe:mu},BS={typedDependencies:RN,createSin:vu},OS={DenseMatrixDependencies:zN,divideScalarDependencies:bE,equalScalarDependencies:jN,matrixDependencies:HN,multiplyScalarDependencies:FE,subtractDependencies:kE,typedDependencies:RN,createUsolve:df},_S={DenseMatrixDependencies:zN,divideScalarDependencies:bE,equalScalarDependencies:jN,matrixDependencies:HN,multiplyScalarDependencies:FE,subtractDependencies:kE,typedDependencies:RN,createUsolveAll:Cd},qS={absDependencies:PN,addDependencies:rE,addScalarDependencies:XN,atanDependencies:mE,bignumberDependencies:yE,columnDependencies:bA,complexDependencies:UA,cosDependencies:ZA,diagDependencies:hS,divideScalarDependencies:bE,dotDependencies:qE,equalDependencies:wE,flattenDependencies:AS,imDependencies:SS,invDependencies:PE,largerDependencies:WE,matrixDependencies:HN,matrixFromColumnsDependencies:CS,multiplyDependencies:IE,multiplyScalarDependencies:FE,numberDependencies:xE,qrDependencies:FS,reDependencies:TS,sinDependencies:BS,smallerDependencies:mA,sqrtDependencies:vS,subtractDependencies:kE,typedDependencies:RN,usolveDependencies:OS,usolveAllDependencies:_S,createEigs:km},IS={BigNumberDependencies:_N,UnitDependencies:jE,createElectricConstant:tn},zS={BigNumberDependencies:_N,UnitDependencies:jE,createElectronMass:hn},kS={BigNumberDependencies:_N,UnitDependencies:jE,createElementaryCharge:on},RS={compareTextDependencies:SA,isZeroDependencies:BE,typedDependencies:RN,createEqualText:Tp},PS={typedDependencies:RN,createErf:es},US={parseDependencies:RA,typedDependencies:RN,createEvaluate:sw},jS={typedDependencies:RN,createExp:os},LS={absDependencies:PN,addDependencies:rE,identityDependencies:TE,invDependencies:PE,multiplyDependencies:IE,typedDependencies:RN,createExpm:sm},HS={ComplexDependencies:qN,typedDependencies:RN,createExpm1:us},ZS={createFalse:Ot},$S={BigNumberDependencies:_N,UnitDependencies:jE,createFaraday:Tn},GS={BigNumberDependencies:_N,UnitDependencies:jE,createFermiCoupling:gn},VS={ComplexDependencies:qN,createI:Gt},WS={ComplexDependencies:qN,typedDependencies:RN,createLog2:$s},YS={BigNumberDependencies:_N,createTau:kt},JS={addScalarDependencies:XN,ceilDependencies:EE,conjDependencies:OE,divideScalarDependencies:bE,dotDivideDependencies:DS,expDependencies:jS,iDependencies:VS,log2Dependencies:WS,matrixDependencies:HN,multiplyScalarDependencies:FE,powDependencies:UE,tauDependencies:YS,typedDependencies:RN,createFft:um},QS={largerDependencies:WE,smallerDependencies:mA,createFibonacciHeapClass:Rf},XS={typedDependencies:RN,createFilter:ls},KS={typedDependencies:RN,createFilterTransform:Sw},eC={BigNumberDependencies:_N,createFineStructure:yn},rC={BigNumberDependencies:_N,UnitDependencies:jE,createFirstRadiation:Bn},tC={typedDependencies:RN,createForEach:ds},nC={typedDependencies:RN,createForEachTransform:Mw},iC={ComplexDependencies:qN,addDependencies:rE,divideDependencies:uS,matrixDependencies:HN,multiplyDependencies:IE,typedDependencies:RN,createFreqz:nh},aC={BigNumberDependencies:_N,UnitDependencies:jE,createGasConstant:_n},oC={BigNumberDependencies:_N,DenseMatrixDependencies:zN,concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,createGcd:Fl},sC={typedDependencies:RN,createGetMatrixDataType:vs},uC={BigNumberDependencies:_N,UnitDependencies:jE,createGravitationConstant:Xt},cC={BigNumberDependencies:_N,UnitDependencies:jE,createGravity:Ln},lC={BigNumberDependencies:_N,UnitDependencies:jE,createHartreeEnergy:vn},pC={isNumericDependencies:ME,typedDependencies:RN,createHasNumericValue:Bl},fC={parseDependencies:RA,createHelpClass:rw},dC={HelpDependencies:fC,typedDependencies:RN,createHelp:fw},mC={formatDependencies:CE,typedDependencies:RN,createHex:xs},hC={absDependencies:PN,addScalarDependencies:XN,divideScalarDependencies:bE,isPositiveDependencies:yA,multiplyScalarDependencies:FE,smallerDependencies:mA,sqrtDependencies:vS,typedDependencies:RN,createHypot:zp},gC={conjDependencies:OE,dotDivideDependencies:DS,fftDependencies:JS,typedDependencies:RN,createIfft:fm},yC={IndexDependencies:gA,typedDependencies:RN,createIndex:Zf},vC={IndexDependencies:gA,createIndexTransform:Lw},xC={BigNumberDependencies:_N,createInfinity:qt},DC={absDependencies:PN,addDependencies:rE,addScalarDependencies:XN,divideScalarDependencies:bE,equalScalarDependencies:jN,flattenDependencies:AS,isNumericDependencies:ME,isZeroDependencies:BE,matrixDependencies:HN,multiplyDependencies:IE,multiplyScalarDependencies:FE,smallerDependencies:mA,subtractDependencies:kE,typedDependencies:RN,createIntersect:$f},bC={BigNumberDependencies:_N,UnitDependencies:jE,createInverseConductanceQuantum:cn},wC={DenseMatrixDependencies:zN,concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,createMod:Gl},NC={BigNumberDependencies:_N,matrixDependencies:HN,typedDependencies:RN,createXgcd:jc},EC={BigNumberDependencies:_N,addDependencies:rE,equalDependencies:wE,isIntegerDependencies:KN,modDependencies:wC,smallerDependencies:mA,typedDependencies:RN,xgcdDependencies:NC,createInvmod:Up},AC={typedDependencies:RN,createIsNaN:Gu},SC={typedDependencies:RN,createIsPrime:Wu},CC={ComplexDependencies:qN,divideScalarDependencies:bE,typedDependencies:RN,createLog:Zp},MC={typedDependencies:RN,createMap:Gs},FC={addDependencies:rE,numericDependencies:DE,typedDependencies:RN,createSum:Ad},TC={divideDependencies:uS,dotDivideDependencies:DS,isNumericDependencies:ME,logDependencies:CC,mapDependencies:MC,matrixDependencies:HN,multiplyDependencies:IE,sumDependencies:FC,typedDependencies:RN,createKldivergence:Jm},BC={BigNumberDependencies:_N,UnitDependencies:jE,createKlitzing:fn},OC={matrixDependencies:HN,multiplyScalarDependencies:FE,typedDependencies:RN,createKron:Il},_C={BigNumberDependencies:_N,createLN10:jt},qC={BigNumberDependencies:_N,createLN2:Ut},IC={BigNumberDependencies:_N,createLOG10E:Ht},zC={BigNumberDependencies:_N,createLOG2E:Lt},kC={concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,createLcm:Gf},RC={parseDependencies:RA,typedDependencies:RN,createLeafCount:nw},PC={DenseMatrixDependencies:zN,concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,zerosDependencies:nE,createLeftShift:Ll},UC={ComplexDependencies:qN,typedDependencies:RN,createLgamma:js},jC={ComplexDependencies:qN,typedDependencies:RN,createLog10:Hs},LC={ComplexDependencies:qN,divideScalarDependencies:bE,logDependencies:CC,typedDependencies:RN,createLog1p:Wf},HC={BigNumberDependencies:_N,UnitDependencies:jE,createLoschmidt:On},ZC={DenseMatrixDependencies:zN,divideScalarDependencies:bE,equalScalarDependencies:jN,matrixDependencies:HN,multiplyScalarDependencies:FE,subtractDependencies:kE,typedDependencies:RN,createLsolve:Jf},$C={DenseMatrixDependencies:zN,divideScalarDependencies:bE,equalScalarDependencies:jN,matrixDependencies:HN,multiplyScalarDependencies:FE,subtractDependencies:kE,typedDependencies:RN,createLsolveAll:_d},GC={FibonacciHeapDependencies:QS,addScalarDependencies:XN,equalScalarDependencies:jN,createSpaClass:Ud},VC={DenseMatrixDependencies:zN,SpaDependencies:GC,SparseMatrixDependencies:LN,absDependencies:PN,addScalarDependencies:XN,divideScalarDependencies:bE,equalScalarDependencies:jN,largerDependencies:WE,matrixDependencies:HN,multiplyScalarDependencies:FE,subtractDependencies:kE,typedDependencies:RN,unaryMinusDependencies:zE,createLup:Ld},WC={SparseMatrixDependencies:LN,absDependencies:PN,addDependencies:rE,divideScalarDependencies:bE,largerDependencies:WE,largerEqDependencies:vA,multiplyDependencies:IE,subtractDependencies:kE,transposeDependencies:rS,typedDependencies:RN,createSlu:wd},YC={DenseMatrixDependencies:zN,lsolveDependencies:ZC,lupDependencies:VC,matrixDependencies:HN,sluDependencies:WC,typedDependencies:RN,usolveDependencies:OS,createLusolve:vm},JC={absDependencies:PN,addDependencies:rE,conjDependencies:OE,ctransposeDependencies:tS,eigsDependencies:qS,equalScalarDependencies:jN,largerDependencies:WE,matrixDependencies:HN,multiplyDependencies:IE,powDependencies:UE,smallerDependencies:mA,sqrtDependencies:vS,typedDependencies:RN,createNorm:oh},QC={identityDependencies:TE,matrixDependencies:HN,multiplyDependencies:IE,normDependencies:JC,qrDependencies:FS,subtractDependencies:kE,typedDependencies:RN,createSchur:fh},XC={absDependencies:PN,addDependencies:rE,concatDependencies:eE,identityDependencies:TE,indexDependencies:yC,lusolveDependencies:YC,matrixDependencies:HN,matrixFromColumnsDependencies:CS,multiplyDependencies:IE,rangeDependencies:DA,schurDependencies:QC,subsetDependencies:ZN,subtractDependencies:kE,transposeDependencies:rS,typedDependencies:RN,createSylvester:vh},KC={matrixDependencies:HN,multiplyDependencies:IE,sylvesterDependencies:XC,transposeDependencies:rS,typedDependencies:RN,createLyap:bh},eM={compareDependencies:EA,isNaNDependencies:AC,isNumericDependencies:ME,typedDependencies:RN,createPartitionSelect:ef},rM={addDependencies:rE,compareDependencies:EA,divideDependencies:uS,partitionSelectDependencies:eM,typedDependencies:RN,createMedian:Vm},tM={absDependencies:PN,mapDependencies:MC,medianDependencies:rM,subtractDependencies:kE,typedDependencies:RN,createMad:Xm},nM={BigNumberDependencies:_N,UnitDependencies:jE,createMagneticConstant:rn},iM={BigNumberDependencies:_N,UnitDependencies:jE,createMagneticFluxQuantum:ln},aM={typedDependencies:RN,createMapTransform:Fw},oM={isZeroDependencies:BE,matrixDependencies:HN,typedDependencies:RN,createMatrixFromFunction:gc},sM={flattenDependencies:AS,matrixDependencies:HN,sizeDependencies:_E,typedDependencies:RN,createMatrixFromRows:Gp},uM={largerDependencies:WE,numericDependencies:DE,typedDependencies:RN,createMax:Qf},cM={largerDependencies:WE,numericDependencies:DE,typedDependencies:RN,createMaxTransform:Iw},lM={addDependencies:rE,divideDependencies:uS,typedDependencies:RN,createMean:Um},pM={addDependencies:rE,divideDependencies:uS,typedDependencies:RN,createMeanTransform:Gw},fM={numericDependencies:DE,smallerDependencies:mA,typedDependencies:RN,createMin:Vp},dM={numericDependencies:DE,smallerDependencies:mA,typedDependencies:RN,createMinTransform:kw},mM={isNaNDependencies:AC,isNumericDependencies:ME,typedDependencies:RN,createMode:vc},hM={BigNumberDependencies:_N,UnitDependencies:jE,createMolarMass:Un},gM={BigNumberDependencies:_N,UnitDependencies:jE,createMolarMassC12:jn},yM={BigNumberDependencies:_N,UnitDependencies:jE,createMolarPlanckConstant:qn},vM={BigNumberDependencies:_N,UnitDependencies:jE,createMolarVolume:In},xM={addDependencies:rE,divideDependencies:uS,factorialDependencies:VE,isIntegerDependencies:KN,isPositiveDependencies:yA,multiplyDependencies:IE,typedDependencies:RN,createMultinomial:Dm},DM={BigNumberDependencies:_N,createNaN:It},bM={BigNumberDependencies:_N,UnitDependencies:jE,createNeutronMass:bn},wM={BigNumberDependencies:_N,concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,createNthRoot:Yl},NM={ComplexDependencies:qN,divideScalarDependencies:bE,typedDependencies:RN,createNthRoots:Qp},EM={BigNumberDependencies:_N,UnitDependencies:jE,createNuclearMagneton:pn},AM={createNull:_t},SM={formatDependencies:CE,typedDependencies:RN,createOct:tu},CM={BigNumberDependencies:_N,matrixDependencies:HN,typedDependencies:RN,createOnes:Jl},MM={DenseMatrixDependencies:zN,concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,createOr:Xp},FM={evaluateDependencies:US,createParserClass:dw},TM={ParserDependencies:FM,typedDependencies:RN,createParser:ww},BM={factorialDependencies:VE,typedDependencies:RN,createPermutations:wm},OM={BigNumberDependencies:_N,createPhi:Pt},_M={BigNumberDependencies:_N,createPi:zt},qM={typedDependencies:RN,createPickRandom:su},IM={ComplexDependencies:qN,addDependencies:rE,ctransposeDependencies:tS,deepEqualDependencies:sS,divideScalarDependencies:bE,dotDependencies:qE,dotDivideDependencies:DS,equalDependencies:wE,invDependencies:PE,matrixDependencies:HN,multiplyDependencies:IE,typedDependencies:RN,createPinv:Zd},zM={BigNumberDependencies:_N,UnitDependencies:jE,createPlanckCharge:Gn},kM={BigNumberDependencies:_N,UnitDependencies:jE,createPlanckConstant:Kt},RM={BigNumberDependencies:_N,UnitDependencies:jE,createPlanckLength:Hn},PM={BigNumberDependencies:_N,UnitDependencies:jE,createPlanckMass:Zn},UM={BigNumberDependencies:_N,UnitDependencies:jE,createPlanckTemperature:Vn},jM={BigNumberDependencies:_N,UnitDependencies:jE,createPlanckTime:$n},LM={typedDependencies:RN,createTypeOf:Mu},HM={addDependencies:rE,cbrtDependencies:cA,divideDependencies:uS,equalScalarDependencies:jN,imDependencies:SS,isZeroDependencies:BE,multiplyDependencies:IE,reDependencies:TS,sqrtDependencies:vS,subtractDependencies:kE,typeOfDependencies:LM,typedDependencies:RN,unaryMinusDependencies:zE,createPolynomialRoot:Am},ZM={typedDependencies:RN,createPrint:cu},$M={BigNumberDependencies:_N,UnitDependencies:jE,createProtonMass:xn},GM={addDependencies:rE,compareDependencies:EA,multiplyDependencies:IE,partitionSelectDependencies:eM,typedDependencies:RN,createQuantileSeq:rf},VM={BigNumberDependencies:_N,UnitDependencies:jE,createQuantumOfCirculation:wn},WM={typedDependencies:RN,createRandom:du},YM={typedDependencies:RN,createRandomInt:Ju},JM={createRangeClass:Kn},QM={bignumberDependencies:yE,matrixDependencies:HN,addDependencies:rE,isPositiveDependencies:yA,largerDependencies:WE,largerEqDependencies:vA,smallerDependencies:mA,smallerEqDependencies:xA,typedDependencies:RN,createRangeTransform:Hw},XM={bignumberDependencies:yE,fractionDependencies:vE,AccessorNodeDependencies:$N,ArrayNodeDependencies:uE,ConstantNodeDependencies:MA,FunctionNodeDependencies:BA,IndexNodeDependencies:OA,ObjectNodeDependencies:_A,OperatorNodeDependencies:qA,ParenthesisNodeDependencies:IA,SymbolNodeDependencies:TA,addDependencies:rE,divideDependencies:uS,equalDependencies:wE,isZeroDependencies:BE,matrixDependencies:HN,multiplyDependencies:IE,parseDependencies:RA,powDependencies:UE,simplifyDependencies:fS,simplifyConstantDependencies:lS,simplifyCoreDependencies:pS,subtractDependencies:kE,typedDependencies:RN,createRationalize:Ew},KM={BigNumberDependencies:_N,UnitDependencies:jE,createReducedPlanckConstant:en},eF={createReplacer:Ii},rF={isIntegerDependencies:KN,matrixDependencies:HN,typedDependencies:RN,createReshape:Cc},tF={matrixDependencies:HN,createResize:Ql},nF={createReviver:Mb},iF={DenseMatrixDependencies:zN,concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,zerosDependencies:nE,createRightArithShift:Kl},aF={DenseMatrixDependencies:zN,concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,zerosDependencies:nE,createRightLogShift:nf},oF={BigNumberDependencies:_N,DenseMatrixDependencies:zN,SparseMatrixDependencies:LN,addScalarDependencies:XN,cosDependencies:ZA,matrixDependencies:HN,multiplyScalarDependencies:FE,normDependencies:JC,sinDependencies:BS,typedDependencies:RN,unaryMinusDependencies:zE,createRotationMatrix:ch},sF={multiplyDependencies:IE,rotationMatrixDependencies:oF,typedDependencies:RN,createRotate:hh},uF={IndexDependencies:gA,matrixDependencies:HN,rangeDependencies:DA,typedDependencies:RN,createRow:rd},cF={IndexDependencies:gA,matrixDependencies:HN,rangeDependencies:DA,typedDependencies:RN,createRowTransform:Zw},lF={BigNumberDependencies:_N,UnitDependencies:jE,createRydberg:Nn},pF={BigNumberDependencies:_N,createSQRT1_2:Zt},fF={BigNumberDependencies:_N,createSQRT2:$t},dF={BigNumberDependencies:_N,createSackurTetrode:zn},mF={BigNumberDependencies:_N,typedDependencies:RN,createSec:hu},hF={BigNumberDependencies:_N,typedDependencies:RN,createSech:Xu},gF={BigNumberDependencies:_N,UnitDependencies:jE,createSecondRadiation:kn},yF={DenseMatrixDependencies:zN,IndexDependencies:gA,compareNaturalDependencies:AA,sizeDependencies:_E,subsetDependencies:ZN,typedDependencies:RN,createSetCartesian:nd},vF={DenseMatrixDependencies:zN,IndexDependencies:gA,compareNaturalDependencies:AA,sizeDependencies:_E,subsetDependencies:ZN,typedDependencies:RN,createSetDifference:Id},xF={DenseMatrixDependencies:zN,IndexDependencies:gA,compareNaturalDependencies:AA,sizeDependencies:_E,subsetDependencies:ZN,typedDependencies:RN,createSetDistinct:ad},DF={DenseMatrixDependencies:zN,IndexDependencies:gA,compareNaturalDependencies:AA,sizeDependencies:_E,subsetDependencies:ZN,typedDependencies:RN,createSetIntersect:Vd},bF={IndexDependencies:gA,compareNaturalDependencies:AA,sizeDependencies:_E,subsetDependencies:ZN,typedDependencies:RN,createSetIsSubset:sd},wF={IndexDependencies:gA,compareNaturalDependencies:AA,sizeDependencies:_E,subsetDependencies:ZN,typedDependencies:RN,createSetMultiplicity:kd},NF={IndexDependencies:gA,compareNaturalDependencies:AA,sizeDependencies:_E,subsetDependencies:ZN,typedDependencies:RN,createSetPowerset:cd},EF={compareNaturalDependencies:AA,typedDependencies:RN,createSetSize:Cm},AF={IndexDependencies:gA,concatDependencies:eE,setDifferenceDependencies:vF,sizeDependencies:_E,subsetDependencies:ZN,typedDependencies:RN,createSetSymDifference:Pd},SF={IndexDependencies:gA,concatDependencies:eE,setIntersectDependencies:DF,setSymDifferenceDependencies:AF,sizeDependencies:_E,subsetDependencies:ZN,typedDependencies:RN,createSetUnion:Yd},CF={typedDependencies:RN,createSinh:ec},MF={absDependencies:PN,addDependencies:rE,bignumberDependencies:yE,divideDependencies:uS,isNegativeDependencies:ZE,isPositiveDependencies:yA,largerDependencies:WE,mapDependencies:MC,matrixDependencies:HN,maxDependencies:uM,multiplyDependencies:IE,smallerDependencies:mA,subtractDependencies:kE,typedDependencies:RN,unaryMinusDependencies:zE,createSolveODE:Fm},FF={compareDependencies:EA,compareNaturalDependencies:AA,matrixDependencies:HN,typedDependencies:RN,createSort:Ed},TF={SparseMatrixDependencies:LN,typedDependencies:RN,createSparse:tc},BF={BigNumberDependencies:_N,UnitDependencies:jE,createSpeedOfLight:Qt},OF={typedDependencies:RN,createSplitUnit:bu},_F={absDependencies:PN,addDependencies:rE,identityDependencies:TE,invDependencies:PE,mapDependencies:MC,maxDependencies:uM,multiplyDependencies:IE,sizeDependencies:_E,sqrtDependencies:vS,subtractDependencies:kE,typedDependencies:RN,createSqrtm:Qd},qF={typedDependencies:RN,createSquare:Nu},IF={matrixDependencies:HN,typedDependencies:RN,createSqueeze:Bc},zF={addDependencies:rE,applyDependencies:aE,divideDependencies:uS,isNaNDependencies:AC,multiplyDependencies:IE,subtractDependencies:kE,typedDependencies:RN,createVariance:Zm},kF={mapDependencies:MC,sqrtDependencies:vS,typedDependencies:RN,varianceDependencies:zF,createStd:eh},RF={mapDependencies:MC,sqrtDependencies:vS,typedDependencies:RN,varianceDependencies:zF,createStdTransform:Yw},PF={BigNumberDependencies:_N,UnitDependencies:jE,createStefanBoltzmann:Rn},UF={typedDependencies:RN,createString:Au},jF={matrixDependencies:HN,typedDependencies:RN,createSubsetTransform:Ow},LF={addDependencies:rE,numericDependencies:DE,typedDependencies:RN,createSumTransform:zw},HF={OperatorNodeDependencies:qA,parseDependencies:RA,simplifyDependencies:fS,typedDependencies:RN,createSymbolicEqual:vw},ZF={typedDependencies:RN,createTan:Su},$F={typedDependencies:RN,createTanh:ic},GF={BigNumberDependencies:_N,UnitDependencies:jE,createThomsonCrossSection:En},VF={concatDependencies:eE,matrixDependencies:HN,typedDependencies:RN,createTo:op},WF={addDependencies:rE,matrixDependencies:HN,typedDependencies:RN,createTrace:lf},YF={createTrue:Bt},JF={DenseMatrixDependencies:zN,concatDependencies:eE,equalScalarDependencies:jN,matrixDependencies:HN,typedDependencies:RN,createUnequal:up},QF={UnitDependencies:jE,typedDependencies:RN,createUnitFunction:_m},XF={eDependencies:NS,createUppercaseE:Wt},KF={piDependencies:_M,createUppercasePi:Vt},eT={BigNumberDependencies:_N,UnitDependencies:jE,createVacuumImpedance:nn},rT={addDependencies:rE,applyDependencies:aE,divideDependencies:uS,isNaNDependencies:AC,multiplyDependencies:IE,subtractDependencies:kE,typedDependencies:RN,createVarianceTransform:Ww},tT={createVersion:Yt},nT={BigNumberDependencies:_N,createWeakMixingAngle:An},iT={BigNumberDependencies:_N,UnitDependencies:jE,createWienDisplacement:Pn},aT={DenseMatrixDependencies:zN,concatDependencies:eE,matrixDependencies:HN,typedDependencies:RN,createXor:lp},oT={ComplexDependencies:qN,addDependencies:rE,multiplyDependencies:IE,numberDependencies:xE,typedDependencies:RN,createZpk2tf:hf},sT=n,uT=t(4279);function cT(e,r){var t=(0,i.Z)({},a,r);if("function"!=typeof Object.create)throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var n,q,G=(n={isNumber:o,isComplex:u,isBigNumber:s,isFraction:c,isUnit:l,isString:p,isArray:f,isMatrix:d,isCollection:m,isDenseMatrix:h,isSparseMatrix:g,isRange:y,isIndex:v,isBoolean:x,isResultSet:D,isHelp:b,isFunction:w,isDate:N,isRegExp:E,isObject:A,isNull:S,isUndefined:C,isAccessorNode:M,isArrayNode:F,isAssignmentNode:T,isBlockNode:B,isConditionalNode:O,isConstantNode:_,isFunctionAssignmentNode:I,isFunctionNode:z,isIndexNode:k,isNode:R,isObjectNode:P,isOperatorNode:U,isParenthesisNode:j,isRangeNode:L,isRelationalNode:H,isSymbolNode:Z,isChain:$},q=new uT,n.on=q.on.bind(q),n.off=q.off.bind(q),n.once=q.once.bind(q),n.emit=q.emit.bind(q),n);G.config=ae(t,G.emit),G.expression={transform:{},mathWithTransform:{config:G.config}};var V={};function W(){for(var e=arguments.length,r=new Array(e),t=0;t2&&void 0!==arguments[2]?arguments[2]:r.fn;if(_i(a,"."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(a));var s=h(r)?t.expression.transform:t,u=a in t.expression.transform,c=re(s,a)?s[a]:void 0,l=function(){var n={};r.dependencies.map(Wr).forEach((e=>{if(_i(e,"."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(e));"math"===e?n.math=t:"mathWithTransform"===e?n.mathWithTransform=t.expression.mathWithTransform:"classes"===e?n.classes=t:n[e]=t[e]}));var o=r(n);if(o&&"function"==typeof o.transform)throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with exports.path="expression.transform"');if(void 0===c||i.override)return o;if(e.isTypedFunction(c)&&e.isTypedFunction(o))return e(c,o);if(i.silent)return c;throw new Error('Cannot import "'+a+'": already exists')};r.meta&&!1===r.meta.lazy?(s[a]=l(),c&&u?o(a):(h(r)||m(r))&&ee(t.expression.mathWithTransform,a,(()=>s[a]))):(ee(s,a,l),c&&u?o(a):(h(r)||m(r))&&ee(t.expression.mathWithTransform,a,(()=>s[a]))),n[a]=r,t.emit("import",a,l)}function f(e){return!re(g,e)}function m(e){return!(-1!==e.fn.indexOf(".")||re(g,e.fn)||e.meta&&e.meta.isClass)}function h(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction||!1}var g={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function(e,r){var t=arguments.length;if(1!==t&&2!==t)throw new El("import",t,1,2);r||(r={});var n,a={};for(var o in function e(t,n,i){if(Array.isArray(n))n.forEach((r=>e(t,r)));else if("object"==typeof n)for(var a in n)re(n,a)&&e(t,n[a],a);else if(Vr(n)||void 0!==i){var o=Vr(n)?h(n)?n.fn+".transform":n.fn:i;if(re(t,o)&&t[o]!==n&&!r.silent)throw new Error('Cannot import "'+o+'" twice');t[o]=n}else if(!r.silent)throw new TypeError("Factory, Object, or Array expected")}(a,e),a)if(re(a,o)){var f=a[o];if(Vr(f))p(f,r);else if("function"==typeof(n=f)||"number"==typeof n||"string"==typeof n||"boolean"==typeof n||null===n||l(n)||u(n)||s(n)||c(n)||d(n)||Array.isArray(n))i(o,f,r);else if(!r.silent)throw new TypeError("Factory, Object, or Array expected")}}}(W,0,G,V);return G.import=Y,G.on("config",(()=>{te(V).forEach((e=>{e&&e.meta&&e.meta.recreateOnConfigChange&&Y(e,{override:!0})}))})),G.create=cT.bind(null,e),G.factory=Gr,G.import(te(X(e))),G.ArgumentsError=El,G.DimensionError=ci,G.IndexError=li,G}}}]);