mathjs 5.10.2 → 5.10.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of mathjs might be problematic. Click here for more details.

package/dist/math.min.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * It features real and complex numbers, units, matrices, a large set of
7
7
  * mathematical functions, and a flexible expression parser.
8
8
  *
9
- * @version 5.10.2
9
+ * @version 5.10.3
10
10
  * @date 2019-05-18
11
11
  *
12
12
  * @license
@@ -52,5 +52,5 @@
52
52
  * Copyright (c) 2015, Robert Eisele (robert@xarg.org)
53
53
  * Dual licensed under the MIT or GPL Version 2 licenses.
54
54
  **/
55
- !function(){"use strict";var d={s:1,n:0,d:1};function e(t){function e(){var e=Error.apply(this,arguments);e.name=this.name=t,this.stack=e.stack,this.message=e.message}function r(){}return r.prototype=Error.prototype,e.prototype=new r,e}var y=c.DivisionByZero=e("DivisionByZero"),t=c.InvalidParameter=e("InvalidParameter");function g(e,t){return isNaN(e=parseInt(e,10))&&v(),e*t}function v(){throw new t}var n=function(e,t){var r,n=0,i=1,o=1,a=0,s=0,u=0,c=1,f=1,l=0,p=1,m=1,h=1;if(null==e);else if(void 0!==t)o=(n=e)*(i=t);else switch(typeof e){case"object":"d"in e&&"n"in e?(n=e.n,i=e.d,"s"in e&&(n*=e.s)):0 in e?(n=e[0],1 in e&&(i=e[1])):v(),o=n*i;break;case"number":if(e<0&&(e=-(o=e)),e%1==0)n=e;else if(0<e){for(1<=e&&(e/=f=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)));p<=1e7&&h<=1e7;){if(e===(r=(l+m)/(p+h))){i=p+h<=1e7?(n=l+m,p+h):p<h?(n=m,h):(n=l,p);break}r<e?(l+=m,p+=h):(m+=l,h+=p),i=1e7<p?(n=m,h):(n=l,p)}n*=f}else(isNaN(e)||isNaN(t))&&(i=n=NaN);break;case"string":if(null===(p=e.match(/\d+|./g))&&v(),"-"===p[l]?(o=-1,l++):"+"===p[l]&&l++,p.length===l+1?s=g(p[l++],o):"."===p[l+1]||"."===p[l]?("."!==p[l]&&(a=g(p[l++],o)),(++l+1===p.length||"("===p[l+1]&&")"===p[l+3]||"'"===p[l+1]&&"'"===p[l+3])&&(s=g(p[l],o),c=Math.pow(10,p[l].length),l++),("("===p[l]&&")"===p[l+2]||"'"===p[l]&&"'"===p[l+2])&&(u=g(p[l+1],o),f=Math.pow(10,p[l+1].length)-1,l+=3)):"/"===p[l+1]||":"===p[l+1]?(s=g(p[l],o),c=g(p[l+2],1),l+=3):"/"===p[l+3]&&" "===p[l+1]&&(a=g(p[l],o),s=g(p[l+2],o),c=g(p[l+4],1),l+=5),p.length<=l){o=n=u+(i=c*f)*a+f*s;break}default:v()}if(0===i)throw new y;d.s=o<0?-1:1,d.n=Math.abs(n),d.d=Math.abs(i)};function u(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function c(e,t){if(!(this instanceof c))return new c(e,t);n(e,t),e=c.REDUCE?u(d.d,d.n):1,this.s=d.s,this.n=d.n/e,this.d=d.d/e}c.REDUCE=1,c.prototype={s:1,n:0,d:1,abs:function(){return new c(this.n,this.d)},neg:function(){return new c(-this.s*this.n,this.d)},add:function(e,t){return n(e,t),new c(this.s*this.n*d.d+d.s*this.d*d.n,this.d*d.d)},sub:function(e,t){return n(e,t),new c(this.s*this.n*d.d-d.s*this.d*d.n,this.d*d.d)},mul:function(e,t){return n(e,t),new c(this.s*d.s*this.n*d.n,this.d*d.d)},div:function(e,t){return n(e,t),new c(this.s*d.s*this.n*d.d,this.d*d.n)},clone:function(){return new c(this)},mod:function(e,t){return isNaN(this.n)||isNaN(this.d)?new c(NaN):void 0===e?new c(this.s*this.n%this.d,1):(n(e,t),0===d.n&&0===this.d&&c(0,0),new c(this.s*(d.d*this.n)%(d.n*this.d),d.d*this.d))},gcd:function(e,t){return n(e,t),new c(u(d.n,this.n)*u(d.d,this.d),d.d*this.d)},lcm:function(e,t){return n(e,t),0===d.n&&0===this.n?new c:new c(d.n*this.n,u(d.n,this.n)*u(d.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new c(NaN):new c(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 c(NaN):new c(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 c(NaN):new c(Math.round(e*this.s*this.n/this.d),e)},inverse:function(){return new c(this.s*this.d,this.n)},pow:function(e){return e<0?new c(Math.pow(this.s*this.d,-e),Math.pow(this.n,-e)):new c(Math.pow(this.s*this.n,e),Math.pow(this.d,e))},equals:function(e,t){return n(e,t),this.s*this.n*d.d==d.s*d.n*this.d},compare:function(e,t){n(e,t);var r=this.s*this.n*d.d-d.s*d.n*this.d;return(0<r)-(r<0)},simplify:function(e){if(isNaN(this.n)||isNaN(this.d))return this;var t=this.abs().toContinued();function r(e){return 1===e.length?new c(e[0]):r(e.slice(1)).inverse().add(e[0])}e=e||.001;for(var n=0;n<t.length;n++){var i=r(t.slice(0,n+1));if(i.sub(this.abs()).abs().valueOf()<e)return i.mul(this.s)}return this},divisible:function(e,t){return n(e,t),!(!(d.n*this.d)||this.n*d.d%(d.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(e){var t,r="",n=this.n,i=this.d;return this.s<0&&(r+="-"),1===i?r+=n:(e&&0<(t=Math.floor(n/i))&&(r+=t,r+=" ",n%=i),r+=n,r+="/",r+=i),r},toLatex:function(e){var t,r="",n=this.n,i=this.d;return this.s<0&&(r+="-"),1===i?r+=n:(e&&0<(t=Math.floor(n/i))&&(r+=t,n%=i),r+="\\frac{",r+=n,r+="}{",r+=i,r+="}"),r},toContinued:function(){var e,t=this.n,r=this.d,n=[];if(isNaN(this.n)||isNaN(this.d))return n;for(;n.push(Math.floor(t/r)),e=t%r,t=r,r=e,1!==t;);return n},toString:function(e){var t,r=this.n,n=this.d;if(isNaN(r)||isNaN(n))return"NaN";c.REDUCE||(r/=t=u(r,n),n/=t),e=e||15;var i=function(e,t){for(;t%2==0;t/=2);for(;t%5==0;t/=5);if(1===t)return 0;for(var r=10%t,n=1;1!==r;n++)if(r=10*r%t,2e3<n)return 0;return n}(0,n),o=function(e,t,r){for(var n=1,i=function(e,t,r){for(var n=1;0<t;e=e*e%r,t>>=1)1&t&&(n=n*e%r);return n}(10,r,t),o=0;o<300;o++){if(n===i)return o;n=10*n%t,i=10*i%t}return 0}(0,n,i),a=-1===this.s?"-":"";if(a+=r/n|0,r%=n,(r*=10)&&(a+="."),i){for(var s=o;s--;)a+=r/n|0,r%=n,r*=10;a+="(";for(s=i;s--;)a+=r/n|0,r%=n,r*=10;a+=")"}else for(s=e;r&&s--;)a+=r/n|0,r%=n,r*=10;return a}},void 0===(o=function(){return c}.apply(i,[]))||(r.exports=o)}()},function(e,t,r){"use strict";e.exports=[r(84),r(49),r(186),r(187),r(188),r(189),r(24),r(106),r(190),r(0),r(191),r(63)]},function(e,t){"use strict";t.isBoolean=function(e){return"boolean"==typeof e}},function(e,t,a){"use strict";var s=a(31),x=a(8),y=s.array,w=s.object,N=s.string,S=s.number,O=Array.isArray,T=S.isNumber,_=S.isInteger,C=N.isString,z=y.validateIndex;t.name="SparseMatrix",t.path="type",t.factory=function(b,e,t,M){var r=t(a(84)),E=t(a(11)),n=t(a(63));function A(e,t){if(!(this instanceof A))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!C(t))throw new Error("Invalid datatype: "+t);if(b.isMatrix(e))!function(e,t,r){"SparseMatrix"===t.type?(e._values=t._values?w.clone(t._values):void 0,e._index=w.clone(t._index),e._ptr=w.clone(t._ptr),e._size=w.clone(t._size),e._datatype=r||t._datatype):i(e,t.valueOf(),r||t._datatype)}(this,e,t);else if(e&&O(e.index)&&O(e.ptr)&&O(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=t||e.datatype;else if(O(e))i(this,e,t);else{if(e)throw new TypeError("Unsupported type of data ("+s.types.type(e)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}}function i(e,t,r){e._values=[],e._index=[],e._ptr=[],e._datatype=r;var n=t.length,i=0,o=E,a=0;if(C(r)&&(o=M.find(E,[r,r])||E,a=M.convert(0,r)),0<n){var s=0;do{e._ptr.push(e._index.length);for(var u=0;u<n;u++){var c=t[u];if(O(c)){if(0===s&&i<c.length&&(i=c.length),s<c.length){var f=c[s];o(f,a)||(e._values.push(f),e._index.push(u))}}else 0===s&&i<1&&(i=1),o(c,a)||(e._values.push(c),e._index.push(u))}s++}while(s<i)}e._ptr.push(e._index.length),e._size=[n,i]}function g(e,t,r,n){if(r-t==0)return r;for(var i=t;i<r;i++)if(n[i]===e)return i;return t}function v(e,t,r,n,i,o,a){i.splice(e,0,n),o.splice(e,0,t);for(var s=r+1;s<a.length;s++)a[s]++}function f(e,t,r,n){var i=n||0,o=E,a=0;C(e._datatype)&&(o=M.find(E,[e._datatype,e._datatype])||E,a=M.convert(0,e._datatype),i=M.convert(i,e._datatype));var s,u,c,f=!o(i,a),l=e._size[0],p=e._size[1];if(p<r){for(u=p;u<r;u++)if(e._ptr[u]=e._values.length,f)for(s=0;s<l;s++)e._values.push(i),e._index.push(s);e._ptr[r]=e._values.length}else r<p&&(e._ptr.splice(r+1,p-r),e._values.splice(e._ptr[r],e._values.length),e._index.splice(e._ptr[r],e._index.length));if(p=r,l<t){if(f){var m=0;for(u=0;u<p;u++){e._ptr[u]=e._ptr[u]+m,c=e._ptr[u+1]+m;var h=0;for(s=l;s<t;s++,h++)e._values.splice(c+h,0,i),e._index.splice(c+h,0,s),m++}e._ptr[p]=e._values.length}}else if(t<l){var d=0;for(u=0;u<p;u++){e._ptr[u]=e._ptr[u]-d;var y=e._ptr[u],g=e._ptr[u+1]-d;for(c=y;c<g;c++)t-1<(s=e._index[c])&&(e._values.splice(c,1),e._index.splice(c,1),d++)}e._ptr[u]=e._values.length}return e._size[0]=t,e._size[1]=r,e}function o(e,t,r,n,i){var o,a,s=n[0],u=n[1],c=[];for(o=0;o<s;o++)for(c[o]=[],a=0;a<u;a++)c[o][a]=0;for(a=0;a<u;a++)for(var f=r[a],l=r[a+1],p=f;p<l;p++)c[o=t[p]][a]=e?i?w.clone(e[p]):e[p]:1;return c}return(A.prototype=new r).type="SparseMatrix",A.prototype.isSparseMatrix=!0,A.prototype.getDataType=function(){return n(this._values)},A.prototype.storage=function(){return"sparse"},A.prototype.datatype=function(){return this._datatype},A.prototype.create=function(e,t){return new A(e,t)},A.prototype.density=function(){var e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},A.prototype.subset=function(e,t,r){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return function(e,t){if(!b.isIndex(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var r,n,i,o,a=t.size();if(a.length!==e._size.length)throw new x(a.length,e._size.length);var s=t.min(),u=t.max();for(r=0,n=e._size.length;r<n;r++)z(s[r],e._size[r]),z(u[r],e._size[r]);var c=e._values,f=e._index,l=e._ptr,p=t.dimension(0),m=t.dimension(1),h=[],d=[];p.forEach(function(e,t){d[e]=t[0],h[e]=!0});var y=c?[]:void 0,g=[],v=[];return m.forEach(function(e){for(v.push(g.length),i=l[e],o=l[e+1];i<o;i++)r=f[i],!0===h[r]&&(g.push(d[r]),y&&y.push(c[i]))}),v.push(g.length),new A({values:y,index:g,ptr:v,size:a,datatype:e._datatype})}(this,e);case 2:case 3:return function(e,t,r,n){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");var i,o=t.size(),a=t.isScalar();b.isMatrix(r)?(i=r.size(),r=r.toArray()):i=y.size(r);if(a){if(0!==i.length)throw new TypeError("Scalar expected");e.set(t.min(),r,n)}else{if(1!==o.length&&2!==o.length)throw new x(o.length,e._size.length,"<");if(i.length<o.length){for(var s=0,u=0;1===o[s]&&1===i[s];)s++;for(;1===o[s];)u++,s++;r=y.unsqueeze(r,o.length,u,i)}if(!w.deepEqual(o,i))throw new x(o,i,">");for(var c=t.min()[0],f=t.min()[1],l=i[0],p=i[1],m=0;m<l;m++)for(var h=0;h<p;h++){var d=r[m][h];e.set([m+c,h+f],d,n)}}return e}(this,e,t,r);default:throw new SyntaxError("Wrong number of arguments")}},A.prototype.get=function(e){if(!O(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new x(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var t=e[0],r=e[1];z(t,this._size[0]),z(r,this._size[1]);var n=g(t,this._ptr[r],this._ptr[r+1],this._index);return n<this._ptr[r+1]&&this._index[n]===t?this._values[n]:0},A.prototype.set=function(e,t,r){if(!O(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new x(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var n=e[0],i=e[1],o=this._size[0],a=this._size[1],s=E,u=0;C(this._datatype)&&(s=M.find(E,[this._datatype,this._datatype])||E,u=M.convert(0,this._datatype)),(o-1<n||a-1<i)&&(f(this,Math.max(n+1,o),Math.max(i+1,a),r),o=this._size[0],a=this._size[1]),z(n,o),z(i,a);var c=g(n,this._ptr[i],this._ptr[i+1],this._index);return c<this._ptr[i+1]&&this._index[c]===n?s(t,u)?function(e,t,r,n,i){r.splice(e,1),n.splice(e,1);for(var o=t+1;o<i.length;o++)i[o]--}(c,i,this._values,this._index,this._ptr):this._values[c]=t:v(c,n,i,t,this._values,this._index,this._ptr),this},A.prototype.resize=function(t,e,r){if(!O(t))throw new TypeError("Array expected");if(2!==t.length)throw new Error("Only two dimensions matrix are supported");return t.forEach(function(e){if(!S.isNumber(e)||!S.isInteger(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+N.format(t)+")")}),f(r?this.clone():this,t[0],t[1],e)},A.prototype.reshape=function(t,e){if(!O(t))throw new TypeError("Array expected");if(2!==t.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");if(t.forEach(function(e){if(!S.isNumber(e)||!S.isInteger(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+N.format(t)+")")}),this._size[0]*this._size[1]!=t[0]*t[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var r=e?this.clone():this;if(this._size[0]===t[0]&&this._size[1]===t[1])return r;for(var n=[],i=0;i<r._ptr.length;i++)for(var o=0;o<r._ptr[i+1]-r._ptr[i];o++)n.push(i);for(var a=r._values.slice(),s=r._index.slice(),u=0;u<r._index.length;u++){var c=s[u],f=n[u],l=c*r._size[1]+f;n[u]=l%t[1],s[u]=Math.floor(l/t[1])}r._values.length=0,r._index.length=0,r._ptr.length=t[1]+1,r._size=t.slice();for(var p=0;p<r._ptr.length;p++)r._ptr[p]=0;for(var m=0;m<a.length;m++){var h=s[m],d=n[m],y=a[m];v(g(h,r._ptr[d],r._ptr[d+1],r._index),h,d,y,r._values,r._index,r._ptr)}return r},A.prototype.clone=function(){return new A({values:this._values?w.clone(this._values):void 0,index:w.clone(this._index),ptr:w.clone(this._ptr),size:w.clone(this._size),datatype:this._datatype})},A.prototype.size=function(){return this._size.slice(0)},A.prototype.map=function(n,e){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var i=this;return function(e,t,r,n,i,o,a){var s=[],u=[],c=[],f=E,l=0;C(e._datatype)&&(f=M.find(E,[e._datatype,e._datatype])||E,l=M.convert(0,e._datatype));for(var p=function(e,t,r){e=o(e,t,r),f(e,l)||(s.push(e),u.push(t))},m=n;m<=i;m++){c.push(s.length);var h=e._ptr[m],d=e._ptr[m+1];if(a)for(var y=h;y<d;y++){var g=e._index[y];t<=g&&g<=r&&p(e._values[y],g-t,m-n)}else{for(var v={},x=h;x<d;x++){var b=e._index[x];v[b]=e._values[x]}for(var w=t;w<=r;w++){var N=w in v?v[w]:0;p(N,w-t,m-n)}}}return c.push(s.length),new A({values:s,index:u,ptr:c,size:[r-t+1,i-n+1]})}(this,0,this._size[0]-1,0,this._size[1]-1,function(e,t,r){return n(e,[t,r],i)},e)},A.prototype.forEach=function(e,t){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var r=this._size[0],n=this._size[1],i=0;i<n;i++){var o=this._ptr[i],a=this._ptr[i+1];if(t)for(var s=o;s<a;s++){var u=this._index[s];e(this._values[s],[u,i],this)}else{for(var c={},f=o;f<a;f++){c[this._index[f]]=this._values[f]}for(var l=0;l<r;l++){e(l in c?c[l]:0,[l,i],this)}}}},A.prototype.toArray=function(){return o(this._values,this._index,this._ptr,this._size,!0)},A.prototype.valueOf=function(){return o(this._values,this._index,this._ptr,this._size,!1)},A.prototype.format=function(e){for(var t=this._size[0],r=this._size[1],n=this.density(),i="Sparse Matrix ["+N.format(t,e)+" x "+N.format(r,e)+"] density: "+N.format(n,e)+"\n",o=0;o<r;o++)for(var a=this._ptr[o],s=this._ptr[o+1],u=a;u<s;u++){var c=this._index[u];i+="\n ("+N.format(c,e)+", "+N.format(o,e)+") ==> "+(this._values?N.format(this._values[u],e):"X")}return i},A.prototype.toString=function(){return N.format(this.toArray())},A.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},A.prototype.diagonal=function(e){if(e){if(b.isBigNumber(e)&&(e=e.toNumber()),!T(e)||!_(e))throw new TypeError("The parameter k must be an integer number")}else e=0;var t=0<e?e:0,r=e<0?-e:0,n=this._size[0],i=this._size[1],o=Math.min(n-r,i-t),a=[],s=[],u=[];u[0]=0;for(var c=t;c<i&&a.length<o;c++)for(var f=this._ptr[c],l=this._ptr[c+1],p=f;p<l;p++){var m=this._index[p];if(m===c-t+r){a.push(this._values[p]),s[a.length-1]=m-r;break}}return u.push(a.length),new A({values:a,index:s,ptr:u,size:[o,1]})},A.fromJSON=function(e){return new A(e)},A.diagonal=function(e,t,r,n,i){if(!O(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map(function(e){if(b.isBigNumber(e)&&(e=e.toNumber()),!T(e)||!_(e)||e<1)throw new Error("Size values must be positive integers");return e}),r){if(b.isBigNumber(r)&&(r=r.toNumber()),!T(r)||!_(r))throw new TypeError("The parameter k must be an integer number")}else r=0;var o=E,a=0;C(i)&&(o=M.find(E,[i,i])||E,a=M.convert(0,i));var s,u=0<r?r:0,c=r<0?-r:0,f=e[0],l=e[1],p=Math.min(f-c,l-u);if(O(t)){if(t.length!==p)throw new Error("Invalid value array length");s=function(e){return t[e]}}else if(b.isMatrix(t)){var m=t.size();if(1!==m.length||m[0]!==p)throw new Error("Invalid matrix length");s=function(e){return t.get([e])}}else s=function(){return t};for(var h=[],d=[],y=[],g=0;g<l;g++){y.push(h.length);var v=g-u;if(0<=v&&v<p){var x=s(v);o(x,a)||(d.push(v+c),h.push(x))}}return y.push(h.length),new A({values:h,index:d,ptr:y,size:[f,l]})},A.prototype.swapRows=function(e,t){if(!(T(e)&&_(e)&&T(t)&&_(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return z(e,this._size[0]),z(t,this._size[0]),A._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},A._forEachRow=function(e,t,r,n,i){for(var o=n[e],a=n[e+1],s=o;s<a;s++)i(r[s],t[s])},A._swapRows=function(e,t,r,n,i,o){for(var a=0;a<r;a++){var s=o[a],u=o[a+1],c=g(e,s,u,i),f=g(t,s,u,i);if(c<u&&f<u&&i[c]===e&&i[f]===t){if(n){var l=n[c];n[c]=n[f],n[f]=l}}else if(c<u&&i[c]===e&&(u<=f||i[f]!==t)){var p=n?n[c]:void 0;i.splice(f,0,t),n&&n.splice(f,0,p),i.splice(f<=c?c+1:c,1),n&&n.splice(f<=c?c+1:c,1)}else if(f<u&&i[f]===t&&(u<=c||i[c]!==e)){var m=n?n[f]:void 0;i.splice(c,0,e),n&&n.splice(c,0,m),i.splice(c<=f?f+1:f,1),n&&n.splice(c<=f?f+1:f,1)}}},b.Matrix._storage.sparse=A},t.lazy=!1},function(e,t,o){"use strict";t.name="Spa",t.path="type",t.factory=function(e,t,r){var n=r(o(14)),c=r(o(11));function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new e.FibonacciHeap}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(e,t){if(this._values[e])this._values[e].value=t;else{var r=this._heap.insert(e,t);this._values[e]=r}},i.prototype.get=function(e){var t=this._values[e];return t?t.value:0},i.prototype.accumulate=function(e,t){var r=this._values[e];r?r.value=n(r.value,t):(r=this._heap.insert(e,t),this._values[e]=r)},i.prototype.forEach=function(e,t,r){var n=this._heap,i=this._values,o=[],a=n.extractMinimum();for(a&&o.push(a);a&&a.key<=t;)a.key>=e&&(c(a.value,0)||r(a.key,a.value,this)),(a=n.extractMinimum())&&o.push(a);for(var s=0;s<o.length;s++){var u=o[s];i[(a=n.insert(u.key,u.value)).key]=a}},i.prototype.swap=function(e,t){var r=this._values[e],n=this._values[t];if(!r&&n)r=this._heap.insert(e,n.value),this._heap.remove(n),this._values[e]=r,this._values[t]=void 0;else if(r&&!n)n=this._heap.insert(t,r.value),this._heap.remove(r),this._values[t]=n,this._values[e]=void 0;else if(r&&n){var i=r.value;r.value=n.value,n.value=i}},i}},function(e,t,o){"use strict";t.name="FibonacciHeap",t.path="type",t.factory=function(e,t,r){var l=r(o(38)),p=r(o(33)),m=1/Math.log((1+Math.sqrt(5))/2);function n(){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}function i(e,t,r){t.left.right=t.right,t.right.left=t.left,r.degree--,r.child===t&&(r.child=t.right),0===r.degree&&(r.child=null),t.left=e,t.right=e.right,((e.right=t).right.left=t).parent=null,t.mark=!1}n.prototype.type="FibonacciHeap",n.prototype.isFibonacciHeap=!0,n.prototype.insert=function(e,t){var r={key:e,value:t,degree:0};if(this._minimum){var n=this._minimum;r.left=n,r.right=n.right,(n.right=r).right.left=r,l(e,n.key)&&(this._minimum=r)}else(r.left=r).right=r,this._minimum=r;return this._size++,r},n.prototype.size=function(){return this._size},n.prototype.clear=function(){this._minimum=null,this._size=0},n.prototype.isEmpty=function(){return 0===this._size},n.prototype.extractMinimum=function(){var e=this._minimum;if(null===e)return e;for(var t=this._minimum,r=e.degree,n=e.child;0<r;){var i=n.right;n.left.right=n.right,n.right.left=n.left,n.left=t,n.right=t.right,((t.right=n).right.left=n).parent=null,n=i,r--}return e.left.right=e.right,e.right.left=e.left,t=e===e.right?null:function(e,t){var r,n=Math.floor(Math.log(t)*m)+1,i=new Array(n),o=0,a=e;if(a)for(o++,a=a.right;a!==e;)o++,a=a.right;for(;0<o;){for(var s=a.degree,u=a.right;r=i[s];){if(p(a.key,r.key)){var c=r;r=a,a=c}h(r,a),i[s]=null,s++}i[s]=a,a=u,o--}e=null;for(var f=0;f<n;f++)(r=i[f])&&(e?(r.left.right=r.right,r.right.left=r.left,r.left=e,r.right=e.right,(e.right=r).right.left=r,l(r.key,e.key)&&(e=r)):e=r);return e}(t=e.right,this._size),this._size--,this._minimum=t,e},n.prototype.remove=function(e){this._minimum=function(e,t,r){t.key=r;var n=t.parent;n&&l(t.key,n.key)&&(i(e,t,n),function e(t,r){var n=r.parent;if(!n)return;r.mark?(i(t,r,n),e(n)):r.mark=!0}(e,n));l(t.key,e.key)&&(e=t);return e}(this._minimum,e,-1),this.extractMinimum()};var h=function(e,t){e.left.right=e.right,e.right.left=e.left,(e.parent=t).child?(e.left=t.child,e.right=t.child.right,(t.child.right=e).right.left=e):((t.child=e).right=e).left=e,t.degree++,e.mark=!1};return n}},function(e,t,a){"use strict";var s=a(31),r=s.string,u=s.object,c=Array.isArray,f=r.isString;t.name="ImmutableDenseMatrix",t.path="type",t.factory=function(n,e,t){var i=t(a(49)),r=t(a(38));function o(e,t){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!f(t))throw new Error("Invalid datatype: "+t);if(n.isMatrix(e)||c(e)){var r=new i(e,t);this._data=r._data,this._size=r._size,this._datatype=r._datatype,this._min=null,this._max=null}else if(e&&c(e.data)&&c(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 ("+s.types.type(e)+")");this._data=[],this._size=[0],this._datatype=t,this._min=null,this._max=null}}return(o.prototype=new i).type="ImmutableDenseMatrix",o.prototype.isImmutableDenseMatrix=!0,o.prototype.subset=function(e){switch(arguments.length){case 1:var t=i.prototype.subset.call(this,e);return n.isMatrix(t)?new o({data:t._data,size:t._size,datatype:t._datatype}):t;case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},o.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},o.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},o.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},o.prototype.clone=function(){return new o({data:u.clone(this._data),size:u.clone(this._size),datatype:this._datatype})},o.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},o.fromJSON=function(e){return new o(e)},o.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},o.prototype.min=function(){if(null===this._min){var t=null;this.forEach(function(e){null!==t&&!r(e,t)||(t=e)}),this._min=null!==t?t:void 0}return this._min},o.prototype.max=function(){if(null===this._max){var t=null;this.forEach(function(e){null!==t&&!r(t,e)||(t=e)}),this._max=null!==t?t:void 0}return this._max},o}},function(e,t){"use strict";t.name="index",t.factory=function(n,e,t,r){return r("index",{"...number | string | BigNumber | Range | Array | Matrix":function(e){var t=e.map(function(e){return n.isBigNumber(e)?e.toNumber():Array.isArray(e)||n.isMatrix(e)?e.map(function(e){return n.isBigNumber(e)?e.toNumber():e}):e}),r=new n.Index;return n.Index.apply(r,t),r}})}},function(e,t){"use strict";t.name="sparse",t.factory=function(e,t,r,n){var i=e.SparseMatrix,o=n("sparse",{"":function(){return new i([])},string:function(e){return new i([],e)},"Array | Matrix":function(e){return new i(e)},"Array | Matrix, string":function(e,t){return new i(e,t)}});return o.toTex={0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},o}},function(e,t,r){"use strict";e.exports=[r(107)]},function(e,t,r){"use strict";var o=r(1),a=r(3);t.name="string",t.factory=function(e,t,r,n){var i=n("string",{"":function(){return""},number:a.format,null:function(){return"null"},boolean:function(e){return e+""},string:function(e){return e},"Array | Matrix":function(e){return o(e,i)},any:function(e){return String(e)}});return i.toTex={0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";e.exports=[r(195),r(196),r(197),r(198),r(199)]},function(e,t,Y){"use strict";function J(e){return(J="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})(e)}function W(){return(W=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var X=Y(9).endsWith,Q=Y(5).clone,K=Y(108);t.name="Unit",t.path="type",t.factory=function(y,g,e,t,r){var v,x,b,c=e(Y(17)),f=e(Y(15)),l=e(Y(21)),p=e(Y(12)),m=e(Y(42)),h=e(Y(25)),d=e(Y(109)),w=e(Y(67)),N=e(Y(51)),i=e(Y(52)),s=e(Y(112)),M=e(Y(26)),n=e(Y(64)),o=e(Y(82));function E(e,t){if(!(this instanceof E))throw new Error("Constructor must be called with the new operator");if(null!=e&&!i(e)&&!y.isComplex(e))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(void 0!==t&&("string"!=typeof t||""===t))throw new TypeError("Second parameter in Unit constructor must be a string");if(void 0!==t){var r=E.parse(t);this.units=r.units,this.dimensions=r.dimensions}else{this.units=[{unit:R,prefix:B.NONE,power:0}],this.dimensions=[];for(var n=0;n<I.length;n++)this.dimensions[n]=0}this.value=null!=e?this._normalize(e):null,this.fixPrefix=!1,this.skipAutomaticSimplification=!0}function A(){for(;" "===b||"\t"===b;)S()}function a(e){return"0"<=e&&e<="9"}function S(){x++,b=v.charAt(x)}function u(e){x=e,b=v.charAt(x)}function O(){var e,t="";if(e=x,"+"===b?S():"-"===b&&(t+=b,S()),!function(e){return"0"<=e&&e<="9"||"."===e}(b))return u(e),null;if("."===b){if(t+=b,S(),!a(b))return u(e),null}else{for(;a(b);)t+=b,S();"."===b&&(t+=b,S())}for(;a(b);)t+=b,S();if("E"===b||"e"===b){var r="",n=x;if(r+=b,S(),"+"!==b&&"-"!==b||(r+=b,S()),!a(b))return u(n),t;for(t+=r;a(b);)t+=b,S()}return t}function T(){for(var e="",t=v.charCodeAt(x);48<=t&&t<=57||65<=t&&t<=90||97<=t&&t<=122;)e+=b,S(),t=v.charCodeAt(x);return(65<=(t=e.charCodeAt(0))&&t<=90||97<=t&&t<=122)&&e||null}function _(e){return b===e?(S(),e):null}function C(e){if(q.hasOwnProperty(e)){var t=q[e];return{unit:t,prefix:t.prefixes[""]}}for(var r in q)if(q.hasOwnProperty(r)&&X(e,r)){var n=q[r],i=e.length-r.length,o=e.substring(0,i),a=n.prefixes.hasOwnProperty(o)?n.prefixes[o]:void 0;if(void 0!==a)return{unit:n,prefix:a}}return null}function z(e){return e.equalBase(k.NONE)&&null!==e.value&&!g.predictable?e.value:e}E.prototype.type="Unit",E.prototype.isUnit=!0,E.parse=function(e,t){if(t=t||{},x=-1,b="","string"!=typeof(v=e))throw new TypeError("Invalid argument in Unit.parse, string expected");var r=new E,n=1,i=!(r.units=[]);S(),A();var o=O(),a=null;o&&(a="BigNumber"===g.number?new y.BigNumber(o):"Fraction"===g.number?new y.Fraction(o):parseFloat(o),A(),_("*")?(n=1,i=!0):_("/")&&(n=-1,i=!0));for(var s=[],u=1;;){for(A();"("===b;)s.push(n),u*=n,n=1,S(),A();var c=void 0;if(!b)break;var f=b;if(null===(c=T()))throw new SyntaxError('Unexpected "'+f+'" in "'+v+'" at index '+x.toString());var l=C(c);if(null===l)throw new SyntaxError('Unit "'+c+'" not found.');var p=n*u;if(A(),_("^")){A();var m=O();if(null===m)throw new SyntaxError('In "'+e+'", "^" must be followed by a floating-point number');p*=m}r.units.push({unit:l.unit,prefix:l.prefix,power:p});for(var h=0;h<I.length;h++)r.dimensions[h]+=(l.unit.dimensions[h]||0)*p;for(A();")"===b;){if(0===s.length)throw new SyntaxError('Unmatched ")" in "'+v+'" at index '+x.toString());u/=s.pop(),S(),A()}if(i=!1,_("*")?(n=1,i=!0):_("/")?(n=-1,i=!0):n=1,l.unit.base){var d=l.unit.base.key;j.auto[d]={unit:l.unit,prefix:l.prefix}}}if(A(),b)throw new SyntaxError('Could not parse: "'+e+'"');if(i)throw new SyntaxError('Trailing characters: "'+e+'"');if(0!==s.length)throw new SyntaxError('Unmatched "(" in "'+v+'"');if(0===r.units.length&&!t.allowNoUnits)throw new SyntaxError('"'+e+'" contains no units');return r.value=void 0!==a?r._normalize(a):null,r},E.prototype.clone=function(){var e=new E;e.fixPrefix=this.fixPrefix,e.skipAutomaticSimplification=this.skipAutomaticSimplification,e.value=Q(this.value),e.dimensions=this.dimensions.slice(0),e.units=[];for(var t=0;t<this.units.length;t++)for(var r in e.units[t]={},this.units[t])this.units[t].hasOwnProperty(r)&&(e.units[t][r]=this.units[t][r]);return e},E.prototype._isDerived=function(){return 0!==this.units.length&&(1<this.units.length||1e-15<Math.abs(this.units[0].power-1))},E.prototype._normalize=function(e){var t,r,n,i,o;if(null==e||0===this.units.length)return e;if(this._isDerived()){var a=e;o=E._getNumberConverter(M(e));for(var s=0;s<this.units.length;s++)t=o(this.units[s].unit.value),i=o(this.units[s].prefix.value),n=o(this.units[s].power),a=l(a,m(l(t,i),n));return a}return t=(o=E._getNumberConverter(M(e)))(this.units[0].unit.value),r=o(this.units[0].unit.offset),i=o(this.units[0].prefix.value),l(c(e,r),l(t,i))},E.prototype._denormalize=function(e,t){var r,n,i,o,a;if(null==e||0===this.units.length)return e;if(this._isDerived()){var s=e;a=E._getNumberConverter(M(e));for(var u=0;u<this.units.length;u++)r=a(this.units[u].unit.value),o=a(this.units[u].prefix.value),i=a(this.units[u].power),s=p(s,m(l(r,o),i));return s}return r=(a=E._getNumberConverter(M(e)))(this.units[0].unit.value),o=a(this.units[0].prefix.value),n=a(this.units[0].unit.offset),f(p(p(e,r),null==t?o:t),n)},E.isValuelessUnit=function(e){return null!==C(e)},E.prototype.hasBase=function(e){if("string"==typeof e&&(e=k[e]),!e)return!1;for(var t=0;t<I.length;t++)if(1e-12<Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0)))return!1;return!0},E.prototype.equalBase=function(e){for(var t=0;t<I.length;t++)if(1e-12<Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0)))return!1;return!0},E.prototype.equals=function(e){return this.equalBase(e)&&N(this.value,e.value)},E.prototype.multiply=function(e){for(var t=this.clone(),r=0;r<I.length;r++)t.dimensions[r]=(this.dimensions[r]||0)+(e.dimensions[r]||0);for(var n=0;n<e.units.length;n++){var i={};for(var o in e.units[n])i[o]=e.units[n][o];t.units.push(i)}if(null!==this.value||null!==e.value){var a=null===this.value?this._normalize(1):this.value,s=null===e.value?e._normalize(1):e.value;t.value=l(a,s)}else t.value=null;return t.skipAutomaticSimplification=!1,z(t)},E.prototype.divide=function(e){for(var t=this.clone(),r=0;r<I.length;r++)t.dimensions[r]=(this.dimensions[r]||0)-(e.dimensions[r]||0);for(var n=0;n<e.units.length;n++){var i={};for(var o in e.units[n])i[o]=e.units[n][o];i.power=-i.power,t.units.push(i)}if(null!==this.value||null!==e.value){var a=null===this.value?this._normalize(1):this.value,s=null===e.value?e._normalize(1):e.value;t.value=p(a,s)}else t.value=null;return t.skipAutomaticSimplification=!1,z(t)},E.prototype.pow=function(e){for(var t=this.clone(),r=0;r<I.length;r++)t.dimensions[r]=(this.dimensions[r]||0)*e;for(var n=0;n<t.units.length;n++)t.units[n].power*=e;return null!==t.value?t.value=m(t.value,e):t.value=null,t.skipAutomaticSimplification=!1,z(t)},E.prototype.abs=function(){var e=this.clone();for(var t in e.value=null!==e.value?h(e.value):null,e.units)"VA"!==e.units[t].unit.name&&"VAR"!==e.units[t].unit.name||(e.units[t].unit=q.W);return e},E.prototype.to=function(e){var t,r=null===this.value?this._normalize(1):this.value;if("string"==typeof e){if(t=E.parse(e),!this.equalBase(t))throw new Error("Units do not match ('".concat(t.toString(),"' != '").concat(this.toString(),"')"));if(null!==t.value)throw new Error("Cannot convert to a unit with a value");return t.value=Q(r),t.fixPrefix=!0,t.skipAutomaticSimplification=!0,t}if(y.isUnit(e)){if(!this.equalBase(e))throw new Error("Units do not match ('".concat(e.toString(),"' != '").concat(this.toString(),"')"));if(null!==e.value)throw new Error("Cannot convert to a unit with a value");return(t=e.clone()).value=Q(r),t.fixPrefix=!0,t.skipAutomaticSimplification=!0,t}throw new Error("String or Unit expected as parameter")},E.prototype.toNumber=function(e){return n(this.toNumeric(e))},E.prototype.toNumeric=function(e){var t;return(t=e?this.to(e):this.clone())._isDerived()?t._denormalize(t.value):t._denormalize(t.value,t.units[0].prefix.value)},E.prototype.toString=function(){return this.format()},E.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.formatUnits(),fixPrefix:this.fixPrefix}},E.fromJSON=function(e){var t=new E(e.value,e.unit);return t.fixPrefix=e.fixPrefix||!1,t},E.prototype.valueOf=E.prototype.toString,E.prototype.simplify=function(){var e,t,r=this.clone(),n=[];for(var i in F)if(r.hasBase(k[i])){e=i;break}if("NONE"===e)r.units=[];else if(e&&F.hasOwnProperty(e)&&(t=F[e]),t)r.units=[{unit:t.unit,prefix:t.prefix,power:1}];else{for(var o=!1,a=0;a<I.length;a++){var s=I[a];1e-12<Math.abs(r.dimensions[a]||0)&&(F.hasOwnProperty(s)?n.push({unit:F[s].unit,prefix:F[s].prefix,power:r.dimensions[a]||0}):o=!0)}n.length<r.units.length&&!o&&(r.units=n)}return r},E.prototype.toSI=function(){for(var e=this.clone(),t=[],r=0;r<I.length;r++){var n=I[r];if(1e-12<Math.abs(e.dimensions[r]||0)){if(!j.si.hasOwnProperty(n))throw new Error("Cannot express custom unit "+n+" in SI units");t.push({unit:j.si[n].unit,prefix:j.si[n].prefix,power:e.dimensions[r]||0})}}return e.units=t,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,e},E.prototype.formatUnits=function(){for(var e="",t="",r=0,n=0,i=0;i<this.units.length;i++)0<this.units[i].power?(r++,e+=" "+this.units[i].prefix.name+this.units[i].unit.name,1e-15<Math.abs(this.units[i].power-1)&&(e+="^"+this.units[i].power)):this.units[i].power<0&&n++;if(0<n)for(var o=0;o<this.units.length;o++)this.units[o].power<0&&(0<r?(t+=" "+this.units[o].prefix.name+this.units[o].unit.name,1e-15<Math.abs(this.units[o].power+1)&&(t+="^"+-this.units[o].power)):(t+=" "+this.units[o].prefix.name+this.units[o].unit.name,t+="^"+this.units[o].power));e=e.substr(1),t=t.substr(1),1<r&&0<n&&(e="("+e+")"),1<n&&0<r&&(t="("+t+")");var a=e;return 0<r&&0<n&&(a+=" / "),a+=t},E.prototype.format=function(e){var t=this.skipAutomaticSimplification||null===this.value?this.clone():this.simplify(),r=!1;for(var n in void 0!==t.value&&null!==t.value&&y.isComplex(t.value)&&(r=Math.abs(t.value.re)<1e-14),t.units)t.units[n].unit&&("VA"===t.units[n].unit.name&&r?t.units[n].unit=q.VAR:"VAR"!==t.units[n].unit.name||r||(t.units[n].unit=q.VA));1!==t.units.length||t.fixPrefix||Math.abs(t.units[0].power-Math.round(t.units[0].power))<1e-14&&(t.units[0].prefix=t._bestPrefix());var i=t._denormalize(t.value),o=null!==t.value?s(i,e||{}):"",a=t.formatUnits();return t.value&&y.isComplex(t.value)&&(o="("+o+")"),0<a.length&&0<o.length&&(o+=" "),o+=a},E.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(1e-14<=Math.abs(this.units[0].power-Math.round(this.units[0].power)))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?h(this.value):0,t=h(this.units[0].unit.value),r=this.units[0].prefix;if(0===e)return r;var n=this.units[0].power,i=Math.log(e/Math.pow(r.value*t,n))/Math.LN10-1.2;if(-2.200001<i&&i<1.800001)return r;i=Math.abs(i);var o=this.units[0].unit.prefixes;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if(s.scientific){var u=Math.abs(Math.log(e/Math.pow(s.value*t,n))/Math.LN10-1.2);(u<i||u===i&&s.name.length<r.name.length)&&(r=s,i=u)}}return r};var B={NONE:{"":{name:"",value:1,scientific:!0}},SHORT:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:10,scientific:!(E.prototype.splitUnit=function(e){for(var t=this.clone(),r=[],n=0;n<e.length&&(t=t.to(e[n]),n!==e.length-1);n++){var i=t.toNumeric(),o=w(i),a=new E(N(o,i)?o:d(t.toNumeric()),e[n].toString());r.push(a),t=f(t,a)}for(var s=0,u=0;u<r.length;u++)s=c(s,r[u].value);return N(s,this.value)&&(t.value=0),r.push(t),r})},h:{name:"h",value:100,scientific:!1},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0},d:{name:"d",value:.1,scientific:!1},c:{name:"c",value:.01,scientific:!1},m:{name:"m",value:.001,scientific:!0},u:{name:"u",value:1e-6,scientific:!0},n:{name:"n",value:1e-9,scientific:!0},p:{name:"p",value:1e-12,scientific:!0},f:{name:"f",value:1e-15,scientific:!0},a:{name:"a",value:1e-18,scientific:!0},z:{name:"z",value:1e-21,scientific:!0},y:{name:"y",value:1e-24,scientific:!0}},LONG:{"":{name:"",value:1,scientific:!0},deca:{name:"deca",value:10,scientific:!1},hecto:{name:"hecto",value:100,scientific:!1},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0},deci:{name:"deci",value:.1,scientific:!1},centi:{name:"centi",value:.01,scientific:!1},milli:{name:"milli",value:.001,scientific:!0},micro:{name:"micro",value:1e-6,scientific:!0},nano:{name:"nano",value:1e-9,scientific:!0},pico:{name:"pico",value:1e-12,scientific:!0},femto:{name:"femto",value:1e-15,scientific:!0},atto:{name:"atto",value:1e-18,scientific:!0},zepto:{name:"zepto",value:1e-21,scientific:!0},yocto:{name:"yocto",value:1e-24,scientific:!0}},SQUARED:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:100,scientific:!1},h:{name:"h",value:1e4,scientific:!1},k:{name:"k",value:1e6,scientific:!0},M:{name:"M",value:1e12,scientific:!0},G:{name:"G",value:1e18,scientific:!0},T:{name:"T",value:1e24,scientific:!0},P:{name:"P",value:1e30,scientific:!0},E:{name:"E",value:1e36,scientific:!0},Z:{name:"Z",value:1e42,scientific:!0},Y:{name:"Y",value:1e48,scientific:!0},d:{name:"d",value:.01,scientific:!1},c:{name:"c",value:1e-4,scientific:!1},m:{name:"m",value:1e-6,scientific:!0},u:{name:"u",value:1e-12,scientific:!0},n:{name:"n",value:1e-18,scientific:!0},p:{name:"p",value:1e-24,scientific:!0},f:{name:"f",value:1e-30,scientific:!0},a:{name:"a",value:1e-36,scientific:!0},z:{name:"z",value:1e-42,scientific:!0},y:{name:"y",value:1e-48,scientific:!0}},CUBIC:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:1e3,scientific:!1},h:{name:"h",value:1e6,scientific:!1},k:{name:"k",value:1e9,scientific:!0},M:{name:"M",value:1e18,scientific:!0},G:{name:"G",value:1e27,scientific:!0},T:{name:"T",value:1e36,scientific:!0},P:{name:"P",value:1e45,scientific:!0},E:{name:"E",value:1e54,scientific:!0},Z:{name:"Z",value:1e63,scientific:!0},Y:{name:"Y",value:1e72,scientific:!0},d:{name:"d",value:.001,scientific:!1},c:{name:"c",value:1e-6,scientific:!1},m:{name:"m",value:1e-9,scientific:!0},u:{name:"u",value:1e-18,scientific:!0},n:{name:"n",value:1e-27,scientific:!0},p:{name:"p",value:1e-36,scientific:!0},f:{name:"f",value:1e-45,scientific:!0},a:{name:"a",value:1e-54,scientific:!0},z:{name:"z",value:1e-63,scientific:!0},y:{name:"y",value:1e-72,scientific:!0}},BINARY_SHORT_SI:{"":{name:"",value:1,scientific:!0},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0}},BINARY_SHORT_IEC:{"":{name:"",value:1,scientific:!0},Ki:{name:"Ki",value:1024,scientific:!0},Mi:{name:"Mi",value:Math.pow(1024,2),scientific:!0},Gi:{name:"Gi",value:Math.pow(1024,3),scientific:!0},Ti:{name:"Ti",value:Math.pow(1024,4),scientific:!0},Pi:{name:"Pi",value:Math.pow(1024,5),scientific:!0},Ei:{name:"Ei",value:Math.pow(1024,6),scientific:!0},Zi:{name:"Zi",value:Math.pow(1024,7),scientific:!0},Yi:{name:"Yi",value:Math.pow(1024,8),scientific:!0}},BINARY_LONG_SI:{"":{name:"",value:1,scientific:!0},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0}},BINARY_LONG_IEC:{"":{name:"",value:1,scientific:!0},kibi:{name:"kibi",value:1024,scientific:!0},mebi:{name:"mebi",value:Math.pow(1024,2),scientific:!0},gibi:{name:"gibi",value:Math.pow(1024,3),scientific:!0},tebi:{name:"tebi",value:Math.pow(1024,4),scientific:!0},pebi:{name:"pebi",value:Math.pow(1024,5),scientific:!0},exi:{name:"exi",value:Math.pow(1024,6),scientific:!0},zebi:{name:"zebi",value:Math.pow(1024,7),scientific:!0},yobi:{name:"yobi",value:Math.pow(1024,8),scientific:!0}},BTU:{"":{name:"",value:1,scientific:!0},MM:{name:"MM",value:1e6,scientific:!0}}};B.SHORTLONG=W(B.SHORT,B.LONG),B.BINARY_SHORT=W(B.BINARY_SHORT_SI,B.BINARY_SHORT_IEC),B.BINARY_LONG=W(B.BINARY_LONG_SI,B.BINARY_LONG_IEC);var I=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],k={NONE:{dimensions:[0,0,0,0,0,0,0,0,0]},MASS:{dimensions:[1,0,0,0,0,0,0,0,0]},LENGTH:{dimensions:[0,1,0,0,0,0,0,0,0]},TIME:{dimensions:[0,0,1,0,0,0,0,0,0]},CURRENT:{dimensions:[0,0,0,1,0,0,0,0,0]},TEMPERATURE:{dimensions:[0,0,0,0,1,0,0,0,0]},LUMINOUS_INTENSITY:{dimensions:[0,0,0,0,0,1,0,0,0]},AMOUNT_OF_SUBSTANCE:{dimensions:[0,0,0,0,0,0,1,0,0]},FORCE:{dimensions:[1,1,-2,0,0,0,0,0,0]},SURFACE:{dimensions:[0,2,0,0,0,0,0,0,0]},VOLUME:{dimensions:[0,3,0,0,0,0,0,0,0]},ENERGY:{dimensions:[1,2,-2,0,0,0,0,0,0]},POWER:{dimensions:[1,2,-3,0,0,0,0,0,0]},PRESSURE:{dimensions:[1,-1,-2,0,0,0,0,0,0]},ELECTRIC_CHARGE:{dimensions:[0,0,1,1,0,0,0,0,0]},ELECTRIC_CAPACITANCE:{dimensions:[-1,-2,4,2,0,0,0,0,0]},ELECTRIC_POTENTIAL:{dimensions:[1,2,-3,-1,0,0,0,0,0]},ELECTRIC_RESISTANCE:{dimensions:[1,2,-3,-2,0,0,0,0,0]},ELECTRIC_INDUCTANCE:{dimensions:[1,2,-2,-2,0,0,0,0,0]},ELECTRIC_CONDUCTANCE:{dimensions:[-1,-2,3,2,0,0,0,0,0]},MAGNETIC_FLUX:{dimensions:[1,2,-2,-1,0,0,0,0,0]},MAGNETIC_FLUX_DENSITY:{dimensions:[1,0,-2,-1,0,0,0,0,0]},FREQUENCY:{dimensions:[0,0,-1,0,0,0,0,0,0]},ANGLE:{dimensions:[0,0,0,0,0,0,0,1,0]},BIT:{dimensions:[0,0,0,0,0,0,0,0,1]}};for(var P in k)k[P].key=P;var R={name:"",base:{},value:1,offset:0,dimensions:I.map(function(){return 0})},q={meter:{name:"meter",base:k.LENGTH,prefixes:B.LONG,value:1,offset:0},inch:{name:"inch",base:k.LENGTH,prefixes:B.NONE,value:.0254,offset:0},foot:{name:"foot",base:k.LENGTH,prefixes:B.NONE,value:.3048,offset:0},yard:{name:"yard",base:k.LENGTH,prefixes:B.NONE,value:.9144,offset:0},mile:{name:"mile",base:k.LENGTH,prefixes:B.NONE,value:1609.344,offset:0},link:{name:"link",base:k.LENGTH,prefixes:B.NONE,value:.201168,offset:0},rod:{name:"rod",base:k.LENGTH,prefixes:B.NONE,value:5.0292,offset:0},chain:{name:"chain",base:k.LENGTH,prefixes:B.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:k.LENGTH,prefixes:B.NONE,value:1e-10,offset:0},m:{name:"m",base:k.LENGTH,prefixes:B.SHORT,value:1,offset:0},in:{name:"in",base:k.LENGTH,prefixes:B.NONE,value:.0254,offset:0},ft:{name:"ft",base:k.LENGTH,prefixes:B.NONE,value:.3048,offset:0},yd:{name:"yd",base:k.LENGTH,prefixes:B.NONE,value:.9144,offset:0},mi:{name:"mi",base:k.LENGTH,prefixes:B.NONE,value:1609.344,offset:0},li:{name:"li",base:k.LENGTH,prefixes:B.NONE,value:.201168,offset:0},rd:{name:"rd",base:k.LENGTH,prefixes:B.NONE,value:5.02921,offset:0},ch:{name:"ch",base:k.LENGTH,prefixes:B.NONE,value:20.1168,offset:0},mil:{name:"mil",base:k.LENGTH,prefixes:B.NONE,value:254e-7,offset:0},m2:{name:"m2",base:k.SURFACE,prefixes:B.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:k.SURFACE,prefixes:B.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:k.SURFACE,prefixes:B.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:k.SURFACE,prefixes:B.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:k.SURFACE,prefixes:B.NONE,value:2589988.110336,offset:0},sqrd:{name:"sqrd",base:k.SURFACE,prefixes:B.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:k.SURFACE,prefixes:B.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:k.SURFACE,prefixes:B.NONE,value:6.4516e-10,offset:0},acre:{name:"acre",base:k.SURFACE,prefixes:B.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:k.SURFACE,prefixes:B.NONE,value:1e4,offset:0},m3:{name:"m3",base:k.VOLUME,prefixes:B.CUBIC,value:1,offset:0},L:{name:"L",base:k.VOLUME,prefixes:B.SHORT,value:.001,offset:0},l:{name:"l",base:k.VOLUME,prefixes:B.SHORT,value:.001,offset:0},litre:{name:"litre",base:k.VOLUME,prefixes:B.LONG,value:.001,offset:0},cuin:{name:"cuin",base:k.VOLUME,prefixes:B.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:k.VOLUME,prefixes:B.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:k.VOLUME,prefixes:B.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:k.VOLUME,prefixes:B.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:k.VOLUME,prefixes:B.NONE,value:15e-6,offset:0},drop:{name:"drop",base:k.VOLUME,prefixes:B.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:k.VOLUME,prefixes:B.NONE,value:5e-8,offset:0},minim:{name:"minim",base:k.VOLUME,prefixes:B.NONE,value:6.161152e-8,offset:0},fluiddram:{name:"fluiddram",base:k.VOLUME,prefixes:B.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:k.VOLUME,prefixes:B.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:k.VOLUME,prefixes:B.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:k.VOLUME,prefixes:B.NONE,value:1e-6,offset:0},cup:{name:"cup",base:k.VOLUME,prefixes:B.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:k.VOLUME,prefixes:B.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:k.VOLUME,prefixes:B.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:k.VOLUME,prefixes:B.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:k.VOLUME,prefixes:B.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:k.VOLUME,prefixes:B.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:k.VOLUME,prefixes:B.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:k.VOLUME,prefixes:B.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:k.VOLUME,prefixes:B.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:k.VOLUME,prefixes:B.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:k.VOLUME,prefixes:B.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:k.VOLUME,prefixes:B.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:k.VOLUME,prefixes:B.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:k.VOLUME,prefixes:B.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:k.VOLUME,prefixes:B.NONE,value:.1173478,offset:0},obl:{name:"obl",base:k.VOLUME,prefixes:B.NONE,value:.1589873,offset:0},g:{name:"g",base:k.MASS,prefixes:B.SHORT,value:.001,offset:0},gram:{name:"gram",base:k.MASS,prefixes:B.LONG,value:.001,offset:0},ton:{name:"ton",base:k.MASS,prefixes:B.SHORT,value:907.18474,offset:0},tonne:{name:"tonne",base:k.MASS,prefixes:B.SHORT,value:1e3,offset:0},grain:{name:"grain",base:k.MASS,prefixes:B.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:k.MASS,prefixes:B.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:k.MASS,prefixes:B.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:k.MASS,prefixes:B.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:k.MASS,prefixes:B.NONE,value:45.359237,offset:0},stick:{name:"stick",base:k.MASS,prefixes:B.NONE,value:.115,offset:0},stone:{name:"stone",base:k.MASS,prefixes:B.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:k.MASS,prefixes:B.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:k.MASS,prefixes:B.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:k.MASS,prefixes:B.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:k.MASS,prefixes:B.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:k.MASS,prefixes:B.NONE,value:45.359237,offset:0},s:{name:"s",base:k.TIME,prefixes:B.SHORT,value:1,offset:0},min:{name:"min",base:k.TIME,prefixes:B.NONE,value:60,offset:0},h:{name:"h",base:k.TIME,prefixes:B.NONE,value:3600,offset:0},second:{name:"second",base:k.TIME,prefixes:B.LONG,value:1,offset:0},sec:{name:"sec",base:k.TIME,prefixes:B.LONG,value:1,offset:0},minute:{name:"minute",base:k.TIME,prefixes:B.NONE,value:60,offset:0},hour:{name:"hour",base:k.TIME,prefixes:B.NONE,value:3600,offset:0},day:{name:"day",base:k.TIME,prefixes:B.NONE,value:86400,offset:0},week:{name:"week",base:k.TIME,prefixes:B.NONE,value:604800,offset:0},month:{name:"month",base:k.TIME,prefixes:B.NONE,value:2629800,offset:0},year:{name:"year",base:k.TIME,prefixes:B.NONE,value:31557600,offset:0},decade:{name:"decade",base:k.TIME,prefixes:B.NONE,value:315576e3,offset:0},century:{name:"century",base:k.TIME,prefixes:B.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:k.TIME,prefixes:B.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:k.FREQUENCY,prefixes:B.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:k.FREQUENCY,prefixes:B.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:k.ANGLE,prefixes:B.SHORT,value:1,offset:0},radian:{name:"radian",base:k.ANGLE,prefixes:B.LONG,value:1,offset:0},deg:{name:"deg",base:k.ANGLE,prefixes:B.SHORT,value:null,offset:0},degree:{name:"degree",base:k.ANGLE,prefixes:B.LONG,value:null,offset:0},grad:{name:"grad",base:k.ANGLE,prefixes:B.SHORT,value:null,offset:0},gradian:{name:"gradian",base:k.ANGLE,prefixes:B.LONG,value:null,offset:0},cycle:{name:"cycle",base:k.ANGLE,prefixes:B.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:k.ANGLE,prefixes:B.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:k.ANGLE,prefixes:B.NONE,value:null,offset:0},A:{name:"A",base:k.CURRENT,prefixes:B.SHORT,value:1,offset:0},ampere:{name:"ampere",base:k.CURRENT,prefixes:B.LONG,value:1,offset:0},K:{name:"K",base:k.TEMPERATURE,prefixes:B.NONE,value:1,offset:0},degC:{name:"degC",base:k.TEMPERATURE,prefixes:B.NONE,value:1,offset:273.15},degF:{name:"degF",base:k.TEMPERATURE,prefixes:B.NONE,value:1/1.8,offset:459.67},degR:{name:"degR",base:k.TEMPERATURE,prefixes:B.NONE,value:1/1.8,offset:0},kelvin:{name:"kelvin",base:k.TEMPERATURE,prefixes:B.NONE,value:1,offset:0},celsius:{name:"celsius",base:k.TEMPERATURE,prefixes:B.NONE,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:k.TEMPERATURE,prefixes:B.NONE,value:1/1.8,offset:459.67},rankine:{name:"rankine",base:k.TEMPERATURE,prefixes:B.NONE,value:1/1.8,offset:0},mol:{name:"mol",base:k.AMOUNT_OF_SUBSTANCE,prefixes:B.SHORT,value:1,offset:0},mole:{name:"mole",base:k.AMOUNT_OF_SUBSTANCE,prefixes:B.LONG,value:1,offset:0},cd:{name:"cd",base:k.LUMINOUS_INTENSITY,prefixes:B.NONE,value:1,offset:0},candela:{name:"candela",base:k.LUMINOUS_INTENSITY,prefixes:B.NONE,value:1,offset:0},N:{name:"N",base:k.FORCE,prefixes:B.SHORT,value:1,offset:0},newton:{name:"newton",base:k.FORCE,prefixes:B.LONG,value:1,offset:0},dyn:{name:"dyn",base:k.FORCE,prefixes:B.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:k.FORCE,prefixes:B.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:k.FORCE,prefixes:B.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:k.FORCE,prefixes:B.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:k.FORCE,prefixes:B.LONG,value:4448.2216,offset:0},J:{name:"J",base:k.ENERGY,prefixes:B.SHORT,value:1,offset:0},joule:{name:"joule",base:k.ENERGY,prefixes:B.SHORT,value:1,offset:0},erg:{name:"erg",base:k.ENERGY,prefixes:B.NONE,value:1e-7,offset:0},Wh:{name:"Wh",base:k.ENERGY,prefixes:B.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:k.ENERGY,prefixes:B.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:k.ENERGY,prefixes:B.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:k.ENERGY,prefixes:B.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:k.POWER,prefixes:B.SHORT,value:1,offset:0},watt:{name:"watt",base:k.POWER,prefixes:B.LONG,value:1,offset:0},hp:{name:"hp",base:k.POWER,prefixes:B.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:k.POWER,prefixes:B.SHORT,value:o.I,offset:0},VA:{name:"VA",base:k.POWER,prefixes:B.SHORT,value:1,offset:0},Pa:{name:"Pa",base:k.PRESSURE,prefixes:B.SHORT,value:1,offset:0},psi:{name:"psi",base:k.PRESSURE,prefixes:B.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:k.PRESSURE,prefixes:B.NONE,value:101325,offset:0},bar:{name:"bar",base:k.PRESSURE,prefixes:B.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:k.PRESSURE,prefixes:B.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:k.PRESSURE,prefixes:B.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:k.PRESSURE,prefixes:B.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:k.PRESSURE,prefixes:B.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:k.ELECTRIC_CHARGE,prefixes:B.LONG,value:1,offset:0},C:{name:"C",base:k.ELECTRIC_CHARGE,prefixes:B.SHORT,value:1,offset:0},farad:{name:"farad",base:k.ELECTRIC_CAPACITANCE,prefixes:B.LONG,value:1,offset:0},F:{name:"F",base:k.ELECTRIC_CAPACITANCE,prefixes:B.SHORT,value:1,offset:0},volt:{name:"volt",base:k.ELECTRIC_POTENTIAL,prefixes:B.LONG,value:1,offset:0},V:{name:"V",base:k.ELECTRIC_POTENTIAL,prefixes:B.SHORT,value:1,offset:0},ohm:{name:"ohm",base:k.ELECTRIC_RESISTANCE,prefixes:B.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:k.ELECTRIC_INDUCTANCE,prefixes:B.LONG,value:1,offset:0},H:{name:"H",base:k.ELECTRIC_INDUCTANCE,prefixes:B.SHORT,value:1,offset:0},siemens:{name:"siemens",base:k.ELECTRIC_CONDUCTANCE,prefixes:B.LONG,value:1,offset:0},S:{name:"S",base:k.ELECTRIC_CONDUCTANCE,prefixes:B.SHORT,value:1,offset:0},weber:{name:"weber",base:k.MAGNETIC_FLUX,prefixes:B.LONG,value:1,offset:0},Wb:{name:"Wb",base:k.MAGNETIC_FLUX,prefixes:B.SHORT,value:1,offset:0},tesla:{name:"tesla",base:k.MAGNETIC_FLUX_DENSITY,prefixes:B.LONG,value:1,offset:0},T:{name:"T",base:k.MAGNETIC_FLUX_DENSITY,prefixes:B.SHORT,value:1,offset:0},b:{name:"b",base:k.BIT,prefixes:B.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:k.BIT,prefixes:B.BINARY_LONG,value:1,offset:0},B:{name:"B",base:k.BIT,prefixes:B.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:k.BIT,prefixes:B.BINARY_LONG,value:8,offset:0}},U={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",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",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole"};function D(e){if("BigNumber"===e.number){var t=K.pi(y.BigNumber);q.rad.value=new y.BigNumber(1),q.deg.value=t.div(180),q.grad.value=t.div(200),q.cycle.value=t.times(2),q.arcsec.value=t.div(648e3),q.arcmin.value=t.div(10800)}else q.rad.value=1,q.deg.value=Math.PI/180,q.grad.value=Math.PI/200,q.cycle.value=2*Math.PI,q.arcsec.value=Math.PI/648e3,q.arcmin.value=Math.PI/10800;q.radian.value=q.rad.value,q.degree.value=q.deg.value,q.gradian.value=q.grad.value}D(g),r.on("config",function(e,t){e.number!==t.number&&D(e)});var j={si:{NONE:{unit:R,prefix:B.NONE[""]},LENGTH:{unit:q.m,prefix:B.SHORT[""]},MASS:{unit:q.g,prefix:B.SHORT.k},TIME:{unit:q.s,prefix:B.SHORT[""]},CURRENT:{unit:q.A,prefix:B.SHORT[""]},TEMPERATURE:{unit:q.K,prefix:B.SHORT[""]},LUMINOUS_INTENSITY:{unit:q.cd,prefix:B.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:q.mol,prefix:B.SHORT[""]},ANGLE:{unit:q.rad,prefix:B.SHORT[""]},BIT:{unit:q.bit,prefix:B.SHORT[""]},FORCE:{unit:q.N,prefix:B.SHORT[""]},ENERGY:{unit:q.J,prefix:B.SHORT[""]},POWER:{unit:q.W,prefix:B.SHORT[""]},PRESSURE:{unit:q.Pa,prefix:B.SHORT[""]},ELECTRIC_CHARGE:{unit:q.C,prefix:B.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:q.F,prefix:B.SHORT[""]},ELECTRIC_POTENTIAL:{unit:q.V,prefix:B.SHORT[""]},ELECTRIC_RESISTANCE:{unit:q.ohm,prefix:B.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:q.H,prefix:B.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:q.S,prefix:B.SHORT[""]},MAGNETIC_FLUX:{unit:q.Wb,prefix:B.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:q.T,prefix:B.SHORT[""]},FREQUENCY:{unit:q.Hz,prefix:B.SHORT[""]}}};j.cgs=JSON.parse(JSON.stringify(j.si)),j.cgs.LENGTH={unit:q.m,prefix:B.SHORT.c},j.cgs.MASS={unit:q.g,prefix:B.SHORT[""]},j.cgs.FORCE={unit:q.dyn,prefix:B.SHORT[""]},j.cgs.ENERGY={unit:q.erg,prefix:B.NONE[""]},j.us=JSON.parse(JSON.stringify(j.si)),j.us.LENGTH={unit:q.ft,prefix:B.NONE[""]},j.us.MASS={unit:q.lbm,prefix:B.NONE[""]},j.us.TEMPERATURE={unit:q.degF,prefix:B.NONE[""]},j.us.FORCE={unit:q.lbf,prefix:B.NONE[""]},j.us.ENERGY={unit:q.BTU,prefix:B.BTU[""]},j.us.POWER={unit:q.hp,prefix:B.NONE[""]},j.us.PRESSURE={unit:q.psi,prefix:B.NONE[""]},j.auto=JSON.parse(JSON.stringify(j.si));var F=j.auto;for(var L in E.setUnitSystem=function(e){if(!j.hasOwnProperty(e))throw new Error("Unit system "+e+" does not exist. Choices are: "+Object.keys(j).join(", "));F=j[e]},E.getUnitSystem=function(){for(var e in j)if(j[e]===F)return e},E.typeConverters={BigNumber:function(e){return new y.BigNumber(e+"")},Fraction:function(e){return new y.Fraction(e)},Complex:function(e){return e},number:function(e){return e}},E._getNumberConverter=function(e){if(!E.typeConverters[e])throw new TypeError('Unsupported type "'+e+'"');return E.typeConverters[e]},q){var H=q[L];H.dimensions=H.base.dimensions}for(var $ in U)if(U.hasOwnProperty($)){var G=q[U[$]],V={};for(var Z in G)G.hasOwnProperty(Z)&&(V[Z]=G[Z]);V.name=$,q[$]=V}return E.createUnit=function(e,t){if("object"!==J(e))throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(t&&t.override)for(var r in e)if(e.hasOwnProperty(r)&&E.deleteUnit(r),e[r].aliases)for(var n=0;n<e[r].aliases.length;n++)E.deleteUnit(e[r].aliases[n]);var i;for(var o in e)e.hasOwnProperty(o)&&(i=E.createUnitSingle(o,e[o]));return i},E.createUnitSingle=function(t,e){if(null==e&&(e={}),"string"!=typeof t)throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(q.hasOwnProperty(t))throw new Error('Cannot create unit "'+t+'": a unit with that name already exists');!function(e){for(var t=0;t<e.length;t++){var r=e.charAt(t),n=function(e){return/^[a-zA-Z]$/.test(e)};if(0===t&&!n(r))throw new Error('Invalid unit name (must begin with alpha character): "'+e+'"');if(0<t&&!(n(r)||"0"<=(i=r)&&i<="9"))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+e+'"')}var i}(t);var r,n,i=null,o=[],a=0;if(e&&"Unit"===e.type)i=e.clone();else if("string"==typeof e)""!==e&&(r=e);else{if("object"!==J(e))throw new TypeError('Cannot create unit "'+t+'" from "'+e.toString()+'": expecting "string" or "Unit" or "Object"');r=e.definition,n=e.prefixes,a=e.offset,e.aliases&&(o=e.aliases.valueOf())}if(o)for(var s=0;s<o.length;s++)if(q.hasOwnProperty(o[s]))throw new Error('Cannot create alias "'+o[s]+'": a unit with that name already exists');if(r&&"string"==typeof r&&!i)try{i=E.parse(r,{allowNoUnits:!0})}catch(e){throw e.message='Could not create unit "'+t+'" from "'+r+'": '+e.message,e}else r&&"Unit"===r.type&&(i=r.clone());o=o||[],a=a||0,n=n&&n.toUpperCase&&B[n.toUpperCase()]||B.NONE;var u={};if(i){var c=!(u={name:t,value:i.value,dimensions:i.dimensions.slice(0),prefixes:n,offset:a});for(var f in k)if(k.hasOwnProperty(f)){for(var l=!0,p=0;p<I.length;p++)if(1e-12<Math.abs((u.dimensions[p]||0)-(k[f].dimensions[p]||0))){l=!1;break}if(l){c=!0,u.base=k[f];break}}if(!c){var m=t+"_STUFF",h={dimensions:i.dimensions.slice(0)};h.key=m,k[m]=h,F[m]={unit:u,prefix:B.NONE[""]},u.base=k[m]}}else{var d=t+"_STUFF";if(0<=I.indexOf(d))throw new Error('Cannot create new base unit "'+t+'": a base unit with that name already exists (and cannot be overridden)');for(var y in I.push(d),k)k.hasOwnProperty(y)&&(k[y].dimensions[I.length-1]=0);for(var g={dimensions:[]},v=0;v<I.length;v++)g.dimensions[v]=0;g.dimensions[I.length-1]=1,g.key=d,k[d]=g,u={name:t,value:1,dimensions:k[d].dimensions.slice(0),prefixes:n,offset:a,base:k[d]},F[d]={unit:u,prefix:B.NONE[""]}}E.UNITS[t]=u;for(var x=0;x<o.length;x++){var b=o[x],w={};for(var N in u)u.hasOwnProperty(N)&&(w[N]=u[N]);w.name=b,E.UNITS[b]=w}return new E(null,t)},E.deleteUnit=function(e){delete E.UNITS[e]},E.PREFIXES=B,E.BASE_DIMENSIONS=I,E.BASE_UNITS=k,E.UNIT_SYSTEMS=j,E.UNITS=q,E},t.math=!0},function(e,t,r){"use strict";var o=r(1);t.name="unit",t.factory=function(r,e,t,n){var i=n("unit",{Unit:function(e){return e.clone()},string:function(e){return r.Unit.isValuelessUnit(e)?new r.Unit(null,e):r.Unit.parse(e,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string":function(e,t){return new r.Unit(e,t)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},i}},function(e,t){"use strict";t.name="createUnit",t.factory=function(i,e,t,r){return r("createUnit",{"Object, Object":function(e,t){return i.Unit.createUnit(e,t)},Object:function(e){return i.Unit.createUnit(e,{})},"string, Unit | string | Object, Object":function(e,t,r){var n={};return n[e]=t,i.Unit.createUnit(n,r)},"string, Unit | string | Object":function(e,t){var r={};return r[e]=t,i.Unit.createUnit(r,{})},string:function(e){var t={};return t[e]={},i.Unit.createUnit(t,{})}})}},function(e,t){"use strict";t.name="splitUnit",t.factory=function(e,t,r,n){return n("splitUnit",{"Unit, Array":function(e,t){return e.splitUnit(t)}})}},function(e,t,r){"use strict";var n=r(5).lazy;function a(e,t,r){n(e,t,r),n(e.expression.mathWithTransform,t,r)}t.factory=function(r,e,t,n,i){function o(e){var t=r.Unit.parse(e);return t.fixPrefix=!0,t}a(i,"speedOfLight",function(){return o("299792458 m s^-1")}),a(i,"gravitationConstant",function(){return o("6.6738480e-11 m^3 kg^-1 s^-2")}),a(i,"planckConstant",function(){return o("6.626069311e-34 J s")}),a(i,"reducedPlanckConstant",function(){return o("1.05457172647e-34 J s")}),a(i,"magneticConstant",function(){return o("1.2566370614e-6 N A^-2")}),a(i,"electricConstant",function(){return o("8.854187817e-12 F m^-1")}),a(i,"vacuumImpedance",function(){return o("376.730313461 ohm")}),a(i,"coulomb",function(){return o("8.9875517873681764e9 N m^2 C^-2")}),a(i,"elementaryCharge",function(){return o("1.60217656535e-19 C")}),a(i,"bohrMagneton",function(){return o("9.2740096820e-24 J T^-1")}),a(i,"conductanceQuantum",function(){return o("7.748091734625e-5 S")}),a(i,"inverseConductanceQuantum",function(){return o("12906.403721742 ohm")}),a(i,"magneticFluxQuantum",function(){return o("2.06783375846e-15 Wb")}),a(i,"nuclearMagneton",function(){return o("5.0507835311e-27 J T^-1")}),a(i,"klitzing",function(){return o("25812.807443484 ohm")}),a(i,"bohrRadius",function(){return o("5.291772109217e-11 m")}),a(i,"classicalElectronRadius",function(){return o("2.817940326727e-15 m")}),a(i,"electronMass",function(){return o("9.1093829140e-31 kg")}),a(i,"fermiCoupling",function(){return o("1.1663645e-5 GeV^-2")}),a(i,"fineStructure",function(){return.007297352569824}),a(i,"hartreeEnergy",function(){return o("4.3597443419e-18 J")}),a(i,"protonMass",function(){return o("1.67262177774e-27 kg")}),a(i,"deuteronMass",function(){return o("3.3435830926e-27 kg")}),a(i,"neutronMass",function(){return o("1.6749271613e-27 kg")}),a(i,"quantumOfCirculation",function(){return o("3.636947552024e-4 m^2 s^-1")}),a(i,"rydberg",function(){return o("10973731.56853955 m^-1")}),a(i,"thomsonCrossSection",function(){return o("6.65245873413e-29 m^2")}),a(i,"weakMixingAngle",function(){return.222321}),a(i,"efimovFactor",function(){return 22.7}),a(i,"atomicMass",function(){return o("1.66053892173e-27 kg")}),a(i,"avogadro",function(){return o("6.0221412927e23 mol^-1")}),a(i,"boltzmann",function(){return o("1.380648813e-23 J K^-1")}),a(i,"faraday",function(){return o("96485.336521 C mol^-1")}),a(i,"firstRadiation",function(){return o("3.7417715317e-16 W m^2")}),a(i,"loschmidt",function(){return o("2.686780524e25 m^-3")}),a(i,"gasConstant",function(){return o("8.314462175 J K^-1 mol^-1")}),a(i,"molarPlanckConstant",function(){return o("3.990312717628e-10 J s mol^-1")}),a(i,"molarVolume",function(){return o("2.241396820e-10 m^3 mol^-1")}),a(i,"sackurTetrode",function(){return-1.164870823}),a(i,"secondRadiation",function(){return o("1.438777013e-2 m K")}),a(i,"stefanBoltzmann",function(){return o("5.67037321e-8 W m^-2 K^-4")}),a(i,"wienDisplacement",function(){return o("2.897772126e-3 m K")}),a(i,"molarMass",function(){return o("1e-3 kg mol^-1")}),a(i,"molarMassC12",function(){return o("1.2e-2 kg mol^-1")}),a(i,"gravity",function(){return o("9.80665 m s^-2")}),a(i,"planckLength",function(){return o("1.61619997e-35 m")}),a(i,"planckMass",function(){return o("2.1765113e-8 kg")}),a(i,"planckTime",function(){return o("5.3910632e-44 s")}),a(i,"planckCharge",function(){return o("1.87554595641e-18 C")}),a(i,"planckTemperature",function(){return o("1.41683385e+32 K")})},t.lazy=!1,t.math=!0},function(e,t,u){"use strict";var n=u(5),c=u(108);function f(e,t,r){e[t]=r,e.expression.mathWithTransform[t]=r}function l(e,t,r){n.lazy(e,t,r),n.lazy(e.expression.mathWithTransform,t,r)}t.factory=function r(n,i,o,a,s){s.on("config",function(e,t){e.number!==t.number&&r(n,i,o,a,s)}),f(s,"true",!0),f(s,"false",!1),f(s,"null",null),f(s,"uninitialized","Error: Constant uninitialized is removed since v4.0.0. Use null instead"),"BigNumber"===i.number?(f(s,"Infinity",new n.BigNumber(1/0)),f(s,"NaN",new n.BigNumber(NaN)),l(s,"pi",function(){return c.pi(n.BigNumber)}),l(s,"tau",function(){return c.tau(n.BigNumber)}),l(s,"e",function(){return c.e(n.BigNumber)}),l(s,"phi",function(){return c.phi(n.BigNumber)}),l(s,"E",function(){return s.e}),l(s,"LN2",function(){return new n.BigNumber(2).ln()}),l(s,"LN10",function(){return new n.BigNumber(10).ln()}),l(s,"LOG2E",function(){return new n.BigNumber(1).div(new n.BigNumber(2).ln())}),l(s,"LOG10E",function(){return new n.BigNumber(1).div(new n.BigNumber(10).ln())}),l(s,"PI",function(){return s.pi}),l(s,"SQRT1_2",function(){return new n.BigNumber("0.5").sqrt()}),l(s,"SQRT2",function(){return new n.BigNumber(2).sqrt()})):(f(s,"Infinity",1/0),f(s,"NaN",NaN),f(s,"pi",Math.PI),f(s,"tau",2*Math.PI),f(s,"e",Math.E),f(s,"phi",1.618033988749895),f(s,"E",s.e),f(s,"LN2",Math.LN2),f(s,"LN10",Math.LN10),f(s,"LOG2E",Math.LOG2E),f(s,"LOG10E",Math.LOG10E),f(s,"PI",s.pi),f(s,"SQRT1_2",Math.SQRT1_2),f(s,"SQRT2",Math.SQRT2)),n.Complex&&f(s,"i",n.Complex.I),f(s,"version",u(201))},t.lazy=!1,t.math=!0},function(e){e.exports="5.10.2"},function(e,t,r){"use strict";e.exports=[r(203),r(224),r(245),r(258),r(262),r(266),r(269),r(273),r(293),r(303),r(306),r(314),r(316),r(321),r(323),r(349),r(351)]},function(e,t,r){"use strict";e.exports=[r(204),r(86),r(207),r(208),r(87),r(132),r(136),r(222),r(137)]},function(e,t,b){"use strict";t.name="derivative",t.factory=function(l,r,e,t){var n=e(b(44)),o=e(b(86)),p=e(b(51)),m=e(b(60)),i=e(b(26)),a=e(b(65)),s=e(b(58)),h=e(b(69)),d=e(b(59)),u=e(b(68)),f=e(b(54)),c=t("derivative",{"Node, SymbolNode, Object":function(e,t,r){var n={};g(n,e,t.name);var i=v(e,n);return r.simplify?o(i):i},"Node, SymbolNode":function(e,t){return c(e,t,{simplify:!0})},"string, SymbolNode":function(e,t){return c(n(e),t)},"string, SymbolNode, Object":function(e,t,r){return c(n(e),t,r)},"string, string":function(e,t){return c(n(e),n(t))},"string, string, Object":function(e,t,r){return c(n(e),n(t),r)},"Node, string":function(e,t){return c(e,n(t))},"Node, string, Object":function(e,t,r){return c(e,n(t),r)}});c._simplify=!0,c.toTex=function(e){return y.apply(null,e.args)};var y=t("_derivTex",{"Node, SymbolNode":function(e,t){return l.isConstantNode(e)&&"string"===i(e.value)?y(n(e.value).toString(),t.toString(),1):y(e.toString(),t.toString(),1)},"Node, ConstantNode":function(e,t){if("string"===i(t.value))return y(e,n(t.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(e,t,r){return y(e.toString(),t.name,r.value)},"string, string, number":function(e,t,r){return(1===r?"{d\\over d"+t+"}":"{d^{"+r+"}\\over d"+t+"^{"+r+"}}")+"\\left[".concat(e,"\\right]")}}),g=t("constTag",{"Object, ConstantNode, string":function(e,t){return e[t]=!0},"Object, SymbolNode, string":function(e,t,r){return t.name!==r&&(e[t]=!0)},"Object, ParenthesisNode, string":function(e,t,r){return g(e,t.content,r)},"Object, FunctionAssignmentNode, string":function(e,t,r){return-1===t.params.indexOf(r)?e[t]=!0:g(e,t.expr,r)},"Object, FunctionNode | OperatorNode, string":function(e,t,r){if(0<t.args.length){for(var n=g(e,t.args[0],r),i=1;i<t.args.length;++i)n=g(e,t.args[i],r)&&n;if(n)return e[t]=!0}return!1}}),v=t("_derivative",{"ConstantNode, Object":function(){return x(0)},"SymbolNode, Object":function(e,t){return void 0!==t[e]?x(0):x(1)},"ParenthesisNode, Object":function(e,t){return new u(v(e.content,t))},"FunctionAssignmentNode, Object":function(e,t){return void 0!==t[e]?x(0):v(e.expr,t)},"FunctionNode, Object":function(e,t){if(1!==e.args.length&&function(e){if(("log"===e.name||"nthRoot"===e.name||"pow"===e.name)&&2===e.args.length)return;for(var t=0;t<e.args.length;++t)e.args[t]=x(0);throw e.compile().eval(),new Error("Expected TypeError, but none found")}(e),void 0!==t[e])return x(0);var r,n,i,o,a=e.args[0],s=!1,u=!1;switch(e.name){case"cbrt":s=!0,n=new d("*","multiply",[x(3),new d("^","pow",[a,new d("/","divide",[x(2),x(3)])])]);break;case"sqrt":case"nthRoot":if(1===e.args.length)s=!0,n=new d("*","multiply",[x(2),new h("sqrt",[a])]);else if(2===e.args.length)return t[r=new d("/","divide",[x(1),e.args[1]])]=t[e.args[1]],v(new d("^","pow",[a,r]),t);break;case"log10":r=x(10);case"log":if(r||1!==e.args.length){if(1===e.args.length&&r||2===e.args.length&&void 0!==t[e.args[1]])n=new d("*","multiply",[a.clone(),new h("log",[r||e.args[1]])]),s=!0;else if(2===e.args.length)return v(new d("/","divide",[new h("log",[a]),new h("log",[e.args[1]])]),t)}else n=a.clone(),s=!0;break;case"pow":return t[r]=t[e.args[1]],v(new d("^","pow",[a,e.args[1]]),t);case"exp":n=new h("exp",[a.clone()]);break;case"sin":n=new h("cos",[a.clone()]);break;case"cos":n=new d("-","unaryMinus",[new h("sin",[a.clone()])]);break;case"tan":n=new d("^","pow",[new h("sec",[a.clone()]),x(2)]);break;case"sec":n=new d("*","multiply",[e,new h("tan",[a.clone()])]);break;case"csc":u=!0,n=new d("*","multiply",[e,new h("cot",[a.clone()])]);break;case"cot":u=!0,n=new d("^","pow",[new h("csc",[a.clone()]),x(2)]);break;case"asin":s=!0,n=new h("sqrt",[new d("-","subtract",[x(1),new d("^","pow",[a.clone(),x(2)])])]);break;case"acos":u=s=!0,n=new h("sqrt",[new d("-","subtract",[x(1),new d("^","pow",[a.clone(),x(2)])])]);break;case"atan":s=!0,n=new d("+","add",[new d("^","pow",[a.clone(),x(2)]),x(1)]);break;case"asec":s=!0,n=new d("*","multiply",[new h("abs",[a.clone()]),new h("sqrt",[new d("-","subtract",[new d("^","pow",[a.clone(),x(2)]),x(1)])])]);break;case"acsc":u=s=!0,n=new d("*","multiply",[new h("abs",[a.clone()]),new h("sqrt",[new d("-","subtract",[new d("^","pow",[a.clone(),x(2)]),x(1)])])]);break;case"acot":u=s=!0,n=new d("+","add",[new d("^","pow",[a.clone(),x(2)]),x(1)]);break;case"sinh":n=new h("cosh",[a.clone()]);break;case"cosh":n=new h("sinh",[a.clone()]);break;case"tanh":n=new d("^","pow",[new h("sech",[a.clone()]),x(2)]);break;case"sech":u=!0,n=new d("*","multiply",[e,new h("tanh",[a.clone()])]);break;case"csch":u=!0,n=new d("*","multiply",[e,new h("coth",[a.clone()])]);break;case"coth":u=!0,n=new d("^","pow",[new h("csch",[a.clone()]),x(2)]);break;case"asinh":s=!0,n=new h("sqrt",[new d("+","add",[new d("^","pow",[a.clone(),x(2)]),x(1)])]);break;case"acosh":s=!0,n=new h("sqrt",[new d("-","subtract",[new d("^","pow",[a.clone(),x(2)]),x(1)])]);break;case"atanh":s=!0,n=new d("-","subtract",[x(1),new d("^","pow",[a.clone(),x(2)])]);break;case"asech":u=s=!0,n=new d("*","multiply",[a.clone(),new h("sqrt",[new d("-","subtract",[x(1),new d("^","pow",[a.clone(),x(2)])])])]);break;case"acsch":u=s=!0,n=new d("*","multiply",[new h("abs",[a.clone()]),new h("sqrt",[new d("+","add",[new d("^","pow",[a.clone(),x(2)]),x(1)])])]);break;case"acoth":u=s=!0,n=new d("-","subtract",[x(1),new d("^","pow",[a.clone(),x(2)])]);break;case"abs":n=new d("/","divide",[new h(new f("abs"),[a.clone()]),a.clone()]);break;case"gamma":default:throw new Error('Function "'+e.name+'" is not supported by derivative, or a wrong number of arguments is passed')}o=s?(i="/","divide"):(i="*","multiply");var c=v(a,t);return u&&(c=new d("-","unaryMinus",[c])),new d(i,o,[c,n])},"OperatorNode, Object":function(e,r){if(void 0!==r[e])return x(0);if("+"===e.op)return new d(e.op,e.fn,e.args.map(function(e){return v(e,r)}));if("-"===e.op){if(e.isUnary())return new d(e.op,e.fn,[v(e.args[0],r)]);if(e.isBinary())return new d(e.op,e.fn,[v(e.args[0],r),v(e.args[1],r)])}if("*"===e.op){var t=e.args.filter(function(e){return void 0!==r[e]});if(0<t.length){var n=e.args.filter(function(e){return void 0===r[e]}),i=1===n.length?n[0]:new d("*","multiply",n),o=t.concat(v(i,r));return new d("*","multiply",o)}return new d("+","add",e.args.map(function(t){return new d("*","multiply",e.args.map(function(e){return e===t?v(e,r):e.clone()}))}))}if("/"===e.op&&e.isBinary()){var a=e.args[0],s=e.args[1];return void 0!==r[s]?new d("/","divide",[v(a,r),s]):void 0!==r[a]?new d("*","multiply",[new d("-","unaryMinus",[a]),new d("/","divide",[v(s,r),new d("^","pow",[s.clone(),x(2)])])]):new d("/","divide",[new d("-","subtract",[new d("*","multiply",[v(a,r),s.clone()]),new d("*","multiply",[a.clone(),v(s,r)])]),new d("^","pow",[s.clone(),x(2)])])}if("^"===e.op&&e.isBinary()){var u=e.args[0],c=e.args[1];if(void 0!==r[u])return l.isConstantNode(u)&&(m(u.value)||p(u.value,1))?x(0):new d("*","multiply",[e,new d("*","multiply",[new h("log",[u.clone()]),v(c.clone(),r)])]);if(void 0===r[c])return new d("*","multiply",[new d("^","pow",[u.clone(),c.clone()]),new d("+","add",[new d("*","multiply",[v(u,r),new d("/","divide",[c.clone(),u.clone()])]),new d("*","multiply",[v(c,r),new h("log",[u.clone()])])])]);if(l.isConstantNode(c)){if(m(c.value))return x(0);if(p(c.value,1))return v(u,r)}var f=new d("^","pow",[u.clone(),new d("-","subtract",[c,x(1)])]);return new d("*","multiply",[c.clone(),new d("*","multiply",[v(u,r),f])])}throw new Error('Operator "'+e.op+'" is not supported by derivative, or a wrong number of arguments is passed')}});function x(e,t){return new s(a(e,t||r.number))}return c}},function(e,t,o){"use strict";function a(e){return(a="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})(e)}var s=o(22).transform,u=o(13).setSafeProperty;t.factory=function(e,t,r){var n=r(o(23)),i=r(o(0));return function(e,t,r){try{if(Array.isArray(e))return i(e).subset(t,r).valueOf();if(e&&"function"==typeof e.subset)return e.subset(t,r);if("string"==typeof e)return n(e,t,r);if("object"!==a(e))throw new TypeError("Cannot apply index: unsupported type of object");if(!t.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return u(e,t.getObjectProperty(),r),e}catch(e){throw s(e)}}}},function(e,t){"use strict";t.math=!0,t.name="resolve",t.path="algebra.simplify",t.factory=function(a,e,t,r,s){var u=s.expression.node.Node,c=s.expression.node.OperatorNode,f=s.expression.node.FunctionNode,l=s.expression.node.ParenthesisNode;return function t(e,r){if(!r)return e;if(a.isSymbolNode(e)){var n=r[e.name];if(n instanceof u)return t(n,r);if("number"==typeof n)return s.parse(String(n))}else{if(a.isOperatorNode(e)){var i=e.args.map(function(e){return t(e,r)});return new c(e.op,e.fn,i,e.implicit)}if(a.isParenthesisNode(e))return new l(t(e.content,r));if(a.isFunctionNode(e)){var o=e.args.map(function(e){return t(e,r)});return new f(e.name,o)}}return e}}},function(e,t,a){"use strict";t.name="rationalize",t.factory=function(e,t,r,n){var m=r(a(86)),h=r(a(127)),d=r(a(125)),i=r(a(129)),y=a(3),g=r(a(58)),v=r(a(59)),p=r(a(54)),o=n("rationalize",{string:function(e){return o(i(e),{},!1)},"string, boolean":function(e,t){return o(i(e),{},t)},"string, Object":function(e,t){return o(i(e),t,!1)},"string, Object, boolean":function(e,t,r){return o(i(e),t,r)},Node:function(e){return o(e,{},!1)},"Node, boolean":function(e,t){return o(e,{},t)},"Node, Object":function(e,t){return o(e,t,!1)},"Node, Object, boolean":function(e,t,r){var n=function(){var e=[h,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},d,{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"}],t=[{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)"}],r=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],n={};return n.firstRules=e.concat(t,r),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=r,n.firstRulesAgain=e.concat(t),n.finalRules=[h,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},d,{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,t,r,n){var a=[],i=m(e,n,t,{exactFractions:!1}),s="+-*"+((r=!!r)?"/":"");!function e(t){var r=t.type;{if("FunctionNode"===r)throw new Error("There is an unsolved function call");if("OperatorNode"===r)if("^"===t.op){if("unaryMinus"===t.args[1].fn&&(t=t.args[0]),"ConstantNode"!==t.args[1].type||!y.isInteger(parseFloat(t.args[1].value)))throw new Error("There is a non-integer exponent");e(t.args[0])}else{if(-1===s.indexOf(t.op))throw new Error("Operator "+t.op+" invalid in polynomial expression");for(var n=0;n<t.args.length;n++)e(t.args[n])}else if("SymbolNode"===r){var i=t.name,o=a.indexOf(i);-1===o&&a.push(i)}else if("ParenthesisNode"===r)e(t.content);else if("ConstantNode"!==r)throw new Error("type "+r+" is not allowed in polynomial expression")}}(i);var o={};return o.expression=i,o.variables=a,o}(e,t,!0,n.firstRules),o=i.variables.length;if(e=i.expression,1<=o){var a,s;e=function e(t,r,n){var i=t.type;var o=1<arguments.length;if("OperatorNode"===i&&t.isBinary()){var a,s=!1;if("^"===t.op&&("ParenthesisNode"!==t.args[0].type&&"OperatorNode"!==t.args[0].type||"ConstantNode"!==t.args[1].type||(a=parseFloat(t.args[1].value),s=2<=a&&y.isInteger(a))),s){if(2<a){var u=t.args[0],c=new v("^","pow",[t.args[0].cloneDeep(),new g(a-1)]);t=new v("*","multiply",[u,c])}else t=new v("*","multiply",[t.args[0],t.args[0].cloneDeep()]);o&&("content"===n?r.content=t:r.args[n]=t)}}if("ParenthesisNode"===i)e(t.content,t,"content");else if("ConstantNode"!==i&&"SymbolNode"!==i)for(var f=0;f<t.args.length;f++)e(t.args[f],t,f);if(!o)return t}(e);var u,c=!0,f=!1;for(e=m(e,n.firstRules,{},{exactFractions:!1});s=c?n.distrDivRules:n.sucDivRules,c=!c,(u=(e=m(e,s)).toString())!==a;)f=!0,a=u;f&&(e=m(e,n.firstRulesAgain,{},{exactFractions:!1})),e=m(e,n.finalRules,{},{exactFractions:!1})}var l=[],p={};return"OperatorNode"===e.type&&e.isBinary()&&"/"===e.op?(1===o&&(e.args[0]=x(e.args[0],l),e.args[1]=x(e.args[1])),r&&(p.numerator=e.args[0],p.denominator=e.args[1])):(1===o&&(e=x(e,l)),r&&(p.numerator=e,p.denominator=null)),r?(p.coefficients=l,p.variables=i.variables,p.expression=e,p):e}});function x(e,u){void 0===u&&(u=[]);var t={cte:1,oper:"+",fire:""},c=u[0]=0,f="";!function e(t,r,n){var i=t.type;{if("FunctionNode"===i)throw new Error("There is an unsolved function call");if("OperatorNode"===i){if(-1==="+-*^".indexOf(t.op))throw new Error("Operator "+t.op+" invalid");if(null!==r){if(("unaryMinus"===t.fn||"pow"===t.fn)&&"add"!==r.fn&&"subtract"!==r.fn&&"multiply"!==r.fn)throw new Error("Invalid "+t.op+" placing");if(("subtract"===t.fn||"add"===t.fn||"multiply"===t.fn)&&"add"!==r.fn&&"subtract"!==r.fn)throw new Error("Invalid "+t.op+" placing");if(("subtract"===t.fn||"add"===t.fn||"unaryMinus"===t.fn)&&0!==n.noFil)throw new Error("Invalid "+t.op+" placing")}"^"!==t.op&&"*"!==t.op||(n.fire=t.op);for(var o=0;o<t.args.length;o++)"unaryMinus"===t.fn&&(n.oper="-"),"+"!==t.op&&"subtract"!==t.fn||(n.fire="",n.cte=1,n.oper=0===o?"+":t.op),n.noFil=o,e(t.args[o],t,n)}else if("SymbolNode"===i){if(t.name!==f&&""!==f)throw new Error("There is more than one variable");if(f=t.name,null===r)return void(u[1]=1);if("^"===r.op&&0!==n.noFil)throw new Error("In power the variable should be the first parameter");if("*"===r.op&&1!==n.noFil)throw new Error("In multiply the variable should be the second parameter");""!==n.fire&&"*"!==n.fire||(c<1&&(u[1]=0),u[1]+=n.cte*("+"===n.oper?1:-1),c=Math.max(1,c))}else{if("ConstantNode"!==i)throw new Error("Type "+i+" is not allowed");var a=parseFloat(t.value);if(null===r)return void(u[0]=a);if("^"===r.op){if(1!==n.noFil)throw new Error("Constant cannot be powered");if(!y.isInteger(a)||a<=0)throw new Error("Non-integer exponent is not allowed");for(var s=c+1;s<a;s++)u[s]=0;return c<a&&(u[a]=0),u[a]+=n.cte*("+"===n.oper?1:-1),void(c=Math.max(a,c))}n.cte=a,""===n.fire&&(u[0]+=n.cte*("+"===n.oper?1:-1))}}}(e,null,t);for(var r,n=!0,i=c=u.length-1;0<=i;i--)if(0!==u[i]){var o=new g(n?u[i]:Math.abs(u[i])),a=u[i]<0?"-":"+";if(0<i){var s=new p(f);if(1<i){var l=new g(i);s=new v("^","pow",[s,l])}o=-1===u[i]&&n?new v("-","unaryMinus",[s]):1===Math.abs(u[i])?s:new v("*","multiply",[o,s])}r=n?o:"+"==a?new v("+","add",[r,o]):new v("-","subtract",[r,o]),n=!1}return n?new g(0):r}return o}},function(e,t,a){"use strict";t.name="qr",t.factory=function(e,t,r,n){var i=r(a(0)),x=r(a(43)),b=r(a(50)),w=r(a(60)),N=r(a(130)),M=r(a(131)),E=r(a(46)),A=r(a(71)),S=r(a(39)),O=r(a(17)),T=r(a(12)),_=r(a(21)),C=r(a(15));function o(e){var t,r,n,i=e._size[0],o=e._size[1],a=b([i],"dense"),s=a._data,u=e.clone(),c=u._data,f=x([i],"");for(n=0;n<Math.min(o,i);++n){var l=c[n][n],p=S(M(l)),m=A(p),h=0;for(t=n;t<i;t++)h=O(h,_(c[t][n],A(c[t][n])));var d=_(p,E(h));if(!w(d)){var y=C(l,d);for(t=n+(f[n]=1);t<i;t++)f[t]=T(c[t][n],y);var g=S(A(T(y,d))),v=void 0;for(r=n;r<o;r++){for(v=0,t=n;t<i;t++)v=O(v,_(A(f[t]),c[t][r]));for(v=_(v,g),t=n;t<i;t++)c[t][r]=_(C(c[t][r],_(f[t],v)),m)}for(t=0;t<i;t++){for(v=0,r=n;r<i;r++)v=O(v,_(s[t][r],f[r]));for(v=_(v,g),r=n;r<i;++r)s[t][r]=T(C(s[t][r],_(v,A(f[r]))),m)}}}for(t=0;t<i;++t)for(r=0;r<t&&r<o;++r){if(N(0,T(c[t][r],1e5)))throw new Error("math.qr(): unknown error - R is not lower triangular (element ("+t+", "+r+") = "+c[t][r]+")");c[t][r]=_(c[t][r],0)}return{Q:a,R:u,toString:function(){return"Q: "+this.Q.toString()+"\nR: "+this.R.toString()}}}return n("qr",{DenseMatrix:function(e){return o(e)},SparseMatrix:function(){return function(){throw new Error("qr not implemented for sparse matrices yet")}()},Array:function(e){var t=o(i(e));return{Q:t.Q.valueOf(),R:t.R.valueOf()}}})}},function(e,t,n){"use strict";t.name="csSqr",t.path="algebra.sparse",t.factory=function(e,t,r){var c=r(n(210)),f=r(n(212)),l=r(n(213)),p=r(n(214)),m=r(n(215));return function(e,t,r){var n,i=t._ptr,o=t._size[1],a={};if(a.q=c(e,t),e&&!a.q)return null;if(r){var s=e?f(t,null,a.q,0):t;a.parent=l(s,1);var u=p(a.parent,o);if(a.cp=m(s,a.parent,u,1),s&&a.parent&&a.cp&&function(e,t){var r=e._ptr,n=e._index,i=e._size,o=i[0],a=i[1];t.pinv=[],t.leftmost=[];var s,u,c,f,l,p=t.parent,m=t.pinv,h=t.leftmost,d=[],y=o,g=o+a,v=o+2*a;for(u=0;u<a;u++)d[y+u]=-1,d[g+u]=-1,d[v+u]=0;for(s=0;s<o;s++)h[s]=-1;for(u=a-1;0<=u;u--)for(f=r[u],l=r[u+1],c=f;c<l;c++)h[n[c]]=u;for(s=o-1;0<=s;s--)(m[s]=-1)!==(u=h[s])&&(0==d[v+u]++&&(d[g+u]=s),d[0+s]=d[y+u],d[y+u]=s);for(t.lnz=0,t.m2=o,u=0;u<a;u++)if(s=d[y+u],t.lnz++,s<0&&(s=t.m2++),m[s]=u,!(--v[u]<=0)){t.lnz+=d[v+u];var x=p[u];-1!==x&&(0===d[v+x]&&(d[g+x]=d[g+u]),d[0+d[g+u]]=d[y+x],d[y+x]=d[0+s],d[v+x]+=d[v+u])}for(s=0;s<o;s++)m[s]<0&&(m[s]=u++);return!0}(s,a))for(n=a.unz=0;n<o;n++)a.unz+=a.cp[n]}else a.unz=4*i[o]+o,a.lnz=a.unz;return a}}},function(e,t,n){"use strict";t.name="csAmd",t.path="algebra.sparse",t.factory=function(e,t,r){var K=r(n(88)),ee=r(n(211)),te=r(n(133)),re=r(n(14)),ne=r(n(10)),ie=r(n(72));function oe(e,t,r,n,i){if(e<2||e+t<0){for(var o=0;o<i;o++)0!==r[n+o]&&(r[n+o]=1);e=2}return e}function ae(e,t){return e!==t}return function(e,t){if(!t||e<=0||3<e)return null;var r=t._size,n=r[0],i=r[1],o=0,a=Math.max(16,10*Math.sqrt(i)),s=function(e,t,r,n,i){var o=ie(t);if(1===e&&n===r)return re(t,o);if(2!==e)return ne(o,t);for(var a=o._index,s=o._ptr,u=0,c=0;c<r;c++){var f=s[c];if(s[c]=u,!(s[c+1]-f>i))for(var l=s[c+1];f<l;f++)a[u++]=a[f]}return s[r]=u,t=ie(o),ne(o,t)}(e,t,n,i,a=Math.min(i-2,a));ee(s,ae,null);for(var u,c,f,l,p,m,h,d,y,g,v,x,b,w,N,M,E=s._index,A=s._ptr,S=A[i],O=[],T=[],_=i+1,C=2*(i+1),z=3*(i+1),B=4*(i+1),I=5*(i+1),k=6*(i+1),P=7*(i+1),R=O,q=function(e,t,r,n,i,o,a,s,u,c,f,l){for(var p=0;p<e;p++)r[n+p]=t[p+1]-t[p];for(var m=r[n+e]=0;m<=e;m++)r[i+m]=-1,o[m]=-1,r[a+m]=-1,r[s+m]=-1,r[u+m]=1,r[c+m]=1,r[f+m]=0,r[l+m]=r[n+m];var h=oe(0,0,r,c,e);return r[f+e]=-2,t[e]=-1,r[c+e]=0,h}(i,A,T,0,z,R,C,P,_,k,B,I),U=function(e,t,r,n,i,o,a,s,u,c,f){for(var l=0,p=0;p<e;p++){var m=r[n+p];if(0===m)r[i+p]=-2,l++,t[p]=-1,r[o+p]=0;else if(a<m)r[s+p]=0,r[i+p]=-1,l++,t[p]=K(e),r[s+e]++;else{var h=r[u+m];-1!==h&&(c[h]=p),r[f+p]=r[u+m],r[u+m]=p}}return l}(i,A,T,I,B,k,a,_,z,R,C),D=0;U<i;){for(f=-1;D<i&&-1===(f=T[z+D]);D++);-1!==T[C+f]&&(R[T[C+f]]=-1),T[z+D]=T[C+f];var j=T[B+f],F=T[_+f];U+=F;var L=0;T[_+f]=-F;var H=A[f],$=0===j?H:S,G=$;for(l=1;l<=j+1;l++){for(d=j<l?(h=H,T[0+(m=f)]-j):(h=A[m=E[H++]],T[0+m]),p=1;p<=d;p++)(y=T[_+(u=E[h++])])<=0||(L+=y,T[_+u]=-y,-1!==T[C+(E[G++]=u)]&&(R[T[C+u]]=R[u]),-1!==R[u]?T[C+R[u]]=T[C+u]:T[z+T[I+u]]=T[C+u]);m!==f&&(A[m]=K(f),T[k+m]=0)}for(0!==j&&(S=G),T[I+f]=L,A[f]=$,T[0+f]=G-$,T[B+f]=-2,q=oe(q,o,T,k,i),g=$;g<G;g++)if(!((v=T[B+(u=E[g])])<=0)){var V=q-(y=-T[_+u]);for(H=A[u],x=A[u]+v-1;H<=x;H++)T[k+(m=E[H])]>=q?T[k+m]-=y:0!==T[k+m]&&(T[k+m]=T[I+m]+V)}for(g=$;g<G;g++){for(b=(x=A[u=E[g]])+T[B+u]-1,M=N=0,H=w=x;H<=b;H++)if(0!==T[k+(m=E[H])]){var Z=T[k+m]-q;0<Z?(M+=Z,N+=E[w++]=m):(A[m]=K(f),T[k+m]=0)}T[B+u]=w-x+1;var Y=w,J=x+T[0+u];for(H=1+b;H<J;H++){var W=T[_+(c=E[H])];W<=0||(M+=W,N+=E[w++]=c)}0===M?(A[u]=K(f),L-=y=-T[_+u],F+=y,U+=y,T[_+u]=0,T[B+u]=-1):(T[I+u]=Math.min(T[I+u],M),E[w]=E[Y],E[Y]=E[x],E[x]=f,T[0+u]=w-x+1,N=(N<0?-N:N)%i,T[C+u]=T[P+N],R[T[P+N]=u]=N)}for(T[I+f]=L,q=oe(q+(o=Math.max(o,L)),o,T,k,i),g=$;g<G;g++)if(!(0<=T[_+(u=E[g])]))for(u=T[P+(N=R[u])],T[P+N]=-1;-1!==u&&-1!==T[C+u];u=T[C+u],q++){for(d=T[0+u],v=T[B+u],H=A[u]+1;H<=A[u]+d-1;H++)T[k+E[H]]=q;var X=u;for(c=T[C+u];-1!==c;){var Q=T[0+c]===d&&T[B+c]===v;for(H=A[c]+1;Q&&H<=A[c]+d-1;H++)T[k+E[H]]!==q&&(Q=0);Q?(A[c]=K(u),T[_+u]+=T[_+c],T[_+c]=0,T[B+c]=-1,c=T[C+c],T[C+X]=c):c=T[C+(X=c)]}}for(g=H=$;g<G;g++)(y=-T[_+(u=E[g])])<=0||(T[_+u]=y,M=T[I+u]+L-y,-1!==T[z+(M=Math.min(M,i-U-y))]&&(R[T[z+M]]=u),T[C+u]=T[z+M],R[u]=-1,T[z+M]=u,D=Math.min(D,M),T[I+u]=M,E[H++]=u);T[_+f]=F,0==(T[0+f]=H-$)&&(A[f]=-1,T[k+f]=0),0!==j&&(S=H)}for(u=0;u<i;u++)A[u]=K(A[u]);for(c=0;c<=i;c++)T[z+c]=-1;for(c=i;0<=c;c--)0<T[_+c]||(T[C+c]=T[z+A[c]],T[z+A[c]]=c);for(m=i;0<=m;m--)T[_+m]<=0||-1!==A[m]&&(T[C+m]=T[z+A[m]],T[z+A[m]]=m);for(u=f=0;u<=i;u++)-1===A[u]&&(f=te(u,f,T,z,C,O,k));return O.splice(O.length-1,1),O}}},function(e,t){"use strict";t.name="csFkeep",t.path="algebra.sparse",t.factory=function(){return function(e,t,r){for(var n=e._values,i=e._index,o=e._ptr,a=e._size[1],s=0,u=0;u<a;u++){var c=o[u];for(o[u]=s;c<o[u+1];c++)t(i[c],u,n?n[c]:1,r)&&(i[s]=i[c],n&&(n[s]=n[c]),s++)}return o[a]=s,i.splice(s,i.length-s),n&&n.splice(s,n.length-s),s}}},function(e,t){"use strict";t.name="csPermute",t.path="algebra.sparse",t.factory=function(e){var w=e.SparseMatrix;return function(e,t,r,n){for(var i=e._values,o=e._index,a=e._ptr,s=e._size,u=e._datatype,c=s[0],f=s[1],l=n&&e._values?[]:null,p=[],m=[],h=0,d=0;d<f;d++){m[d]=h;for(var y=r?r[d]:d,g=a[y],v=a[y+1],x=g;x<v;x++){var b=t?t[o[x]]:o[x];p[h]=b,l&&(l[h]=i[x]),h++}}return m[f]=h,new w({values:l,index:p,ptr:m,size:[c,f],datatype:u})}}},function(e,t){"use strict";t.name="csEtree",t.path="algebra.sparse",t.factory=function(){return function(e,t){if(!e)return null;var r,n,i=e._index,o=e._ptr,a=e._size,s=a[0],u=a[1],c=[],f=[],l=u;if(t)for(r=0;r<s;r++)f[l+r]=-1;for(var p=0;p<u;p++){c[p]=-1,f[0+p]=-1;for(var m=o[p],h=o[p+1],d=m;d<h;d++){var y=i[d];for(r=t?f[l+y]:y;-1!==r&&r<p;r=n)n=f[0+r],f[0+r]=p,-1===n&&(c[r]=p);t&&(f[l+y]=p)}}return c}}},function(e,t,n){"use strict";t.name="csPost",t.path="algebra.sparse",t.factory=function(e,t,r){var u=r(n(133));return function(e,t){if(!e)return null;var r,n=0,i=[],o=[],a=t,s=2*t;for(r=0;r<t;r++)o[0+r]=-1;for(r=t-1;0<=r;r--)-1!==e[r]&&(o[a+r]=o[0+e[r]],o[0+e[r]]=r);for(r=0;r<t;r++)-1===e[r]&&(n=u(r,n,o,0,a,i,s));return i}}},function(e,t,n){"use strict";t.name="csCounts",t.path="algebra.sparse",t.factory=function(e,t,r){var S=r(n(72)),O=r(n(216));return function(e,t,r,n){if(!e||!t||!r)return null;var i,o,a,s,u,c,f,l=e._size,p=l[0],m=l[1],h=4*m+(n?m+p+1:0),d=[],y=m,g=2*m,v=3*m,x=4*m,b=5*m+1;for(a=0;a<h;a++)d[a]=-1;var w=[],N=S(e),M=N._index,E=N._ptr;for(a=0;a<m;a++)for(w[o=r[a]]=-1===d[v+o]?1:0;-1!==o&&-1===d[v+o];o=t[o])d[v+o]=a;if(n){for(a=0;a<m;a++)d[r[a]]=a;for(i=0;i<p;i++){for(a=m,c=E[i],f=E[i+1],u=c;u<f;u++)a=Math.min(a,d[M[u]]);d[b+i]=d[x+a],d[x+a]=i}}for(i=0;i<m;i++)d[0+i]=i;for(a=0;a<m;a++){for(-1!==t[o=r[a]]&&w[t[o]]--,s=n?d[x+a]:o;-1!==s;s=n?d[b+s]:-1)for(u=E[s];u<E[s+1];u++){i=M[u];var A=O(i,o,d,v,y,g,0);1<=A.jleaf&&w[o]++,2===A.jleaf&&w[A.q]--}-1!==t[o]&&(d[0+o]=t[o])}for(o=0;o<m;o++)-1!==t[o]&&(w[t[o]]+=w[o]);return w}}},function(e,t){"use strict";t.name="csLeaf",t.path="algebra.sparse",t.factory=function(){return function(e,t,r,n,i,o,a){var s,u,c,f,l=0;if(e<=t||r[n+t]<=r[i+e])return-1;if(r[i+e]=r[n+t],c=r[o+e],r[o+e]=t,-1===c)l=1,f=e;else{for(l=2,f=c;f!==r[a+f];f=r[a+f]);for(s=c;s!==f;s=u)u=r[a+s],r[a+s]=f}return{jleaf:l,q:f}}}},function(e,t,n){"use strict";t.name="csLu",t.path="algebra.sparse",t.factory=function(e,t,r){var O=r(n(25)),T=r(n(12)),_=r(n(10)),C=r(n(33)),z=r(n(89)),B=r(n(218)),I=e.SparseMatrix;return function(e,t,r){if(!e)return null;var n,i=e._size[1],o=100,a=100;t&&(n=t.q,o=t.lnz||o,a=t.unz||a);var s,u,c=[],f=[],l=[],p=new I({values:c,index:f,ptr:l,size:[i,i]}),m=[],h=[],d=[],y=new I({values:m,index:h,ptr:d,size:[i,i]}),g=[],v=[],x=[];for(s=0;s<i;s++)v[s]=0,g[s]=-1,l[s+1]=0;for(var b=a=o=0;b<i;b++){l[b]=o,d[b]=a;var w=n?n[b]:b,N=B(p,e,w,x,v,g,1),M=-1,E=-1;for(u=N;u<i;u++)if(g[s=x[u]]<0){var A=O(v[s]);C(A,E)&&(E=A,M=s)}else h[a]=g[s],m[a++]=v[s];if(-1===M||E<=0)return null;g[w]<0&&z(O(v[w]),_(E,r))&&(M=w);var S=v[M];for(h[a]=b,m[a++]=S,g[M]=b,f[o]=M,c[o++]=1,u=N;u<i;u++)g[s=x[u]]<0&&(f[o]=s,c[o++]=T(v[s],S)),v[s]=0}for(l[i]=o,d[i]=a,u=0;u<o;u++)f[u]=g[f[u]];return c.splice(o,c.length-o),f.splice(o,f.length-o),m.splice(a,m.length-a),h.splice(a,h.length-a),{L:p,U:y,pinv:g}}}},function(e,t,n){"use strict";t.name="csSpsolve",t.path="algebra.sparse",t.factory=function(e,t,r){var M=r(n(12)),E=r(n(10)),A=r(n(15)),S=r(n(219));return function(e,t,r,n,i,o,a){var s,u,c,f,l=e._values,p=e._index,m=e._ptr,h=e._size[1],d=t._values,y=t._index,g=t._ptr,v=S(e,t,r,n,o);for(s=v;s<h;s++)i[n[s]]=0;for(u=g[r],c=g[r+1],s=u;s<c;s++)i[y[s]]=d[s];for(var x=v;x<h;x++){var b=n[x],w=o?o[b]:b;if(!(w<0))for(u=m[w],c=m[w+1],i[b]=M(i[b],l[a?u:c-1]),s=a?u+1:u,f=a?c:c-1;s<f;s++){var N=p[s];i[N]=A(i[N],E(l[s],i[b]))}}return v}}},function(e,t,n){"use strict";t.name="csReach",t.path="algebra.sparse",t.factory=function(e,t,r){var d=r(n(220)),y=r(n(134)),g=r(n(135));return function(e,t,r,n,i){var o,a,s,u=e._ptr,c=e._size,f=t._index,l=t._ptr,p=c[1],m=p;for(a=l[r],s=l[r+1],o=a;o<s;o++){var h=f[o];y(u,h)||(m=d(h,e,m,n,i))}for(o=m;o<p;o++)g(u,n[o]);return m}}},function(e,t,n){"use strict";t.name="csDfs",t.path="algebra.sparse",t.factory=function(e,t,r){var h=r(n(134)),d=r(n(135)),y=r(n(221));return function(e,t,r,n,i){var o,a,s,u=t._index,c=t._ptr,f=t._size[1],l=0;for(n[0]=e;0<=l;){e=n[l];var p=i?i[e]:e;h(c,e)||(d(c,e),n[f+l]=p<0?0:y(c[p]));var m=1;for(a=n[f+l],s=p<0?0:y(c[p+1]);a<s;a++)if(o=u[a],!h(c,o)){n[f+l]=a,n[++l]=o,m=0;break}m&&(l--,n[--r]=e)}return r}}},function(e,t,i){"use strict";t.name="csUnflip",t.path="algebra.sparse",t.factory=function(e,t,r){var n=r(i(88));return function(e){return e<0?n(e):e}}},function(e,t,h){"use strict";var d=Array.isArray;t.name="lusolve",t.factory=function(t,e,r,n){var i=r(h(0)),o=r(h(87)),a=r(h(132)),s=r(h(223)),u=r(h(90)),c=r(h(137)),f=r(h(136)),l=n("lusolve",{"Array, Array | Matrix":function(e,t){e=i(e);var r=o(e);return m(r.L,r.U,r.p,null,t).valueOf()},"DenseMatrix, Array | Matrix":function(e,t){var r=o(e);return m(r.L,r.U,r.p,null,t)},"SparseMatrix, Array | Matrix":function(e,t){var r=o(e);return m(r.L,r.U,r.p,null,t)},"SparseMatrix, Array | Matrix, number, number":function(e,t,r,n){var i=a(e,r,n);return m(i.L,i.U,i.p,i.q,t)},"Object, Array | Matrix":function(e,t){return m(e.L,e.U,e.p,e.q,t)}}),p=function(e){if(t.isMatrix(e))return e;if(d(e))return i(e);throw new TypeError("Invalid Matrix LU decomposition")};function m(e,t,r,n,i){e=p(e),t=p(t),i=u(e,i,!1),r&&(i._data=s(r,i._data));var o=f(e,i),a=c(t,o);return n&&(a._data=s(n,a._data)),a}return l}},function(e,t){"use strict";t.name="csIpvec",t.path="algebra.sparse",t.factory=function(){return function(e,t){var r,n=t.length,i=[];if(e)for(r=0;r<n;r++)i[e[r]]=t[r];else for(r=0;r<n;r++)i[r]=t[r];return i}}},function(e,t,r){"use strict";e.exports=[r(25),r(14),r(17),r(225),r(110),r(226),r(45),r(138),r(227),r(228),r(229),r(230),r(109),r(111),r(231),r(232),r(233),r(91),r(235),r(236),r(237),r(238),r(10),r(239),r(240),r(241),r(42),r(67),r(131),r(46),r(242),r(15),r(39),r(243),r(244)]},function(e,t,n){"use strict";var i=n(1);var l=Math.cbrt||function(e){if(0===e)return e;var t,r=e<0;return r&&(e=-e),t=isFinite(e)?(e/((t=Math.exp(Math.log(e)/3))*t)+2*t)/3:e,r?-t:t};t.name="cbrt",t.factory=function(a,s,e,t){var o=e(n(39)),u=e(n(61)),c=e(n(0)),r=t("cbrt",{number:l,Complex:f,"Complex, boolean":f,BigNumber:function(e){return e.cbrt()},Unit:function(e){{if(e.value&&a.isComplex(e.value)){var t=e.clone();return t.value=1,(t=t.pow(1/3)).value=f(e.value),t}var r,n=u(e.value);n&&(e.value=o(e.value)),r=a.isBigNumber(e.value)?new a.BigNumber(1).div(3):a.isFraction(e.value)?new a.Fraction(1,3):1/3;var i=e.pow(r);return n&&(i.value=o(i.value)),i}},"Array | Matrix":function(e){return i(e,r,!0)}});function f(e,t){var r=e.arg()/3,n=e.abs(),i=new a.Complex(l(n),0).mul(new a.Complex(0,r).exp());if(t){var o=[i,new a.Complex(l(n),0).mul(new a.Complex(0,r+2*Math.PI/3).exp()),new a.Complex(l(n),0).mul(new a.Complex(0,r-2*Math.PI/3).exp())];return"Array"===s.matrix?o:c(o)}return i}return r.toTex={1:"\\sqrt[3]{${args[0]}}"},r}},function(e,t,r){"use strict";var o=r(1);t.name="cube",t.factory=function(e,t,r,n){var i=n("cube",{number:function(e){return e*e*e},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)},"Array | Matrix":function(e){return o(e,i,!0)},Unit:function(e){return e.pow(3)}});return i.toTex={1:"\\left(${args[0]}\\right)^3"},i}},function(e,t,m){"use strict";t.name="dotMultiply",t.factory=function(e,t,r,n){var i=r(m(0)),o=r(m(21)),a=m(4),s=r(m(27)),u=r(m(139)),c=r(m(20)),f=r(m(7)),l=r(m(6)),p=n("dotMultiply",{"any, any":o,"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,o,!1)},"SparseMatrix, DenseMatrix":function(e,t){return s(t,e,o,!0)},"DenseMatrix, SparseMatrix":function(e,t){return s(e,t,o,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,o)},"Array, Array":function(e,t){return p(i(e),i(t)).valueOf()},"Array, Matrix":function(e,t){return p(i(e),t)},"Matrix, Array":function(e,t){return p(e,i(t))},"SparseMatrix, any":function(e,t){return c(e,t,o,!1)},"DenseMatrix, any":function(e,t){return l(e,t,o,!1)},"any, SparseMatrix":function(e,t){return c(t,e,o,!0)},"any, DenseMatrix":function(e,t){return l(t,e,o,!0)},"Array, any":function(e,t){return l(i(e),t,o,!1).valueOf()},"any, Array":function(e,t){return l(i(t),e,o,!0).valueOf()}});return p.toTex={2:"\\left(${args[0]}".concat(a.operators.dotMultiply,"${args[1]}\\right)")},p}},function(e,t,h){"use strict";t.name="dotPow",t.factory=function(e,t,r,n){var i=r(h(0)),o=r(h(42)),a=h(4),s=r(h(18)),u=r(h(29)),c=r(h(20)),f=r(h(19)),l=r(h(7)),p=r(h(6)),m=n("dotPow",{"any, any":o,"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,o,!1)},"SparseMatrix, DenseMatrix":function(e,t){return s(t,e,o,!0)},"DenseMatrix, SparseMatrix":function(e,t){return s(e,t,o,!1)},"DenseMatrix, DenseMatrix":function(e,t){return l(e,t,o)},"Array, Array":function(e,t){return m(i(e),i(t)).valueOf()},"Array, Matrix":function(e,t){return m(i(e),t)},"Matrix, Array":function(e,t){return m(e,i(t))},"SparseMatrix, any":function(e,t){return c(e,t,m,!1)},"DenseMatrix, any":function(e,t){return p(e,t,m,!1)},"any, SparseMatrix":function(e,t){return f(t,e,m,!0)},"any, DenseMatrix":function(e,t){return p(t,e,m,!0)},"Array, any":function(e,t){return p(i(e),t,m,!1).valueOf()},"any, Array":function(e,t){return p(i(t),e,m,!0).valueOf()}});return m.toTex={2:"\\left(${args[0]}".concat(a.operators.dotPow,"${args[1]}\\right)")},m}},function(e,t,r){"use strict";var o=r(1);t.name="exp",t.factory=function(e,t,r,n){var i=n("exp",{number:Math.exp,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\exp\\left(${args[0]}\\right)"},i}},function(e,t,a){"use strict";var s=a(1);t.name="expm1",t.factory=function(r,e,t,n){var i=a(4),o=n("expm1",{number:Math.expm1||function(e){return 2e-4<=e||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6},Complex:function(e){var t=Math.exp(e.re);return new r.Complex(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)},"Array | Matrix":function(e){return s(e,o)}});return o.toTex="\\left(e".concat(i.operators.pow,"{${args[0]}}-1\\right)"),o}},function(e,t,l){"use strict";var n=l(3).isInteger;function p(e,t){if(!n(e)||!n(t))throw new Error("Parameters in function gcd must be integer numbers");for(var r;0!==t;)r=e%t,e=t,t=r;return e<0?-e:e}t.name="gcd",t.factory=function(i,e,t,r){var n=t(l(0)),o=t(l(37)),a=t(l(85)),s=t(l(41)),u=t(l(7)),c=t(l(6)),f=r("gcd",{"number, number":p,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function gcd must be integer numbers");var r=new i.BigNumber(0);for(;!t.isZero();){var n=e.mod(t);e=t,t=n}return e.lt(r)?e.neg():e},"Fraction, Fraction":function(e,t){return e.gcd(t)},"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,f)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,f,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,f,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,f)},"Array, Array":function(e,t){return f(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return f(n(e),t)},"Matrix, Array":function(e,t){return f(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return s(e,t,f,!1)},"DenseMatrix, number | BigNumber":function(e,t){return c(e,t,f,!1)},"number | BigNumber, SparseMatrix":function(e,t){return s(t,e,f,!0)},"number | BigNumber, DenseMatrix":function(e,t){return c(t,e,f,!0)},"Array, number | BigNumber":function(e,t){return c(n(e),t,f,!1).valueOf()},"number | BigNumber, Array":function(e,t){return c(n(t),e,f,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(e,t,r){for(var n=f(e,t),i=0;i<r.length;i++)n=f(n,r[i]);return n}});return f.toTex="\\gcd\\left(${args}\\right)",f}},function(e,t,p){"use strict";var m=p(2).flatten;t.name="hypot",t.factory=function(e,t,r,n){var o=r(p(25)),a=r(p(17)),s=r(p(12)),u=r(p(21)),c=r(p(46)),f=r(p(38)),l=r(p(73)),i=n("hypot",{"... number | BigNumber":function(e){for(var t=0,r=0,n=0;n<e.length;n++){var i=o(e[n]);f(r,i)?(t=u(t,u(s(r,i),s(r,i))),t=a(t,1),r=i):t=a(t,l(i)?u(s(i,r),s(i,r)):i)}return u(r,c(t))},Array:function(e){return i.apply(i,m(e))},Matrix:function(e){return i.apply(i,m(e.toArray()))}});return i.toTex="\\hypot\\left(${args}\\right)",i}},function(e,t,l){"use strict";var i=l(3).isInteger;function p(e,t){if(!i(e)||!i(t))throw new Error("Parameters in function lcm must be integer numbers");if(0===e||0===t)return 0;for(var r,n=e*t;0!==t;)t=e%(r=t),e=r;return Math.abs(n/e)}t.name="lcm",t.factory=function(i,e,t,r){var n=t(l(0)),o=t(l(27)),a=t(l(74)),s=t(l(20)),u=t(l(7)),c=t(l(6)),f=r("lcm",{"number, number":p,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(e.isZero()||t.isZero())return new i.BigNumber(0);var r=e.times(t);for(;!t.isZero();){var n=t;t=e.mod(n),e=n}return r.div(e).abs()},"Fraction, Fraction":function(e,t){return e.lcm(t)},"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,f)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,f,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,f,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,f)},"Array, Array":function(e,t){return f(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return f(n(e),t)},"Matrix, Array":function(e,t){return f(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return s(e,t,f,!1)},"DenseMatrix, number | BigNumber":function(e,t){return c(e,t,f,!1)},"number | BigNumber, SparseMatrix":function(e,t){return s(t,e,f,!0)},"number | BigNumber, DenseMatrix":function(e,t){return c(t,e,f,!0)},"Array, number | BigNumber":function(e,t){return c(n(e),t,f,!1).valueOf()},"number | BigNumber, Array":function(e,t){return c(n(t),e,f,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(e,t,r){for(var n=f(e,t),i=0;i<r.length;i++)n=f(n,r[i]);return n}});return f.toTex=void 0,f}},function(e){"use strict";e.exports=function(e,t,r,n,i,o,a,s,u,c,f){var l,p,m,h,d=e._values,y=e._index,g=e._ptr,v=a._index;if(n)for(p=g[t],m=g[t+1],l=p;l<m;l++)r[h=y[l]]!==o?(r[h]=o,v.push(h),c?(n[h]=u?s(d[l],f):s(f,d[l]),i[h]=o):n[h]=d[l]):(n[h]=u?s(d[l],n[h]):s(n[h],d[l]),i[h]=o);else for(p=g[t],m=g[t+1],l=p;l<m;l++)r[h=y[l]]!==o?(r[h]=o,v.push(h)):i[h]=o}},function(e,t,r){"use strict";var o=r(1);var a=Math.log10||function(e){return Math.log(e)/Math.LN10};t.name="log10",t.factory=function(t,r,e,n){var i=n("log10",{number:function(e){return 0<=e||r.predictable?a(e):new t.Complex(e,0).log().div(Math.LN10)},Complex:function(e){return new t.Complex(e).log().div(Math.LN10)},BigNumber:function(e){return!e.isNegative()||r.predictable?e.log():new t.Complex(e.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\log_{10}\\left(${args[0]}\\right)"},i}},function(e,t,u){"use strict";var c=u(1);t.name="log1p",t.factory=function(r,n,e,t){var i=e(u(12)),o=e(u(91)),a=t("log1p",{number:function(e){return-1<=e||n.predictable?Math.log1p?Math.log1p(e):Math.log(e+1):s(new r.Complex(e,0))},Complex:s,BigNumber:function(e){var t=e.plus(1);return!t.isNegative()||n.predictable?t.ln():s(new r.Complex(e.toNumber(),0))},"Array | Matrix":function(e){return c(e,a)},"any, any":function(e,t){return i(a(e),o(t))}});function s(e){var t=e.re+1;return new r.Complex(Math.log(Math.sqrt(t*t+e.im*e.im)),Math.atan2(e.im,t))}return a.toTex={1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},a}},function(e,t,r){"use strict";var a=r(1);t.name="log2",t.factory=function(r,t,e,n){var i=n("log2",{number:function(e){return 0<=e||t.predictable?Math.log2?Math.log2(e):Math.log(e)/Math.LN2:o(new r.Complex(e,0))},Complex:o,BigNumber:function(e){return!e.isNegative()||t.predictable?e.log(2):o(new r.Complex(e.toNumber(),0))},"Array | Matrix":function(e){return a(e,i)}});function o(e){var t=Math.sqrt(e.re*e.re+e.im*e.im);return new r.Complex(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}return i.toTex="\\log_{2}\\left(${args[0]}\\right)",i}},function(e,t,h){"use strict";t.name="mod",t.factory=function(e,t,r,n){var i=r(h(0)),o=h(4),a=r(h(27)),s=r(h(18)),u=r(h(66)),c=r(h(20)),f=r(h(19)),l=r(h(7)),p=r(h(6)),m=n("mod",{"number, number":function(e,t){{if(0<t)return e-t*Math.floor(e/t);if(0===t)return e;throw new Error("Cannot calculate mod for a negative divisor")}},"BigNumber, BigNumber":function(e,t){return t.isZero()?e:e.mod(t)},"Fraction, Fraction":function(e,t){return e.mod(t)},"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,m,!1)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,m,!0)},"DenseMatrix, SparseMatrix":function(e,t){return s(e,t,m,!1)},"DenseMatrix, DenseMatrix":function(e,t){return l(e,t,m)},"Array, Array":function(e,t){return m(i(e),i(t)).valueOf()},"Array, Matrix":function(e,t){return m(i(e),t)},"Matrix, Array":function(e,t){return m(e,i(t))},"SparseMatrix, any":function(e,t){return c(e,t,m,!1)},"DenseMatrix, any":function(e,t){return p(e,t,m,!1)},"any, SparseMatrix":function(e,t){return f(t,e,m,!0)},"any, DenseMatrix":function(e,t){return p(t,e,m,!0)},"Array, any":function(e,t){return p(i(e),t,m,!1).valueOf()},"any, Array":function(e,t){return p(i(t),e,m,!0).valueOf()}});return m.toTex={2:"\\left(${args[0]}".concat(o.operators.mod,"${args[1]}\\right)")},m}},function(e,t,a){"use strict";t.name="norm",t.factory=function(e,t,r,n){var l=r(a(25)),p=r(a(14)),m=r(a(42)),h=r(a(71)),d=r(a(46)),y=r(a(10)),g=r(a(11)),v=r(a(33)),x=r(a(38)),i=r(a(0)),o=n("norm",{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 b(i(e),2)},Matrix:function(e){return b(e,2)},"number | Complex | BigNumber | boolean, number | BigNumber | string":function(e){return o(e)},"Array, number | BigNumber | string":function(e,t){return b(i(e),t)},"Matrix, number | BigNumber | string":function(e,t){return b(e,t)}});function b(e,t){var r=e.size();if(1===r.length){if(t===Number.POSITIVE_INFINITY||"inf"===t){var n=0;return e.forEach(function(e){var t=l(e);v(t,n)&&(n=t)},!0),n}var i;if(t===Number.NEGATIVE_INFINITY||"-inf"===t)return e.forEach(function(e){var t=l(e);i&&!x(t,i)||(i=t)},!0),i||0;if("fro"===t)return b(e,2);if("number"!=typeof t||isNaN(t))throw new Error("Unsupported parameter value");if(g(t,0))return Number.POSITIVE_INFINITY;var o=0;return e.forEach(function(e){o=p(m(l(e),t),o)},!0),m(o,1/t)}if(2===r.length){if(1===t){var a=[],s=0;return e.forEach(function(e,t){var r=t[1],n=p(a[r]||0,l(e));v(n,s)&&(s=n),a[r]=n},!0),s}if(t===Number.POSITIVE_INFINITY||"inf"===t){var u=[],c=0;return e.forEach(function(e,t){var r=t[0],n=p(u[r]||0,l(e));v(n,c)&&(c=n),u[r]=n},!0),c}if("fro"===t){var f=0;return e.forEach(function(e){f=p(f,y(e,h(e)))}),l(d(f))}if(2===t)throw new Error("Unsupported parameter value, missing implementation of matrix singular value decomposition");throw new Error("Unsupported parameter value")}}return o.toTex={1:"\\left\\|${args[0]}\\right\\|",2:void 0},o}},function(e,t,h){"use strict";function d(e,t){var r=t<0;if(r&&(t=-t),0===t)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!=1)throw new Error("Root must be odd when a is negative.");if(0===e)return r?1/0:0;if(!isFinite(e))return r?0:e;var n=Math.pow(Math.abs(e),1/t);return n=e<0?-n:n,r?1/n:n}t.name="nthRoot",t.factory=function(u,e,t,r){var n=t(h(0)),i=t(h(37)),o=t(h(27)),a=t(h(74)),s=t(h(20)),c=t(h(7)),f=t(h(6)),l="Complex number not supported in function nthRoot. Use nthRoots instead.",p=r("nthRoot",{number:function(e){return d(e,2)},"number, number":d,BigNumber:function(e){return m(e,new u.BigNumber(2))},Complex:function(){throw new Error(l)},"Complex, number":function(){throw new Error(l)},"BigNumber, BigNumber":m,"Array | Matrix":function(e){return p(e,2)},"SparseMatrix, SparseMatrix":function(e,t){if(1===t.density())return a(e,t,p);throw new Error("Root must be non-zero")},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,p,!0)},"DenseMatrix, SparseMatrix":function(e,t){if(1===t.density())return i(e,t,p,!1);throw new Error("Root must be non-zero")},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,p)},"Array, Array":function(e,t){return p(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return p(n(e),t)},"Matrix, Array":function(e,t){return p(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return s(e,t,p,!1)},"DenseMatrix, number | BigNumber":function(e,t){return f(e,t,p,!1)},"number | BigNumber, SparseMatrix":function(e,t){if(1===t.density())return s(t,e,p,!0);throw new Error("Root must be non-zero")},"number | BigNumber, DenseMatrix":function(e,t){return f(t,e,p,!0)},"Array, number | BigNumber":function(e,t){return p(n(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return p(e,n(t)).valueOf()}});return p.toTex={2:"\\sqrt[${args[1]}]{${args[0]}}"},p;function m(e,t){var r=u.BigNumber.precision,n=u.BigNumber.clone({precision:r+2}),i=new u.BigNumber(0),o=new n(1),a=t.isNegative();if(a&&(t=t.neg()),t.isZero())throw new Error("Root must be non-zero");if(e.isNegative()&&!t.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(e.isZero())return a?new n(1/0):0;if(!e.isFinite())return a?i:e;var s=e.abs().pow(o.div(t));return s=e.isNeg()?s.neg():s,new u.BigNumber((a?o.div(s):s).toPrecision(r))}}},function(e,t,r){"use strict";var n=r(82),i=r(103),f=n.factory("Complex",{},"",i,{on:function(){}});var l=[function(e){return f(e)},function(e){return f(0,e)},function(e){return f(-e)},function(e){return f(0,-e)}];function o(e,t){if(t<0)throw new Error("Root must be greater than zero");if(0===t)throw new Error("Root must be non-zero");if(t%1!=0)throw new Error("Root must be an integer");if(0===e||0===e.abs())return[f(0)];var r,n="number"==typeof e;!n&&0!==e.re&&0!==e.im||(r=n?2*+(e<0):0===e.im?2*+(e.re<0):2*+(e.im<0)+1);for(var i=e.arg(),o=e.abs(),a=[],s=Math.pow(o,1/t),u=0;u<t;u++){var c=(r+4*u)/t;c!==Math.round(c)?a.push(f({r:s,phi:(i+2*Math.PI*u)/t})):a.push(l[c%4](s))}return a}t.name="nthRoots",t.factory=function(e,t,r,n){var i=n("nthRoots",{Complex:function(e){return o(e,2)},"Complex, number":o});return i.toTex={2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},i}},function(e,t,r){"use strict";var o=r(1);t.name="square",t.factory=function(e,t,r,n){var i=n("square",{number:function(e){return e*e},Complex:function(e){return e.mul(e)},BigNumber:function(e){return e.times(e)},Fraction:function(e){return e.mul(e)},"Array | Matrix":function(e){return o(e,i,!0)},Unit:function(e){return e.pow(2)}});return i.toTex={1:"\\left(${args[0]}\\right)^2"},i}},function(e,t,a){"use strict";var s=a(1);t.name="unaryPlus",t.factory=function(t,r,e,n){var i=a(4),o=n("unaryPlus",{number:function(e){return e},Complex:function(e){return e},BigNumber:function(e){return e},Fraction:function(e){return e},Unit:function(e){return e.clone()},"Array | Matrix":function(e){return s(e,o,!0)},"boolean | string":function(e){return"BigNumber"===r.number?new t.BigNumber(+e):+e}});return o.toTex={1:"".concat(i.operators.unaryPlus,"\\left(${args[0]}\\right)")},o}},function(e,t,n){"use strict";var f=n(3).isInteger;t.name="xgcd",t.factory=function(p,m,e,t){var h=e(n(0)),r=t("xgcd",{"number, number":function(e,t){var r,n,i,o,a=0,s=1,u=1,c=0;if(!f(e)||!f(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)n=Math.floor(e/t),i=e-n*t,a=s-n*(r=a),s=r,u=c-n*(r=u),c=r,e=t,t=i;o=e<0?[-e,-s,-c]:[e,e?s:0,c];return"Array"===m.matrix?o:h(o)},"BigNumber, BigNumber":function(e,t){var r,n,i,o,a=new p.BigNumber(0),s=new p.BigNumber(1),u=a,c=s,f=s,l=a;if(!e.isInt()||!t.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!t.isZero();)n=e.div(t).floor(),i=e.mod(t),r=u,u=c.minus(n.times(u)),c=r,r=f,f=l.minus(n.times(f)),l=r,e=t,t=i;o=e.lt(a)?[e.neg(),c.neg(),l.neg()]:[e,e.isZero()?0:c,l];return"Array"===m.matrix?o:h(o)}});return r.toTex=void 0,r}},function(e,t,r){"use strict";e.exports=[r(246),r(248),r(249),r(251),r(253),r(255),r(257)]},function(e,t,p){"use strict";var m=p(3).isInteger,h=p(247);t.name="bitAnd",t.factory=function(e,t,r,n){var i=p(4),o=r(p(0)),a=r(p(27)),s=r(p(74)),u=r(p(20)),c=r(p(7)),f=r(p(6)),l=n("bitAnd",{"number, number":function(e,t){if(!m(e)||!m(t))throw new Error("Integers expected in function bitAnd");return e&t},"BigNumber, BigNumber":h,"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,l,!1)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,l,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,l,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,l)},"Array, Array":function(e,t){return l(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return l(o(e),t)},"Matrix, Array":function(e,t){return l(e,o(t))},"SparseMatrix, any":function(e,t){return u(e,t,l,!1)},"DenseMatrix, any":function(e,t){return f(e,t,l,!1)},"any, SparseMatrix":function(e,t){return u(t,e,l,!0)},"any, DenseMatrix":function(e,t){return f(t,e,l,!0)},"Array, any":function(e,t){return f(o(e),t,l,!1).valueOf()},"any, Array":function(e,t){return f(o(t),e,l,!0).valueOf()}});return l.toTex={2:"\\left(${args[0]}".concat(i.operators.bitAnd,"${args[1]}\\right)")},l}},function(e,t,r){"use strict";var n=r(92);e.exports=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new r(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e}return n(e,t,function(e,t){return e&t})}},function(e,t,a){"use strict";var s=a(1),u=a(93),c=a(3).isInteger;t.name="bitNot",t.factory=function(e,t,r,n){var i=a(4),o=n("bitNot",{number:function(e){if(!c(e))throw new Error("Integer expected in function bitNot");return~e},BigNumber:u,"Array | Matrix":function(e){return s(e,o)}});return o.toTex={1:i.operators.bitNot+"\\left(${args[0]}\\right)"},o}},function(e,t,p){"use strict";var m=p(3).isInteger,h=p(250);t.name="bitOr",t.factory=function(e,t,r,n){var i=p(4),o=r(p(0)),a=r(p(37)),s=r(p(85)),u=r(p(41)),c=r(p(7)),f=r(p(6)),l=n("bitOr",{"number, number":function(e,t){if(!m(e)||!m(t))throw new Error("Integers expected in function bitOr");return e|t},"BigNumber, BigNumber":h,"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,l)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,l,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,l,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,l)},"Array, Array":function(e,t){return l(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return l(o(e),t)},"Matrix, Array":function(e,t){return l(e,o(t))},"SparseMatrix, any":function(e,t){return u(e,t,l,!1)},"DenseMatrix, any":function(e,t){return f(e,t,l,!1)},"any, SparseMatrix":function(e,t){return u(t,e,l,!0)},"any, DenseMatrix":function(e,t){return f(t,e,l,!0)},"Array, any":function(e,t){return f(o(e),t,l,!1).valueOf()},"any, Array":function(e,t){return f(o(t),e,l,!0).valueOf()}});return l.toTex={2:"\\left(${args[0]}".concat(i.operators.bitOr,"${args[1]}\\right)")},l}},function(e,t,r){"use strict";var i=r(92);e.exports=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);var n=new r(-1);return e.isZero()||t.eq(n)||e.eq(t)?t:t.isZero()||e.eq(n)?e:e.isFinite()&&t.isFinite()?i(e,t,function(e,t){return e|t}):!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?n:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e}},function(e,t,p){"use strict";var m=p(3).isInteger,h=p(252);t.name="bitXor",t.factory=function(e,t,r,n){var i=p(4),o=r(p(0)),a=r(p(18)),s=r(p(29)),u=r(p(19)),c=r(p(7)),f=r(p(6)),l=n("bitXor",{"number, number":function(e,t){if(!m(e)||!m(t))throw new Error("Integers expected in function bitXor");return e^t},"BigNumber, BigNumber":h,"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,l)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,l,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,l,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,l)},"Array, Array":function(e,t){return l(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return l(o(e),t)},"Matrix, Array":function(e,t){return l(e,o(t))},"SparseMatrix, any":function(e,t){return u(e,t,l,!1)},"DenseMatrix, any":function(e,t){return f(e,t,l,!1)},"any, SparseMatrix":function(e,t){return u(t,e,l,!0)},"any, DenseMatrix":function(e,t){return f(t,e,l,!0)},"Array, any":function(e,t){return f(o(e),t,l,!1).valueOf()},"any, Array":function(e,t){return f(o(t),e,l,!0).valueOf()}});return l.toTex={2:"\\left(${args[0]}".concat(i.operators.bitXor,"${args[1]}\\right)")},l}},function(e,t,r){"use strict";var i=r(92),o=r(93);e.exports=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new r(0);var n=new r(-1);return e.eq(n)?o(t):t.eq(n)?o(e):e.isFinite()&&t.isFinite()?i(e,t,function(e,t){return e^t}):e.isFinite()||t.isFinite()?new r(e.isNegative()===t.isNegative()?1/0:-1/0):n}},function(e,t,y){"use strict";var g=y(3).isInteger,v=y(254);t.name="leftShift",t.factory=function(e,t,r,n){var i=y(4),o=r(y(0)),a=r(y(11)),s=r(y(43)),u=r(y(37)),c=r(y(27)),f=r(y(94)),l=r(y(41)),p=r(y(20)),m=r(y(7)),h=r(y(6)),d=n("leftShift",{"number, number":function(e,t){if(!g(e)||!g(t))throw new Error("Integers expected in function leftShift");return e<<t},"BigNumber, BigNumber":v,"SparseMatrix, SparseMatrix":function(e,t){return f(e,t,d,!1)},"SparseMatrix, DenseMatrix":function(e,t){return c(t,e,d,!0)},"DenseMatrix, SparseMatrix":function(e,t){return u(e,t,d,!1)},"DenseMatrix, DenseMatrix":function(e,t){return m(e,t,d)},"Array, Array":function(e,t){return d(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return d(o(e),t)},"Matrix, Array":function(e,t){return d(e,o(t))},"SparseMatrix, number | BigNumber":function(e,t){return a(t,0)?e.clone():p(e,t,d,!1)},"DenseMatrix, number | BigNumber":function(e,t){return a(t,0)?e.clone():h(e,t,d,!1)},"number | BigNumber, SparseMatrix":function(e,t){return a(e,0)?s(t.size(),t.storage()):l(t,e,d,!0)},"number | BigNumber, DenseMatrix":function(e,t){return a(e,0)?s(t.size(),t.storage()):h(t,e,d,!0)},"Array, number | BigNumber":function(e,t){return d(o(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return d(e,o(t)).valueOf()}});return d.toTex={2:"\\left(${args[0]}".concat(i.operators.leftShift,"${args[1]}\\right)")},d}},function(e){"use strict";e.exports=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:e.isFinite()||t.isFinite()?t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new r(2).pow(t)):new r(NaN)}},function(e,t,y){"use strict";var g=y(3).isInteger,v=y(256);t.name="rightArithShift",t.factory=function(e,t,r,n){var i=y(4),o=r(y(0)),a=r(y(11)),s=r(y(43)),u=r(y(37)),c=r(y(27)),f=r(y(94)),l=r(y(41)),p=r(y(20)),m=r(y(7)),h=r(y(6)),d=n("rightArithShift",{"number, number":function(e,t){if(!g(e)||!g(t))throw new Error("Integers expected in function rightArithShift");return e>>t},"BigNumber, BigNumber":v,"SparseMatrix, SparseMatrix":function(e,t){return f(e,t,d,!1)},"SparseMatrix, DenseMatrix":function(e,t){return c(t,e,d,!0)},"DenseMatrix, SparseMatrix":function(e,t){return u(e,t,d,!1)},"DenseMatrix, DenseMatrix":function(e,t){return m(e,t,d)},"Array, Array":function(e,t){return d(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return d(o(e),t)},"Matrix, Array":function(e,t){return d(e,o(t))},"SparseMatrix, number | BigNumber":function(e,t){return a(t,0)?e.clone():p(e,t,d,!1)},"DenseMatrix, number | BigNumber":function(e,t){return a(t,0)?e.clone():h(e,t,d,!1)},"number | BigNumber, SparseMatrix":function(e,t){return a(e,0)?s(t.size(),t.storage()):l(t,e,d,!0)},"number | BigNumber, DenseMatrix":function(e,t){return a(e,0)?s(t.size(),t.storage()):h(t,e,d,!0)},"Array, number | BigNumber":function(e,t){return d(o(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return d(e,o(t)).valueOf()}});return d.toTex={2:"\\left(${args[0]}".concat(i.operators.rightArithShift,"${args[1]}\\right)")},d}},function(e){"use strict";e.exports=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new r(2).pow(t)).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}},function(e,t,y){"use strict";var g=y(3).isInteger;t.name="rightLogShift",t.factory=function(e,t,r,n){var i=y(4),o=r(y(0)),a=r(y(11)),s=r(y(43)),u=r(y(37)),c=r(y(27)),f=r(y(94)),l=r(y(41)),p=r(y(20)),m=r(y(7)),h=r(y(6)),d=n("rightLogShift",{"number, number":function(e,t){if(!g(e)||!g(t))throw new Error("Integers expected in function rightLogShift");return e>>>t},"SparseMatrix, SparseMatrix":function(e,t){return f(e,t,d,!1)},"SparseMatrix, DenseMatrix":function(e,t){return c(t,e,d,!0)},"DenseMatrix, SparseMatrix":function(e,t){return u(e,t,d,!1)},"DenseMatrix, DenseMatrix":function(e,t){return m(e,t,d)},"Array, Array":function(e,t){return d(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return d(o(e),t)},"Matrix, Array":function(e,t){return d(e,o(t))},"SparseMatrix, number | BigNumber":function(e,t){return a(t,0)?e.clone():p(e,t,d,!1)},"DenseMatrix, number | BigNumber":function(e,t){return a(t,0)?e.clone():h(e,t,d,!1)},"number | BigNumber, SparseMatrix":function(e,t){return a(e,0)?s(t.size(),t.storage()):l(t,e,d,!0)},"number | BigNumber, DenseMatrix":function(e,t){return a(e,0)?s(t.size(),t.storage()):h(t,e,d,!0)},"Array, number | BigNumber":function(e,t){return d(o(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return d(e,o(t)).valueOf()}});return d.toTex={2:"\\left(${args[0]}".concat(i.operators.rightLogShift,"${args[1]}\\right)")},d}},function(e,t,r){"use strict";e.exports=[r(259),r(260),r(140),r(261)]},function(e,t,c){"use strict";t.name="bellNumbers",t.factory=function(e,t,r,n){var i=r(c(14)),o=r(c(140)),a=r(c(61)),s=r(c(34)),u=n("bellNumbers",{"number | BigNumber":function(e){if(!s(e)||a(e))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var t=0,r=0;r<=e;r++)t=i(t,o(e,r));return t}});return u.toTex={1:"\\mathrm{B}_{${args[0]}}"},u}},function(e,t,f){"use strict";t.name="composition",t.factory=function(e,t,r,n){var i=r(f(76)),o=r(f(17)),a=r(f(73)),s=r(f(34)),u=r(f(33)),c=n("composition",{"number | BigNumber, number | BigNumber":function(e,t){if(!(s(e)&&a(e)&&s(t)&&a(t)))throw new TypeError("Positive integer value expected in function composition");if(u(t,e))throw new TypeError("k must be less than or equal to n in function composition");return i(o(e,-1),o(t,-1))}});return c.toTex=void 0,c}},function(e,t,l){"use strict";t.name="catalan",t.factory=function(e,t,r,n){var i=r(l(14)),o=r(l(45)),a=r(l(10)),s=r(l(76)),u=r(l(61)),c=r(l(34)),f=n("catalan",{"number | BigNumber":function(e){if(!c(e)||u(e))throw new TypeError("Non-negative integer value expected in function catalan");return o(s(a(e,2),e),i(e,1))}});return f.toTex={1:"\\mathrm{C}_{${args[0]}}"},f}},function(e,t,r){"use strict";e.exports=[r(263),r(71),r(264),r(265)]},function(e,t,r){"use strict";var o=r(1);t.name="arg",t.factory=function(t,e,r,n){var i=n("arg",{number:function(e){return Math.atan2(0,e)},BigNumber:function(e){return t.BigNumber.atan2(0,e)},Complex:function(e){return e.arg()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\arg\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="im",t.factory=function(e,t,r,n){var i=n("im",{number:function(){return 0},BigNumber:function(){return new e.BigNumber(0)},Complex:function(e){return e.im},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},i}},function(e,t,r){"use strict";var o=r(1);t.name="re",t.factory=function(e,t,r,n){var i=n("re",{number:function(e){return e},BigNumber:function(e){return e},Complex:function(e){return e.re},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},i}},function(e,t,r){"use strict";e.exports=[r(267),r(268)]},function(e,t,u){"use strict";t.name="intersect",t.factory=function(t,h,e,r){var d=e(u(25)),y=e(u(14)),A=e(u(17)),i=e(u(0)),g=e(u(10)),S=e(u(21)),O=e(u(12)),T=e(u(15)),v=e(u(38)),_=e(u(11)),o=r("intersect",{"Array, Array, Array":function(e,t,r){if(!s(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!s(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!function(e){return 4===e.length&&n(e[0])&&n(e[1])&&n(e[2])&&n(e[3])}(r))throw new TypeError("Array with 4 numbers expected as third argument");return function(e,t,r,n,i,o,a,s,u,c){var f=S(e,a),l=S(n,a),p=S(t,s),m=S(i,s),h=S(r,u),d=S(o,u),y=O(T(T(T(c,f),p),h),T(T(T(A(A(l,m),d),f),p),h)),g=A(e,S(y,T(n,e))),v=A(t,S(y,T(i,t))),x=A(r,S(y,T(o,r)));return[g,v,x]}(e[0],e[1],e[2],t[0],t[1],t[2],r[0],r[1],r[2],r[3])},"Array, Array, Array, Array":function(e,t,r,n){if(2===e.length){if(!a(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!a(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!a(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!a(n))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return function(e,t,r,n){var i=e,o=r,a=T(i,t),s=T(o,n),u=T(S(a[0],s[1]),S(s[0],a[1]));if(v(d(u),h.epsilon))return null;var c=S(s[0],i[1]),f=S(s[1],i[0]),l=S(s[0],o[1]),p=S(s[1],o[0]),m=O(A(T(T(c,f),l),p),u);return y(g(a,m),i)}(e,t,r,n)}if(3!==e.length)throw new TypeError("Arrays with two or thee dimensional points expected");if(!s(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!s(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!s(r))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!s(n))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return function(e,t,r,n,i,o,a,s,u,c,f,l){var p=C(e,a,c,a,t,s,f,s,r,u,l,u),m=C(c,a,n,e,f,s,i,t,l,u,o,r),h=C(e,a,n,e,t,s,i,t,r,u,o,r),d=C(c,a,c,a,f,s,f,s,l,u,l,u),y=C(n,e,n,e,i,t,i,t,o,r,o,r),g=O(T(S(p,m),S(h,d)),T(S(y,d),S(m,m))),v=O(A(p,S(g,m)),d),x=A(e,S(g,T(n,e))),b=A(t,S(g,T(i,t))),w=A(r,S(g,T(o,r))),N=A(a,S(v,T(c,a))),M=A(s,S(v,T(f,s))),E=A(u,S(v,T(l,u)));return _(x,N)&&_(b,M)&&_(w,E)?[x,b,w]:null}(e[0],e[1],e[2],t[0],t[1],t[2],r[0],r[1],r[2],n[0],n[1],n[2])},"Matrix, Matrix, Matrix":function(e,t,r){return i(o(e.valueOf(),t.valueOf(),r.valueOf()))},"Matrix, Matrix, Matrix, Matrix":function(e,t,r,n){return i(o(e.valueOf(),t.valueOf(),r.valueOf(),n.valueOf()))}});function n(e){return"number"==typeof e||t.isBigNumber(e)}function a(e){return 2===e.length&&n(e[0])&&n(e[1])}function s(e){return 3===e.length&&n(e[0])&&n(e[1])&&n(e[2])}function C(e,t,r,n,i,o,a,s,u,c,f,l){var p=S(T(e,t),T(r,n)),m=S(T(i,o),T(a,s)),h=S(T(u,c),T(f,l));return A(A(p,m),h)}return o}},function(e,t,b){"use strict";t.name="distance",t.factory=function(t,e,r,n){var l=r(b(17)),p=r(b(15)),m=r(b(21)),h=r(b(12)),s=r(b(39)),d=r(b(46)),u=r(b(25));function i(e){return"number"==typeof e||t.isBigNumber(e)}function c(e){return e.constructor!==Array&&(e=f(e)),i(e[0])&&i(e[1])}function o(e){return e.constructor!==Array&&(e=f(e)),i(e[0])&&i(e[1])&&i(e[2])}function a(e){return e.constructor!==Array&&(e=f(e)),i(e[0])&&i(e[1])&&i(e[2])&&i(e[3])&&i(e[4])&&i(e[5])}function f(e){for(var t=Object.keys(e),r=[],n=0;n<t.length;n++)r.push(e[t[n]]);return r}function y(e,t,r,n,i){var o=u(l(l(m(r,e),m(n,t)),i)),a=d(l(m(r,r),m(n,n)));return h(o,a)}function g(e,t,r,n,i,o,a,s,u){var c=[p(m(p(i,t),u),m(p(o,r),s)),p(m(p(o,r),a),m(p(n,e),u)),p(m(p(n,e),s),m(p(i,t),a))];c=d(l(l(m(c[0],c[0]),m(c[1],c[1])),m(c[2],c[2])));var f=d(l(l(m(a,a),m(s,s)),m(u,u)));return h(c,f)}function v(e,t,r,n){var i=p(n,t),o=p(r,e),a=l(m(i,i),m(o,o));return d(a)}function x(e,t,r,n,i,o){var a=p(o,r),s=p(i,t),u=p(n,e),c=l(l(m(a,a),m(s,s)),m(u,u));return d(c)}return n("distance",{"Array, Array, Array":function(e,t,r){if(2!==e.length||2!==t.length||2!==r.length)throw new TypeError("Invalid Arguments: Try again");if(!c(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!c(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!c(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");var n=h(p(r[1],r[0]),p(t[1],t[0])),i=m(m(n,n),t[0]),o=s(m(n,t[0])),a=e[1];return y(e[0],e[1],i,o,a)},"Object, Object, Object":function(e,t,r){if(2!==Object.keys(e).length||2!==Object.keys(t).length||2!==Object.keys(r).length)throw new TypeError("Invalid Arguments: Try again");if(!c(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!c(t))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!c(r))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(e.hasOwnProperty("pointX")&&e.hasOwnProperty("pointY")&&t.hasOwnProperty("lineOnePtX")&&t.hasOwnProperty("lineOnePtY")&&r.hasOwnProperty("lineTwoPtX")&&r.hasOwnProperty("lineTwoPtY")){var n=h(p(r.lineTwoPtY,r.lineTwoPtX),p(t.lineOnePtY,t.lineOnePtX)),i=m(m(n,n),t.lineOnePtX),o=s(m(n,t.lineOnePtX)),a=e.pointX;return y(e.pointX,e.pointY,i,o,a)}throw new TypeError("Key names do not match")},"Array, Array":function(e,t){if(2===e.length&&3===t.length){if(!c(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!o(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return y(e[0],e[1],t[0],t[1],t[2])}if(3===e.length&&6===t.length){if(!o(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!a(t))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return g(e[0],e[1],e[2],t[0],t[1],t[2],t[3],t[4],t[5])}if(2===e.length&&2===t.length){if(!c(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!c(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");return v(e[0],e[1],t[0],t[1])}if(3!==e.length||3!==t.length)throw new TypeError("Invalid Arguments: Try again");if(!o(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!o(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return x(e[0],e[1],e[2],t[0],t[1],t[2])},"Object, Object":function(e,t){if(2===Object.keys(e).length&&3===Object.keys(t).length){if(!c(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!o(t))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if(e.hasOwnProperty("pointX")&&e.hasOwnProperty("pointY")&&t.hasOwnProperty("xCoeffLine")&&t.hasOwnProperty("yCoeffLine")&&t.hasOwnProperty("constant"))return y(e.pointX,e.pointY,t.xCoeffLine,t.yCoeffLine,t.constant);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&6===Object.keys(t).length){if(!o(e))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!a(t))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if(e.hasOwnProperty("pointX")&&e.hasOwnProperty("pointY")&&t.hasOwnProperty("x0")&&t.hasOwnProperty("y0")&&t.hasOwnProperty("z0")&&t.hasOwnProperty("a")&&t.hasOwnProperty("b")&&t.hasOwnProperty("c"))return g(e.pointX,e.pointY,e.pointZ,t.x0,t.y0,t.z0,t.a,t.b,t.c);throw new TypeError("Key names do not match")}if(2===Object.keys(e).length&&2===Object.keys(t).length){if(!c(e))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!c(t))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if(e.hasOwnProperty("pointOneX")&&e.hasOwnProperty("pointOneY")&&t.hasOwnProperty("pointTwoX")&&t.hasOwnProperty("pointTwoY"))return v(e.pointOneX,e.pointOneY,t.pointTwoX,t.pointTwoY);throw new TypeError("Key names do not match")}if(3!==Object.keys(e).length||3!==Object.keys(t).length)throw new TypeError("Invalid Arguments: Try again");if(!o(e))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!o(t))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if(e.hasOwnProperty("pointOneX")&&e.hasOwnProperty("pointOneY")&&e.hasOwnProperty("pointOneZ")&&t.hasOwnProperty("pointTwoX")&&t.hasOwnProperty("pointTwoY")&&t.hasOwnProperty("pointTwoZ"))return x(e.pointOneX,e.pointOneY,e.pointOneZ,t.pointTwoX,t.pointTwoY,t.pointTwoZ);throw new TypeError("Key names do not match")},Array:function(e){if(!function(e){if(2===e[0].length&&i(e[0][0])&&i(e[0][1])){for(var t in e)if(2!==e[t].length||!i(e[t][0])||!i(e[t][1]))return!1}else{if(!(3===e[0].length&&i(e[0][0])&&i(e[0][1])&&i(e[0][2])))return!1;for(var r in e)if(3!==e[r].length||!i(e[r][0])||!i(e[r][1])||!i(e[r][2]))return!1}return!0}(e))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return function(e){for(var t=[],r=0;r<e.length-1;r++)for(var n=r+1;n<e.length;n++)2===e[0].length?t.push(v(e[r][0],e[r][1],e[n][0],e[n][1])):3===e[0].length&&t.push(x(e[r][0],e[r][1],e[r][2],e[n][0],e[n][1],e[n][2]));return t}(e)}})}},function(e,t,r){"use strict";e.exports=[r(270),r(142),r(271),r(272)]},function(e,t,h){"use strict";t.name="and",t.factory=function(e,t,r,n){var i=h(4),o=r(h(0)),a=r(h(43)),s=r(h(142)),u=r(h(27)),c=r(h(74)),f=r(h(20)),l=r(h(7)),p=r(h(6)),m=n("and",{"number, number":function(e,t){return!(!e||!t)},"Complex, Complex":function(e,t){return!(0===e.re&&0===e.im||0===t.re&&0===t.im)},"BigNumber, BigNumber":function(e,t){return!(e.isZero()||t.isZero()||e.isNaN()||t.isNaN())},"Unit, Unit":function(e,t){return m(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return c(e,t,m,!1)},"SparseMatrix, DenseMatrix":function(e,t){return u(t,e,m,!0)},"DenseMatrix, SparseMatrix":function(e,t){return u(e,t,m,!1)},"DenseMatrix, DenseMatrix":function(e,t){return l(e,t,m)},"Array, Array":function(e,t){return m(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return m(o(e),t)},"Matrix, Array":function(e,t){return m(e,o(t))},"SparseMatrix, any":function(e,t){return s(t)?a(e.size(),e.storage()):f(e,t,m,!1)},"DenseMatrix, any":function(e,t){return s(t)?a(e.size(),e.storage()):p(e,t,m,!1)},"any, SparseMatrix":function(e,t){return s(e)?a(e.size(),e.storage()):f(t,e,m,!0)},"any, DenseMatrix":function(e,t){return s(e)?a(e.size(),e.storage()):p(t,e,m,!0)},"Array, any":function(e,t){return m(o(e),t).valueOf()},"any, Array":function(e,t){return m(e,o(t)).valueOf()}});return m.toTex={2:"\\left(${args[0]}".concat(i.operators.and,"${args[1]}\\right)")},m}},function(e,t,p){"use strict";t.name="or",t.factory=function(e,t,r,n){var i=p(4),o=r(p(0)),a=r(p(18)),s=r(p(66)),u=r(p(19)),c=r(p(7)),f=r(p(6)),l=n("or",{"number, number":function(e,t){return!(!e&&!t)},"Complex, Complex":function(e,t){return 0!==e.re||0!==e.im||0!==t.re||0!==t.im},"BigNumber, BigNumber":function(e,t){return!e.isZero()&&!e.isNaN()||!t.isZero()&&!t.isNaN()},"Unit, Unit":function(e,t){return l(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,l)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,l,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,l,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,l)},"Array, Array":function(e,t){return l(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return l(o(e),t)},"Matrix, Array":function(e,t){return l(e,o(t))},"SparseMatrix, any":function(e,t){return u(e,t,l,!1)},"DenseMatrix, any":function(e,t){return f(e,t,l,!1)},"any, SparseMatrix":function(e,t){return u(t,e,l,!0)},"any, DenseMatrix":function(e,t){return f(t,e,l,!0)},"Array, any":function(e,t){return f(o(e),t,l,!1).valueOf()},"any, Array":function(e,t){return f(o(t),e,l,!0).valueOf()}});return l.toTex={2:"\\left(${args[0]}".concat(i.operators.or,"${args[1]}\\right)")},l}},function(e,t,p){"use strict";t.name="xor",t.factory=function(e,t,r,n){var i=p(4),o=r(p(0)),a=r(p(18)),s=r(p(29)),u=r(p(19)),c=r(p(7)),f=r(p(6)),l=n("xor",{"number, number":function(e,t){return!!e!=!!t},"Complex, Complex":function(e,t){return(0!==e.re||0!==e.im)!=(0!==t.re||0!==t.im)},"BigNumber, BigNumber":function(e,t){return(!e.isZero()&&!e.isNaN())!=(!t.isZero()&&!t.isNaN())},"Unit, Unit":function(e,t){return l(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,l)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,l,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,l,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,l)},"Array, Array":function(e,t){return l(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return l(o(e),t)},"Matrix, Array":function(e,t){return l(e,o(t))},"SparseMatrix, any":function(e,t){return u(e,t,l,!1)},"DenseMatrix, any":function(e,t){return f(e,t,l,!1)},"any, SparseMatrix":function(e,t){return u(t,e,l,!0)},"any, DenseMatrix":function(e,t){return f(t,e,l,!0)},"Array, any":function(e,t){return f(o(e),t,l,!1).valueOf()},"any, Array":function(e,t){return f(o(t),e,l,!0).valueOf()}});return l.toTex={2:"\\left(${args[0]}".concat(i.operators.xor,"${args[1]}\\right)")},l}},function(e,t,r){"use strict";e.exports=[r(96),r(143),r(78),r(274),r(275),r(128),r(276),r(277),r(278),r(279),r(280),r(281),r(282),r(50),r(70),r(283),r(145),r(284),r(97),r(77),r(285),r(286),r(146),r(28),r(287),r(289),r(290),r(23),r(291),r(72),r(43),r(292)]},function(e,t,c){"use strict";var f=c(2);t.name="cross",t.factory=function(e,t,r,n){var i=r(c(0)),a=r(c(15)),s=r(c(10)),o=n("cross",{"Matrix, Matrix":function(e,t){return i(u(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return i(u(e.toArray(),t))},"Array, Matrix":function(e,t){return i(u(e,t.toArray()))},"Array, Array":u});return o.toTex={2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},o;function u(e,t){var r=Math.max(f.size(e).length,f.size(t).length);e=f.squeeze(e),t=f.squeeze(t);var n=f.size(e),i=f.size(t);if(1!==n.length||1!==i.length||3!==n[0]||3!==i[0])throw new RangeError("Vectors with length 3 expected (Size A = ["+n.join(", ")+"], B = ["+i.join(", ")+"])");var o=[a(s(e[1],t[2]),s(e[2],t[1])),a(s(e[2],t[0]),s(e[0],t[2])),a(s(e[0],t[1]),s(e[1],t[0]))];return 1<r?[o]:o}}},function(e,t,u){"use strict";t.name="ctranspose",t.factory=function(e,t,r,n){var i=r(u(72)),o=r(u(71)),a=u(4),s=n("ctranspose",{any:function(e){return o(i(e))}});return s.toTex={1:"\\left(${args[0]}\\right)".concat(a.operators.ctranspose)},s}},function(e,t,o){"use strict";var a=o(2),s=o(3).isInteger;t.name="diag",t.factory=function(f,e,t,r){var l=t(o(0)),n=r("diag",{Array:function(e){return i(e,0,a.size(e),null)},"Array, number":function(e,t){return i(e,t,a.size(e),null)},"Array, BigNumber":function(e,t){return i(e,t.toNumber(),a.size(e),null)},"Array, string":function(e,t){return i(e,0,a.size(e),t)},"Array, number, string":function(e,t,r){return i(e,t,a.size(e),r)},"Array, BigNumber, string":function(e,t,r){return i(e,t.toNumber(),a.size(e),r)},Matrix:function(e){return i(e,0,e.size(),e.storage())},"Matrix, number":function(e,t){return i(e,t,e.size(),e.storage())},"Matrix, BigNumber":function(e,t){return i(e,t.toNumber(),e.size(),e.storage())},"Matrix, string":function(e,t){return i(e,0,e.size(),t)},"Matrix, number, string":function(e,t,r){return i(e,t,e.size(),r)},"Matrix, BigNumber, string":function(e,t,r){return i(e,t.toNumber(),e.size(),r)}});return n.toTex=void 0,n;function i(e,t,r,n){if(!s(t))throw new TypeError("Second parameter in function diag must be an integer");var i=0<t?t:0,o=t<0?-t:0;switch(r.length){case 1:return function(e,t,r,n,i,o){var a=[n+i,n+o],s=f.Matrix.storage(r||"dense").diagonal(a,e,t);return null!==r?s:s.valueOf()}(e,t,n,r[0],o,i);case 2:return function(e,t,r,n,i,o){if(f.isMatrix(e)){var a=e.diagonal(t);return null!==r?r!==a.storage()?l(a,r):a:a.valueOf()}for(var s=Math.min(n[0]-i,n[1]-o),u=[],c=0;c<s;c++)u[c]=e[c+i][c+o];return null!==r?l(u):u}(e,t,n,r,o,i)}throw new RangeError("Matrix for function diag must be 2 dimensional")}}},function(e,t,a){"use strict";var c=a(2).size;t.name="dot",t.factory=function(e,t,r,n){var s=r(a(14)),u=r(a(10)),i=n("dot",{"Matrix, Matrix":function(e,t){return o(e.toArray(),t.toArray())},"Matrix, Array":function(e,t){return o(e.toArray(),t)},"Array, Matrix":function(e,t){return o(e,t.toArray())},"Array, Array":o});return i.toTex={2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},i;function o(e,t){var r=c(e),n=c(t),i=r[0];if(1!==r.length||1!==n.length)throw new RangeError("Vector expected");if(r[0]!==n[0])throw new RangeError("Vectors must have equal length ("+r[0]+" != "+n[0]+")");if(0===i)throw new RangeError("Cannot calculate the dot product of empty vectors");for(var o=0,a=0;a<i;a++)o=s(o,u(e[a],t[a]));return o}}},function(e,t){"use strict";t.name="eye",t.factory=function(){return function(){throw new Error('Function "eye" is renamed to "identity" since mathjs version 5.0.0. To keep eye working, create an alias for it using "math.import({eye: math.identity}, {override: true})"')}}},function(e,t,i){"use strict";var M=i(9).format;t.name="expm",t.factory=function(d,e,t,r){var y=t(i(25)),g=t(i(14)),v=t(i(50)),x=t(i(70)),b=t(i(10)),w=d.SparseMatrix,n=r("expm",{Matrix:function(e){var t=e.size();if(2!==t.length||t[0]!==t[1])throw new RangeError("Matrix must be square (size: "+M(t)+")");for(var r=t[0],n=function(e,t){for(var r=0;r<30;r++)for(var n=0;n<=r;n++){var i=r-n;if(N(e,n,i)<t)return{q:n,j:i}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}(function(e){for(var t=e.size()[0],r=0,n=0;n<t;n++){for(var i=0,o=0;o<t;o++)i+=y(e.get([n,o]));r=Math.max(i,r)}return r}(e),1e-15),i=n.q,o=n.j,a=b(e,Math.pow(2,-o)),s=v(r),u=v(r),c=1,f=a,l=-1,p=1;p<=i;p++)1<p&&(f=b(f,a),l=-l),s=g(s,b(c=c*(i-p+1)/((2*i-p+1)*p),f)),u=g(u,b(c*l,f));for(var m=b(x(u),s),h=0;h<o;h++)m=b(m,m);return d.isSparseMatrix(e)?new w(m):m}});function N(e,t,r){for(var n=1,i=2;i<=t;i++)n*=i;for(var o=n,a=t+1;a<=2*t;a++)o*=a;var s=o*(2*t+1);return 8*Math.pow(e/Math.pow(2,r),2*t)*n*n/(o*s)}return n.toTex={1:"\\exp\\left(${args[0]}\\right)"},n}},function(e,t,a){"use strict";var r=a(2).filter,s=a(2).filterRegExp,o=a(36).maxArgumentCount;function u(e,n){var i=o(n);return r(e,function(e,t,r){return 1===i?n(e):2===i?n(e,[t]):n(e,[t],r)})}t.name="filter",t.factory=function(e,t,r,n){var i=r(a(0)),o=n("filter",{"Array, function":u,"Matrix, function":function(e,t){return i(u(e.toArray(),t))},"Array, RegExp":s,"Matrix, RegExp":function(e,t){return i(s(e.toArray(),t))}});return o.toTex=void 0,o}},function(e,t,a){"use strict";var s=a(5).clone,u=a(2).flatten;t.name="flatten",t.factory=function(e,t,r,n){var i=r(a(0)),o=n("flatten",{Array:function(e){return u(s(e))},Matrix:function(e){var t=u(s(e.toArray()));return i(t)}});return o.toTex=void 0,o}},function(e,t,r){"use strict";var n=r(36).maxArgumentCount,a=r(2).forEach;function o(t,i){var o=n(i);!function r(e,n){Array.isArray(e)?a(e,function(e,t){r(e,n.concat(t))}):1===o?i(e):2===o?i(e,n):i(e,n,t)}(t,[])}t.name="forEach",t.factory=function(e,t,r,n){var i=n("forEach",{"Array, function":o,"Matrix, function":function(e,t){return e.forEach(t)}});return i.toTex=void 0,i}},function(e,t,s){"use strict";var u=s(2).size;t.name="kron",t.factory=function(e,t,r,n){var i=r(s(0)),o=r(s(21));return n("kron",{"Matrix, Matrix":function(e,t){return i(a(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return i(a(e.toArray(),t))},"Array, Matrix":function(e,t){return i(a(e,t.toArray()))},"Array, Array":a});function a(e,r){if(1===u(e).length&&(e=[e]),1===u(r).length&&(r=[r]),2<u(e).length||2<u(r).length)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 n=[],i=[];return e.map(function(t){return r.map(function(e){return i=[],n.push(i),t.map(function(t){return e.map(function(e){return i.push(o(t,e))})})})})&&n}}},function(e,t,s){"use strict";var u=s(3).isInteger,c=s(2).resize;t.name="ones",t.factory=function(o,r,e,t){var a=e(s(0)),n=t("ones",{"":function(){return"Array"===r.matrix?i([]):i([],"default")},"...number | BigNumber | string":function(e){if("string"!=typeof e[e.length-1])return"Array"===r.matrix?i(e):i(e,"default");var t=e.pop();return i(e,t)},Array:i,Matrix:function(e){var t=e.storage();return i(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return i(e.valueOf(),t)}});return n.toTex=void 0,n;function i(e,t){var r=function(e){var n=!1;return e.forEach(function(e,t,r){o.isBigNumber(e)&&(n=!0,r[t]=e.toNumber())}),n}(e)?new o.BigNumber(1):1;if(function(e){e.forEach(function(e){if("number"!=typeof e||!u(e)||e<0)throw new Error("Parameters in function ones must be positive integers")})}(e),t){var n=a(t);return 0<e.length?n.resize(e,r):n}var i=[];return 0<e.length?c(i,e,r):i}}},function(e,t,s){"use strict";var u=s(2);t.name="reshape",t.factory=function(e,t,r,n){var i=r(s(0)),o=r(s(34)),a=n("reshape",{"Matrix, Array":function(e,t){return e.reshape?e.reshape(t):i(u.reshape(e.valueOf(),t))},"Array, Array":function(e,t){return t.forEach(function(e){if(!o(e))throw new TypeError("Invalid size for dimension: "+e)}),u.reshape(e,t)}});return a.toTex=void 0,a}},function(e,t,r){"use strict";var u=r(8),c=r(57),f=r(3).isInteger,l=r(9).format,p=r(5).clone,m=r(2);t.name="resize",t.factory=function(o,a,e){function t(e,t,r){if(2!==arguments.length&&3!==arguments.length)throw new c("resize",arguments.length,2,3);if(o.isMatrix(t)&&(t=t.valueOf()),o.isBigNumber(t[0])&&(t=t.map(function(e){return o.isBigNumber(e)?e.toNumber():e})),o.isMatrix(e))return e.resize(t,r,!0);if("string"==typeof e)return function(e,t,r){if(void 0!==r){if("string"!=typeof r||1!==r.length)throw new TypeError("Single character expected as defaultValue")}else r=" ";if(1!==t.length)throw new u(t.length,1);var n=t[0];if("number"!=typeof n||!f(n))throw new TypeError("Invalid size, must contain positive integers (size: "+l(t)+")");{if(e.length>n)return e.substring(0,n);if(e.length<n){for(var i=e,o=0,a=n-e.length;o<a;o++)i+=r;return i}return e}}(e,t,r);var n=!Array.isArray(e)&&"Array"!==a.matrix;if(0===t.length){for(;Array.isArray(e);)e=e[0];return p(e)}Array.isArray(e)||(e=[e]),e=p(e);var i=m.resize(e,t,r);return n?s(i):i}var s=e(r(0));return t.toTex=void 0,t}},function(e,t,p){"use strict";var m=p(2).size;t.name="sort",t.factory=function(e,t,r,n){function i(e,t){return-a(e,t)}var o=r(p(0)),a=r(p(55)),s=r(p(30)),u=n("sort",{Array:function(e){return f(e),e.sort(a)},Matrix:function(e){return l(e),o(e.toArray().sort(a),e.storage())},"Array, function":function(e,t){return f(e),e.sort(t)},"Matrix, function":function(e,t){return l(e),o(e.toArray().sort(t),e.storage())},"Array, string":function(e,t){return f(e),e.sort(c(t))},"Matrix, string":function(e,t){return l(e),o(e.toArray().sort(c(t)),e.storage())}});function c(e){if("asc"===e)return a;if("desc"===e)return i;if("natural"===e)return s;throw new Error('String "asc", "desc", or "natural" expected')}function f(e){if(1!==m(e).length)throw new Error("One dimensional array expected")}function l(e){if(1!==e.size().length)throw new Error("One dimensional matrix expected")}return u.toTex=void 0,u}},function(e){e.exports=function t(e,r){"use strict";function n(e){return t.insensitive&&(""+e).toLowerCase()||""+e}var i,o,a=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,s=/(^[ ]*|[ ]*$)/g,u=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=/^0x[0-9a-f]+$/i,f=/^0/,l=n(e).replace(s,"")||"",p=n(r).replace(s,"")||"",m=l.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=p.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),d=parseInt(l.match(c),16)||1!==m.length&&l.match(u)&&Date.parse(l),y=parseInt(p.match(c),16)||d&&p.match(u)&&Date.parse(p)||null;if(y){if(d<y)return-1;if(y<d)return 1}for(var g=0,v=Math.max(m.length,h.length);g<v;g++){if(i=!(m[g]||"").match(f)&&parseFloat(m[g])||m[g]||0,o=!(h[g]||"").match(f)&&parseFloat(h[g])||h[g]||0,isNaN(i)!==isNaN(o))return isNaN(i)?1:-1;if(typeof i!=typeof o&&(i+="",o+=""),i<o)return-1;if(o<i)return 1}return 0}},function(e,t,y){"use strict";var g=y(2),v=y(4),x=y(9);t.name="sqrtm",t.factory=function(r,e,t,n){var a=t(y(25)),s=t(y(14)),u=t(y(10)),i=t(y(46)),c=t(y(15)),f=t(y(70)),l=t(y(28)),p=t(y(98)),m=t(y(50)),o=n("sqrtm",{"Array | Matrix":function(e){var t=r.isMatrix(e)?e.size():g.size(e);switch(t.length){case 1:if(1===t[0])return i(e);throw new RangeError("Matrix must be square (size: "+x.format(t)+")");case 2:if(t[0]===t[1])return function(e){var t,r=0,n=e,i=m(l(e));do{var o=n;if(n=u(.5,s(o,f(i))),i=u(.5,s(i,f(o))),t=p(a(c(n,o))),d<t&&++r>h)throw new Error("computing square root of matrix: iterative method could not converge")}while(d<t);return n}(e);throw new RangeError("Matrix must be square (size: "+x.format(t)+")")}}}),h=1e3,d=1e-6;return o.toTex={1:"{${args[0]}}".concat(v.operators.pow,"{\\frac{1}{2}}")},o}},function(e,t,a){"use strict";var s=a(5),u=a(2);t.name="squeeze",t.factory=function(e,t,r,n){var i=r(a(0)),o=n("squeeze",{Array:function(e){return u.squeeze(s.clone(e))},Matrix:function(e){var t=u.squeeze(e.toArray());return Array.isArray(t)?i(t):t},any:function(e){return s.clone(e)}});return o.toTex=void 0,o}},function(e,t,s){"use strict";var u=s(5).clone,h=s(9).format;t.name="trace",t.factory=function(e,t,r,n){var i=r(s(0)),m=r(s(14)),o=n("trace",{Array:function(e){return a(i(e))},SparseMatrix:function(e){var t=e._values,r=e._index,n=e._ptr,i=e._size,o=i[0],a=i[1];if(o!==a)throw new RangeError("Matrix must be square (size: "+h(i)+")");var s=0;if(0<t.length)for(var u=0;u<a;u++)for(var c=n[u],f=n[u+1],l=c;l<f;l++){var p=r[l];if(p===u){s=m(s,t[l]);break}if(u<p)break}return s},DenseMatrix:a,any:u});function a(e){var t=e._size,r=e._data;switch(t.length){case 1:if(1===t[0])return u(r[0]);throw new RangeError("Matrix must be square (size: "+h(t)+")");case 2:var n=t[0];if(n!==t[1])throw new RangeError("Matrix must be square (size: "+h(t)+")");for(var i=0,o=0;o<n;o++)i=m(i,r[o][o]);return i;default:throw new RangeError("Matrix must be two dimensional (size: "+h(t)+")")}}return o.toTex={1:"\\mathrm{tr}\\left(${args[0]}\\right)"},o}},function(e,t,o){"use strict";t.name="getMatrixDataType",t.factory=function(e,t,r,n){var i=r(o(63));return n("getMatrixDataType",{Array:function(e){return i(e)},Matrix:function(e){return e.getDataType()}})}},function(e,t,r){"use strict";e.exports=[r(76),r(75),r(141),r(294),r(295),r(296),r(297),r(301),r(302)]},function(e,t,a){"use strict";t.name="kldivergence",t.factory=function(e,t,r,n){var i=r(a(0)),s=r(a(45)),u=r(a(99)),c=r(a(10)),f=r(a(138)),l=r(a(91)),p=r(a(52));function o(e,t){var r=t.size().length,n=e.size().length;if(1<r)throw new Error("first object must be one dimensional");if(1<n)throw new Error("second object must be one dimensional");if(r!==n)throw new Error("Length of two vectors must be equal");if(0===u(e))throw new Error("Sum of elements in first object must be non zero");if(0===u(t))throw new Error("Sum of elements in second object must be non zero");var i=s(e,u(e)),o=s(t,u(t)),a=u(c(i,l(f(i,o))));return p(a)?a:Number.NaN}return n("kldivergence",{"Array, Array":function(e,t){return o(i(e),i(t))},"Matrix, Array":function(e,t){return o(e,i(t))},"Array, Matrix":function(e,t){return o(i(e),t)},"Matrix, Matrix":function(e,t){return o(e,t)}})}},function(e,t,f){"use strict";var l=f(47);t.name="multinomial",t.factory=function(e,t,r,n){var i=r(f(14)),o=r(f(10)),a=r(f(45)),s=r(f(75)),u=r(f(34)),c=r(f(73));return n("multinomial",{"Array | Matrix":function(e){var t=0,r=1;return l(e,function(e){if(!u(e)||!c(e))throw new TypeError("Positive integer value expected in function multinomial");t=i(t,e),r=o(r,s(e))}),a(s(t),r)}})}},function(e,t,s){"use strict";var u=s(3).isInteger;function c(e){return e.isInteger()&&e.gte(0)}t.name="permutations",t.factory=function(i,e,t,r){var n=t(s(75)),o=s(95),a=r("permutations",{"number | BigNumber":n,"number, number":function(e,t){if(!u(e)||e<0)throw new TypeError("Positive integer value expected in function permutations");if(!u(t)||t<0)throw new TypeError("Positive integer value expected in function permutations");if(e<t)throw new TypeError("second argument k must be less than or equal to first argument n");return o(e-t+1,e)},"BigNumber, BigNumber":function(e,t){var r,n;if(!c(e)||!c(t))throw new TypeError("Positive integer value expected in function permutations");if(t.gt(e))throw new TypeError("second argument k must be less than or equal to first argument n");for(r=new i.BigNumber(1),n=e.minus(t).plus(1);n.lte(e);n=n.plus(1))r=r.times(n);return r}});return a.toTex=void 0,a}},function(e,t,i){"use strict";t.name="pickRandom",t.factory=function(e,t,r){var n=r(i(100))("uniform").pickRandom;return n.toTex=void 0,n}},function(e,t,r){"use strict";var s=r(299),u=s();t.factory=function(e,t,r,n,i){var o;function a(e){o=null===e?u:s(String(e))}return a(t.randomSeed),i.on("config",function(e,t,r){void 0!==r.randomSeed&&a(e.randomSeed)}),function(){return o()}},t.math=!0},function(p,e,t){"use strict";(function(e){var i=[],o=void 0===e?window:e,a=Math.pow(256,6),s=Math.pow(2,52),u=2*s,t=Math.random;function c(e){var t,r=e.length,a=this,n=0,i=a.i=a.j=0,o=a.S=[];for(r||(e=[r++]);n<256;)o[n]=n++;for(n=0;n<256;n++)o[n]=o[i=255&i+e[n%r]+(t=o[n])],o[i]=t;(a.g=function(e){for(var t,r=0,n=a.i,i=a.j,o=a.S;e--;)t=o[n=255&n+1],r=256*r+o[255&(o[n]=o[i=255&i+t])+(o[i]=t)];return a.i=n,a.j=i,r})(256)}function f(e,t){for(var r,n=e+"",i=0;i<n.length;)t[255&i]=255&(r^=19*t[255&i])+n.charCodeAt(i++);return l(t)}function l(e){return String.fromCharCode.apply(0,e)}p.exports=function(e,t){if(t&&!0===t.global)return t.global=!1,Math.random=p.exports(e,t),t.global=!0,Math.random;var r=[],n=(f(function e(t,r){var n,i=[],o=(typeof t)[0];if(r&&"o"==o)for(n in t)try{i.push(e(t[n],r-1))}catch(e){}return i.length?i:"s"==o?t:t+"\0"}(t&&t.entropy||!1?[e,l(i)]:0 in arguments?e:function(e){try{return o.crypto.getRandomValues(e=new Uint8Array(256)),l(e)}catch(e){return[+new Date,o,o.navigator&&o.navigator.plugins,o.screen,l(i)]}}(),3),r),new c(r));return f(l(n.S),i),function(){for(var e=n.g(6),t=a,r=0;e<s;)e=256*(e+r),t*=256,r=n.g(1);for(;u<=e;)e/=2,t/=2,r>>>=1;return(e+r)/t}},p.exports.resetGlobal=function(){Math.random=t},f(Math.random(),i)}).call(this,t(300))},function(e){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,t,i){"use strict";t.name="random",t.factory=function(e,t,r){var n=r(i(100))("uniform").random;return n.toTex=void 0,n}},function(e,t,i){"use strict";t.name="randomInt",t.factory=function(e,t,r){var n=r(i(100))("uniform").randomInt;return n.toTex=void 0,n}},function(e,t,r){"use strict";e.exports=[r(55),r(30),r(147),r(304),r(51),r(305),r(33),r(89),r(38),r(144),r(130)]},function(e,t,a){"use strict";t.name="deepEqual",t.factory=function(e,t,r,n){var o=r(a(51)),i=n("deepEqual",{"any, any":function(e,t){return function e(t,r){{if(Array.isArray(t)){if(Array.isArray(r)){var n=t.length;if(n!==r.length)return!1;for(var i=0;i<n;i++)if(!e(t[i],r[i]))return!1;return!0}return!1}return!Array.isArray(r)&&o(t,r)}}(e.valueOf(),t.valueOf())}});return i.toTex=void 0,i}},function(e,t,s){"use strict";t.name="equalText",t.factory=function(e,t,r,n){var i=r(s(147)),o=r(s(60)),a=n("equalText",{"any, any":function(e,t){return o(i(e,t))}});return a.toTex=void 0,a}},function(e,t,r){"use strict";e.exports=[r(307),r(148),r(308),r(149),r(309),r(310),r(311),r(312),r(150),r(313)]},function(e,t,i){"use strict";var p=i(2).flatten;t.name="setCartesian",t.factory=function(e,t,r,n){var s=r(i(24)),u=r(i(49)),c=r(i(28)),f=r(i(23)),l=r(i(30));return n("setCartesian",{"Array | Matrix, Array | Matrix":function(e,t){var r=[];if(0!==f(c(e),new s(0))&&0!==f(c(t),new s(0))){var n=p(Array.isArray(e)?e:e.toArray()).sort(l),i=p(Array.isArray(t)?t:t.toArray()).sort(l);r=[];for(var o=0;o<n.length;o++)for(var a=0;a<i.length;a++)r.push([n[o],i[a]])}return Array.isArray(e)&&Array.isArray(t)?r:new u(r)}})}},function(e,t,c){"use strict";var f=c(2).flatten;t.name="setDistinct",t.factory=function(e,t,r,n){var i=r(c(24)),o=r(c(49)),a=r(c(28)),s=r(c(23)),u=r(c(30));return n("setDistinct",{"Array | Matrix":function(e){var t;if(0===s(a(e),new i(0)))t=[];else{var r=f(Array.isArray(e)?e:e.toArray()).sort(u);(t=[]).push(r[0]);for(var n=1;n<r.length;n++)0!==u(r[n],r[n-1])&&t.push(r[n])}return Array.isArray(e)?t:new o(t)}})}},function(e,t,i){"use strict";var l=i(2).flatten,p=i(2).identify;t.name="setIsSubset",t.factory=function(e,t,r,n){var s=r(i(24)),u=r(i(28)),c=r(i(23)),f=r(i(30));return n("setIsSubset",{"Array | Matrix, Array | Matrix":function(e,t){if(0===c(u(e),new s(0)))return!0;if(0===c(u(t),new s(0)))return!1;for(var r,n=p(l(Array.isArray(e)?e:e.toArray()).sort(f)),i=p(l(Array.isArray(t)?t:t.toArray()).sort(f)),o=0;o<n.length;o++){r=!1;for(var a=0;a<i.length;a++)if(0===f(n[o].value,i[a].value)&&n[o].identifier===i[a].identifier){r=!0;break}if(!1===r)return!1}return!0}})}},function(e,t,i){"use strict";var c=i(2).flatten;t.name="setMultiplicity",t.factory=function(e,t,r,n){var o=r(i(30)),a=r(i(24)),s=r(i(28)),u=r(i(23));return n("setMultiplicity",{"number | BigNumber | Fraction | Complex, Array | Matrix":function(e,t){if(0===u(s(t),new a(0)))return 0;for(var r=c(Array.isArray(t)?t:t.toArray()),n=0,i=0;i<r.length;i++)0===o(r[i],e)&&n++;return n}})}},function(e,t,c){"use strict";var f=c(2).flatten;t.name="setPowerset",t.factory=function(e,t,r,n){var i=r(c(24)),o=r(c(28)),a=r(c(23)),s=r(c(30));return n("setPowerset",{"Array | Matrix":function(e){if(0===a(o(e),new i(0)))return[];for(var t=f(Array.isArray(e)?e:e.toArray()).sort(s),r=[],n=0;n.toString(2).length<=t.length;)r.push(u(t,n.toString(2).split("").reverse())),n++;return function(e){for(var t=[],r=e.length-1;0<r;r--)for(var n=0;n<r;n++)e[n].length>e[n+1].length&&(t=e[n],e[n]=e[n+1],e[n+1]=t);return e}(r)}});function u(e,t){for(var r=[],n=0;n<t.length;n++)"1"===t[n]&&r.push(e[n]);return r}}},function(e,t,i){"use strict";var a=i(2).flatten;t.name="setSize",t.factory=function(e,t,r,n){var o=r(i(30));return n("setSize",{"Array | Matrix":function(e){return Array.isArray(e)?a(e).length:a(e.toArray()).length},"Array | Matrix, boolean":function(e,t){if(!1===t||0===e.length)return Array.isArray(e)?a(e).length:a(e.toArray()).length;for(var r=a(Array.isArray(e)?e:e.toArray()).sort(o),n=1,i=1;i<r.length;i++)0!==o(r[i],r[i-1])&&n++;return n}})}},function(e,t,f){"use strict";var l=f(2).flatten;t.name="setUnion",t.factory=function(e,t,r,n){var i=r(f(24)),o=r(f(78)),a=r(f(28)),s=r(f(23)),u=r(f(149)),c=r(f(150));return n("setUnion",{"Array | Matrix, Array | Matrix":function(e,t){if(0===s(a(e),new i(0)))return l(t);if(0===s(a(t),new i(0)))return l(e);var r=l(e),n=l(t);return o(c(r,n),u(r,n))}})}},function(e,t,r){"use strict";e.exports=[r(315)]},function(e,t,r){"use strict";var o=r(1),a=r(3).sign;var s=[[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]],u=[[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]],c=Math.pow(2,53);t.name="erf",t.factory=function(t,e,r,n){var i=n("erf",{number:function(e){var t=Math.abs(e);return c<=t?a(e):t<=.46875?a(e)*function(e){var t,r=e*e,n=s[0][4]*r,i=r;for(t=0;t<3;t+=1)n=(n+s[0][t])*r,i=(i+u[0][t])*r;return e*(n+s[0][3])/(i+u[0][3])}(t):t<=4?a(e)*(1-function(e){var t,r=s[1][8]*e,n=e;for(t=0;t<7;t+=1)r=(r+s[1][t])*e,n=(n+u[1][t])*e;var i=(r+s[1][7])/(n+u[1][7]),o=parseInt(16*e)/16,a=(e-o)*(e+o);return Math.exp(-o*o)*Math.exp(-a)*i}(t)):a(e)*(1-function(e){var t,r=1/(e*e),n=s[2][5]*r,i=r;for(t=0;t<4;t+=1)n=(n+s[2][t])*r,i=(i+u[2][t])*r;var o=r*(n+s[2][4])/(i+u[2][4]);o=(.5641895835477563-o)/e,r=parseInt(16*e)/16;var a=(e-r)*(e+r);return Math.exp(-r*r)*Math.exp(-a)*o}(t))},BigNumber:function(e){return new t.BigNumber(i(e.toNumber()))},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"erf\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";e.exports=[r(317),r(98),r(152),r(151),r(153),r(318),r(319),r(320),r(154),r(99),r(101)]},function(e,t,l){"use strict";var p=l(2).flatten;t.name="mad",t.factory=function(e,t,r,n){var i=r(l(25)),o=r(l(145)),a=r(l(151)),s=r(l(15)),u=r(l(40)),c=n("mad",{"Array | Matrix":f,"...":function(e){return f(e)}});return c.toTex=void 0,c;function f(e){if(0===(e=p(e.valueOf())).length)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var t=a(e);return a(o(e,function(e){return i(s(e,t))}))}catch(e){throw e instanceof TypeError&&-1!==e.message.indexOf("median")?new TypeError(e.message.replace("median","mad")):u(e,"mad")}}}},function(e,t,o){"use strict";var u=o(2).flatten;t.name="mode",t.factory=function(e,t,r,n){var a=r(o(79)),s=r(o(52));return n("mode",{"Array | Matrix":i,"...":function(e){return i(e)}});function i(e){if(0===(e=u(e.valueOf())).length)throw new Error("Cannot calculate mode of an empty array");for(var t={},r=[],n=0,i=0;i<e.length;i++){var o=e[i];if(s(o)&&a(o))throw new Error("Cannot calculate mode of an array containing NaN values");o in t||(t[o]=0),t[o]++,t[o]===n?r.push(o):t[o]>n&&(n=t[o],r=[o])}return r}}},function(e,t,u){"use strict";var c=u(47);t.name="prod",t.factory=function(e,t,r,n){var i=r(u(21)),o=r(u(40)),a=n("prod",{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(){throw new Error("prod(A, dim) is not yet supported")},"...":function(e){return s(e)}});return a.toTex=void 0,a;function s(e){var r;if(c(e,function(t){try{r=void 0===r?t:i(r,t)}catch(e){throw o(e,"prod",t)}}),void 0===r)throw new Error("Cannot calculate prod of an empty array");return r}}},function(e,t,n){"use strict";var d=n(3).isInteger,S=n(3).isNumber,O=n(2).flatten,y=n(35);t.name="quantileSeq",t.factory=function(m,e,t,r){var w=t(n(14)),N=t(n(10)),M=t(n(97)),E=t(n(55));function h(e,t,r){var n=O(e),i=n.length;if(0===i)throw new Error("Cannot calculate quantile of an empty sequence");if(S(t)){var o=t*(i-1),a=o%1;if(0==a){var s=r?n[o]:M(n,o);return A(s),s}var u,c,f=Math.floor(o);if(r)u=n[f],c=n[f+1];else{c=M(n,f+1),u=n[f];for(var l=0;l<f;++l)0<E(n[l],u)&&(u=n[l])}return A(u),A(c),w(N(u,1-a),N(c,a))}var p=t.times(i-1);if(p.isInteger()){p=p.toNumber();var m=r?n[p]:M(n,p);return A(m),m}var h,d,y=p.floor(),g=p.minus(y),v=y.toNumber();if(r)h=n[v],d=n[v+1];else{d=M(n,v+1),h=n[v];for(var x=0;x<v;++x)0<E(n[x],h)&&(h=n[x])}A(h),A(d);var b=new g.constructor(1);return w(N(h,b.minus(g)),N(d,g))}var A=r({"number | BigNumber | Unit":function(e){return e}});return function(e,t,r){var n,i,o;if(arguments.length<2||3<arguments.length)throw new SyntaxError("Function quantileSeq requires two or three parameters");if(y(e)){if("boolean"!=typeof(r=r||!1))throw new TypeError("Unexpected type of argument in function quantileSeq");if(i=e.valueOf(),S(t)){if(t<0)throw new Error("N/prob must be non-negative");if(t<=1)return h(i,t,r);if(1<t){if(!d(t))throw new Error("N must be a positive integer");var a=t+1;n=new Array(t);for(var s=0;s<t;)n[s]=h(i,++s/a,r);return n}}if(m.isBigNumber(t)){if(t.isNegative())throw new Error("N/prob must be non-negative");if(o=new t.constructor(1),t.lte(o))return new m.BigNumber(h(i,t,r));if(t.gt(o)){if(!t.isInteger())throw new Error("N must be a positive integer");var u=t.toNumber();if(4294967295<u)throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var c=new m.BigNumber(u+1);n=new Array(u);for(var f=0;f<u;)n[f]=new m.BigNumber(h(i,new m.BigNumber(++f).div(c),r));return n}}if(Array.isArray(t)){n=new Array(t.length);for(var l=0;l<n.length;++l){var p=t[l];if(S(p)){if(p<0||1<p)throw new Error("Probability must be between 0 and 1, inclusive")}else{if(!m.isBigNumber(p))throw new TypeError("Unexpected type of argument in function quantileSeq");if(o=new p.constructor(1),p.isNegative()||p.gt(o))throw new Error("Probability must be between 0 and 1, inclusive")}n[l]=h(i,p,r)}return n}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}}},function(e,t,r){"use strict";e.exports=[r(112),r(322)]},function(e,t,r){"use strict";var s=r(9).isString,u=r(9).format;function o(e,o,a){return e.replace(/\$([\w.]+)/g,function(e,t){for(var r=t.split("."),n=o[r.shift()];r.length&&void 0!==n;){var i=r.shift();n=i?n[i]:n+"."}return void 0!==n?s(n)?n:u(n,a):e})}t.name="print",t.factory=function(e,t,r,n){var i=n("print",{"string, Object | Array":o,"string, Object | Array, number | Object":o});return i.toTex=void 0,i}},function(e,t,r){"use strict";e.exports=[r(324),r(325),r(326),r(327),r(328),r(329),r(330),r(331),r(332),r(333),r(334),r(335),r(336),r(337),r(338),r(339),r(340),r(341),r(342),r(343),r(344),r(345),r(346),r(347),r(348)]},function(e,t,r){"use strict";var o=r(1);t.name="acos",t.factory=function(t,r,e,n){var i=n("acos",{number:function(e){return-1<=e&&e<=1||r.predictable?Math.acos(e):new t.Complex(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\cos^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);var a=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)};t.name="acosh",t.factory=function(t,r,e,n){var i=n("acosh",{number:function(e){return 1<=e||r.predictable?a(e):e<=-1?new t.Complex(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new t.Complex(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\cosh^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="acot",t.factory=function(t,e,r,n){var i=n("acot",{number:function(e){return Math.atan(1/e)},Complex:function(e){return e.acot()},BigNumber:function(e){return new t.BigNumber(1).div(e).atan()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\cot^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="acoth",t.factory=function(t,r,e,n){var i=n("acoth",{number:function(e){return 1<=e||e<=-1||r.predictable?isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0:new t.Complex(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new t.BigNumber(1).div(e).atanh()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\coth^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="acsc",t.factory=function(t,r,e,n){var i=n("acsc",{number:function(e){return e<=-1||1<=e||r.predictable?Math.asin(1/e):new t.Complex(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new t.BigNumber(1).div(e).asin()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\csc^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="acsch",t.factory=function(t,e,r,n){var i=n("acsch",{number:function(e){return e=1/e,Math.log(e+Math.sqrt(e*e+1))},Complex:function(e){return e.acsch()},BigNumber:function(e){return new t.BigNumber(1).div(e).asinh()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="asec",t.factory=function(t,r,e,n){var i=n("asec",{number:function(e){return e<=-1||1<=e||r.predictable?Math.acos(1/e):new t.Complex(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new t.BigNumber(1).div(e).acos()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\sec^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="asech",t.factory=function(r,n,e,t){var i=t("asech",{number:function(e){if(e<=1&&-1<=e||n.predictable){e=1/e;var t=Math.sqrt(e*e-1);return 0<e||n.predictable?Math.log(t+e):new r.Complex(Math.log(t-e),Math.PI)}return new r.Complex(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new r.BigNumber(1).div(e).acosh()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="asin",t.factory=function(t,r,e,n){var i=n("asin",{number:function(e){return-1<=e&&e<=1||r.predictable?Math.asin(e):new t.Complex(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()},"Array | Matrix":function(e){return o(e,i,!0)}});return i.toTex={1:"\\sin^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="asinh",t.factory=function(e,t,r,n){var i=n("asinh",{number:Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()},"Array | Matrix":function(e){return o(e,i,!0)}});return i.toTex={1:"\\sinh^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="atan",t.factory=function(e,t,r,n){var i=n("atan",{number:function(e){return Math.atan(e)},Complex:function(e){return e.atan()},BigNumber:function(e){return e.atan()},"Array | Matrix":function(e){return o(e,i,!0)}});return i.toTex={1:"\\tan^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,m){"use strict";t.name="atan2",t.factory=function(r,e,t,n){var i=t(m(0)),o=t(m(27)),a=t(m(18)),s=t(m(139)),u=t(m(20)),c=t(m(19)),f=t(m(7)),l=t(m(6)),p=n("atan2",{"number, number":Math.atan2,"BigNumber, BigNumber":function(e,t){return r.BigNumber.atan2(e,t)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,p,!1)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,p,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,p,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,p)},"Array, Array":function(e,t){return p(i(e),i(t)).valueOf()},"Array, Matrix":function(e,t){return p(i(e),t)},"Matrix, Array":function(e,t){return p(e,i(t))},"SparseMatrix, number | BigNumber":function(e,t){return u(e,t,p,!1)},"DenseMatrix, number | BigNumber":function(e,t){return l(e,t,p,!1)},"number | BigNumber, SparseMatrix":function(e,t){return c(t,e,p,!0)},"number | BigNumber, DenseMatrix":function(e,t){return l(t,e,p,!0)},"Array, number | BigNumber":function(e,t){return l(i(e),t,p,!1).valueOf()},"number | BigNumber, Array":function(e,t){return l(i(t),e,p,!0).valueOf()}});return p.toTex={2:"\\mathrm{atan2}\\left(${args}\\right)"},p}},function(e,t,r){"use strict";var o=r(1);var a=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2};t.name="atanh",t.factory=function(t,r,e,n){var i=n("atanh",{number:function(e){return e<=1&&-1<=e||r.predictable?a(e):new t.Complex(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()},"Array | Matrix":function(e){return o(e,i,!0)}});return i.toTex={1:"\\tanh^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="cos",t.factory=function(t,e,r,n){var i=n("cos",{number:Math.cos,Complex:function(e){return e.cos()},BigNumber:function(e){return e.cos()},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cos is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\cos\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);var a=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2};t.name="cosh",t.factory=function(t,e,r,n){var i=n("cosh",{number:a,Complex:function(e){return e.cosh()},BigNumber:function(e){return e.cosh()},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cosh is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\cosh\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="cot",t.factory=function(t,e,r,n){var i=n("cot",{number:function(e){return 1/Math.tan(e)},Complex:function(e){return e.cot()},BigNumber:function(e){return new t.BigNumber(1).div(e.tan())},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\cot\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);function a(e){var t=Math.exp(2*e);return(t+1)/(t-1)}t.name="coth",t.factory=function(t,e,r,n){var i=n("coth",{number:a,Complex:function(e){return e.coth()},BigNumber:function(e){return new t.BigNumber(1).div(e.tanh())},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function coth is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\coth\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="csc",t.factory=function(t,e,r,n){var i=n("csc",{number:function(e){return 1/Math.sin(e)},Complex:function(e){return e.csc()},BigNumber:function(e){return new t.BigNumber(1).div(e.sin())},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csc is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\csc\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1),n=r(3).sign;function a(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*n(e)}t.name="csch",t.factory=function(t,e,r,n){var i=n("csch",{number:a,Complex:function(e){return e.csch()},BigNumber:function(e){return new t.BigNumber(1).div(e.sinh())},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csch is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\mathrm{csch}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="sec",t.factory=function(t,e,r,n){var i=n("sec",{number:function(e){return 1/Math.cos(e)},Complex:function(e){return e.sec()},BigNumber:function(e){return new t.BigNumber(1).div(e.cos())},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sec is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\sec\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);function a(e){return 2/(Math.exp(e)+Math.exp(-e))}t.name="sech",t.factory=function(t,e,r,n){var i=n("sech",{number:a,Complex:function(e){return e.sech()},BigNumber:function(e){return new t.BigNumber(1).div(e.cosh())},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sech is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\mathrm{sech}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="sin",t.factory=function(t,e,r,n){var i=n("sin",{number:Math.sin,Complex:function(e){return e.sin()},BigNumber:function(e){return e.sin()},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sin is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i,!0)}});return i.toTex={1:"\\sin\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);var a=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2};t.name="sinh",t.factory=function(t,e,r,n){var i=n("sinh",{number:a,Complex:function(e){return e.sinh()},BigNumber:function(e){return e.sinh()},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sinh is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i,!0)}});return i.toTex={1:"\\sinh\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="tan",t.factory=function(t,e,r,n){var i=n("tan",{number:Math.tan,Complex:function(e){return e.tan()},BigNumber:function(e){return e.tan()},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tan is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i,!0)}});return i.toTex={1:"\\tan\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);var a=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};t.name="tanh",t.factory=function(t,e,r,n){var i=n("tanh",{number:a,Complex:function(e){return e.tanh()},BigNumber:function(e){return e.tanh()},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tanh is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i,!0)}});return i.toTex={1:"\\tanh\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";e.exports=[r(350)]},function(e,t,c){"use strict";t.name="to",t.factory=function(e,t,r,n){var i=c(4),o=r(c(0)),a=r(c(7)),s=r(c(6)),u=n("to",{"Unit, Unit | string":function(e,t){return e.to(t)},"Matrix, Matrix":function(e,t){return a(e,t,u)},"Array, Array":function(e,t){return u(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return u(o(e),t)},"Matrix, Array":function(e,t){return u(e,o(t))},"Matrix, any":function(e,t){return s(e,t,u,!1)},"any, Matrix":function(e,t){return s(t,e,u,!0)},"Array, any":function(e,t){return s(o(e),t,u,!1).valueOf()},"any, Array":function(e,t){return s(o(t),e,u,!0).valueOf()}});return u.toTex={2:"\\left(${args[0]}".concat(i.operators.to,"${args[1]}\\right)")},u}},function(e,t,r){"use strict";e.exports=[r(352),r(34),r(61),r(52),r(353),r(73),r(354),r(60),r(79),r(26)]},function(e,t,r){"use strict";var o=r(5);t.name="clone",t.factory=function(e,t,r,n){var i=n("clone",{any:o.clone});return i.toTex=void 0,i}},function(e,t,o){"use strict";t.name="hasNumericValue",t.factory=function(e,t,r,n){var i=r(o(52));return n("hasNumericValue",{string:function(e){return 0<e.trim().length&&!isNaN(Number(e))},any:function(e){return i(e)}})}},function(e,t,r){"use strict";var o=r(1);t.name="isPrime",t.factory=function(r,e,t,n){var i=n("isPrime",{number:function(e){if(e<2)return!1;if(2===e)return!0;if(e%2==0)return!1;for(var t=3;t*t<=e;t+=2)if(e%t==0)return!1;return!0},BigNumber:function(e){if(e.lt(2))return!1;if(e.equals(2))return!0;if(e.mod(2).isZero())return!1;for(var t=r.BigNumber(3);t.times(t).lte(e);t=t.plus(1))if(e.mod(t).isZero())return!1;return!0},"Array | Matrix":function(e){return o(e,i)}});return i}},function(e,t,r){"use strict";e.exports=[r(155),r(561),r(565),r(567),r(584),r(44),r(159)]},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(num,den)"],description:"Create a fraction from a number or from a numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]}},function(e){e.exports={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[0:2, 0:2] = ones(2, 2)"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]}},function(e){e.exports={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:[]}},function(e){e.exports={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:[]}},function(e){e.exports={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]}},function(e){e.exports={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]}},function(e){e.exports={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:[]}},function(e){e.exports={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:[]}},function(e){e.exports={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]}},function(e){e.exports={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]}},function(e){e.exports={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:[]}},function(e){e.exports={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:[]}},function(e){e.exports={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]}},function(e){e.exports={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"]}},function(e){e.exports={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]}},function(e){e.exports={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]}},function(e){e.exports={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.eval({x: 3})"],seealso:["simplify","parse","eval"]}},function(e){e.exports={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Solves 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:["lup","lusolve","usolve","matrix","sparse"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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.eval({x: 2})"],seealso:["derivative","parse","eval"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Solves 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:["lup","lusolve","lsolve","matrix","sparse"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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")']}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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([[1, 2], [3, 4]])"],seealso:["sqrt","abs","square","multiply"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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:[]}},function(e){e.exports={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:[]}},function(e){e.exports={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number, number": f(x)=x+x })',"double(2)",'double("hello")'],seealso:[]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"eval",category:"Expression",syntax:["eval(expression)","eval([expr1, expr2, expr3, ...])"],description:"Evaluate an expression or an array with expressions.",examples:['eval("2 + 3")','eval("sqrt(" + 4 + ")")'],seealso:[]}},function(e){e.exports={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]}},function(e){e.exports={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:[]}},function(e){e.exports={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:[]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"transpose",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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["forEach([1, 2, 3], function(val) { console.log(val) })"],seealso:["map","sort","filter"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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)'],seealso:["sort"]}},function(e){e.exports={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")',"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"]}},function(e){e.exports={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"]}},function(e){e.exports={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])"],seealso:["size","squeeze","resize"]}},function(e){e.exports={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"]}},function(e){e.exports={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","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]}},function(e){e.exports={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"])',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of a matrix or string. Indexes are one-based. Both the ranges lower-bound and upper-bound are included.",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]"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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:["permutations","factorial"]}},function(e){e.exports={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","permutations","gamma"]}},function(e){e.exports={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"]}},function(e){e.exports={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:[]}},function(e){e.exports={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"]}},function(e){e.exports={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","factorial"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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 before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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:[]}},function(e){e.exports={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"]}},function(e){e.exports={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dim)"],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","var"]}},function(e){e.exports={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dim)"],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","var"]}},function(e){e.exports={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","var","quantileSeq"]}},function(e){e.exports={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dim)"],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","var"]}},function(e){e.exports={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","var"]}},function(e){e.exports={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","var"]}},function(e){e.exports={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","var"]}},function(e){e.exports={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(var(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","min","prod","sum","var"]}},function(e){e.exports={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)"],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","var"]}},function(e){e.exports={name:"var",category:"Statistics",syntax:["var(a, b, c, ...)","var(A)","var(A, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["var(2, 4, 6)","var([2, 4, 6, 8])",'var([2, 4, 6, 8], "uncorrected")','var([2, 4, 6, 8], "biased")',"var([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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:[]}},function(e){e.exports={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:[]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e,t,r){"use strict";e.exports=[r(562),r(563),r(564),r(129),r(158)]},function(e,t,o){"use strict";var a=o(1);t.name="compile",t.factory=function(e,t,r,n){var i=r(o(44));return n("compile",{string:function(e){return i(e).compile()},"Array | Matrix":function(e){return a(e,function(e){return i(e).compile()})}})}},function(e,t,o){"use strict";var a=o(1);t.name="eval",t.factory=function(e,t,r,n){var i=r(o(44));return n("compile",{string:function(e){return i(e).compile().eval({})},"string, Object":function(e,t){return i(e).compile().eval(t)},"Array | Matrix":function(e){var t={};return a(e,function(e){return i(e).compile().eval(t)})},"Array | Matrix, Object":function(e,t){return a(e,function(e){return i(e).compile().eval(t)})}})}},function(e,t,n){"use strict";var s=n(13).getSafeProperty;t.math=!0,t.name="help",t.factory=function(i,e,t,r,o){var a=t(n(155));return r("help",{any:function(e){var t,r=e;if("string"!=typeof e)for(t in o)if(o.hasOwnProperty(t)&&e===o[t]){r=t;break}var n=s(a,r);if(!n)throw new Error('No documentation found on "'+r+'"');return new i.Help(n)}})}},function(e,t,r){"use strict";e.exports=[r(113),r(116),r(117),r(118),r(119),r(58),r(121),r(120),r(69),r(16),r(122),r(59),r(68),r(123),r(124),r(54),r(566)]},function(e,t){"use strict";t.name="UpdateNode",t.path="expression.node",t.factory=function(){return function(){throw new Error("UpdateNode is deprecated. Use AssignmentNode instead.")}}},function(e,t,r){"use strict";e.exports=[r(568),r(569),r(570),r(571),r(572),r(573),r(574),r(575),r(576),r(577),r(578),r(579),r(580),r(581),r(582),r(583)]},function(e,t,o){"use strict";var a=o(22).transform;t.name="apply",t.path="expression.transform",t.factory=function(r,e,t,n){var i=t(o(96));return n("apply",{"...any":function(e){var t=e[1];r.isNumber(t)?e[1]=t-1:r.isBigNumber(t)&&(e[1]=t.minus(1));try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";var a=o(22).transform;t.name="column",t.path="expression.transform",t.factory=function(n,e,t,r){var i=t(o(143));return r("column",{"...any":function(e){var t=e.length-1,r=e[t];n.isNumber(r)&&(e[t]=r-1);try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";var a=o(22).transform;t.name="concat",t.path="expression.transform",t.factory=function(n,e,t,r){var i=t(o(78));return r("concat",{"...any":function(e){var t=e.length-1,r=e[t];n.isNumber(r)?e[t]=r-1:n.isBigNumber(r)&&(e[t]=r.minus(1));try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,u){"use strict";var r=u(2).filter,c=u(2).filterRegExp,o=u(36).maxArgumentCount;function f(e,n){var i=o(n);return r(e,function(e,t,r){return 1===i?n(e):2===i?n(e,[t+1]):n(e,[t+1],r)})}t.name="filter",t.path="expression.transform",t.factory=function(o,e,t,r){var a=t(u(102)),n=t(u(0));function i(e,t,r){var n,i;return e[0]&&(n=e[0].compile().eval(r)),e[1]&&(i=o.isSymbolNode(e[1])||o.isFunctionAssignmentNode(e[1])?e[1].compile().eval(r):a(e[1],t,r)),s(n,i)}i.rawArgs=!0;var s=r("filter",{"Array, function":f,"Matrix, function":function(e,t){return n(f(e.toArray(),t))},"Array, RegExp":c,"Matrix, RegExp":function(e,t){return n(c(e.toArray(),t))}});return s.toTex=void 0,i}},function(e,t,i){"use strict";var u=i(36).maxArgumentCount,c=i(2).forEach;t.name="forEach",t.path="expression.transform",t.factory=function(o,e,t,r){var a=t(i(102));function n(e,t,r){var n,i;return e[0]&&(n=e[0].compile().eval(r)),e[1]&&(i=o.isSymbolNode(e[1])||o.isFunctionAssignmentNode(e[1])?e[1].compile().eval(r):a(e[1],t,r)),s(n,i)}n.rawArgs=!0;var s=r("forEach",{"Array | Matrix, function":function(t,i){var o=u(i);!function r(e,n){Array.isArray(e)?c(e,function(e,t){r(e,n.concat(t+1))}):1===o?i(e):2===o?i(e,n):i(e,n,t)}(t.valueOf(),[])}});return n}},function(e,t){"use strict";t.name="index",t.path="expression.transform",t.factory=function(o){return function(){for(var e=[],t=0,r=arguments.length;t<r;t++){var n=arguments[t];if(o.isRange(n))n.start--,n.end-=0<n.step?0:2;else if(n&&!0===n.isSet)n=n.map(function(e){return e-1});else if(o.isArray(n)||o.isMatrix(n))n=n.map(function(e){return e-1});else if(o.isNumber(n))n--;else if(o.isBigNumber(n))n=n.toNumber()-1;else if("string"!=typeof n)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");e[t]=n}var i=new o.Index;return o.Index.apply(i,e),i}}},function(e,t,u){"use strict";var r=u(36).maxArgumentCount,a=u(2).map;function c(e,t,i){var o=r(t);return function r(e,n){return Array.isArray(e)?a(e,function(e,t){return r(e,n.concat(t+1))}):1===o?t(e):2===o?t(e,n):t(e,n,i)}(e,[])}t.name="map",t.path="expression.transform",t.factory=function(o,e,t,r){var a=t(u(102)),n=t(u(0));function i(e,t,r){var n,i;return e[0]&&(n=e[0].compile().eval(r)),e[1]&&(i=o.isSymbolNode(e[1])||o.isFunctionAssignmentNode(e[1])?e[1].compile().eval(r):a(e[1],t,r)),s(n,i)}i.rawArgs=!0;var s=r("map",{"Array, function":function(e,t){return c(e,t,e)},"Matrix, function":function(e,t){return n(c(e.valueOf(),t,e))}});return i}},function(e,t,o){"use strict";var a=o(22).transform,s=o(35);t.name="max",t.path="expression.transform",t.factory=function(r,e,t,n){var i=t(o(98));return n("max",{"...any":function(e){if(2===e.length&&s(e[0])){var t=e[1];r.isNumber(t)?e[1]=t-1:r.isBigNumber(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";var a=o(22).transform,s=o(35);t.name="mean",t.path="expression.transform",t.factory=function(r,e,t,n){var i=t(o(152));return n("mean",{"...any":function(e){if(2===e.length&&s(e[0])){var t=e[1];r.isNumber(t)?e[1]=t-1:r.isBigNumber(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";var a=o(22).transform,s=o(35);t.name="min",t.path="expression.transform",t.factory=function(r,e,t,n){var i=t(o(153));return n("min",{"...any":function(e){if(2===e.length&&s(e[0])){var t=e[1];r.isNumber(t)?e[1]=t-1:r.isBigNumber(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";t.name="range",t.path="expression.transform",t.factory=function(e,t,r,n){var i=r(o(77));return n("range",{"...any":function(e){return"boolean"!=typeof e[e.length-1]&&e.push(!0),i.apply(null,e)}})}},function(e,t,o){"use strict";var a=o(22).transform,s=o(35);t.name="std",t.path="expression.transform",t.factory=function(r,e,t,n){var i=t(o(154));return n("std",{"...any":function(e){if(2<=e.length&&s(e[0])){var t=e[1];r.isNumber(t)?e[1]=t-1:r.isBigNumber(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";var a=o(22).transform;t.name="row",t.path="expression.transform",t.factory=function(n,e,t,r){var i=t(o(146));return r("row",{"...any":function(e){var t=e.length-1,r=e[t];n.isNumber(r)&&(e[t]=r-1);try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";var a=o(22).transform;t.name="subset",t.path="expression.transform",t.factory=function(e,t,r,n){var i=r(o(23));return n("subset",{"...any":function(e){try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";var a=o(22).transform,s=o(35);t.name="sum",t.path="expression.transform",t.factory=function(r,e,t,n){var i=t(o(99));return n("sum",{"...any":function(e){if(2===e.length&&s(e[0])){var t=e[1];r.isNumber(t)?e[1]=t-1:r.isBigNumber(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";var a=o(22).transform,s=o(35);t.name="var",t.path="expression.transform",t.factory=function(r,e,t,n){var i=t(o(101));return n("var",{"...any":function(e){if(2<=e.length&&s(e[0])){var t=e[1];r.isNumber(t)?e[1]=t-1:r.isBigNumber(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,r){"use strict";var i=r(5),s=r(9);t.name="Help",t.path="type",t.factory=function(o,e,t){var a=t(r(158))();function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!e)throw new Error('Argument "doc" missing');this.doc=e}return n.prototype.type="Help",n.prototype.isHelp=!0,n.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 r=0;r<e.examples.length;r++){var n=e.examples[r];t+=" "+n+"\n";var i=void 0;try{i=a.eval(n)}catch(e){i=e}void 0===i||o.isHelp(i)||(t+=" "+s.format(i,{precision:14})+"\n")}t+="\n"}return e.seealso&&e.seealso.length&&(t+="See also: "+e.seealso.join(", ")+"\n"),t},n.prototype.toJSON=function(){var e=i.clone(this.doc);return e.mathjs="Help",e},n.fromJSON=function(e){var t={};for(var r in e)"mathjs"!==r&&(t[r]=e[r]);return new n(t)},n.prototype.valueOf=n.prototype.toString,n}},function(e,t,r){"use strict";e.exports=[r(586)]},function(e,t){"use strict";t.name="reviver",t.path="json",t.factory=function(n,e,t,r,i){return function(e,t){var r=n[t&&t.mathjs]||i.expression&&i.expression.node[t&&t.mathjs];return r&&"function"==typeof r.fromJSON?r.fromJSON(t):t}},t.math=!0},function(e,t,r){"use strict";var n=r(57),i=r(8),o=r(48);e.exports=[{name:"ArgumentsError",path:"error",factory:function(){return n}},{name:"DimensionError",path:"error",factory:function(){return i}},{name:"IndexError",path:"error",factory:function(){return o}}]}],i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=161);function i(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}var r,n});
55
+ !function(){"use strict";var d={s:1,n:0,d:1};function e(t){function e(){var e=Error.apply(this,arguments);e.name=this.name=t,this.stack=e.stack,this.message=e.message}function r(){}return r.prototype=Error.prototype,e.prototype=new r,e}var y=c.DivisionByZero=e("DivisionByZero"),t=c.InvalidParameter=e("InvalidParameter");function g(e,t){return isNaN(e=parseInt(e,10))&&v(),e*t}function v(){throw new t}var n=function(e,t){var r,n=0,i=1,o=1,a=0,s=0,u=0,c=1,f=1,l=0,p=1,m=1,h=1;if(null==e);else if(void 0!==t)o=(n=e)*(i=t);else switch(typeof e){case"object":"d"in e&&"n"in e?(n=e.n,i=e.d,"s"in e&&(n*=e.s)):0 in e?(n=e[0],1 in e&&(i=e[1])):v(),o=n*i;break;case"number":if(e<0&&(e=-(o=e)),e%1==0)n=e;else if(0<e){for(1<=e&&(e/=f=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)));p<=1e7&&h<=1e7;){if(e===(r=(l+m)/(p+h))){i=p+h<=1e7?(n=l+m,p+h):p<h?(n=m,h):(n=l,p);break}r<e?(l+=m,p+=h):(m+=l,h+=p),i=1e7<p?(n=m,h):(n=l,p)}n*=f}else(isNaN(e)||isNaN(t))&&(i=n=NaN);break;case"string":if(null===(p=e.match(/\d+|./g))&&v(),"-"===p[l]?(o=-1,l++):"+"===p[l]&&l++,p.length===l+1?s=g(p[l++],o):"."===p[l+1]||"."===p[l]?("."!==p[l]&&(a=g(p[l++],o)),(++l+1===p.length||"("===p[l+1]&&")"===p[l+3]||"'"===p[l+1]&&"'"===p[l+3])&&(s=g(p[l],o),c=Math.pow(10,p[l].length),l++),("("===p[l]&&")"===p[l+2]||"'"===p[l]&&"'"===p[l+2])&&(u=g(p[l+1],o),f=Math.pow(10,p[l+1].length)-1,l+=3)):"/"===p[l+1]||":"===p[l+1]?(s=g(p[l],o),c=g(p[l+2],1),l+=3):"/"===p[l+3]&&" "===p[l+1]&&(a=g(p[l],o),s=g(p[l+2],o),c=g(p[l+4],1),l+=5),p.length<=l){o=n=u+(i=c*f)*a+f*s;break}default:v()}if(0===i)throw new y;d.s=o<0?-1:1,d.n=Math.abs(n),d.d=Math.abs(i)};function u(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function c(e,t){if(!(this instanceof c))return new c(e,t);n(e,t),e=c.REDUCE?u(d.d,d.n):1,this.s=d.s,this.n=d.n/e,this.d=d.d/e}c.REDUCE=1,c.prototype={s:1,n:0,d:1,abs:function(){return new c(this.n,this.d)},neg:function(){return new c(-this.s*this.n,this.d)},add:function(e,t){return n(e,t),new c(this.s*this.n*d.d+d.s*this.d*d.n,this.d*d.d)},sub:function(e,t){return n(e,t),new c(this.s*this.n*d.d-d.s*this.d*d.n,this.d*d.d)},mul:function(e,t){return n(e,t),new c(this.s*d.s*this.n*d.n,this.d*d.d)},div:function(e,t){return n(e,t),new c(this.s*d.s*this.n*d.d,this.d*d.n)},clone:function(){return new c(this)},mod:function(e,t){return isNaN(this.n)||isNaN(this.d)?new c(NaN):void 0===e?new c(this.s*this.n%this.d,1):(n(e,t),0===d.n&&0===this.d&&c(0,0),new c(this.s*(d.d*this.n)%(d.n*this.d),d.d*this.d))},gcd:function(e,t){return n(e,t),new c(u(d.n,this.n)*u(d.d,this.d),d.d*this.d)},lcm:function(e,t){return n(e,t),0===d.n&&0===this.n?new c:new c(d.n*this.n,u(d.n,this.n)*u(d.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new c(NaN):new c(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 c(NaN):new c(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 c(NaN):new c(Math.round(e*this.s*this.n/this.d),e)},inverse:function(){return new c(this.s*this.d,this.n)},pow:function(e){return e<0?new c(Math.pow(this.s*this.d,-e),Math.pow(this.n,-e)):new c(Math.pow(this.s*this.n,e),Math.pow(this.d,e))},equals:function(e,t){return n(e,t),this.s*this.n*d.d==d.s*d.n*this.d},compare:function(e,t){n(e,t);var r=this.s*this.n*d.d-d.s*d.n*this.d;return(0<r)-(r<0)},simplify:function(e){if(isNaN(this.n)||isNaN(this.d))return this;var t=this.abs().toContinued();function r(e){return 1===e.length?new c(e[0]):r(e.slice(1)).inverse().add(e[0])}e=e||.001;for(var n=0;n<t.length;n++){var i=r(t.slice(0,n+1));if(i.sub(this.abs()).abs().valueOf()<e)return i.mul(this.s)}return this},divisible:function(e,t){return n(e,t),!(!(d.n*this.d)||this.n*d.d%(d.n*this.d))},valueOf:function(){return this.s*this.n/this.d},toFraction:function(e){var t,r="",n=this.n,i=this.d;return this.s<0&&(r+="-"),1===i?r+=n:(e&&0<(t=Math.floor(n/i))&&(r+=t,r+=" ",n%=i),r+=n,r+="/",r+=i),r},toLatex:function(e){var t,r="",n=this.n,i=this.d;return this.s<0&&(r+="-"),1===i?r+=n:(e&&0<(t=Math.floor(n/i))&&(r+=t,n%=i),r+="\\frac{",r+=n,r+="}{",r+=i,r+="}"),r},toContinued:function(){var e,t=this.n,r=this.d,n=[];if(isNaN(this.n)||isNaN(this.d))return n;for(;n.push(Math.floor(t/r)),e=t%r,t=r,r=e,1!==t;);return n},toString:function(e){var t,r=this.n,n=this.d;if(isNaN(r)||isNaN(n))return"NaN";c.REDUCE||(r/=t=u(r,n),n/=t),e=e||15;var i=function(e,t){for(;t%2==0;t/=2);for(;t%5==0;t/=5);if(1===t)return 0;for(var r=10%t,n=1;1!==r;n++)if(r=10*r%t,2e3<n)return 0;return n}(0,n),o=function(e,t,r){for(var n=1,i=function(e,t,r){for(var n=1;0<t;e=e*e%r,t>>=1)1&t&&(n=n*e%r);return n}(10,r,t),o=0;o<300;o++){if(n===i)return o;n=10*n%t,i=10*i%t}return 0}(0,n,i),a=-1===this.s?"-":"";if(a+=r/n|0,r%=n,(r*=10)&&(a+="."),i){for(var s=o;s--;)a+=r/n|0,r%=n,r*=10;a+="(";for(s=i;s--;)a+=r/n|0,r%=n,r*=10;a+=")"}else for(s=e;r&&s--;)a+=r/n|0,r%=n,r*=10;return a}},void 0===(o=function(){return c}.apply(i,[]))||(r.exports=o)}()},function(e,t,r){"use strict";e.exports=[r(84),r(49),r(186),r(187),r(188),r(189),r(24),r(106),r(190),r(0),r(191),r(63)]},function(e,t){"use strict";t.isBoolean=function(e){return"boolean"==typeof e}},function(e,t,a){"use strict";var s=a(31),x=a(8),y=s.array,w=s.object,N=s.string,S=s.number,O=Array.isArray,T=S.isNumber,_=S.isInteger,C=N.isString,z=y.validateIndex;t.name="SparseMatrix",t.path="type",t.factory=function(b,e,t,M){var r=t(a(84)),E=t(a(11)),n=t(a(63));function A(e,t){if(!(this instanceof A))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!C(t))throw new Error("Invalid datatype: "+t);if(b.isMatrix(e))!function(e,t,r){"SparseMatrix"===t.type?(e._values=t._values?w.clone(t._values):void 0,e._index=w.clone(t._index),e._ptr=w.clone(t._ptr),e._size=w.clone(t._size),e._datatype=r||t._datatype):i(e,t.valueOf(),r||t._datatype)}(this,e,t);else if(e&&O(e.index)&&O(e.ptr)&&O(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=t||e.datatype;else if(O(e))i(this,e,t);else{if(e)throw new TypeError("Unsupported type of data ("+s.types.type(e)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}}function i(e,t,r){e._values=[],e._index=[],e._ptr=[],e._datatype=r;var n=t.length,i=0,o=E,a=0;if(C(r)&&(o=M.find(E,[r,r])||E,a=M.convert(0,r)),0<n){var s=0;do{e._ptr.push(e._index.length);for(var u=0;u<n;u++){var c=t[u];if(O(c)){if(0===s&&i<c.length&&(i=c.length),s<c.length){var f=c[s];o(f,a)||(e._values.push(f),e._index.push(u))}}else 0===s&&i<1&&(i=1),o(c,a)||(e._values.push(c),e._index.push(u))}s++}while(s<i)}e._ptr.push(e._index.length),e._size=[n,i]}function g(e,t,r,n){if(r-t==0)return r;for(var i=t;i<r;i++)if(n[i]===e)return i;return t}function v(e,t,r,n,i,o,a){i.splice(e,0,n),o.splice(e,0,t);for(var s=r+1;s<a.length;s++)a[s]++}function f(e,t,r,n){var i=n||0,o=E,a=0;C(e._datatype)&&(o=M.find(E,[e._datatype,e._datatype])||E,a=M.convert(0,e._datatype),i=M.convert(i,e._datatype));var s,u,c,f=!o(i,a),l=e._size[0],p=e._size[1];if(p<r){for(u=p;u<r;u++)if(e._ptr[u]=e._values.length,f)for(s=0;s<l;s++)e._values.push(i),e._index.push(s);e._ptr[r]=e._values.length}else r<p&&(e._ptr.splice(r+1,p-r),e._values.splice(e._ptr[r],e._values.length),e._index.splice(e._ptr[r],e._index.length));if(p=r,l<t){if(f){var m=0;for(u=0;u<p;u++){e._ptr[u]=e._ptr[u]+m,c=e._ptr[u+1]+m;var h=0;for(s=l;s<t;s++,h++)e._values.splice(c+h,0,i),e._index.splice(c+h,0,s),m++}e._ptr[p]=e._values.length}}else if(t<l){var d=0;for(u=0;u<p;u++){e._ptr[u]=e._ptr[u]-d;var y=e._ptr[u],g=e._ptr[u+1]-d;for(c=y;c<g;c++)t-1<(s=e._index[c])&&(e._values.splice(c,1),e._index.splice(c,1),d++)}e._ptr[u]=e._values.length}return e._size[0]=t,e._size[1]=r,e}function o(e,t,r,n,i){var o,a,s=n[0],u=n[1],c=[];for(o=0;o<s;o++)for(c[o]=[],a=0;a<u;a++)c[o][a]=0;for(a=0;a<u;a++)for(var f=r[a],l=r[a+1],p=f;p<l;p++)c[o=t[p]][a]=e?i?w.clone(e[p]):e[p]:1;return c}return(A.prototype=new r).type="SparseMatrix",A.prototype.isSparseMatrix=!0,A.prototype.getDataType=function(){return n(this._values)},A.prototype.storage=function(){return"sparse"},A.prototype.datatype=function(){return this._datatype},A.prototype.create=function(e,t){return new A(e,t)},A.prototype.density=function(){var e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},A.prototype.subset=function(e,t,r){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return function(e,t){if(!b.isIndex(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var r,n,i,o,a=t.size();if(a.length!==e._size.length)throw new x(a.length,e._size.length);var s=t.min(),u=t.max();for(r=0,n=e._size.length;r<n;r++)z(s[r],e._size[r]),z(u[r],e._size[r]);var c=e._values,f=e._index,l=e._ptr,p=t.dimension(0),m=t.dimension(1),h=[],d=[];p.forEach(function(e,t){d[e]=t[0],h[e]=!0});var y=c?[]:void 0,g=[],v=[];return m.forEach(function(e){for(v.push(g.length),i=l[e],o=l[e+1];i<o;i++)r=f[i],!0===h[r]&&(g.push(d[r]),y&&y.push(c[i]))}),v.push(g.length),new A({values:y,index:g,ptr:v,size:a,datatype:e._datatype})}(this,e);case 2:case 3:return function(e,t,r,n){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");var i,o=t.size(),a=t.isScalar();b.isMatrix(r)?(i=r.size(),r=r.toArray()):i=y.size(r);if(a){if(0!==i.length)throw new TypeError("Scalar expected");e.set(t.min(),r,n)}else{if(1!==o.length&&2!==o.length)throw new x(o.length,e._size.length,"<");if(i.length<o.length){for(var s=0,u=0;1===o[s]&&1===i[s];)s++;for(;1===o[s];)u++,s++;r=y.unsqueeze(r,o.length,u,i)}if(!w.deepEqual(o,i))throw new x(o,i,">");for(var c=t.min()[0],f=t.min()[1],l=i[0],p=i[1],m=0;m<l;m++)for(var h=0;h<p;h++){var d=r[m][h];e.set([m+c,h+f],d,n)}}return e}(this,e,t,r);default:throw new SyntaxError("Wrong number of arguments")}},A.prototype.get=function(e){if(!O(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new x(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var t=e[0],r=e[1];z(t,this._size[0]),z(r,this._size[1]);var n=g(t,this._ptr[r],this._ptr[r+1],this._index);return n<this._ptr[r+1]&&this._index[n]===t?this._values[n]:0},A.prototype.set=function(e,t,r){if(!O(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new x(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var n=e[0],i=e[1],o=this._size[0],a=this._size[1],s=E,u=0;C(this._datatype)&&(s=M.find(E,[this._datatype,this._datatype])||E,u=M.convert(0,this._datatype)),(o-1<n||a-1<i)&&(f(this,Math.max(n+1,o),Math.max(i+1,a),r),o=this._size[0],a=this._size[1]),z(n,o),z(i,a);var c=g(n,this._ptr[i],this._ptr[i+1],this._index);return c<this._ptr[i+1]&&this._index[c]===n?s(t,u)?function(e,t,r,n,i){r.splice(e,1),n.splice(e,1);for(var o=t+1;o<i.length;o++)i[o]--}(c,i,this._values,this._index,this._ptr):this._values[c]=t:v(c,n,i,t,this._values,this._index,this._ptr),this},A.prototype.resize=function(t,e,r){if(!O(t))throw new TypeError("Array expected");if(2!==t.length)throw new Error("Only two dimensions matrix are supported");return t.forEach(function(e){if(!S.isNumber(e)||!S.isInteger(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+N.format(t)+")")}),f(r?this.clone():this,t[0],t[1],e)},A.prototype.reshape=function(t,e){if(!O(t))throw new TypeError("Array expected");if(2!==t.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");if(t.forEach(function(e){if(!S.isNumber(e)||!S.isInteger(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+N.format(t)+")")}),this._size[0]*this._size[1]!=t[0]*t[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var r=e?this.clone():this;if(this._size[0]===t[0]&&this._size[1]===t[1])return r;for(var n=[],i=0;i<r._ptr.length;i++)for(var o=0;o<r._ptr[i+1]-r._ptr[i];o++)n.push(i);for(var a=r._values.slice(),s=r._index.slice(),u=0;u<r._index.length;u++){var c=s[u],f=n[u],l=c*r._size[1]+f;n[u]=l%t[1],s[u]=Math.floor(l/t[1])}r._values.length=0,r._index.length=0,r._ptr.length=t[1]+1,r._size=t.slice();for(var p=0;p<r._ptr.length;p++)r._ptr[p]=0;for(var m=0;m<a.length;m++){var h=s[m],d=n[m],y=a[m];v(g(h,r._ptr[d],r._ptr[d+1],r._index),h,d,y,r._values,r._index,r._ptr)}return r},A.prototype.clone=function(){return new A({values:this._values?w.clone(this._values):void 0,index:w.clone(this._index),ptr:w.clone(this._ptr),size:w.clone(this._size),datatype:this._datatype})},A.prototype.size=function(){return this._size.slice(0)},A.prototype.map=function(n,e){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var i=this;return function(e,t,r,n,i,o,a){var s=[],u=[],c=[],f=E,l=0;C(e._datatype)&&(f=M.find(E,[e._datatype,e._datatype])||E,l=M.convert(0,e._datatype));for(var p=function(e,t,r){e=o(e,t,r),f(e,l)||(s.push(e),u.push(t))},m=n;m<=i;m++){c.push(s.length);var h=e._ptr[m],d=e._ptr[m+1];if(a)for(var y=h;y<d;y++){var g=e._index[y];t<=g&&g<=r&&p(e._values[y],g-t,m-n)}else{for(var v={},x=h;x<d;x++){var b=e._index[x];v[b]=e._values[x]}for(var w=t;w<=r;w++){var N=w in v?v[w]:0;p(N,w-t,m-n)}}}return c.push(s.length),new A({values:s,index:u,ptr:c,size:[r-t+1,i-n+1]})}(this,0,this._size[0]-1,0,this._size[1]-1,function(e,t,r){return n(e,[t,r],i)},e)},A.prototype.forEach=function(e,t){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var r=this._size[0],n=this._size[1],i=0;i<n;i++){var o=this._ptr[i],a=this._ptr[i+1];if(t)for(var s=o;s<a;s++){var u=this._index[s];e(this._values[s],[u,i],this)}else{for(var c={},f=o;f<a;f++){c[this._index[f]]=this._values[f]}for(var l=0;l<r;l++){e(l in c?c[l]:0,[l,i],this)}}}},A.prototype.toArray=function(){return o(this._values,this._index,this._ptr,this._size,!0)},A.prototype.valueOf=function(){return o(this._values,this._index,this._ptr,this._size,!1)},A.prototype.format=function(e){for(var t=this._size[0],r=this._size[1],n=this.density(),i="Sparse Matrix ["+N.format(t,e)+" x "+N.format(r,e)+"] density: "+N.format(n,e)+"\n",o=0;o<r;o++)for(var a=this._ptr[o],s=this._ptr[o+1],u=a;u<s;u++){var c=this._index[u];i+="\n ("+N.format(c,e)+", "+N.format(o,e)+") ==> "+(this._values?N.format(this._values[u],e):"X")}return i},A.prototype.toString=function(){return N.format(this.toArray())},A.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},A.prototype.diagonal=function(e){if(e){if(b.isBigNumber(e)&&(e=e.toNumber()),!T(e)||!_(e))throw new TypeError("The parameter k must be an integer number")}else e=0;var t=0<e?e:0,r=e<0?-e:0,n=this._size[0],i=this._size[1],o=Math.min(n-r,i-t),a=[],s=[],u=[];u[0]=0;for(var c=t;c<i&&a.length<o;c++)for(var f=this._ptr[c],l=this._ptr[c+1],p=f;p<l;p++){var m=this._index[p];if(m===c-t+r){a.push(this._values[p]),s[a.length-1]=m-r;break}}return u.push(a.length),new A({values:a,index:s,ptr:u,size:[o,1]})},A.fromJSON=function(e){return new A(e)},A.diagonal=function(e,t,r,n,i){if(!O(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map(function(e){if(b.isBigNumber(e)&&(e=e.toNumber()),!T(e)||!_(e)||e<1)throw new Error("Size values must be positive integers");return e}),r){if(b.isBigNumber(r)&&(r=r.toNumber()),!T(r)||!_(r))throw new TypeError("The parameter k must be an integer number")}else r=0;var o=E,a=0;C(i)&&(o=M.find(E,[i,i])||E,a=M.convert(0,i));var s,u=0<r?r:0,c=r<0?-r:0,f=e[0],l=e[1],p=Math.min(f-c,l-u);if(O(t)){if(t.length!==p)throw new Error("Invalid value array length");s=function(e){return t[e]}}else if(b.isMatrix(t)){var m=t.size();if(1!==m.length||m[0]!==p)throw new Error("Invalid matrix length");s=function(e){return t.get([e])}}else s=function(){return t};for(var h=[],d=[],y=[],g=0;g<l;g++){y.push(h.length);var v=g-u;if(0<=v&&v<p){var x=s(v);o(x,a)||(d.push(v+c),h.push(x))}}return y.push(h.length),new A({values:h,index:d,ptr:y,size:[f,l]})},A.prototype.swapRows=function(e,t){if(!(T(e)&&_(e)&&T(t)&&_(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return z(e,this._size[0]),z(t,this._size[0]),A._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},A._forEachRow=function(e,t,r,n,i){for(var o=n[e],a=n[e+1],s=o;s<a;s++)i(r[s],t[s])},A._swapRows=function(e,t,r,n,i,o){for(var a=0;a<r;a++){var s=o[a],u=o[a+1],c=g(e,s,u,i),f=g(t,s,u,i);if(c<u&&f<u&&i[c]===e&&i[f]===t){if(n){var l=n[c];n[c]=n[f],n[f]=l}}else if(c<u&&i[c]===e&&(u<=f||i[f]!==t)){var p=n?n[c]:void 0;i.splice(f,0,t),n&&n.splice(f,0,p),i.splice(f<=c?c+1:c,1),n&&n.splice(f<=c?c+1:c,1)}else if(f<u&&i[f]===t&&(u<=c||i[c]!==e)){var m=n?n[f]:void 0;i.splice(c,0,e),n&&n.splice(c,0,m),i.splice(c<=f?f+1:f,1),n&&n.splice(c<=f?f+1:f,1)}}},b.Matrix._storage.sparse=A},t.lazy=!1},function(e,t,o){"use strict";t.name="Spa",t.path="type",t.factory=function(e,t,r){var n=r(o(14)),c=r(o(11));function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new e.FibonacciHeap}return i.prototype.type="Spa",i.prototype.isSpa=!0,i.prototype.set=function(e,t){if(this._values[e])this._values[e].value=t;else{var r=this._heap.insert(e,t);this._values[e]=r}},i.prototype.get=function(e){var t=this._values[e];return t?t.value:0},i.prototype.accumulate=function(e,t){var r=this._values[e];r?r.value=n(r.value,t):(r=this._heap.insert(e,t),this._values[e]=r)},i.prototype.forEach=function(e,t,r){var n=this._heap,i=this._values,o=[],a=n.extractMinimum();for(a&&o.push(a);a&&a.key<=t;)a.key>=e&&(c(a.value,0)||r(a.key,a.value,this)),(a=n.extractMinimum())&&o.push(a);for(var s=0;s<o.length;s++){var u=o[s];i[(a=n.insert(u.key,u.value)).key]=a}},i.prototype.swap=function(e,t){var r=this._values[e],n=this._values[t];if(!r&&n)r=this._heap.insert(e,n.value),this._heap.remove(n),this._values[e]=r,this._values[t]=void 0;else if(r&&!n)n=this._heap.insert(t,r.value),this._heap.remove(r),this._values[t]=n,this._values[e]=void 0;else if(r&&n){var i=r.value;r.value=n.value,n.value=i}},i}},function(e,t,o){"use strict";t.name="FibonacciHeap",t.path="type",t.factory=function(e,t,r){var l=r(o(38)),p=r(o(33)),m=1/Math.log((1+Math.sqrt(5))/2);function n(){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}function i(e,t,r){t.left.right=t.right,t.right.left=t.left,r.degree--,r.child===t&&(r.child=t.right),0===r.degree&&(r.child=null),t.left=e,t.right=e.right,((e.right=t).right.left=t).parent=null,t.mark=!1}n.prototype.type="FibonacciHeap",n.prototype.isFibonacciHeap=!0,n.prototype.insert=function(e,t){var r={key:e,value:t,degree:0};if(this._minimum){var n=this._minimum;r.left=n,r.right=n.right,(n.right=r).right.left=r,l(e,n.key)&&(this._minimum=r)}else(r.left=r).right=r,this._minimum=r;return this._size++,r},n.prototype.size=function(){return this._size},n.prototype.clear=function(){this._minimum=null,this._size=0},n.prototype.isEmpty=function(){return 0===this._size},n.prototype.extractMinimum=function(){var e=this._minimum;if(null===e)return e;for(var t=this._minimum,r=e.degree,n=e.child;0<r;){var i=n.right;n.left.right=n.right,n.right.left=n.left,n.left=t,n.right=t.right,((t.right=n).right.left=n).parent=null,n=i,r--}return e.left.right=e.right,e.right.left=e.left,t=e===e.right?null:function(e,t){var r,n=Math.floor(Math.log(t)*m)+1,i=new Array(n),o=0,a=e;if(a)for(o++,a=a.right;a!==e;)o++,a=a.right;for(;0<o;){for(var s=a.degree,u=a.right;r=i[s];){if(p(a.key,r.key)){var c=r;r=a,a=c}h(r,a),i[s]=null,s++}i[s]=a,a=u,o--}e=null;for(var f=0;f<n;f++)(r=i[f])&&(e?(r.left.right=r.right,r.right.left=r.left,r.left=e,r.right=e.right,(e.right=r).right.left=r,l(r.key,e.key)&&(e=r)):e=r);return e}(t=e.right,this._size),this._size--,this._minimum=t,e},n.prototype.remove=function(e){this._minimum=function(e,t,r){t.key=r;var n=t.parent;n&&l(t.key,n.key)&&(i(e,t,n),function e(t,r){var n=r.parent;if(!n)return;r.mark?(i(t,r,n),e(n)):r.mark=!0}(e,n));l(t.key,e.key)&&(e=t);return e}(this._minimum,e,-1),this.extractMinimum()};var h=function(e,t){e.left.right=e.right,e.right.left=e.left,(e.parent=t).child?(e.left=t.child,e.right=t.child.right,(t.child.right=e).right.left=e):((t.child=e).right=e).left=e,t.degree++,e.mark=!1};return n}},function(e,t,a){"use strict";var s=a(31),r=s.string,u=s.object,c=Array.isArray,f=r.isString;t.name="ImmutableDenseMatrix",t.path="type",t.factory=function(n,e,t){var i=t(a(49)),r=t(a(38));function o(e,t){if(!(this instanceof o))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!f(t))throw new Error("Invalid datatype: "+t);if(n.isMatrix(e)||c(e)){var r=new i(e,t);this._data=r._data,this._size=r._size,this._datatype=r._datatype,this._min=null,this._max=null}else if(e&&c(e.data)&&c(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 ("+s.types.type(e)+")");this._data=[],this._size=[0],this._datatype=t,this._min=null,this._max=null}}return(o.prototype=new i).type="ImmutableDenseMatrix",o.prototype.isImmutableDenseMatrix=!0,o.prototype.subset=function(e){switch(arguments.length){case 1:var t=i.prototype.subset.call(this,e);return n.isMatrix(t)?new o({data:t._data,size:t._size,datatype:t._datatype}):t;case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},o.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},o.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},o.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},o.prototype.clone=function(){return new o({data:u.clone(this._data),size:u.clone(this._size),datatype:this._datatype})},o.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},o.fromJSON=function(e){return new o(e)},o.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},o.prototype.min=function(){if(null===this._min){var t=null;this.forEach(function(e){null!==t&&!r(e,t)||(t=e)}),this._min=null!==t?t:void 0}return this._min},o.prototype.max=function(){if(null===this._max){var t=null;this.forEach(function(e){null!==t&&!r(t,e)||(t=e)}),this._max=null!==t?t:void 0}return this._max},o}},function(e,t){"use strict";t.name="index",t.factory=function(n,e,t,r){return r("index",{"...number | string | BigNumber | Range | Array | Matrix":function(e){var t=e.map(function(e){return n.isBigNumber(e)?e.toNumber():Array.isArray(e)||n.isMatrix(e)?e.map(function(e){return n.isBigNumber(e)?e.toNumber():e}):e}),r=new n.Index;return n.Index.apply(r,t),r}})}},function(e,t){"use strict";t.name="sparse",t.factory=function(e,t,r,n){var i=e.SparseMatrix,o=n("sparse",{"":function(){return new i([])},string:function(e){return new i([],e)},"Array | Matrix":function(e){return new i(e)},"Array | Matrix, string":function(e,t){return new i(e,t)}});return o.toTex={0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},o}},function(e,t,r){"use strict";e.exports=[r(107)]},function(e,t,r){"use strict";var o=r(1),a=r(3);t.name="string",t.factory=function(e,t,r,n){var i=n("string",{"":function(){return""},number:a.format,null:function(){return"null"},boolean:function(e){return e+""},string:function(e){return e},"Array | Matrix":function(e){return o(e,i)},any:function(e){return String(e)}});return i.toTex={0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";e.exports=[r(195),r(196),r(197),r(198),r(199)]},function(e,t,Y){"use strict";function J(e){return(J="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})(e)}function W(){return(W=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}var X=Y(9).endsWith,Q=Y(5).clone,K=Y(108);t.name="Unit",t.path="type",t.factory=function(y,g,e,t,r){var v,x,b,c=e(Y(17)),f=e(Y(15)),l=e(Y(21)),p=e(Y(12)),m=e(Y(42)),h=e(Y(25)),d=e(Y(109)),w=e(Y(67)),N=e(Y(51)),i=e(Y(52)),s=e(Y(112)),M=e(Y(26)),n=e(Y(64)),o=e(Y(82));function E(e,t){if(!(this instanceof E))throw new Error("Constructor must be called with the new operator");if(null!=e&&!i(e)&&!y.isComplex(e))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(void 0!==t&&("string"!=typeof t||""===t))throw new TypeError("Second parameter in Unit constructor must be a string");if(void 0!==t){var r=E.parse(t);this.units=r.units,this.dimensions=r.dimensions}else{this.units=[{unit:R,prefix:B.NONE,power:0}],this.dimensions=[];for(var n=0;n<I.length;n++)this.dimensions[n]=0}this.value=null!=e?this._normalize(e):null,this.fixPrefix=!1,this.skipAutomaticSimplification=!0}function A(){for(;" "===b||"\t"===b;)S()}function a(e){return"0"<=e&&e<="9"}function S(){x++,b=v.charAt(x)}function u(e){x=e,b=v.charAt(x)}function O(){var e,t="";if(e=x,"+"===b?S():"-"===b&&(t+=b,S()),!function(e){return"0"<=e&&e<="9"||"."===e}(b))return u(e),null;if("."===b){if(t+=b,S(),!a(b))return u(e),null}else{for(;a(b);)t+=b,S();"."===b&&(t+=b,S())}for(;a(b);)t+=b,S();if("E"===b||"e"===b){var r="",n=x;if(r+=b,S(),"+"!==b&&"-"!==b||(r+=b,S()),!a(b))return u(n),t;for(t+=r;a(b);)t+=b,S()}return t}function T(){for(var e="",t=v.charCodeAt(x);48<=t&&t<=57||65<=t&&t<=90||97<=t&&t<=122;)e+=b,S(),t=v.charCodeAt(x);return(65<=(t=e.charCodeAt(0))&&t<=90||97<=t&&t<=122)&&e||null}function _(e){return b===e?(S(),e):null}function C(e){if(q.hasOwnProperty(e)){var t=q[e];return{unit:t,prefix:t.prefixes[""]}}for(var r in q)if(q.hasOwnProperty(r)&&X(e,r)){var n=q[r],i=e.length-r.length,o=e.substring(0,i),a=n.prefixes.hasOwnProperty(o)?n.prefixes[o]:void 0;if(void 0!==a)return{unit:n,prefix:a}}return null}function z(e){return e.equalBase(k.NONE)&&null!==e.value&&!g.predictable?e.value:e}E.prototype.type="Unit",E.prototype.isUnit=!0,E.parse=function(e,t){if(t=t||{},x=-1,b="","string"!=typeof(v=e))throw new TypeError("Invalid argument in Unit.parse, string expected");var r=new E,n=1,i=!(r.units=[]);S(),A();var o=O(),a=null;o&&(a="BigNumber"===g.number?new y.BigNumber(o):"Fraction"===g.number?new y.Fraction(o):parseFloat(o),A(),_("*")?(n=1,i=!0):_("/")&&(n=-1,i=!0));for(var s=[],u=1;;){for(A();"("===b;)s.push(n),u*=n,n=1,S(),A();var c=void 0;if(!b)break;var f=b;if(null===(c=T()))throw new SyntaxError('Unexpected "'+f+'" in "'+v+'" at index '+x.toString());var l=C(c);if(null===l)throw new SyntaxError('Unit "'+c+'" not found.');var p=n*u;if(A(),_("^")){A();var m=O();if(null===m)throw new SyntaxError('In "'+e+'", "^" must be followed by a floating-point number');p*=m}r.units.push({unit:l.unit,prefix:l.prefix,power:p});for(var h=0;h<I.length;h++)r.dimensions[h]+=(l.unit.dimensions[h]||0)*p;for(A();")"===b;){if(0===s.length)throw new SyntaxError('Unmatched ")" in "'+v+'" at index '+x.toString());u/=s.pop(),S(),A()}if(i=!1,_("*")?(n=1,i=!0):_("/")?(n=-1,i=!0):n=1,l.unit.base){var d=l.unit.base.key;j.auto[d]={unit:l.unit,prefix:l.prefix}}}if(A(),b)throw new SyntaxError('Could not parse: "'+e+'"');if(i)throw new SyntaxError('Trailing characters: "'+e+'"');if(0!==s.length)throw new SyntaxError('Unmatched "(" in "'+v+'"');if(0===r.units.length&&!t.allowNoUnits)throw new SyntaxError('"'+e+'" contains no units');return r.value=void 0!==a?r._normalize(a):null,r},E.prototype.clone=function(){var e=new E;e.fixPrefix=this.fixPrefix,e.skipAutomaticSimplification=this.skipAutomaticSimplification,e.value=Q(this.value),e.dimensions=this.dimensions.slice(0),e.units=[];for(var t=0;t<this.units.length;t++)for(var r in e.units[t]={},this.units[t])this.units[t].hasOwnProperty(r)&&(e.units[t][r]=this.units[t][r]);return e},E.prototype._isDerived=function(){return 0!==this.units.length&&(1<this.units.length||1e-15<Math.abs(this.units[0].power-1))},E.prototype._normalize=function(e){var t,r,n,i,o;if(null==e||0===this.units.length)return e;if(this._isDerived()){var a=e;o=E._getNumberConverter(M(e));for(var s=0;s<this.units.length;s++)t=o(this.units[s].unit.value),i=o(this.units[s].prefix.value),n=o(this.units[s].power),a=l(a,m(l(t,i),n));return a}return t=(o=E._getNumberConverter(M(e)))(this.units[0].unit.value),r=o(this.units[0].unit.offset),i=o(this.units[0].prefix.value),l(c(e,r),l(t,i))},E.prototype._denormalize=function(e,t){var r,n,i,o,a;if(null==e||0===this.units.length)return e;if(this._isDerived()){var s=e;a=E._getNumberConverter(M(e));for(var u=0;u<this.units.length;u++)r=a(this.units[u].unit.value),o=a(this.units[u].prefix.value),i=a(this.units[u].power),s=p(s,m(l(r,o),i));return s}return r=(a=E._getNumberConverter(M(e)))(this.units[0].unit.value),o=a(this.units[0].prefix.value),n=a(this.units[0].unit.offset),f(p(p(e,r),null==t?o:t),n)},E.isValuelessUnit=function(e){return null!==C(e)},E.prototype.hasBase=function(e){if("string"==typeof e&&(e=k[e]),!e)return!1;for(var t=0;t<I.length;t++)if(1e-12<Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0)))return!1;return!0},E.prototype.equalBase=function(e){for(var t=0;t<I.length;t++)if(1e-12<Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0)))return!1;return!0},E.prototype.equals=function(e){return this.equalBase(e)&&N(this.value,e.value)},E.prototype.multiply=function(e){for(var t=this.clone(),r=0;r<I.length;r++)t.dimensions[r]=(this.dimensions[r]||0)+(e.dimensions[r]||0);for(var n=0;n<e.units.length;n++){var i={};for(var o in e.units[n])i[o]=e.units[n][o];t.units.push(i)}if(null!==this.value||null!==e.value){var a=null===this.value?this._normalize(1):this.value,s=null===e.value?e._normalize(1):e.value;t.value=l(a,s)}else t.value=null;return t.skipAutomaticSimplification=!1,z(t)},E.prototype.divide=function(e){for(var t=this.clone(),r=0;r<I.length;r++)t.dimensions[r]=(this.dimensions[r]||0)-(e.dimensions[r]||0);for(var n=0;n<e.units.length;n++){var i={};for(var o in e.units[n])i[o]=e.units[n][o];i.power=-i.power,t.units.push(i)}if(null!==this.value||null!==e.value){var a=null===this.value?this._normalize(1):this.value,s=null===e.value?e._normalize(1):e.value;t.value=p(a,s)}else t.value=null;return t.skipAutomaticSimplification=!1,z(t)},E.prototype.pow=function(e){for(var t=this.clone(),r=0;r<I.length;r++)t.dimensions[r]=(this.dimensions[r]||0)*e;for(var n=0;n<t.units.length;n++)t.units[n].power*=e;return null!==t.value?t.value=m(t.value,e):t.value=null,t.skipAutomaticSimplification=!1,z(t)},E.prototype.abs=function(){var e=this.clone();for(var t in e.value=null!==e.value?h(e.value):null,e.units)"VA"!==e.units[t].unit.name&&"VAR"!==e.units[t].unit.name||(e.units[t].unit=q.W);return e},E.prototype.to=function(e){var t,r=null===this.value?this._normalize(1):this.value;if("string"==typeof e){if(t=E.parse(e),!this.equalBase(t))throw new Error("Units do not match ('".concat(t.toString(),"' != '").concat(this.toString(),"')"));if(null!==t.value)throw new Error("Cannot convert to a unit with a value");return t.value=Q(r),t.fixPrefix=!0,t.skipAutomaticSimplification=!0,t}if(y.isUnit(e)){if(!this.equalBase(e))throw new Error("Units do not match ('".concat(e.toString(),"' != '").concat(this.toString(),"')"));if(null!==e.value)throw new Error("Cannot convert to a unit with a value");return(t=e.clone()).value=Q(r),t.fixPrefix=!0,t.skipAutomaticSimplification=!0,t}throw new Error("String or Unit expected as parameter")},E.prototype.toNumber=function(e){return n(this.toNumeric(e))},E.prototype.toNumeric=function(e){var t;return(t=e?this.to(e):this.clone())._isDerived()?t._denormalize(t.value):t._denormalize(t.value,t.units[0].prefix.value)},E.prototype.toString=function(){return this.format()},E.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.formatUnits(),fixPrefix:this.fixPrefix}},E.fromJSON=function(e){var t=new E(e.value,e.unit);return t.fixPrefix=e.fixPrefix||!1,t},E.prototype.valueOf=E.prototype.toString,E.prototype.simplify=function(){var e,t,r=this.clone(),n=[];for(var i in F)if(r.hasBase(k[i])){e=i;break}if("NONE"===e)r.units=[];else if(e&&F.hasOwnProperty(e)&&(t=F[e]),t)r.units=[{unit:t.unit,prefix:t.prefix,power:1}];else{for(var o=!1,a=0;a<I.length;a++){var s=I[a];1e-12<Math.abs(r.dimensions[a]||0)&&(F.hasOwnProperty(s)?n.push({unit:F[s].unit,prefix:F[s].prefix,power:r.dimensions[a]||0}):o=!0)}n.length<r.units.length&&!o&&(r.units=n)}return r},E.prototype.toSI=function(){for(var e=this.clone(),t=[],r=0;r<I.length;r++){var n=I[r];if(1e-12<Math.abs(e.dimensions[r]||0)){if(!j.si.hasOwnProperty(n))throw new Error("Cannot express custom unit "+n+" in SI units");t.push({unit:j.si[n].unit,prefix:j.si[n].prefix,power:e.dimensions[r]||0})}}return e.units=t,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,e},E.prototype.formatUnits=function(){for(var e="",t="",r=0,n=0,i=0;i<this.units.length;i++)0<this.units[i].power?(r++,e+=" "+this.units[i].prefix.name+this.units[i].unit.name,1e-15<Math.abs(this.units[i].power-1)&&(e+="^"+this.units[i].power)):this.units[i].power<0&&n++;if(0<n)for(var o=0;o<this.units.length;o++)this.units[o].power<0&&(0<r?(t+=" "+this.units[o].prefix.name+this.units[o].unit.name,1e-15<Math.abs(this.units[o].power+1)&&(t+="^"+-this.units[o].power)):(t+=" "+this.units[o].prefix.name+this.units[o].unit.name,t+="^"+this.units[o].power));e=e.substr(1),t=t.substr(1),1<r&&0<n&&(e="("+e+")"),1<n&&0<r&&(t="("+t+")");var a=e;return 0<r&&0<n&&(a+=" / "),a+=t},E.prototype.format=function(e){var t=this.skipAutomaticSimplification||null===this.value?this.clone():this.simplify(),r=!1;for(var n in void 0!==t.value&&null!==t.value&&y.isComplex(t.value)&&(r=Math.abs(t.value.re)<1e-14),t.units)t.units[n].unit&&("VA"===t.units[n].unit.name&&r?t.units[n].unit=q.VAR:"VAR"!==t.units[n].unit.name||r||(t.units[n].unit=q.VA));1!==t.units.length||t.fixPrefix||Math.abs(t.units[0].power-Math.round(t.units[0].power))<1e-14&&(t.units[0].prefix=t._bestPrefix());var i=t._denormalize(t.value),o=null!==t.value?s(i,e||{}):"",a=t.formatUnits();return t.value&&y.isComplex(t.value)&&(o="("+o+")"),0<a.length&&0<o.length&&(o+=" "),o+=a},E.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(1e-14<=Math.abs(this.units[0].power-Math.round(this.units[0].power)))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?h(this.value):0,t=h(this.units[0].unit.value),r=this.units[0].prefix;if(0===e)return r;var n=this.units[0].power,i=Math.log(e/Math.pow(r.value*t,n))/Math.LN10-1.2;if(-2.200001<i&&i<1.800001)return r;i=Math.abs(i);var o=this.units[0].unit.prefixes;for(var a in o)if(o.hasOwnProperty(a)){var s=o[a];if(s.scientific){var u=Math.abs(Math.log(e/Math.pow(s.value*t,n))/Math.LN10-1.2);(u<i||u===i&&s.name.length<r.name.length)&&(r=s,i=u)}}return r};var B={NONE:{"":{name:"",value:1,scientific:!0}},SHORT:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:10,scientific:!(E.prototype.splitUnit=function(e){for(var t=this.clone(),r=[],n=0;n<e.length&&(t=t.to(e[n]),n!==e.length-1);n++){var i=t.toNumeric(),o=w(i),a=new E(N(o,i)?o:d(t.toNumeric()),e[n].toString());r.push(a),t=f(t,a)}for(var s=0,u=0;u<r.length;u++)s=c(s,r[u].value);return N(s,this.value)&&(t.value=0),r.push(t),r})},h:{name:"h",value:100,scientific:!1},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0},d:{name:"d",value:.1,scientific:!1},c:{name:"c",value:.01,scientific:!1},m:{name:"m",value:.001,scientific:!0},u:{name:"u",value:1e-6,scientific:!0},n:{name:"n",value:1e-9,scientific:!0},p:{name:"p",value:1e-12,scientific:!0},f:{name:"f",value:1e-15,scientific:!0},a:{name:"a",value:1e-18,scientific:!0},z:{name:"z",value:1e-21,scientific:!0},y:{name:"y",value:1e-24,scientific:!0}},LONG:{"":{name:"",value:1,scientific:!0},deca:{name:"deca",value:10,scientific:!1},hecto:{name:"hecto",value:100,scientific:!1},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0},deci:{name:"deci",value:.1,scientific:!1},centi:{name:"centi",value:.01,scientific:!1},milli:{name:"milli",value:.001,scientific:!0},micro:{name:"micro",value:1e-6,scientific:!0},nano:{name:"nano",value:1e-9,scientific:!0},pico:{name:"pico",value:1e-12,scientific:!0},femto:{name:"femto",value:1e-15,scientific:!0},atto:{name:"atto",value:1e-18,scientific:!0},zepto:{name:"zepto",value:1e-21,scientific:!0},yocto:{name:"yocto",value:1e-24,scientific:!0}},SQUARED:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:100,scientific:!1},h:{name:"h",value:1e4,scientific:!1},k:{name:"k",value:1e6,scientific:!0},M:{name:"M",value:1e12,scientific:!0},G:{name:"G",value:1e18,scientific:!0},T:{name:"T",value:1e24,scientific:!0},P:{name:"P",value:1e30,scientific:!0},E:{name:"E",value:1e36,scientific:!0},Z:{name:"Z",value:1e42,scientific:!0},Y:{name:"Y",value:1e48,scientific:!0},d:{name:"d",value:.01,scientific:!1},c:{name:"c",value:1e-4,scientific:!1},m:{name:"m",value:1e-6,scientific:!0},u:{name:"u",value:1e-12,scientific:!0},n:{name:"n",value:1e-18,scientific:!0},p:{name:"p",value:1e-24,scientific:!0},f:{name:"f",value:1e-30,scientific:!0},a:{name:"a",value:1e-36,scientific:!0},z:{name:"z",value:1e-42,scientific:!0},y:{name:"y",value:1e-48,scientific:!0}},CUBIC:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:1e3,scientific:!1},h:{name:"h",value:1e6,scientific:!1},k:{name:"k",value:1e9,scientific:!0},M:{name:"M",value:1e18,scientific:!0},G:{name:"G",value:1e27,scientific:!0},T:{name:"T",value:1e36,scientific:!0},P:{name:"P",value:1e45,scientific:!0},E:{name:"E",value:1e54,scientific:!0},Z:{name:"Z",value:1e63,scientific:!0},Y:{name:"Y",value:1e72,scientific:!0},d:{name:"d",value:.001,scientific:!1},c:{name:"c",value:1e-6,scientific:!1},m:{name:"m",value:1e-9,scientific:!0},u:{name:"u",value:1e-18,scientific:!0},n:{name:"n",value:1e-27,scientific:!0},p:{name:"p",value:1e-36,scientific:!0},f:{name:"f",value:1e-45,scientific:!0},a:{name:"a",value:1e-54,scientific:!0},z:{name:"z",value:1e-63,scientific:!0},y:{name:"y",value:1e-72,scientific:!0}},BINARY_SHORT_SI:{"":{name:"",value:1,scientific:!0},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0}},BINARY_SHORT_IEC:{"":{name:"",value:1,scientific:!0},Ki:{name:"Ki",value:1024,scientific:!0},Mi:{name:"Mi",value:Math.pow(1024,2),scientific:!0},Gi:{name:"Gi",value:Math.pow(1024,3),scientific:!0},Ti:{name:"Ti",value:Math.pow(1024,4),scientific:!0},Pi:{name:"Pi",value:Math.pow(1024,5),scientific:!0},Ei:{name:"Ei",value:Math.pow(1024,6),scientific:!0},Zi:{name:"Zi",value:Math.pow(1024,7),scientific:!0},Yi:{name:"Yi",value:Math.pow(1024,8),scientific:!0}},BINARY_LONG_SI:{"":{name:"",value:1,scientific:!0},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0}},BINARY_LONG_IEC:{"":{name:"",value:1,scientific:!0},kibi:{name:"kibi",value:1024,scientific:!0},mebi:{name:"mebi",value:Math.pow(1024,2),scientific:!0},gibi:{name:"gibi",value:Math.pow(1024,3),scientific:!0},tebi:{name:"tebi",value:Math.pow(1024,4),scientific:!0},pebi:{name:"pebi",value:Math.pow(1024,5),scientific:!0},exi:{name:"exi",value:Math.pow(1024,6),scientific:!0},zebi:{name:"zebi",value:Math.pow(1024,7),scientific:!0},yobi:{name:"yobi",value:Math.pow(1024,8),scientific:!0}},BTU:{"":{name:"",value:1,scientific:!0},MM:{name:"MM",value:1e6,scientific:!0}}};B.SHORTLONG=W(B.SHORT,B.LONG),B.BINARY_SHORT=W(B.BINARY_SHORT_SI,B.BINARY_SHORT_IEC),B.BINARY_LONG=W(B.BINARY_LONG_SI,B.BINARY_LONG_IEC);var I=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],k={NONE:{dimensions:[0,0,0,0,0,0,0,0,0]},MASS:{dimensions:[1,0,0,0,0,0,0,0,0]},LENGTH:{dimensions:[0,1,0,0,0,0,0,0,0]},TIME:{dimensions:[0,0,1,0,0,0,0,0,0]},CURRENT:{dimensions:[0,0,0,1,0,0,0,0,0]},TEMPERATURE:{dimensions:[0,0,0,0,1,0,0,0,0]},LUMINOUS_INTENSITY:{dimensions:[0,0,0,0,0,1,0,0,0]},AMOUNT_OF_SUBSTANCE:{dimensions:[0,0,0,0,0,0,1,0,0]},FORCE:{dimensions:[1,1,-2,0,0,0,0,0,0]},SURFACE:{dimensions:[0,2,0,0,0,0,0,0,0]},VOLUME:{dimensions:[0,3,0,0,0,0,0,0,0]},ENERGY:{dimensions:[1,2,-2,0,0,0,0,0,0]},POWER:{dimensions:[1,2,-3,0,0,0,0,0,0]},PRESSURE:{dimensions:[1,-1,-2,0,0,0,0,0,0]},ELECTRIC_CHARGE:{dimensions:[0,0,1,1,0,0,0,0,0]},ELECTRIC_CAPACITANCE:{dimensions:[-1,-2,4,2,0,0,0,0,0]},ELECTRIC_POTENTIAL:{dimensions:[1,2,-3,-1,0,0,0,0,0]},ELECTRIC_RESISTANCE:{dimensions:[1,2,-3,-2,0,0,0,0,0]},ELECTRIC_INDUCTANCE:{dimensions:[1,2,-2,-2,0,0,0,0,0]},ELECTRIC_CONDUCTANCE:{dimensions:[-1,-2,3,2,0,0,0,0,0]},MAGNETIC_FLUX:{dimensions:[1,2,-2,-1,0,0,0,0,0]},MAGNETIC_FLUX_DENSITY:{dimensions:[1,0,-2,-1,0,0,0,0,0]},FREQUENCY:{dimensions:[0,0,-1,0,0,0,0,0,0]},ANGLE:{dimensions:[0,0,0,0,0,0,0,1,0]},BIT:{dimensions:[0,0,0,0,0,0,0,0,1]}};for(var P in k)k[P].key=P;var R={name:"",base:{},value:1,offset:0,dimensions:I.map(function(){return 0})},q={meter:{name:"meter",base:k.LENGTH,prefixes:B.LONG,value:1,offset:0},inch:{name:"inch",base:k.LENGTH,prefixes:B.NONE,value:.0254,offset:0},foot:{name:"foot",base:k.LENGTH,prefixes:B.NONE,value:.3048,offset:0},yard:{name:"yard",base:k.LENGTH,prefixes:B.NONE,value:.9144,offset:0},mile:{name:"mile",base:k.LENGTH,prefixes:B.NONE,value:1609.344,offset:0},link:{name:"link",base:k.LENGTH,prefixes:B.NONE,value:.201168,offset:0},rod:{name:"rod",base:k.LENGTH,prefixes:B.NONE,value:5.0292,offset:0},chain:{name:"chain",base:k.LENGTH,prefixes:B.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:k.LENGTH,prefixes:B.NONE,value:1e-10,offset:0},m:{name:"m",base:k.LENGTH,prefixes:B.SHORT,value:1,offset:0},in:{name:"in",base:k.LENGTH,prefixes:B.NONE,value:.0254,offset:0},ft:{name:"ft",base:k.LENGTH,prefixes:B.NONE,value:.3048,offset:0},yd:{name:"yd",base:k.LENGTH,prefixes:B.NONE,value:.9144,offset:0},mi:{name:"mi",base:k.LENGTH,prefixes:B.NONE,value:1609.344,offset:0},li:{name:"li",base:k.LENGTH,prefixes:B.NONE,value:.201168,offset:0},rd:{name:"rd",base:k.LENGTH,prefixes:B.NONE,value:5.02921,offset:0},ch:{name:"ch",base:k.LENGTH,prefixes:B.NONE,value:20.1168,offset:0},mil:{name:"mil",base:k.LENGTH,prefixes:B.NONE,value:254e-7,offset:0},m2:{name:"m2",base:k.SURFACE,prefixes:B.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:k.SURFACE,prefixes:B.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:k.SURFACE,prefixes:B.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:k.SURFACE,prefixes:B.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:k.SURFACE,prefixes:B.NONE,value:2589988.110336,offset:0},sqrd:{name:"sqrd",base:k.SURFACE,prefixes:B.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:k.SURFACE,prefixes:B.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:k.SURFACE,prefixes:B.NONE,value:6.4516e-10,offset:0},acre:{name:"acre",base:k.SURFACE,prefixes:B.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:k.SURFACE,prefixes:B.NONE,value:1e4,offset:0},m3:{name:"m3",base:k.VOLUME,prefixes:B.CUBIC,value:1,offset:0},L:{name:"L",base:k.VOLUME,prefixes:B.SHORT,value:.001,offset:0},l:{name:"l",base:k.VOLUME,prefixes:B.SHORT,value:.001,offset:0},litre:{name:"litre",base:k.VOLUME,prefixes:B.LONG,value:.001,offset:0},cuin:{name:"cuin",base:k.VOLUME,prefixes:B.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:k.VOLUME,prefixes:B.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:k.VOLUME,prefixes:B.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:k.VOLUME,prefixes:B.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:k.VOLUME,prefixes:B.NONE,value:15e-6,offset:0},drop:{name:"drop",base:k.VOLUME,prefixes:B.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:k.VOLUME,prefixes:B.NONE,value:5e-8,offset:0},minim:{name:"minim",base:k.VOLUME,prefixes:B.NONE,value:6.161152e-8,offset:0},fluiddram:{name:"fluiddram",base:k.VOLUME,prefixes:B.NONE,value:36966911e-13,offset:0},fluidounce:{name:"fluidounce",base:k.VOLUME,prefixes:B.NONE,value:2957353e-11,offset:0},gill:{name:"gill",base:k.VOLUME,prefixes:B.NONE,value:.0001182941,offset:0},cc:{name:"cc",base:k.VOLUME,prefixes:B.NONE,value:1e-6,offset:0},cup:{name:"cup",base:k.VOLUME,prefixes:B.NONE,value:.0002365882,offset:0},pint:{name:"pint",base:k.VOLUME,prefixes:B.NONE,value:.0004731765,offset:0},quart:{name:"quart",base:k.VOLUME,prefixes:B.NONE,value:.0009463529,offset:0},gallon:{name:"gallon",base:k.VOLUME,prefixes:B.NONE,value:.003785412,offset:0},beerbarrel:{name:"beerbarrel",base:k.VOLUME,prefixes:B.NONE,value:.1173478,offset:0},oilbarrel:{name:"oilbarrel",base:k.VOLUME,prefixes:B.NONE,value:.1589873,offset:0},hogshead:{name:"hogshead",base:k.VOLUME,prefixes:B.NONE,value:.238481,offset:0},fldr:{name:"fldr",base:k.VOLUME,prefixes:B.NONE,value:36966911e-13,offset:0},floz:{name:"floz",base:k.VOLUME,prefixes:B.NONE,value:2957353e-11,offset:0},gi:{name:"gi",base:k.VOLUME,prefixes:B.NONE,value:.0001182941,offset:0},cp:{name:"cp",base:k.VOLUME,prefixes:B.NONE,value:.0002365882,offset:0},pt:{name:"pt",base:k.VOLUME,prefixes:B.NONE,value:.0004731765,offset:0},qt:{name:"qt",base:k.VOLUME,prefixes:B.NONE,value:.0009463529,offset:0},gal:{name:"gal",base:k.VOLUME,prefixes:B.NONE,value:.003785412,offset:0},bbl:{name:"bbl",base:k.VOLUME,prefixes:B.NONE,value:.1173478,offset:0},obl:{name:"obl",base:k.VOLUME,prefixes:B.NONE,value:.1589873,offset:0},g:{name:"g",base:k.MASS,prefixes:B.SHORT,value:.001,offset:0},gram:{name:"gram",base:k.MASS,prefixes:B.LONG,value:.001,offset:0},ton:{name:"ton",base:k.MASS,prefixes:B.SHORT,value:907.18474,offset:0},tonne:{name:"tonne",base:k.MASS,prefixes:B.SHORT,value:1e3,offset:0},grain:{name:"grain",base:k.MASS,prefixes:B.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:k.MASS,prefixes:B.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:k.MASS,prefixes:B.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:k.MASS,prefixes:B.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:k.MASS,prefixes:B.NONE,value:45.359237,offset:0},stick:{name:"stick",base:k.MASS,prefixes:B.NONE,value:.115,offset:0},stone:{name:"stone",base:k.MASS,prefixes:B.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:k.MASS,prefixes:B.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:k.MASS,prefixes:B.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:k.MASS,prefixes:B.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:k.MASS,prefixes:B.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:k.MASS,prefixes:B.NONE,value:45.359237,offset:0},s:{name:"s",base:k.TIME,prefixes:B.SHORT,value:1,offset:0},min:{name:"min",base:k.TIME,prefixes:B.NONE,value:60,offset:0},h:{name:"h",base:k.TIME,prefixes:B.NONE,value:3600,offset:0},second:{name:"second",base:k.TIME,prefixes:B.LONG,value:1,offset:0},sec:{name:"sec",base:k.TIME,prefixes:B.LONG,value:1,offset:0},minute:{name:"minute",base:k.TIME,prefixes:B.NONE,value:60,offset:0},hour:{name:"hour",base:k.TIME,prefixes:B.NONE,value:3600,offset:0},day:{name:"day",base:k.TIME,prefixes:B.NONE,value:86400,offset:0},week:{name:"week",base:k.TIME,prefixes:B.NONE,value:604800,offset:0},month:{name:"month",base:k.TIME,prefixes:B.NONE,value:2629800,offset:0},year:{name:"year",base:k.TIME,prefixes:B.NONE,value:31557600,offset:0},decade:{name:"decade",base:k.TIME,prefixes:B.NONE,value:315576e3,offset:0},century:{name:"century",base:k.TIME,prefixes:B.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:k.TIME,prefixes:B.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:k.FREQUENCY,prefixes:B.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:k.FREQUENCY,prefixes:B.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:k.ANGLE,prefixes:B.SHORT,value:1,offset:0},radian:{name:"radian",base:k.ANGLE,prefixes:B.LONG,value:1,offset:0},deg:{name:"deg",base:k.ANGLE,prefixes:B.SHORT,value:null,offset:0},degree:{name:"degree",base:k.ANGLE,prefixes:B.LONG,value:null,offset:0},grad:{name:"grad",base:k.ANGLE,prefixes:B.SHORT,value:null,offset:0},gradian:{name:"gradian",base:k.ANGLE,prefixes:B.LONG,value:null,offset:0},cycle:{name:"cycle",base:k.ANGLE,prefixes:B.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:k.ANGLE,prefixes:B.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:k.ANGLE,prefixes:B.NONE,value:null,offset:0},A:{name:"A",base:k.CURRENT,prefixes:B.SHORT,value:1,offset:0},ampere:{name:"ampere",base:k.CURRENT,prefixes:B.LONG,value:1,offset:0},K:{name:"K",base:k.TEMPERATURE,prefixes:B.NONE,value:1,offset:0},degC:{name:"degC",base:k.TEMPERATURE,prefixes:B.NONE,value:1,offset:273.15},degF:{name:"degF",base:k.TEMPERATURE,prefixes:B.NONE,value:1/1.8,offset:459.67},degR:{name:"degR",base:k.TEMPERATURE,prefixes:B.NONE,value:1/1.8,offset:0},kelvin:{name:"kelvin",base:k.TEMPERATURE,prefixes:B.NONE,value:1,offset:0},celsius:{name:"celsius",base:k.TEMPERATURE,prefixes:B.NONE,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:k.TEMPERATURE,prefixes:B.NONE,value:1/1.8,offset:459.67},rankine:{name:"rankine",base:k.TEMPERATURE,prefixes:B.NONE,value:1/1.8,offset:0},mol:{name:"mol",base:k.AMOUNT_OF_SUBSTANCE,prefixes:B.SHORT,value:1,offset:0},mole:{name:"mole",base:k.AMOUNT_OF_SUBSTANCE,prefixes:B.LONG,value:1,offset:0},cd:{name:"cd",base:k.LUMINOUS_INTENSITY,prefixes:B.NONE,value:1,offset:0},candela:{name:"candela",base:k.LUMINOUS_INTENSITY,prefixes:B.NONE,value:1,offset:0},N:{name:"N",base:k.FORCE,prefixes:B.SHORT,value:1,offset:0},newton:{name:"newton",base:k.FORCE,prefixes:B.LONG,value:1,offset:0},dyn:{name:"dyn",base:k.FORCE,prefixes:B.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:k.FORCE,prefixes:B.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:k.FORCE,prefixes:B.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:k.FORCE,prefixes:B.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:k.FORCE,prefixes:B.LONG,value:4448.2216,offset:0},J:{name:"J",base:k.ENERGY,prefixes:B.SHORT,value:1,offset:0},joule:{name:"joule",base:k.ENERGY,prefixes:B.SHORT,value:1,offset:0},erg:{name:"erg",base:k.ENERGY,prefixes:B.NONE,value:1e-7,offset:0},Wh:{name:"Wh",base:k.ENERGY,prefixes:B.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:k.ENERGY,prefixes:B.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:k.ENERGY,prefixes:B.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:k.ENERGY,prefixes:B.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:k.POWER,prefixes:B.SHORT,value:1,offset:0},watt:{name:"watt",base:k.POWER,prefixes:B.LONG,value:1,offset:0},hp:{name:"hp",base:k.POWER,prefixes:B.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:k.POWER,prefixes:B.SHORT,value:o.I,offset:0},VA:{name:"VA",base:k.POWER,prefixes:B.SHORT,value:1,offset:0},Pa:{name:"Pa",base:k.PRESSURE,prefixes:B.SHORT,value:1,offset:0},psi:{name:"psi",base:k.PRESSURE,prefixes:B.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:k.PRESSURE,prefixes:B.NONE,value:101325,offset:0},bar:{name:"bar",base:k.PRESSURE,prefixes:B.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:k.PRESSURE,prefixes:B.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:k.PRESSURE,prefixes:B.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:k.PRESSURE,prefixes:B.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:k.PRESSURE,prefixes:B.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:k.ELECTRIC_CHARGE,prefixes:B.LONG,value:1,offset:0},C:{name:"C",base:k.ELECTRIC_CHARGE,prefixes:B.SHORT,value:1,offset:0},farad:{name:"farad",base:k.ELECTRIC_CAPACITANCE,prefixes:B.LONG,value:1,offset:0},F:{name:"F",base:k.ELECTRIC_CAPACITANCE,prefixes:B.SHORT,value:1,offset:0},volt:{name:"volt",base:k.ELECTRIC_POTENTIAL,prefixes:B.LONG,value:1,offset:0},V:{name:"V",base:k.ELECTRIC_POTENTIAL,prefixes:B.SHORT,value:1,offset:0},ohm:{name:"ohm",base:k.ELECTRIC_RESISTANCE,prefixes:B.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:k.ELECTRIC_INDUCTANCE,prefixes:B.LONG,value:1,offset:0},H:{name:"H",base:k.ELECTRIC_INDUCTANCE,prefixes:B.SHORT,value:1,offset:0},siemens:{name:"siemens",base:k.ELECTRIC_CONDUCTANCE,prefixes:B.LONG,value:1,offset:0},S:{name:"S",base:k.ELECTRIC_CONDUCTANCE,prefixes:B.SHORT,value:1,offset:0},weber:{name:"weber",base:k.MAGNETIC_FLUX,prefixes:B.LONG,value:1,offset:0},Wb:{name:"Wb",base:k.MAGNETIC_FLUX,prefixes:B.SHORT,value:1,offset:0},tesla:{name:"tesla",base:k.MAGNETIC_FLUX_DENSITY,prefixes:B.LONG,value:1,offset:0},T:{name:"T",base:k.MAGNETIC_FLUX_DENSITY,prefixes:B.SHORT,value:1,offset:0},b:{name:"b",base:k.BIT,prefixes:B.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:k.BIT,prefixes:B.BINARY_LONG,value:1,offset:0},B:{name:"B",base:k.BIT,prefixes:B.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:k.BIT,prefixes:B.BINARY_LONG,value:8,offset:0}},U={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",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",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole"};function D(e){if("BigNumber"===e.number){var t=K.pi(y.BigNumber);q.rad.value=new y.BigNumber(1),q.deg.value=t.div(180),q.grad.value=t.div(200),q.cycle.value=t.times(2),q.arcsec.value=t.div(648e3),q.arcmin.value=t.div(10800)}else q.rad.value=1,q.deg.value=Math.PI/180,q.grad.value=Math.PI/200,q.cycle.value=2*Math.PI,q.arcsec.value=Math.PI/648e3,q.arcmin.value=Math.PI/10800;q.radian.value=q.rad.value,q.degree.value=q.deg.value,q.gradian.value=q.grad.value}D(g),r.on("config",function(e,t){e.number!==t.number&&D(e)});var j={si:{NONE:{unit:R,prefix:B.NONE[""]},LENGTH:{unit:q.m,prefix:B.SHORT[""]},MASS:{unit:q.g,prefix:B.SHORT.k},TIME:{unit:q.s,prefix:B.SHORT[""]},CURRENT:{unit:q.A,prefix:B.SHORT[""]},TEMPERATURE:{unit:q.K,prefix:B.SHORT[""]},LUMINOUS_INTENSITY:{unit:q.cd,prefix:B.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:q.mol,prefix:B.SHORT[""]},ANGLE:{unit:q.rad,prefix:B.SHORT[""]},BIT:{unit:q.bit,prefix:B.SHORT[""]},FORCE:{unit:q.N,prefix:B.SHORT[""]},ENERGY:{unit:q.J,prefix:B.SHORT[""]},POWER:{unit:q.W,prefix:B.SHORT[""]},PRESSURE:{unit:q.Pa,prefix:B.SHORT[""]},ELECTRIC_CHARGE:{unit:q.C,prefix:B.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:q.F,prefix:B.SHORT[""]},ELECTRIC_POTENTIAL:{unit:q.V,prefix:B.SHORT[""]},ELECTRIC_RESISTANCE:{unit:q.ohm,prefix:B.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:q.H,prefix:B.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:q.S,prefix:B.SHORT[""]},MAGNETIC_FLUX:{unit:q.Wb,prefix:B.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:q.T,prefix:B.SHORT[""]},FREQUENCY:{unit:q.Hz,prefix:B.SHORT[""]}}};j.cgs=JSON.parse(JSON.stringify(j.si)),j.cgs.LENGTH={unit:q.m,prefix:B.SHORT.c},j.cgs.MASS={unit:q.g,prefix:B.SHORT[""]},j.cgs.FORCE={unit:q.dyn,prefix:B.SHORT[""]},j.cgs.ENERGY={unit:q.erg,prefix:B.NONE[""]},j.us=JSON.parse(JSON.stringify(j.si)),j.us.LENGTH={unit:q.ft,prefix:B.NONE[""]},j.us.MASS={unit:q.lbm,prefix:B.NONE[""]},j.us.TEMPERATURE={unit:q.degF,prefix:B.NONE[""]},j.us.FORCE={unit:q.lbf,prefix:B.NONE[""]},j.us.ENERGY={unit:q.BTU,prefix:B.BTU[""]},j.us.POWER={unit:q.hp,prefix:B.NONE[""]},j.us.PRESSURE={unit:q.psi,prefix:B.NONE[""]},j.auto=JSON.parse(JSON.stringify(j.si));var F=j.auto;for(var L in E.setUnitSystem=function(e){if(!j.hasOwnProperty(e))throw new Error("Unit system "+e+" does not exist. Choices are: "+Object.keys(j).join(", "));F=j[e]},E.getUnitSystem=function(){for(var e in j)if(j[e]===F)return e},E.typeConverters={BigNumber:function(e){return new y.BigNumber(e+"")},Fraction:function(e){return new y.Fraction(e)},Complex:function(e){return e},number:function(e){return e}},E._getNumberConverter=function(e){if(!E.typeConverters[e])throw new TypeError('Unsupported type "'+e+'"');return E.typeConverters[e]},q){var H=q[L];H.dimensions=H.base.dimensions}for(var $ in U)if(U.hasOwnProperty($)){var G=q[U[$]],V={};for(var Z in G)G.hasOwnProperty(Z)&&(V[Z]=G[Z]);V.name=$,q[$]=V}return E.createUnit=function(e,t){if("object"!==J(e))throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(t&&t.override)for(var r in e)if(e.hasOwnProperty(r)&&E.deleteUnit(r),e[r].aliases)for(var n=0;n<e[r].aliases.length;n++)E.deleteUnit(e[r].aliases[n]);var i;for(var o in e)e.hasOwnProperty(o)&&(i=E.createUnitSingle(o,e[o]));return i},E.createUnitSingle=function(t,e){if(null==e&&(e={}),"string"!=typeof t)throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(q.hasOwnProperty(t))throw new Error('Cannot create unit "'+t+'": a unit with that name already exists');!function(e){for(var t=0;t<e.length;t++){var r=e.charAt(t),n=function(e){return/^[a-zA-Z]$/.test(e)};if(0===t&&!n(r))throw new Error('Invalid unit name (must begin with alpha character): "'+e+'"');if(0<t&&!(n(r)||"0"<=(i=r)&&i<="9"))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+e+'"')}var i}(t);var r,n,i=null,o=[],a=0;if(e&&"Unit"===e.type)i=e.clone();else if("string"==typeof e)""!==e&&(r=e);else{if("object"!==J(e))throw new TypeError('Cannot create unit "'+t+'" from "'+e.toString()+'": expecting "string" or "Unit" or "Object"');r=e.definition,n=e.prefixes,a=e.offset,e.aliases&&(o=e.aliases.valueOf())}if(o)for(var s=0;s<o.length;s++)if(q.hasOwnProperty(o[s]))throw new Error('Cannot create alias "'+o[s]+'": a unit with that name already exists');if(r&&"string"==typeof r&&!i)try{i=E.parse(r,{allowNoUnits:!0})}catch(e){throw e.message='Could not create unit "'+t+'" from "'+r+'": '+e.message,e}else r&&"Unit"===r.type&&(i=r.clone());o=o||[],a=a||0,n=n&&n.toUpperCase&&B[n.toUpperCase()]||B.NONE;var u={};if(i){var c=!(u={name:t,value:i.value,dimensions:i.dimensions.slice(0),prefixes:n,offset:a});for(var f in k)if(k.hasOwnProperty(f)){for(var l=!0,p=0;p<I.length;p++)if(1e-12<Math.abs((u.dimensions[p]||0)-(k[f].dimensions[p]||0))){l=!1;break}if(l){c=!0,u.base=k[f];break}}if(!c){var m=t+"_STUFF",h={dimensions:i.dimensions.slice(0)};h.key=m,k[m]=h,F[m]={unit:u,prefix:B.NONE[""]},u.base=k[m]}}else{var d=t+"_STUFF";if(0<=I.indexOf(d))throw new Error('Cannot create new base unit "'+t+'": a base unit with that name already exists (and cannot be overridden)');for(var y in I.push(d),k)k.hasOwnProperty(y)&&(k[y].dimensions[I.length-1]=0);for(var g={dimensions:[]},v=0;v<I.length;v++)g.dimensions[v]=0;g.dimensions[I.length-1]=1,g.key=d,k[d]=g,u={name:t,value:1,dimensions:k[d].dimensions.slice(0),prefixes:n,offset:a,base:k[d]},F[d]={unit:u,prefix:B.NONE[""]}}E.UNITS[t]=u;for(var x=0;x<o.length;x++){var b=o[x],w={};for(var N in u)u.hasOwnProperty(N)&&(w[N]=u[N]);w.name=b,E.UNITS[b]=w}return new E(null,t)},E.deleteUnit=function(e){delete E.UNITS[e]},E.PREFIXES=B,E.BASE_DIMENSIONS=I,E.BASE_UNITS=k,E.UNIT_SYSTEMS=j,E.UNITS=q,E},t.math=!0},function(e,t,r){"use strict";var o=r(1);t.name="unit",t.factory=function(r,e,t,n){var i=n("unit",{Unit:function(e){return e.clone()},string:function(e){return r.Unit.isValuelessUnit(e)?new r.Unit(null,e):r.Unit.parse(e,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string":function(e,t){return new r.Unit(e,t)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},i}},function(e,t){"use strict";t.name="createUnit",t.factory=function(i,e,t,r){return r("createUnit",{"Object, Object":function(e,t){return i.Unit.createUnit(e,t)},Object:function(e){return i.Unit.createUnit(e,{})},"string, Unit | string | Object, Object":function(e,t,r){var n={};return n[e]=t,i.Unit.createUnit(n,r)},"string, Unit | string | Object":function(e,t){var r={};return r[e]=t,i.Unit.createUnit(r,{})},string:function(e){var t={};return t[e]={},i.Unit.createUnit(t,{})}})}},function(e,t){"use strict";t.name="splitUnit",t.factory=function(e,t,r,n){return n("splitUnit",{"Unit, Array":function(e,t){return e.splitUnit(t)}})}},function(e,t,r){"use strict";var n=r(5).lazy;function a(e,t,r){n(e,t,r),n(e.expression.mathWithTransform,t,r)}t.factory=function(r,e,t,n,i){function o(e){var t=r.Unit.parse(e);return t.fixPrefix=!0,t}a(i,"speedOfLight",function(){return o("299792458 m s^-1")}),a(i,"gravitationConstant",function(){return o("6.6738480e-11 m^3 kg^-1 s^-2")}),a(i,"planckConstant",function(){return o("6.626069311e-34 J s")}),a(i,"reducedPlanckConstant",function(){return o("1.05457172647e-34 J s")}),a(i,"magneticConstant",function(){return o("1.2566370614e-6 N A^-2")}),a(i,"electricConstant",function(){return o("8.854187817e-12 F m^-1")}),a(i,"vacuumImpedance",function(){return o("376.730313461 ohm")}),a(i,"coulomb",function(){return o("8.9875517873681764e9 N m^2 C^-2")}),a(i,"elementaryCharge",function(){return o("1.60217656535e-19 C")}),a(i,"bohrMagneton",function(){return o("9.2740096820e-24 J T^-1")}),a(i,"conductanceQuantum",function(){return o("7.748091734625e-5 S")}),a(i,"inverseConductanceQuantum",function(){return o("12906.403721742 ohm")}),a(i,"magneticFluxQuantum",function(){return o("2.06783375846e-15 Wb")}),a(i,"nuclearMagneton",function(){return o("5.0507835311e-27 J T^-1")}),a(i,"klitzing",function(){return o("25812.807443484 ohm")}),a(i,"bohrRadius",function(){return o("5.291772109217e-11 m")}),a(i,"classicalElectronRadius",function(){return o("2.817940326727e-15 m")}),a(i,"electronMass",function(){return o("9.1093829140e-31 kg")}),a(i,"fermiCoupling",function(){return o("1.1663645e-5 GeV^-2")}),a(i,"fineStructure",function(){return.007297352569824}),a(i,"hartreeEnergy",function(){return o("4.3597443419e-18 J")}),a(i,"protonMass",function(){return o("1.67262177774e-27 kg")}),a(i,"deuteronMass",function(){return o("3.3435830926e-27 kg")}),a(i,"neutronMass",function(){return o("1.6749271613e-27 kg")}),a(i,"quantumOfCirculation",function(){return o("3.636947552024e-4 m^2 s^-1")}),a(i,"rydberg",function(){return o("10973731.56853955 m^-1")}),a(i,"thomsonCrossSection",function(){return o("6.65245873413e-29 m^2")}),a(i,"weakMixingAngle",function(){return.222321}),a(i,"efimovFactor",function(){return 22.7}),a(i,"atomicMass",function(){return o("1.66053892173e-27 kg")}),a(i,"avogadro",function(){return o("6.0221412927e23 mol^-1")}),a(i,"boltzmann",function(){return o("1.380648813e-23 J K^-1")}),a(i,"faraday",function(){return o("96485.336521 C mol^-1")}),a(i,"firstRadiation",function(){return o("3.7417715317e-16 W m^2")}),a(i,"loschmidt",function(){return o("2.686780524e25 m^-3")}),a(i,"gasConstant",function(){return o("8.314462175 J K^-1 mol^-1")}),a(i,"molarPlanckConstant",function(){return o("3.990312717628e-10 J s mol^-1")}),a(i,"molarVolume",function(){return o("2.241396820e-10 m^3 mol^-1")}),a(i,"sackurTetrode",function(){return-1.164870823}),a(i,"secondRadiation",function(){return o("1.438777013e-2 m K")}),a(i,"stefanBoltzmann",function(){return o("5.67037321e-8 W m^-2 K^-4")}),a(i,"wienDisplacement",function(){return o("2.897772126e-3 m K")}),a(i,"molarMass",function(){return o("1e-3 kg mol^-1")}),a(i,"molarMassC12",function(){return o("1.2e-2 kg mol^-1")}),a(i,"gravity",function(){return o("9.80665 m s^-2")}),a(i,"planckLength",function(){return o("1.61619997e-35 m")}),a(i,"planckMass",function(){return o("2.1765113e-8 kg")}),a(i,"planckTime",function(){return o("5.3910632e-44 s")}),a(i,"planckCharge",function(){return o("1.87554595641e-18 C")}),a(i,"planckTemperature",function(){return o("1.41683385e+32 K")})},t.lazy=!1,t.math=!0},function(e,t,u){"use strict";var n=u(5),c=u(108);function f(e,t,r){e[t]=r,e.expression.mathWithTransform[t]=r}function l(e,t,r){n.lazy(e,t,r),n.lazy(e.expression.mathWithTransform,t,r)}t.factory=function r(n,i,o,a,s){s.on("config",function(e,t){e.number!==t.number&&r(n,i,o,a,s)}),f(s,"true",!0),f(s,"false",!1),f(s,"null",null),f(s,"uninitialized","Error: Constant uninitialized is removed since v4.0.0. Use null instead"),"BigNumber"===i.number?(f(s,"Infinity",new n.BigNumber(1/0)),f(s,"NaN",new n.BigNumber(NaN)),l(s,"pi",function(){return c.pi(n.BigNumber)}),l(s,"tau",function(){return c.tau(n.BigNumber)}),l(s,"e",function(){return c.e(n.BigNumber)}),l(s,"phi",function(){return c.phi(n.BigNumber)}),l(s,"E",function(){return s.e}),l(s,"LN2",function(){return new n.BigNumber(2).ln()}),l(s,"LN10",function(){return new n.BigNumber(10).ln()}),l(s,"LOG2E",function(){return new n.BigNumber(1).div(new n.BigNumber(2).ln())}),l(s,"LOG10E",function(){return new n.BigNumber(1).div(new n.BigNumber(10).ln())}),l(s,"PI",function(){return s.pi}),l(s,"SQRT1_2",function(){return new n.BigNumber("0.5").sqrt()}),l(s,"SQRT2",function(){return new n.BigNumber(2).sqrt()})):(f(s,"Infinity",1/0),f(s,"NaN",NaN),f(s,"pi",Math.PI),f(s,"tau",2*Math.PI),f(s,"e",Math.E),f(s,"phi",1.618033988749895),f(s,"E",s.e),f(s,"LN2",Math.LN2),f(s,"LN10",Math.LN10),f(s,"LOG2E",Math.LOG2E),f(s,"LOG10E",Math.LOG10E),f(s,"PI",s.pi),f(s,"SQRT1_2",Math.SQRT1_2),f(s,"SQRT2",Math.SQRT2)),n.Complex&&f(s,"i",n.Complex.I),f(s,"version",u(201))},t.lazy=!1,t.math=!0},function(e){e.exports="5.10.3"},function(e,t,r){"use strict";e.exports=[r(203),r(224),r(245),r(258),r(262),r(266),r(269),r(273),r(293),r(303),r(306),r(314),r(316),r(321),r(323),r(349),r(351)]},function(e,t,r){"use strict";e.exports=[r(204),r(86),r(207),r(208),r(87),r(132),r(136),r(222),r(137)]},function(e,t,b){"use strict";t.name="derivative",t.factory=function(l,r,e,t){var n=e(b(44)),o=e(b(86)),p=e(b(51)),m=e(b(60)),i=e(b(26)),a=e(b(65)),s=e(b(58)),h=e(b(69)),d=e(b(59)),u=e(b(68)),f=e(b(54)),c=t("derivative",{"Node, SymbolNode, Object":function(e,t,r){var n={};g(n,e,t.name);var i=v(e,n);return r.simplify?o(i):i},"Node, SymbolNode":function(e,t){return c(e,t,{simplify:!0})},"string, SymbolNode":function(e,t){return c(n(e),t)},"string, SymbolNode, Object":function(e,t,r){return c(n(e),t,r)},"string, string":function(e,t){return c(n(e),n(t))},"string, string, Object":function(e,t,r){return c(n(e),n(t),r)},"Node, string":function(e,t){return c(e,n(t))},"Node, string, Object":function(e,t,r){return c(e,n(t),r)}});c._simplify=!0,c.toTex=function(e){return y.apply(null,e.args)};var y=t("_derivTex",{"Node, SymbolNode":function(e,t){return l.isConstantNode(e)&&"string"===i(e.value)?y(n(e.value).toString(),t.toString(),1):y(e.toString(),t.toString(),1)},"Node, ConstantNode":function(e,t){if("string"===i(t.value))return y(e,n(t.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(e,t,r){return y(e.toString(),t.name,r.value)},"string, string, number":function(e,t,r){return(1===r?"{d\\over d"+t+"}":"{d^{"+r+"}\\over d"+t+"^{"+r+"}}")+"\\left[".concat(e,"\\right]")}}),g=t("constTag",{"Object, ConstantNode, string":function(e,t){return e[t]=!0},"Object, SymbolNode, string":function(e,t,r){return t.name!==r&&(e[t]=!0)},"Object, ParenthesisNode, string":function(e,t,r){return g(e,t.content,r)},"Object, FunctionAssignmentNode, string":function(e,t,r){return-1===t.params.indexOf(r)?e[t]=!0:g(e,t.expr,r)},"Object, FunctionNode | OperatorNode, string":function(e,t,r){if(0<t.args.length){for(var n=g(e,t.args[0],r),i=1;i<t.args.length;++i)n=g(e,t.args[i],r)&&n;if(n)return e[t]=!0}return!1}}),v=t("_derivative",{"ConstantNode, Object":function(){return x(0)},"SymbolNode, Object":function(e,t){return void 0!==t[e]?x(0):x(1)},"ParenthesisNode, Object":function(e,t){return new u(v(e.content,t))},"FunctionAssignmentNode, Object":function(e,t){return void 0!==t[e]?x(0):v(e.expr,t)},"FunctionNode, Object":function(e,t){if(1!==e.args.length&&function(e){if(("log"===e.name||"nthRoot"===e.name||"pow"===e.name)&&2===e.args.length)return;for(var t=0;t<e.args.length;++t)e.args[t]=x(0);throw e.compile().eval(),new Error("Expected TypeError, but none found")}(e),void 0!==t[e])return x(0);var r,n,i,o,a=e.args[0],s=!1,u=!1;switch(e.name){case"cbrt":s=!0,n=new d("*","multiply",[x(3),new d("^","pow",[a,new d("/","divide",[x(2),x(3)])])]);break;case"sqrt":case"nthRoot":if(1===e.args.length)s=!0,n=new d("*","multiply",[x(2),new h("sqrt",[a])]);else if(2===e.args.length)return t[r=new d("/","divide",[x(1),e.args[1]])]=t[e.args[1]],v(new d("^","pow",[a,r]),t);break;case"log10":r=x(10);case"log":if(r||1!==e.args.length){if(1===e.args.length&&r||2===e.args.length&&void 0!==t[e.args[1]])n=new d("*","multiply",[a.clone(),new h("log",[r||e.args[1]])]),s=!0;else if(2===e.args.length)return v(new d("/","divide",[new h("log",[a]),new h("log",[e.args[1]])]),t)}else n=a.clone(),s=!0;break;case"pow":return t[r]=t[e.args[1]],v(new d("^","pow",[a,e.args[1]]),t);case"exp":n=new h("exp",[a.clone()]);break;case"sin":n=new h("cos",[a.clone()]);break;case"cos":n=new d("-","unaryMinus",[new h("sin",[a.clone()])]);break;case"tan":n=new d("^","pow",[new h("sec",[a.clone()]),x(2)]);break;case"sec":n=new d("*","multiply",[e,new h("tan",[a.clone()])]);break;case"csc":u=!0,n=new d("*","multiply",[e,new h("cot",[a.clone()])]);break;case"cot":u=!0,n=new d("^","pow",[new h("csc",[a.clone()]),x(2)]);break;case"asin":s=!0,n=new h("sqrt",[new d("-","subtract",[x(1),new d("^","pow",[a.clone(),x(2)])])]);break;case"acos":u=s=!0,n=new h("sqrt",[new d("-","subtract",[x(1),new d("^","pow",[a.clone(),x(2)])])]);break;case"atan":s=!0,n=new d("+","add",[new d("^","pow",[a.clone(),x(2)]),x(1)]);break;case"asec":s=!0,n=new d("*","multiply",[new h("abs",[a.clone()]),new h("sqrt",[new d("-","subtract",[new d("^","pow",[a.clone(),x(2)]),x(1)])])]);break;case"acsc":u=s=!0,n=new d("*","multiply",[new h("abs",[a.clone()]),new h("sqrt",[new d("-","subtract",[new d("^","pow",[a.clone(),x(2)]),x(1)])])]);break;case"acot":u=s=!0,n=new d("+","add",[new d("^","pow",[a.clone(),x(2)]),x(1)]);break;case"sinh":n=new h("cosh",[a.clone()]);break;case"cosh":n=new h("sinh",[a.clone()]);break;case"tanh":n=new d("^","pow",[new h("sech",[a.clone()]),x(2)]);break;case"sech":u=!0,n=new d("*","multiply",[e,new h("tanh",[a.clone()])]);break;case"csch":u=!0,n=new d("*","multiply",[e,new h("coth",[a.clone()])]);break;case"coth":u=!0,n=new d("^","pow",[new h("csch",[a.clone()]),x(2)]);break;case"asinh":s=!0,n=new h("sqrt",[new d("+","add",[new d("^","pow",[a.clone(),x(2)]),x(1)])]);break;case"acosh":s=!0,n=new h("sqrt",[new d("-","subtract",[new d("^","pow",[a.clone(),x(2)]),x(1)])]);break;case"atanh":s=!0,n=new d("-","subtract",[x(1),new d("^","pow",[a.clone(),x(2)])]);break;case"asech":u=s=!0,n=new d("*","multiply",[a.clone(),new h("sqrt",[new d("-","subtract",[x(1),new d("^","pow",[a.clone(),x(2)])])])]);break;case"acsch":u=s=!0,n=new d("*","multiply",[new h("abs",[a.clone()]),new h("sqrt",[new d("+","add",[new d("^","pow",[a.clone(),x(2)]),x(1)])])]);break;case"acoth":u=s=!0,n=new d("-","subtract",[x(1),new d("^","pow",[a.clone(),x(2)])]);break;case"abs":n=new d("/","divide",[new h(new f("abs"),[a.clone()]),a.clone()]);break;case"gamma":default:throw new Error('Function "'+e.name+'" is not supported by derivative, or a wrong number of arguments is passed')}o=s?(i="/","divide"):(i="*","multiply");var c=v(a,t);return u&&(c=new d("-","unaryMinus",[c])),new d(i,o,[c,n])},"OperatorNode, Object":function(e,r){if(void 0!==r[e])return x(0);if("+"===e.op)return new d(e.op,e.fn,e.args.map(function(e){return v(e,r)}));if("-"===e.op){if(e.isUnary())return new d(e.op,e.fn,[v(e.args[0],r)]);if(e.isBinary())return new d(e.op,e.fn,[v(e.args[0],r),v(e.args[1],r)])}if("*"===e.op){var t=e.args.filter(function(e){return void 0!==r[e]});if(0<t.length){var n=e.args.filter(function(e){return void 0===r[e]}),i=1===n.length?n[0]:new d("*","multiply",n),o=t.concat(v(i,r));return new d("*","multiply",o)}return new d("+","add",e.args.map(function(t){return new d("*","multiply",e.args.map(function(e){return e===t?v(e,r):e.clone()}))}))}if("/"===e.op&&e.isBinary()){var a=e.args[0],s=e.args[1];return void 0!==r[s]?new d("/","divide",[v(a,r),s]):void 0!==r[a]?new d("*","multiply",[new d("-","unaryMinus",[a]),new d("/","divide",[v(s,r),new d("^","pow",[s.clone(),x(2)])])]):new d("/","divide",[new d("-","subtract",[new d("*","multiply",[v(a,r),s.clone()]),new d("*","multiply",[a.clone(),v(s,r)])]),new d("^","pow",[s.clone(),x(2)])])}if("^"===e.op&&e.isBinary()){var u=e.args[0],c=e.args[1];if(void 0!==r[u])return l.isConstantNode(u)&&(m(u.value)||p(u.value,1))?x(0):new d("*","multiply",[e,new d("*","multiply",[new h("log",[u.clone()]),v(c.clone(),r)])]);if(void 0===r[c])return new d("*","multiply",[new d("^","pow",[u.clone(),c.clone()]),new d("+","add",[new d("*","multiply",[v(u,r),new d("/","divide",[c.clone(),u.clone()])]),new d("*","multiply",[v(c,r),new h("log",[u.clone()])])])]);if(l.isConstantNode(c)){if(m(c.value))return x(0);if(p(c.value,1))return v(u,r)}var f=new d("^","pow",[u.clone(),new d("-","subtract",[c,x(1)])]);return new d("*","multiply",[c.clone(),new d("*","multiply",[v(u,r),f])])}throw new Error('Operator "'+e.op+'" is not supported by derivative, or a wrong number of arguments is passed')}});function x(e,t){return new s(a(e,t||r.number))}return c}},function(e,t,o){"use strict";function a(e){return(a="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})(e)}var s=o(22).transform,u=o(13).setSafeProperty;t.factory=function(e,t,r){var n=r(o(23)),i=r(o(0));return function(e,t,r){try{if(Array.isArray(e))return i(e).subset(t,r).valueOf();if(e&&"function"==typeof e.subset)return e.subset(t,r);if("string"==typeof e)return n(e,t,r);if("object"!==a(e))throw new TypeError("Cannot apply index: unsupported type of object");if(!t.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return u(e,t.getObjectProperty(),r),e}catch(e){throw s(e)}}}},function(e,t){"use strict";t.math=!0,t.name="resolve",t.path="algebra.simplify",t.factory=function(a,e,t,r,s){var u=s.expression.node.Node,c=s.expression.node.OperatorNode,f=s.expression.node.FunctionNode,l=s.expression.node.ParenthesisNode;return function t(e,r){if(!r)return e;if(a.isSymbolNode(e)){var n=r[e.name];if(n instanceof u)return t(n,r);if("number"==typeof n)return s.parse(String(n))}else{if(a.isOperatorNode(e)){var i=e.args.map(function(e){return t(e,r)});return new c(e.op,e.fn,i,e.implicit)}if(a.isParenthesisNode(e))return new l(t(e.content,r));if(a.isFunctionNode(e)){var o=e.args.map(function(e){return t(e,r)});return new f(e.name,o)}}return e}}},function(e,t,a){"use strict";t.name="rationalize",t.factory=function(e,t,r,n){var m=r(a(86)),h=r(a(127)),d=r(a(125)),i=r(a(129)),y=a(3),g=r(a(58)),v=r(a(59)),p=r(a(54)),o=n("rationalize",{string:function(e){return o(i(e),{},!1)},"string, boolean":function(e,t){return o(i(e),{},t)},"string, Object":function(e,t){return o(i(e),t,!1)},"string, Object, boolean":function(e,t,r){return o(i(e),t,r)},Node:function(e){return o(e,{},!1)},"Node, boolean":function(e,t){return o(e,{},t)},"Node, Object":function(e,t){return o(e,t,!1)},"Node, Object, boolean":function(e,t,r){var n=function(){var e=[h,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},d,{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"}],t=[{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)"}],r=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],n={};return n.firstRules=e.concat(t,r),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=r,n.firstRulesAgain=e.concat(t),n.finalRules=[h,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},d,{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,t,r,n){var a=[],i=m(e,n,t,{exactFractions:!1}),s="+-*"+((r=!!r)?"/":"");!function e(t){var r=t.type;{if("FunctionNode"===r)throw new Error("There is an unsolved function call");if("OperatorNode"===r)if("^"===t.op){if("unaryMinus"===t.args[1].fn&&(t=t.args[0]),"ConstantNode"!==t.args[1].type||!y.isInteger(parseFloat(t.args[1].value)))throw new Error("There is a non-integer exponent");e(t.args[0])}else{if(-1===s.indexOf(t.op))throw new Error("Operator "+t.op+" invalid in polynomial expression");for(var n=0;n<t.args.length;n++)e(t.args[n])}else if("SymbolNode"===r){var i=t.name,o=a.indexOf(i);-1===o&&a.push(i)}else if("ParenthesisNode"===r)e(t.content);else if("ConstantNode"!==r)throw new Error("type "+r+" is not allowed in polynomial expression")}}(i);var o={};return o.expression=i,o.variables=a,o}(e,t,!0,n.firstRules),o=i.variables.length;if(e=i.expression,1<=o){var a,s;e=function e(t,r,n){var i=t.type;var o=1<arguments.length;if("OperatorNode"===i&&t.isBinary()){var a,s=!1;if("^"===t.op&&("ParenthesisNode"!==t.args[0].type&&"OperatorNode"!==t.args[0].type||"ConstantNode"!==t.args[1].type||(a=parseFloat(t.args[1].value),s=2<=a&&y.isInteger(a))),s){if(2<a){var u=t.args[0],c=new v("^","pow",[t.args[0].cloneDeep(),new g(a-1)]);t=new v("*","multiply",[u,c])}else t=new v("*","multiply",[t.args[0],t.args[0].cloneDeep()]);o&&("content"===n?r.content=t:r.args[n]=t)}}if("ParenthesisNode"===i)e(t.content,t,"content");else if("ConstantNode"!==i&&"SymbolNode"!==i)for(var f=0;f<t.args.length;f++)e(t.args[f],t,f);if(!o)return t}(e);var u,c=!0,f=!1;for(e=m(e,n.firstRules,{},{exactFractions:!1});s=c?n.distrDivRules:n.sucDivRules,c=!c,(u=(e=m(e,s)).toString())!==a;)f=!0,a=u;f&&(e=m(e,n.firstRulesAgain,{},{exactFractions:!1})),e=m(e,n.finalRules,{},{exactFractions:!1})}var l=[],p={};return"OperatorNode"===e.type&&e.isBinary()&&"/"===e.op?(1===o&&(e.args[0]=x(e.args[0],l),e.args[1]=x(e.args[1])),r&&(p.numerator=e.args[0],p.denominator=e.args[1])):(1===o&&(e=x(e,l)),r&&(p.numerator=e,p.denominator=null)),r?(p.coefficients=l,p.variables=i.variables,p.expression=e,p):e}});function x(e,u){void 0===u&&(u=[]);var t={cte:1,oper:"+",fire:""},c=u[0]=0,f="";!function e(t,r,n){var i=t.type;{if("FunctionNode"===i)throw new Error("There is an unsolved function call");if("OperatorNode"===i){if(-1==="+-*^".indexOf(t.op))throw new Error("Operator "+t.op+" invalid");if(null!==r){if(("unaryMinus"===t.fn||"pow"===t.fn)&&"add"!==r.fn&&"subtract"!==r.fn&&"multiply"!==r.fn)throw new Error("Invalid "+t.op+" placing");if(("subtract"===t.fn||"add"===t.fn||"multiply"===t.fn)&&"add"!==r.fn&&"subtract"!==r.fn)throw new Error("Invalid "+t.op+" placing");if(("subtract"===t.fn||"add"===t.fn||"unaryMinus"===t.fn)&&0!==n.noFil)throw new Error("Invalid "+t.op+" placing")}"^"!==t.op&&"*"!==t.op||(n.fire=t.op);for(var o=0;o<t.args.length;o++)"unaryMinus"===t.fn&&(n.oper="-"),"+"!==t.op&&"subtract"!==t.fn||(n.fire="",n.cte=1,n.oper=0===o?"+":t.op),n.noFil=o,e(t.args[o],t,n)}else if("SymbolNode"===i){if(t.name!==f&&""!==f)throw new Error("There is more than one variable");if(f=t.name,null===r)return void(u[1]=1);if("^"===r.op&&0!==n.noFil)throw new Error("In power the variable should be the first parameter");if("*"===r.op&&1!==n.noFil)throw new Error("In multiply the variable should be the second parameter");""!==n.fire&&"*"!==n.fire||(c<1&&(u[1]=0),u[1]+=n.cte*("+"===n.oper?1:-1),c=Math.max(1,c))}else{if("ConstantNode"!==i)throw new Error("Type "+i+" is not allowed");var a=parseFloat(t.value);if(null===r)return void(u[0]=a);if("^"===r.op){if(1!==n.noFil)throw new Error("Constant cannot be powered");if(!y.isInteger(a)||a<=0)throw new Error("Non-integer exponent is not allowed");for(var s=c+1;s<a;s++)u[s]=0;return c<a&&(u[a]=0),u[a]+=n.cte*("+"===n.oper?1:-1),void(c=Math.max(a,c))}n.cte=a,""===n.fire&&(u[0]+=n.cte*("+"===n.oper?1:-1))}}}(e,null,t);for(var r,n=!0,i=c=u.length-1;0<=i;i--)if(0!==u[i]){var o=new g(n?u[i]:Math.abs(u[i])),a=u[i]<0?"-":"+";if(0<i){var s=new p(f);if(1<i){var l=new g(i);s=new v("^","pow",[s,l])}o=-1===u[i]&&n?new v("-","unaryMinus",[s]):1===Math.abs(u[i])?s:new v("*","multiply",[o,s])}r=n?o:"+"==a?new v("+","add",[r,o]):new v("-","subtract",[r,o]),n=!1}return n?new g(0):r}return o}},function(e,t,a){"use strict";t.name="qr",t.factory=function(e,t,r,n){var i=r(a(0)),x=r(a(43)),b=r(a(50)),w=r(a(60)),N=r(a(130)),M=r(a(131)),E=r(a(46)),A=r(a(71)),S=r(a(39)),O=r(a(17)),T=r(a(12)),_=r(a(21)),C=r(a(15));function o(e){var t,r,n,i=e._size[0],o=e._size[1],a=b([i],"dense"),s=a._data,u=e.clone(),c=u._data,f=x([i],"");for(n=0;n<Math.min(o,i);++n){var l=c[n][n],p=S(M(l)),m=A(p),h=0;for(t=n;t<i;t++)h=O(h,_(c[t][n],A(c[t][n])));var d=_(p,E(h));if(!w(d)){var y=C(l,d);for(t=n+(f[n]=1);t<i;t++)f[t]=T(c[t][n],y);var g=S(A(T(y,d))),v=void 0;for(r=n;r<o;r++){for(v=0,t=n;t<i;t++)v=O(v,_(A(f[t]),c[t][r]));for(v=_(v,g),t=n;t<i;t++)c[t][r]=_(C(c[t][r],_(f[t],v)),m)}for(t=0;t<i;t++){for(v=0,r=n;r<i;r++)v=O(v,_(s[t][r],f[r]));for(v=_(v,g),r=n;r<i;++r)s[t][r]=T(C(s[t][r],_(v,A(f[r]))),m)}}}for(t=0;t<i;++t)for(r=0;r<t&&r<o;++r){if(N(0,T(c[t][r],1e5)))throw new Error("math.qr(): unknown error - R is not lower triangular (element ("+t+", "+r+") = "+c[t][r]+")");c[t][r]=_(c[t][r],0)}return{Q:a,R:u,toString:function(){return"Q: "+this.Q.toString()+"\nR: "+this.R.toString()}}}return n("qr",{DenseMatrix:function(e){return o(e)},SparseMatrix:function(){return function(){throw new Error("qr not implemented for sparse matrices yet")}()},Array:function(e){var t=o(i(e));return{Q:t.Q.valueOf(),R:t.R.valueOf()}}})}},function(e,t,n){"use strict";t.name="csSqr",t.path="algebra.sparse",t.factory=function(e,t,r){var c=r(n(210)),f=r(n(212)),l=r(n(213)),p=r(n(214)),m=r(n(215));return function(e,t,r){var n,i=t._ptr,o=t._size[1],a={};if(a.q=c(e,t),e&&!a.q)return null;if(r){var s=e?f(t,null,a.q,0):t;a.parent=l(s,1);var u=p(a.parent,o);if(a.cp=m(s,a.parent,u,1),s&&a.parent&&a.cp&&function(e,t){var r=e._ptr,n=e._index,i=e._size,o=i[0],a=i[1];t.pinv=[],t.leftmost=[];var s,u,c,f,l,p=t.parent,m=t.pinv,h=t.leftmost,d=[],y=o,g=o+a,v=o+2*a;for(u=0;u<a;u++)d[y+u]=-1,d[g+u]=-1,d[v+u]=0;for(s=0;s<o;s++)h[s]=-1;for(u=a-1;0<=u;u--)for(f=r[u],l=r[u+1],c=f;c<l;c++)h[n[c]]=u;for(s=o-1;0<=s;s--)(m[s]=-1)!==(u=h[s])&&(0==d[v+u]++&&(d[g+u]=s),d[0+s]=d[y+u],d[y+u]=s);for(t.lnz=0,t.m2=o,u=0;u<a;u++)if(s=d[y+u],t.lnz++,s<0&&(s=t.m2++),m[s]=u,!(--v[u]<=0)){t.lnz+=d[v+u];var x=p[u];-1!==x&&(0===d[v+x]&&(d[g+x]=d[g+u]),d[0+d[g+u]]=d[y+x],d[y+x]=d[0+s],d[v+x]+=d[v+u])}for(s=0;s<o;s++)m[s]<0&&(m[s]=u++);return!0}(s,a))for(n=a.unz=0;n<o;n++)a.unz+=a.cp[n]}else a.unz=4*i[o]+o,a.lnz=a.unz;return a}}},function(e,t,n){"use strict";t.name="csAmd",t.path="algebra.sparse",t.factory=function(e,t,r){var K=r(n(88)),ee=r(n(211)),te=r(n(133)),re=r(n(14)),ne=r(n(10)),ie=r(n(72));function oe(e,t,r,n,i){if(e<2||e+t<0){for(var o=0;o<i;o++)0!==r[n+o]&&(r[n+o]=1);e=2}return e}function ae(e,t){return e!==t}return function(e,t){if(!t||e<=0||3<e)return null;var r=t._size,n=r[0],i=r[1],o=0,a=Math.max(16,10*Math.sqrt(i)),s=function(e,t,r,n,i){var o=ie(t);if(1===e&&n===r)return re(t,o);if(2!==e)return ne(o,t);for(var a=o._index,s=o._ptr,u=0,c=0;c<r;c++){var f=s[c];if(s[c]=u,!(s[c+1]-f>i))for(var l=s[c+1];f<l;f++)a[u++]=a[f]}return s[r]=u,t=ie(o),ne(o,t)}(e,t,n,i,a=Math.min(i-2,a));ee(s,ae,null);for(var u,c,f,l,p,m,h,d,y,g,v,x,b,w,N,M,E=s._index,A=s._ptr,S=A[i],O=[],T=[],_=i+1,C=2*(i+1),z=3*(i+1),B=4*(i+1),I=5*(i+1),k=6*(i+1),P=7*(i+1),R=O,q=function(e,t,r,n,i,o,a,s,u,c,f,l){for(var p=0;p<e;p++)r[n+p]=t[p+1]-t[p];for(var m=r[n+e]=0;m<=e;m++)r[i+m]=-1,o[m]=-1,r[a+m]=-1,r[s+m]=-1,r[u+m]=1,r[c+m]=1,r[f+m]=0,r[l+m]=r[n+m];var h=oe(0,0,r,c,e);return r[f+e]=-2,t[e]=-1,r[c+e]=0,h}(i,A,T,0,z,R,C,P,_,k,B,I),U=function(e,t,r,n,i,o,a,s,u,c,f){for(var l=0,p=0;p<e;p++){var m=r[n+p];if(0===m)r[i+p]=-2,l++,t[p]=-1,r[o+p]=0;else if(a<m)r[s+p]=0,r[i+p]=-1,l++,t[p]=K(e),r[s+e]++;else{var h=r[u+m];-1!==h&&(c[h]=p),r[f+p]=r[u+m],r[u+m]=p}}return l}(i,A,T,I,B,k,a,_,z,R,C),D=0;U<i;){for(f=-1;D<i&&-1===(f=T[z+D]);D++);-1!==T[C+f]&&(R[T[C+f]]=-1),T[z+D]=T[C+f];var j=T[B+f],F=T[_+f];U+=F;var L=0;T[_+f]=-F;var H=A[f],$=0===j?H:S,G=$;for(l=1;l<=j+1;l++){for(d=j<l?(h=H,T[0+(m=f)]-j):(h=A[m=E[H++]],T[0+m]),p=1;p<=d;p++)(y=T[_+(u=E[h++])])<=0||(L+=y,T[_+u]=-y,-1!==T[C+(E[G++]=u)]&&(R[T[C+u]]=R[u]),-1!==R[u]?T[C+R[u]]=T[C+u]:T[z+T[I+u]]=T[C+u]);m!==f&&(A[m]=K(f),T[k+m]=0)}for(0!==j&&(S=G),T[I+f]=L,A[f]=$,T[0+f]=G-$,T[B+f]=-2,q=oe(q,o,T,k,i),g=$;g<G;g++)if(!((v=T[B+(u=E[g])])<=0)){var V=q-(y=-T[_+u]);for(H=A[u],x=A[u]+v-1;H<=x;H++)T[k+(m=E[H])]>=q?T[k+m]-=y:0!==T[k+m]&&(T[k+m]=T[I+m]+V)}for(g=$;g<G;g++){for(b=(x=A[u=E[g]])+T[B+u]-1,M=N=0,H=w=x;H<=b;H++)if(0!==T[k+(m=E[H])]){var Z=T[k+m]-q;0<Z?(M+=Z,N+=E[w++]=m):(A[m]=K(f),T[k+m]=0)}T[B+u]=w-x+1;var Y=w,J=x+T[0+u];for(H=1+b;H<J;H++){var W=T[_+(c=E[H])];W<=0||(M+=W,N+=E[w++]=c)}0===M?(A[u]=K(f),L-=y=-T[_+u],F+=y,U+=y,T[_+u]=0,T[B+u]=-1):(T[I+u]=Math.min(T[I+u],M),E[w]=E[Y],E[Y]=E[x],E[x]=f,T[0+u]=w-x+1,N=(N<0?-N:N)%i,T[C+u]=T[P+N],R[T[P+N]=u]=N)}for(T[I+f]=L,q=oe(q+(o=Math.max(o,L)),o,T,k,i),g=$;g<G;g++)if(!(0<=T[_+(u=E[g])]))for(u=T[P+(N=R[u])],T[P+N]=-1;-1!==u&&-1!==T[C+u];u=T[C+u],q++){for(d=T[0+u],v=T[B+u],H=A[u]+1;H<=A[u]+d-1;H++)T[k+E[H]]=q;var X=u;for(c=T[C+u];-1!==c;){var Q=T[0+c]===d&&T[B+c]===v;for(H=A[c]+1;Q&&H<=A[c]+d-1;H++)T[k+E[H]]!==q&&(Q=0);Q?(A[c]=K(u),T[_+u]+=T[_+c],T[_+c]=0,T[B+c]=-1,c=T[C+c],T[C+X]=c):c=T[C+(X=c)]}}for(g=H=$;g<G;g++)(y=-T[_+(u=E[g])])<=0||(T[_+u]=y,M=T[I+u]+L-y,-1!==T[z+(M=Math.min(M,i-U-y))]&&(R[T[z+M]]=u),T[C+u]=T[z+M],R[u]=-1,T[z+M]=u,D=Math.min(D,M),T[I+u]=M,E[H++]=u);T[_+f]=F,0==(T[0+f]=H-$)&&(A[f]=-1,T[k+f]=0),0!==j&&(S=H)}for(u=0;u<i;u++)A[u]=K(A[u]);for(c=0;c<=i;c++)T[z+c]=-1;for(c=i;0<=c;c--)0<T[_+c]||(T[C+c]=T[z+A[c]],T[z+A[c]]=c);for(m=i;0<=m;m--)T[_+m]<=0||-1!==A[m]&&(T[C+m]=T[z+A[m]],T[z+A[m]]=m);for(u=f=0;u<=i;u++)-1===A[u]&&(f=te(u,f,T,z,C,O,k));return O.splice(O.length-1,1),O}}},function(e,t){"use strict";t.name="csFkeep",t.path="algebra.sparse",t.factory=function(){return function(e,t,r){for(var n=e._values,i=e._index,o=e._ptr,a=e._size[1],s=0,u=0;u<a;u++){var c=o[u];for(o[u]=s;c<o[u+1];c++)t(i[c],u,n?n[c]:1,r)&&(i[s]=i[c],n&&(n[s]=n[c]),s++)}return o[a]=s,i.splice(s,i.length-s),n&&n.splice(s,n.length-s),s}}},function(e,t){"use strict";t.name="csPermute",t.path="algebra.sparse",t.factory=function(e){var w=e.SparseMatrix;return function(e,t,r,n){for(var i=e._values,o=e._index,a=e._ptr,s=e._size,u=e._datatype,c=s[0],f=s[1],l=n&&e._values?[]:null,p=[],m=[],h=0,d=0;d<f;d++){m[d]=h;for(var y=r?r[d]:d,g=a[y],v=a[y+1],x=g;x<v;x++){var b=t?t[o[x]]:o[x];p[h]=b,l&&(l[h]=i[x]),h++}}return m[f]=h,new w({values:l,index:p,ptr:m,size:[c,f],datatype:u})}}},function(e,t){"use strict";t.name="csEtree",t.path="algebra.sparse",t.factory=function(){return function(e,t){if(!e)return null;var r,n,i=e._index,o=e._ptr,a=e._size,s=a[0],u=a[1],c=[],f=[],l=u;if(t)for(r=0;r<s;r++)f[l+r]=-1;for(var p=0;p<u;p++){c[p]=-1,f[0+p]=-1;for(var m=o[p],h=o[p+1],d=m;d<h;d++){var y=i[d];for(r=t?f[l+y]:y;-1!==r&&r<p;r=n)n=f[0+r],f[0+r]=p,-1===n&&(c[r]=p);t&&(f[l+y]=p)}}return c}}},function(e,t,n){"use strict";t.name="csPost",t.path="algebra.sparse",t.factory=function(e,t,r){var u=r(n(133));return function(e,t){if(!e)return null;var r,n=0,i=[],o=[],a=t,s=2*t;for(r=0;r<t;r++)o[0+r]=-1;for(r=t-1;0<=r;r--)-1!==e[r]&&(o[a+r]=o[0+e[r]],o[0+e[r]]=r);for(r=0;r<t;r++)-1===e[r]&&(n=u(r,n,o,0,a,i,s));return i}}},function(e,t,n){"use strict";t.name="csCounts",t.path="algebra.sparse",t.factory=function(e,t,r){var S=r(n(72)),O=r(n(216));return function(e,t,r,n){if(!e||!t||!r)return null;var i,o,a,s,u,c,f,l=e._size,p=l[0],m=l[1],h=4*m+(n?m+p+1:0),d=[],y=m,g=2*m,v=3*m,x=4*m,b=5*m+1;for(a=0;a<h;a++)d[a]=-1;var w=[],N=S(e),M=N._index,E=N._ptr;for(a=0;a<m;a++)for(w[o=r[a]]=-1===d[v+o]?1:0;-1!==o&&-1===d[v+o];o=t[o])d[v+o]=a;if(n){for(a=0;a<m;a++)d[r[a]]=a;for(i=0;i<p;i++){for(a=m,c=E[i],f=E[i+1],u=c;u<f;u++)a=Math.min(a,d[M[u]]);d[b+i]=d[x+a],d[x+a]=i}}for(i=0;i<m;i++)d[0+i]=i;for(a=0;a<m;a++){for(-1!==t[o=r[a]]&&w[t[o]]--,s=n?d[x+a]:o;-1!==s;s=n?d[b+s]:-1)for(u=E[s];u<E[s+1];u++){i=M[u];var A=O(i,o,d,v,y,g,0);1<=A.jleaf&&w[o]++,2===A.jleaf&&w[A.q]--}-1!==t[o]&&(d[0+o]=t[o])}for(o=0;o<m;o++)-1!==t[o]&&(w[t[o]]+=w[o]);return w}}},function(e,t){"use strict";t.name="csLeaf",t.path="algebra.sparse",t.factory=function(){return function(e,t,r,n,i,o,a){var s,u,c,f,l=0;if(e<=t||r[n+t]<=r[i+e])return-1;if(r[i+e]=r[n+t],c=r[o+e],r[o+e]=t,-1===c)l=1,f=e;else{for(l=2,f=c;f!==r[a+f];f=r[a+f]);for(s=c;s!==f;s=u)u=r[a+s],r[a+s]=f}return{jleaf:l,q:f}}}},function(e,t,n){"use strict";t.name="csLu",t.path="algebra.sparse",t.factory=function(e,t,r){var O=r(n(25)),T=r(n(12)),_=r(n(10)),C=r(n(33)),z=r(n(89)),B=r(n(218)),I=e.SparseMatrix;return function(e,t,r){if(!e)return null;var n,i=e._size[1],o=100,a=100;t&&(n=t.q,o=t.lnz||o,a=t.unz||a);var s,u,c=[],f=[],l=[],p=new I({values:c,index:f,ptr:l,size:[i,i]}),m=[],h=[],d=[],y=new I({values:m,index:h,ptr:d,size:[i,i]}),g=[],v=[],x=[];for(s=0;s<i;s++)v[s]=0,g[s]=-1,l[s+1]=0;for(var b=a=o=0;b<i;b++){l[b]=o,d[b]=a;var w=n?n[b]:b,N=B(p,e,w,x,v,g,1),M=-1,E=-1;for(u=N;u<i;u++)if(g[s=x[u]]<0){var A=O(v[s]);C(A,E)&&(E=A,M=s)}else h[a]=g[s],m[a++]=v[s];if(-1===M||E<=0)return null;g[w]<0&&z(O(v[w]),_(E,r))&&(M=w);var S=v[M];for(h[a]=b,m[a++]=S,g[M]=b,f[o]=M,c[o++]=1,u=N;u<i;u++)g[s=x[u]]<0&&(f[o]=s,c[o++]=T(v[s],S)),v[s]=0}for(l[i]=o,d[i]=a,u=0;u<o;u++)f[u]=g[f[u]];return c.splice(o,c.length-o),f.splice(o,f.length-o),m.splice(a,m.length-a),h.splice(a,h.length-a),{L:p,U:y,pinv:g}}}},function(e,t,n){"use strict";t.name="csSpsolve",t.path="algebra.sparse",t.factory=function(e,t,r){var M=r(n(12)),E=r(n(10)),A=r(n(15)),S=r(n(219));return function(e,t,r,n,i,o,a){var s,u,c,f,l=e._values,p=e._index,m=e._ptr,h=e._size[1],d=t._values,y=t._index,g=t._ptr,v=S(e,t,r,n,o);for(s=v;s<h;s++)i[n[s]]=0;for(u=g[r],c=g[r+1],s=u;s<c;s++)i[y[s]]=d[s];for(var x=v;x<h;x++){var b=n[x],w=o?o[b]:b;if(!(w<0))for(u=m[w],c=m[w+1],i[b]=M(i[b],l[a?u:c-1]),s=a?u+1:u,f=a?c:c-1;s<f;s++){var N=p[s];i[N]=A(i[N],E(l[s],i[b]))}}return v}}},function(e,t,n){"use strict";t.name="csReach",t.path="algebra.sparse",t.factory=function(e,t,r){var d=r(n(220)),y=r(n(134)),g=r(n(135));return function(e,t,r,n,i){var o,a,s,u=e._ptr,c=e._size,f=t._index,l=t._ptr,p=c[1],m=p;for(a=l[r],s=l[r+1],o=a;o<s;o++){var h=f[o];y(u,h)||(m=d(h,e,m,n,i))}for(o=m;o<p;o++)g(u,n[o]);return m}}},function(e,t,n){"use strict";t.name="csDfs",t.path="algebra.sparse",t.factory=function(e,t,r){var h=r(n(134)),d=r(n(135)),y=r(n(221));return function(e,t,r,n,i){var o,a,s,u=t._index,c=t._ptr,f=t._size[1],l=0;for(n[0]=e;0<=l;){e=n[l];var p=i?i[e]:e;h(c,e)||(d(c,e),n[f+l]=p<0?0:y(c[p]));var m=1;for(a=n[f+l],s=p<0?0:y(c[p+1]);a<s;a++)if(o=u[a],!h(c,o)){n[f+l]=a,n[++l]=o,m=0;break}m&&(l--,n[--r]=e)}return r}}},function(e,t,i){"use strict";t.name="csUnflip",t.path="algebra.sparse",t.factory=function(e,t,r){var n=r(i(88));return function(e){return e<0?n(e):e}}},function(e,t,h){"use strict";var d=Array.isArray;t.name="lusolve",t.factory=function(t,e,r,n){var i=r(h(0)),o=r(h(87)),a=r(h(132)),s=r(h(223)),u=r(h(90)),c=r(h(137)),f=r(h(136)),l=n("lusolve",{"Array, Array | Matrix":function(e,t){e=i(e);var r=o(e);return m(r.L,r.U,r.p,null,t).valueOf()},"DenseMatrix, Array | Matrix":function(e,t){var r=o(e);return m(r.L,r.U,r.p,null,t)},"SparseMatrix, Array | Matrix":function(e,t){var r=o(e);return m(r.L,r.U,r.p,null,t)},"SparseMatrix, Array | Matrix, number, number":function(e,t,r,n){var i=a(e,r,n);return m(i.L,i.U,i.p,i.q,t)},"Object, Array | Matrix":function(e,t){return m(e.L,e.U,e.p,e.q,t)}}),p=function(e){if(t.isMatrix(e))return e;if(d(e))return i(e);throw new TypeError("Invalid Matrix LU decomposition")};function m(e,t,r,n,i){e=p(e),t=p(t),i=u(e,i,!1),r&&(i._data=s(r,i._data));var o=f(e,i),a=c(t,o);return n&&(a._data=s(n,a._data)),a}return l}},function(e,t){"use strict";t.name="csIpvec",t.path="algebra.sparse",t.factory=function(){return function(e,t){var r,n=t.length,i=[];if(e)for(r=0;r<n;r++)i[e[r]]=t[r];else for(r=0;r<n;r++)i[r]=t[r];return i}}},function(e,t,r){"use strict";e.exports=[r(25),r(14),r(17),r(225),r(110),r(226),r(45),r(138),r(227),r(228),r(229),r(230),r(109),r(111),r(231),r(232),r(233),r(91),r(235),r(236),r(237),r(238),r(10),r(239),r(240),r(241),r(42),r(67),r(131),r(46),r(242),r(15),r(39),r(243),r(244)]},function(e,t,n){"use strict";var i=n(1);var l=Math.cbrt||function(e){if(0===e)return e;var t,r=e<0;return r&&(e=-e),t=isFinite(e)?(e/((t=Math.exp(Math.log(e)/3))*t)+2*t)/3:e,r?-t:t};t.name="cbrt",t.factory=function(a,s,e,t){var o=e(n(39)),u=e(n(61)),c=e(n(0)),r=t("cbrt",{number:l,Complex:f,"Complex, boolean":f,BigNumber:function(e){return e.cbrt()},Unit:function(e){{if(e.value&&a.isComplex(e.value)){var t=e.clone();return t.value=1,(t=t.pow(1/3)).value=f(e.value),t}var r,n=u(e.value);n&&(e.value=o(e.value)),r=a.isBigNumber(e.value)?new a.BigNumber(1).div(3):a.isFraction(e.value)?new a.Fraction(1,3):1/3;var i=e.pow(r);return n&&(i.value=o(i.value)),i}},"Array | Matrix":function(e){return i(e,r,!0)}});function f(e,t){var r=e.arg()/3,n=e.abs(),i=new a.Complex(l(n),0).mul(new a.Complex(0,r).exp());if(t){var o=[i,new a.Complex(l(n),0).mul(new a.Complex(0,r+2*Math.PI/3).exp()),new a.Complex(l(n),0).mul(new a.Complex(0,r-2*Math.PI/3).exp())];return"Array"===s.matrix?o:c(o)}return i}return r.toTex={1:"\\sqrt[3]{${args[0]}}"},r}},function(e,t,r){"use strict";var o=r(1);t.name="cube",t.factory=function(e,t,r,n){var i=n("cube",{number:function(e){return e*e*e},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)},"Array | Matrix":function(e){return o(e,i,!0)},Unit:function(e){return e.pow(3)}});return i.toTex={1:"\\left(${args[0]}\\right)^3"},i}},function(e,t,m){"use strict";t.name="dotMultiply",t.factory=function(e,t,r,n){var i=r(m(0)),o=r(m(21)),a=m(4),s=r(m(27)),u=r(m(139)),c=r(m(20)),f=r(m(7)),l=r(m(6)),p=n("dotMultiply",{"any, any":o,"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,o,!1)},"SparseMatrix, DenseMatrix":function(e,t){return s(t,e,o,!0)},"DenseMatrix, SparseMatrix":function(e,t){return s(e,t,o,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,o)},"Array, Array":function(e,t){return p(i(e),i(t)).valueOf()},"Array, Matrix":function(e,t){return p(i(e),t)},"Matrix, Array":function(e,t){return p(e,i(t))},"SparseMatrix, any":function(e,t){return c(e,t,o,!1)},"DenseMatrix, any":function(e,t){return l(e,t,o,!1)},"any, SparseMatrix":function(e,t){return c(t,e,o,!0)},"any, DenseMatrix":function(e,t){return l(t,e,o,!0)},"Array, any":function(e,t){return l(i(e),t,o,!1).valueOf()},"any, Array":function(e,t){return l(i(t),e,o,!0).valueOf()}});return p.toTex={2:"\\left(${args[0]}".concat(a.operators.dotMultiply,"${args[1]}\\right)")},p}},function(e,t,h){"use strict";t.name="dotPow",t.factory=function(e,t,r,n){var i=r(h(0)),o=r(h(42)),a=h(4),s=r(h(18)),u=r(h(29)),c=r(h(20)),f=r(h(19)),l=r(h(7)),p=r(h(6)),m=n("dotPow",{"any, any":o,"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,o,!1)},"SparseMatrix, DenseMatrix":function(e,t){return s(t,e,o,!0)},"DenseMatrix, SparseMatrix":function(e,t){return s(e,t,o,!1)},"DenseMatrix, DenseMatrix":function(e,t){return l(e,t,o)},"Array, Array":function(e,t){return m(i(e),i(t)).valueOf()},"Array, Matrix":function(e,t){return m(i(e),t)},"Matrix, Array":function(e,t){return m(e,i(t))},"SparseMatrix, any":function(e,t){return c(e,t,m,!1)},"DenseMatrix, any":function(e,t){return p(e,t,m,!1)},"any, SparseMatrix":function(e,t){return f(t,e,m,!0)},"any, DenseMatrix":function(e,t){return p(t,e,m,!0)},"Array, any":function(e,t){return p(i(e),t,m,!1).valueOf()},"any, Array":function(e,t){return p(i(t),e,m,!0).valueOf()}});return m.toTex={2:"\\left(${args[0]}".concat(a.operators.dotPow,"${args[1]}\\right)")},m}},function(e,t,r){"use strict";var o=r(1);t.name="exp",t.factory=function(e,t,r,n){var i=n("exp",{number:Math.exp,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\exp\\left(${args[0]}\\right)"},i}},function(e,t,a){"use strict";var s=a(1);t.name="expm1",t.factory=function(r,e,t,n){var i=a(4),o=n("expm1",{number:Math.expm1||function(e){return 2e-4<=e||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6},Complex:function(e){var t=Math.exp(e.re);return new r.Complex(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)},"Array | Matrix":function(e){return s(e,o)}});return o.toTex="\\left(e".concat(i.operators.pow,"{${args[0]}}-1\\right)"),o}},function(e,t,l){"use strict";var n=l(3).isInteger;function p(e,t){if(!n(e)||!n(t))throw new Error("Parameters in function gcd must be integer numbers");for(var r;0!==t;)r=e%t,e=t,t=r;return e<0?-e:e}t.name="gcd",t.factory=function(i,e,t,r){var n=t(l(0)),o=t(l(37)),a=t(l(85)),s=t(l(41)),u=t(l(7)),c=t(l(6)),f=r("gcd",{"number, number":p,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function gcd must be integer numbers");var r=new i.BigNumber(0);for(;!t.isZero();){var n=e.mod(t);e=t,t=n}return e.lt(r)?e.neg():e},"Fraction, Fraction":function(e,t){return e.gcd(t)},"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,f)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,f,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,f,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,f)},"Array, Array":function(e,t){return f(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return f(n(e),t)},"Matrix, Array":function(e,t){return f(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return s(e,t,f,!1)},"DenseMatrix, number | BigNumber":function(e,t){return c(e,t,f,!1)},"number | BigNumber, SparseMatrix":function(e,t){return s(t,e,f,!0)},"number | BigNumber, DenseMatrix":function(e,t){return c(t,e,f,!0)},"Array, number | BigNumber":function(e,t){return c(n(e),t,f,!1).valueOf()},"number | BigNumber, Array":function(e,t){return c(n(t),e,f,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(e,t,r){for(var n=f(e,t),i=0;i<r.length;i++)n=f(n,r[i]);return n}});return f.toTex="\\gcd\\left(${args}\\right)",f}},function(e,t,p){"use strict";var m=p(2).flatten;t.name="hypot",t.factory=function(e,t,r,n){var o=r(p(25)),a=r(p(17)),s=r(p(12)),u=r(p(21)),c=r(p(46)),f=r(p(38)),l=r(p(73)),i=n("hypot",{"... number | BigNumber":function(e){for(var t=0,r=0,n=0;n<e.length;n++){var i=o(e[n]);f(r,i)?(t=u(t,u(s(r,i),s(r,i))),t=a(t,1),r=i):t=a(t,l(i)?u(s(i,r),s(i,r)):i)}return u(r,c(t))},Array:function(e){return i.apply(i,m(e))},Matrix:function(e){return i.apply(i,m(e.toArray()))}});return i.toTex="\\hypot\\left(${args}\\right)",i}},function(e,t,l){"use strict";var i=l(3).isInteger;function p(e,t){if(!i(e)||!i(t))throw new Error("Parameters in function lcm must be integer numbers");if(0===e||0===t)return 0;for(var r,n=e*t;0!==t;)t=e%(r=t),e=r;return Math.abs(n/e)}t.name="lcm",t.factory=function(i,e,t,r){var n=t(l(0)),o=t(l(27)),a=t(l(74)),s=t(l(20)),u=t(l(7)),c=t(l(6)),f=r("lcm",{"number, number":p,"BigNumber, BigNumber":function(e,t){if(!e.isInt()||!t.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(e.isZero()||t.isZero())return new i.BigNumber(0);var r=e.times(t);for(;!t.isZero();){var n=t;t=e.mod(n),e=n}return r.div(e).abs()},"Fraction, Fraction":function(e,t){return e.lcm(t)},"SparseMatrix, SparseMatrix":function(e,t){return a(e,t,f)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,f,!0)},"DenseMatrix, SparseMatrix":function(e,t){return o(e,t,f,!1)},"DenseMatrix, DenseMatrix":function(e,t){return u(e,t,f)},"Array, Array":function(e,t){return f(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return f(n(e),t)},"Matrix, Array":function(e,t){return f(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return s(e,t,f,!1)},"DenseMatrix, number | BigNumber":function(e,t){return c(e,t,f,!1)},"number | BigNumber, SparseMatrix":function(e,t){return s(t,e,f,!0)},"number | BigNumber, DenseMatrix":function(e,t){return c(t,e,f,!0)},"Array, number | BigNumber":function(e,t){return c(n(e),t,f,!1).valueOf()},"number | BigNumber, Array":function(e,t){return c(n(t),e,f,!0).valueOf()},"Array | Matrix | number | BigNumber, Array | Matrix | number | BigNumber, ...Array | Matrix | number | BigNumber":function(e,t,r){for(var n=f(e,t),i=0;i<r.length;i++)n=f(n,r[i]);return n}});return f.toTex=void 0,f}},function(e){"use strict";e.exports=function(e,t,r,n,i,o,a,s,u,c,f){var l,p,m,h,d=e._values,y=e._index,g=e._ptr,v=a._index;if(n)for(p=g[t],m=g[t+1],l=p;l<m;l++)r[h=y[l]]!==o?(r[h]=o,v.push(h),c?(n[h]=u?s(d[l],f):s(f,d[l]),i[h]=o):n[h]=d[l]):(n[h]=u?s(d[l],n[h]):s(n[h],d[l]),i[h]=o);else for(p=g[t],m=g[t+1],l=p;l<m;l++)r[h=y[l]]!==o?(r[h]=o,v.push(h)):i[h]=o}},function(e,t,r){"use strict";var o=r(1);var a=Math.log10||function(e){return Math.log(e)/Math.LN10};t.name="log10",t.factory=function(t,r,e,n){var i=n("log10",{number:function(e){return 0<=e||r.predictable?a(e):new t.Complex(e,0).log().div(Math.LN10)},Complex:function(e){return new t.Complex(e).log().div(Math.LN10)},BigNumber:function(e){return!e.isNegative()||r.predictable?e.log():new t.Complex(e.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\log_{10}\\left(${args[0]}\\right)"},i}},function(e,t,u){"use strict";var c=u(1);t.name="log1p",t.factory=function(r,n,e,t){var i=e(u(12)),o=e(u(91)),a=t("log1p",{number:function(e){return-1<=e||n.predictable?Math.log1p?Math.log1p(e):Math.log(e+1):s(new r.Complex(e,0))},Complex:s,BigNumber:function(e){var t=e.plus(1);return!t.isNegative()||n.predictable?t.ln():s(new r.Complex(e.toNumber(),0))},"Array | Matrix":function(e){return c(e,a)},"any, any":function(e,t){return i(a(e),o(t))}});function s(e){var t=e.re+1;return new r.Complex(Math.log(Math.sqrt(t*t+e.im*e.im)),Math.atan2(e.im,t))}return a.toTex={1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},a}},function(e,t,r){"use strict";var a=r(1);t.name="log2",t.factory=function(r,t,e,n){var i=n("log2",{number:function(e){return 0<=e||t.predictable?Math.log2?Math.log2(e):Math.log(e)/Math.LN2:o(new r.Complex(e,0))},Complex:o,BigNumber:function(e){return!e.isNegative()||t.predictable?e.log(2):o(new r.Complex(e.toNumber(),0))},"Array | Matrix":function(e){return a(e,i)}});function o(e){var t=Math.sqrt(e.re*e.re+e.im*e.im);return new r.Complex(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}return i.toTex="\\log_{2}\\left(${args[0]}\\right)",i}},function(e,t,h){"use strict";t.name="mod",t.factory=function(e,t,r,n){var i=r(h(0)),o=h(4),a=r(h(27)),s=r(h(18)),u=r(h(66)),c=r(h(20)),f=r(h(19)),l=r(h(7)),p=r(h(6)),m=n("mod",{"number, number":function(e,t){{if(0<t)return e-t*Math.floor(e/t);if(0===t)return e;throw new Error("Cannot calculate mod for a negative divisor")}},"BigNumber, BigNumber":function(e,t){return t.isZero()?e:e.mod(t)},"Fraction, Fraction":function(e,t){return e.mod(t)},"SparseMatrix, SparseMatrix":function(e,t){return u(e,t,m,!1)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,m,!0)},"DenseMatrix, SparseMatrix":function(e,t){return s(e,t,m,!1)},"DenseMatrix, DenseMatrix":function(e,t){return l(e,t,m)},"Array, Array":function(e,t){return m(i(e),i(t)).valueOf()},"Array, Matrix":function(e,t){return m(i(e),t)},"Matrix, Array":function(e,t){return m(e,i(t))},"SparseMatrix, any":function(e,t){return c(e,t,m,!1)},"DenseMatrix, any":function(e,t){return p(e,t,m,!1)},"any, SparseMatrix":function(e,t){return f(t,e,m,!0)},"any, DenseMatrix":function(e,t){return p(t,e,m,!0)},"Array, any":function(e,t){return p(i(e),t,m,!1).valueOf()},"any, Array":function(e,t){return p(i(t),e,m,!0).valueOf()}});return m.toTex={2:"\\left(${args[0]}".concat(o.operators.mod,"${args[1]}\\right)")},m}},function(e,t,a){"use strict";t.name="norm",t.factory=function(e,t,r,n){var l=r(a(25)),p=r(a(14)),m=r(a(42)),h=r(a(71)),d=r(a(46)),y=r(a(10)),g=r(a(11)),v=r(a(33)),x=r(a(38)),i=r(a(0)),o=n("norm",{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 b(i(e),2)},Matrix:function(e){return b(e,2)},"number | Complex | BigNumber | boolean, number | BigNumber | string":function(e){return o(e)},"Array, number | BigNumber | string":function(e,t){return b(i(e),t)},"Matrix, number | BigNumber | string":function(e,t){return b(e,t)}});function b(e,t){var r=e.size();if(1===r.length){if(t===Number.POSITIVE_INFINITY||"inf"===t){var n=0;return e.forEach(function(e){var t=l(e);v(t,n)&&(n=t)},!0),n}var i;if(t===Number.NEGATIVE_INFINITY||"-inf"===t)return e.forEach(function(e){var t=l(e);i&&!x(t,i)||(i=t)},!0),i||0;if("fro"===t)return b(e,2);if("number"!=typeof t||isNaN(t))throw new Error("Unsupported parameter value");if(g(t,0))return Number.POSITIVE_INFINITY;var o=0;return e.forEach(function(e){o=p(m(l(e),t),o)},!0),m(o,1/t)}if(2===r.length){if(1===t){var a=[],s=0;return e.forEach(function(e,t){var r=t[1],n=p(a[r]||0,l(e));v(n,s)&&(s=n),a[r]=n},!0),s}if(t===Number.POSITIVE_INFINITY||"inf"===t){var u=[],c=0;return e.forEach(function(e,t){var r=t[0],n=p(u[r]||0,l(e));v(n,c)&&(c=n),u[r]=n},!0),c}if("fro"===t){var f=0;return e.forEach(function(e){f=p(f,y(e,h(e)))}),l(d(f))}if(2===t)throw new Error("Unsupported parameter value, missing implementation of matrix singular value decomposition");throw new Error("Unsupported parameter value")}}return o.toTex={1:"\\left\\|${args[0]}\\right\\|",2:void 0},o}},function(e,t,h){"use strict";function d(e,t){var r=t<0;if(r&&(t=-t),0===t)throw new Error("Root must be non-zero");if(e<0&&Math.abs(t)%2!=1)throw new Error("Root must be odd when a is negative.");if(0===e)return r?1/0:0;if(!isFinite(e))return r?0:e;var n=Math.pow(Math.abs(e),1/t);return n=e<0?-n:n,r?1/n:n}t.name="nthRoot",t.factory=function(u,e,t,r){var n=t(h(0)),i=t(h(37)),o=t(h(27)),a=t(h(74)),s=t(h(20)),c=t(h(7)),f=t(h(6)),l="Complex number not supported in function nthRoot. Use nthRoots instead.",p=r("nthRoot",{number:function(e){return d(e,2)},"number, number":d,BigNumber:function(e){return m(e,new u.BigNumber(2))},Complex:function(){throw new Error(l)},"Complex, number":function(){throw new Error(l)},"BigNumber, BigNumber":m,"Array | Matrix":function(e){return p(e,2)},"SparseMatrix, SparseMatrix":function(e,t){if(1===t.density())return a(e,t,p);throw new Error("Root must be non-zero")},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,p,!0)},"DenseMatrix, SparseMatrix":function(e,t){if(1===t.density())return i(e,t,p,!1);throw new Error("Root must be non-zero")},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,p)},"Array, Array":function(e,t){return p(n(e),n(t)).valueOf()},"Array, Matrix":function(e,t){return p(n(e),t)},"Matrix, Array":function(e,t){return p(e,n(t))},"SparseMatrix, number | BigNumber":function(e,t){return s(e,t,p,!1)},"DenseMatrix, number | BigNumber":function(e,t){return f(e,t,p,!1)},"number | BigNumber, SparseMatrix":function(e,t){if(1===t.density())return s(t,e,p,!0);throw new Error("Root must be non-zero")},"number | BigNumber, DenseMatrix":function(e,t){return f(t,e,p,!0)},"Array, number | BigNumber":function(e,t){return p(n(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return p(e,n(t)).valueOf()}});return p.toTex={2:"\\sqrt[${args[1]}]{${args[0]}}"},p;function m(e,t){var r=u.BigNumber.precision,n=u.BigNumber.clone({precision:r+2}),i=new u.BigNumber(0),o=new n(1),a=t.isNegative();if(a&&(t=t.neg()),t.isZero())throw new Error("Root must be non-zero");if(e.isNegative()&&!t.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(e.isZero())return a?new n(1/0):0;if(!e.isFinite())return a?i:e;var s=e.abs().pow(o.div(t));return s=e.isNeg()?s.neg():s,new u.BigNumber((a?o.div(s):s).toPrecision(r))}}},function(e,t,r){"use strict";var n=r(82),i=r(103),f=n.factory("Complex",{},"",i,{on:function(){}});var l=[function(e){return f(e)},function(e){return f(0,e)},function(e){return f(-e)},function(e){return f(0,-e)}];function o(e,t){if(t<0)throw new Error("Root must be greater than zero");if(0===t)throw new Error("Root must be non-zero");if(t%1!=0)throw new Error("Root must be an integer");if(0===e||0===e.abs())return[f(0)];var r,n="number"==typeof e;!n&&0!==e.re&&0!==e.im||(r=n?2*+(e<0):0===e.im?2*+(e.re<0):2*+(e.im<0)+1);for(var i=e.arg(),o=e.abs(),a=[],s=Math.pow(o,1/t),u=0;u<t;u++){var c=(r+4*u)/t;c!==Math.round(c)?a.push(f({r:s,phi:(i+2*Math.PI*u)/t})):a.push(l[c%4](s))}return a}t.name="nthRoots",t.factory=function(e,t,r,n){var i=n("nthRoots",{Complex:function(e){return o(e,2)},"Complex, number":o});return i.toTex={2:"\\{y : $y^{args[1]} = {${args[0]}}\\}"},i}},function(e,t,r){"use strict";var o=r(1);t.name="square",t.factory=function(e,t,r,n){var i=n("square",{number:function(e){return e*e},Complex:function(e){return e.mul(e)},BigNumber:function(e){return e.times(e)},Fraction:function(e){return e.mul(e)},"Array | Matrix":function(e){return o(e,i,!0)},Unit:function(e){return e.pow(2)}});return i.toTex={1:"\\left(${args[0]}\\right)^2"},i}},function(e,t,a){"use strict";var s=a(1);t.name="unaryPlus",t.factory=function(t,r,e,n){var i=a(4),o=n("unaryPlus",{number:function(e){return e},Complex:function(e){return e},BigNumber:function(e){return e},Fraction:function(e){return e},Unit:function(e){return e.clone()},"Array | Matrix":function(e){return s(e,o,!0)},"boolean | string":function(e){return"BigNumber"===r.number?new t.BigNumber(+e):+e}});return o.toTex={1:"".concat(i.operators.unaryPlus,"\\left(${args[0]}\\right)")},o}},function(e,t,n){"use strict";var f=n(3).isInteger;t.name="xgcd",t.factory=function(p,m,e,t){var h=e(n(0)),r=t("xgcd",{"number, number":function(e,t){var r,n,i,o,a=0,s=1,u=1,c=0;if(!f(e)||!f(t))throw new Error("Parameters in function xgcd must be integer numbers");for(;t;)n=Math.floor(e/t),i=e-n*t,a=s-n*(r=a),s=r,u=c-n*(r=u),c=r,e=t,t=i;o=e<0?[-e,-s,-c]:[e,e?s:0,c];return"Array"===m.matrix?o:h(o)},"BigNumber, BigNumber":function(e,t){var r,n,i,o,a=new p.BigNumber(0),s=new p.BigNumber(1),u=a,c=s,f=s,l=a;if(!e.isInt()||!t.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!t.isZero();)n=e.div(t).floor(),i=e.mod(t),r=u,u=c.minus(n.times(u)),c=r,r=f,f=l.minus(n.times(f)),l=r,e=t,t=i;o=e.lt(a)?[e.neg(),c.neg(),l.neg()]:[e,e.isZero()?0:c,l];return"Array"===m.matrix?o:h(o)}});return r.toTex=void 0,r}},function(e,t,r){"use strict";e.exports=[r(246),r(248),r(249),r(251),r(253),r(255),r(257)]},function(e,t,p){"use strict";var m=p(3).isInteger,h=p(247);t.name="bitAnd",t.factory=function(e,t,r,n){var i=p(4),o=r(p(0)),a=r(p(27)),s=r(p(74)),u=r(p(20)),c=r(p(7)),f=r(p(6)),l=n("bitAnd",{"number, number":function(e,t){if(!m(e)||!m(t))throw new Error("Integers expected in function bitAnd");return e&t},"BigNumber, BigNumber":h,"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,l,!1)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,l,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,l,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,l)},"Array, Array":function(e,t){return l(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return l(o(e),t)},"Matrix, Array":function(e,t){return l(e,o(t))},"SparseMatrix, any":function(e,t){return u(e,t,l,!1)},"DenseMatrix, any":function(e,t){return f(e,t,l,!1)},"any, SparseMatrix":function(e,t){return u(t,e,l,!0)},"any, DenseMatrix":function(e,t){return f(t,e,l,!0)},"Array, any":function(e,t){return f(o(e),t,l,!1).valueOf()},"any, Array":function(e,t){return f(o(t),e,l,!0).valueOf()}});return l.toTex={2:"\\left(${args[0]}".concat(i.operators.bitAnd,"${args[1]}\\right)")},l}},function(e,t,r){"use strict";var n=r(92);e.exports=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitAnd");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new r(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e}return n(e,t,function(e,t){return e&t})}},function(e,t,a){"use strict";var s=a(1),u=a(93),c=a(3).isInteger;t.name="bitNot",t.factory=function(e,t,r,n){var i=a(4),o=n("bitNot",{number:function(e){if(!c(e))throw new Error("Integer expected in function bitNot");return~e},BigNumber:u,"Array | Matrix":function(e){return s(e,o)}});return o.toTex={1:i.operators.bitNot+"\\left(${args[0]}\\right)"},o}},function(e,t,p){"use strict";var m=p(3).isInteger,h=p(250);t.name="bitOr",t.factory=function(e,t,r,n){var i=p(4),o=r(p(0)),a=r(p(37)),s=r(p(85)),u=r(p(41)),c=r(p(7)),f=r(p(6)),l=n("bitOr",{"number, number":function(e,t){if(!m(e)||!m(t))throw new Error("Integers expected in function bitOr");return e|t},"BigNumber, BigNumber":h,"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,l)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,l,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,l,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,l)},"Array, Array":function(e,t){return l(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return l(o(e),t)},"Matrix, Array":function(e,t){return l(e,o(t))},"SparseMatrix, any":function(e,t){return u(e,t,l,!1)},"DenseMatrix, any":function(e,t){return f(e,t,l,!1)},"any, SparseMatrix":function(e,t){return u(t,e,l,!0)},"any, DenseMatrix":function(e,t){return f(t,e,l,!0)},"Array, any":function(e,t){return f(o(e),t,l,!1).valueOf()},"any, Array":function(e,t){return f(o(t),e,l,!0).valueOf()}});return l.toTex={2:"\\left(${args[0]}".concat(i.operators.bitOr,"${args[1]}\\right)")},l}},function(e,t,r){"use strict";var i=r(92);e.exports=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitOr");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);var n=new r(-1);return e.isZero()||t.eq(n)||e.eq(t)?t:t.isZero()||e.eq(n)?e:e.isFinite()&&t.isFinite()?i(e,t,function(e,t){return e|t}):!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?n:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e}},function(e,t,p){"use strict";var m=p(3).isInteger,h=p(252);t.name="bitXor",t.factory=function(e,t,r,n){var i=p(4),o=r(p(0)),a=r(p(18)),s=r(p(29)),u=r(p(19)),c=r(p(7)),f=r(p(6)),l=n("bitXor",{"number, number":function(e,t){if(!m(e)||!m(t))throw new Error("Integers expected in function bitXor");return e^t},"BigNumber, BigNumber":h,"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,l)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,l,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,l,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,l)},"Array, Array":function(e,t){return l(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return l(o(e),t)},"Matrix, Array":function(e,t){return l(e,o(t))},"SparseMatrix, any":function(e,t){return u(e,t,l,!1)},"DenseMatrix, any":function(e,t){return f(e,t,l,!1)},"any, SparseMatrix":function(e,t){return u(t,e,l,!0)},"any, DenseMatrix":function(e,t){return f(t,e,l,!0)},"Array, any":function(e,t){return f(o(e),t,l,!1).valueOf()},"any, Array":function(e,t){return f(o(t),e,l,!0).valueOf()}});return l.toTex={2:"\\left(${args[0]}".concat(i.operators.bitXor,"${args[1]}\\right)")},l}},function(e,t,r){"use strict";var i=r(92),o=r(93);e.exports=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function bitXor");var r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new r(0);var n=new r(-1);return e.eq(n)?o(t):t.eq(n)?o(e):e.isFinite()&&t.isFinite()?i(e,t,function(e,t){return e^t}):e.isFinite()||t.isFinite()?new r(e.isNegative()===t.isNegative()?1/0:-1/0):n}},function(e,t,y){"use strict";var g=y(3).isInteger,v=y(254);t.name="leftShift",t.factory=function(e,t,r,n){var i=y(4),o=r(y(0)),a=r(y(11)),s=r(y(43)),u=r(y(37)),c=r(y(27)),f=r(y(94)),l=r(y(41)),p=r(y(20)),m=r(y(7)),h=r(y(6)),d=n("leftShift",{"number, number":function(e,t){if(!g(e)||!g(t))throw new Error("Integers expected in function leftShift");return e<<t},"BigNumber, BigNumber":v,"SparseMatrix, SparseMatrix":function(e,t){return f(e,t,d,!1)},"SparseMatrix, DenseMatrix":function(e,t){return c(t,e,d,!0)},"DenseMatrix, SparseMatrix":function(e,t){return u(e,t,d,!1)},"DenseMatrix, DenseMatrix":function(e,t){return m(e,t,d)},"Array, Array":function(e,t){return d(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return d(o(e),t)},"Matrix, Array":function(e,t){return d(e,o(t))},"SparseMatrix, number | BigNumber":function(e,t){return a(t,0)?e.clone():p(e,t,d,!1)},"DenseMatrix, number | BigNumber":function(e,t){return a(t,0)?e.clone():h(e,t,d,!1)},"number | BigNumber, SparseMatrix":function(e,t){return a(e,0)?s(t.size(),t.storage()):l(t,e,d,!0)},"number | BigNumber, DenseMatrix":function(e,t){return a(e,0)?s(t.size(),t.storage()):h(t,e,d,!0)},"Array, number | BigNumber":function(e,t){return d(o(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return d(e,o(t)).valueOf()}});return d.toTex={2:"\\left(${args[0]}".concat(i.operators.leftShift,"${args[1]}\\right)")},d}},function(e){"use strict";e.exports=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function leftShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:e.isFinite()||t.isFinite()?t.lt(55)?e.times(Math.pow(2,t.toNumber())+""):e.times(new r(2).pow(t)):new r(NaN)}},function(e,t,y){"use strict";var g=y(3).isInteger,v=y(256);t.name="rightArithShift",t.factory=function(e,t,r,n){var i=y(4),o=r(y(0)),a=r(y(11)),s=r(y(43)),u=r(y(37)),c=r(y(27)),f=r(y(94)),l=r(y(41)),p=r(y(20)),m=r(y(7)),h=r(y(6)),d=n("rightArithShift",{"number, number":function(e,t){if(!g(e)||!g(t))throw new Error("Integers expected in function rightArithShift");return e>>t},"BigNumber, BigNumber":v,"SparseMatrix, SparseMatrix":function(e,t){return f(e,t,d,!1)},"SparseMatrix, DenseMatrix":function(e,t){return c(t,e,d,!0)},"DenseMatrix, SparseMatrix":function(e,t){return u(e,t,d,!1)},"DenseMatrix, DenseMatrix":function(e,t){return m(e,t,d)},"Array, Array":function(e,t){return d(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return d(o(e),t)},"Matrix, Array":function(e,t){return d(e,o(t))},"SparseMatrix, number | BigNumber":function(e,t){return a(t,0)?e.clone():p(e,t,d,!1)},"DenseMatrix, number | BigNumber":function(e,t){return a(t,0)?e.clone():h(e,t,d,!1)},"number | BigNumber, SparseMatrix":function(e,t){return a(e,0)?s(t.size(),t.storage()):l(t,e,d,!0)},"number | BigNumber, DenseMatrix":function(e,t){return a(e,0)?s(t.size(),t.storage()):h(t,e,d,!0)},"Array, number | BigNumber":function(e,t){return d(o(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return d(e,o(t)).valueOf()}});return d.toTex={2:"\\left(${args[0]}".concat(i.operators.rightArithShift,"${args[1]}\\right)")},d}},function(e){"use strict";e.exports=function(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error("Integers expected in function rightArithShift");var r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:t.isFinite()?t.lt(55)?e.div(Math.pow(2,t.toNumber())+"").floor():e.div(new r(2).pow(t)).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}},function(e,t,y){"use strict";var g=y(3).isInteger;t.name="rightLogShift",t.factory=function(e,t,r,n){var i=y(4),o=r(y(0)),a=r(y(11)),s=r(y(43)),u=r(y(37)),c=r(y(27)),f=r(y(94)),l=r(y(41)),p=r(y(20)),m=r(y(7)),h=r(y(6)),d=n("rightLogShift",{"number, number":function(e,t){if(!g(e)||!g(t))throw new Error("Integers expected in function rightLogShift");return e>>>t},"SparseMatrix, SparseMatrix":function(e,t){return f(e,t,d,!1)},"SparseMatrix, DenseMatrix":function(e,t){return c(t,e,d,!0)},"DenseMatrix, SparseMatrix":function(e,t){return u(e,t,d,!1)},"DenseMatrix, DenseMatrix":function(e,t){return m(e,t,d)},"Array, Array":function(e,t){return d(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return d(o(e),t)},"Matrix, Array":function(e,t){return d(e,o(t))},"SparseMatrix, number | BigNumber":function(e,t){return a(t,0)?e.clone():p(e,t,d,!1)},"DenseMatrix, number | BigNumber":function(e,t){return a(t,0)?e.clone():h(e,t,d,!1)},"number | BigNumber, SparseMatrix":function(e,t){return a(e,0)?s(t.size(),t.storage()):l(t,e,d,!0)},"number | BigNumber, DenseMatrix":function(e,t){return a(e,0)?s(t.size(),t.storage()):h(t,e,d,!0)},"Array, number | BigNumber":function(e,t){return d(o(e),t).valueOf()},"number | BigNumber, Array":function(e,t){return d(e,o(t)).valueOf()}});return d.toTex={2:"\\left(${args[0]}".concat(i.operators.rightLogShift,"${args[1]}\\right)")},d}},function(e,t,r){"use strict";e.exports=[r(259),r(260),r(140),r(261)]},function(e,t,c){"use strict";t.name="bellNumbers",t.factory=function(e,t,r,n){var i=r(c(14)),o=r(c(140)),a=r(c(61)),s=r(c(34)),u=n("bellNumbers",{"number | BigNumber":function(e){if(!s(e)||a(e))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var t=0,r=0;r<=e;r++)t=i(t,o(e,r));return t}});return u.toTex={1:"\\mathrm{B}_{${args[0]}}"},u}},function(e,t,f){"use strict";t.name="composition",t.factory=function(e,t,r,n){var i=r(f(76)),o=r(f(17)),a=r(f(73)),s=r(f(34)),u=r(f(33)),c=n("composition",{"number | BigNumber, number | BigNumber":function(e,t){if(!(s(e)&&a(e)&&s(t)&&a(t)))throw new TypeError("Positive integer value expected in function composition");if(u(t,e))throw new TypeError("k must be less than or equal to n in function composition");return i(o(e,-1),o(t,-1))}});return c.toTex=void 0,c}},function(e,t,l){"use strict";t.name="catalan",t.factory=function(e,t,r,n){var i=r(l(14)),o=r(l(45)),a=r(l(10)),s=r(l(76)),u=r(l(61)),c=r(l(34)),f=n("catalan",{"number | BigNumber":function(e){if(!c(e)||u(e))throw new TypeError("Non-negative integer value expected in function catalan");return o(s(a(e,2),e),i(e,1))}});return f.toTex={1:"\\mathrm{C}_{${args[0]}}"},f}},function(e,t,r){"use strict";e.exports=[r(263),r(71),r(264),r(265)]},function(e,t,r){"use strict";var o=r(1);t.name="arg",t.factory=function(t,e,r,n){var i=n("arg",{number:function(e){return Math.atan2(0,e)},BigNumber:function(e){return t.BigNumber.atan2(0,e)},Complex:function(e){return e.arg()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\arg\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="im",t.factory=function(e,t,r,n){var i=n("im",{number:function(){return 0},BigNumber:function(){return new e.BigNumber(0)},Complex:function(e){return e.im},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},i}},function(e,t,r){"use strict";var o=r(1);t.name="re",t.factory=function(e,t,r,n){var i=n("re",{number:function(e){return e},BigNumber:function(e){return e},Complex:function(e){return e.re},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},i}},function(e,t,r){"use strict";e.exports=[r(267),r(268)]},function(e,t,u){"use strict";t.name="intersect",t.factory=function(t,h,e,r){var d=e(u(25)),y=e(u(14)),A=e(u(17)),i=e(u(0)),g=e(u(10)),S=e(u(21)),O=e(u(12)),T=e(u(15)),v=e(u(38)),_=e(u(11)),o=r("intersect",{"Array, Array, Array":function(e,t,r){if(!s(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!s(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!function(e){return 4===e.length&&n(e[0])&&n(e[1])&&n(e[2])&&n(e[3])}(r))throw new TypeError("Array with 4 numbers expected as third argument");return function(e,t,r,n,i,o,a,s,u,c){var f=S(e,a),l=S(n,a),p=S(t,s),m=S(i,s),h=S(r,u),d=S(o,u),y=O(T(T(T(c,f),p),h),T(T(T(A(A(l,m),d),f),p),h)),g=A(e,S(y,T(n,e))),v=A(t,S(y,T(i,t))),x=A(r,S(y,T(o,r)));return[g,v,x]}(e[0],e[1],e[2],t[0],t[1],t[2],r[0],r[1],r[2],r[3])},"Array, Array, Array, Array":function(e,t,r,n){if(2===e.length){if(!a(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!a(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!a(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!a(n))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return function(e,t,r,n){var i=e,o=r,a=T(i,t),s=T(o,n),u=T(S(a[0],s[1]),S(s[0],a[1]));if(v(d(u),h.epsilon))return null;var c=S(s[0],i[1]),f=S(s[1],i[0]),l=S(s[0],o[1]),p=S(s[1],o[0]),m=O(A(T(T(c,f),l),p),u);return y(g(a,m),i)}(e,t,r,n)}if(3!==e.length)throw new TypeError("Arrays with two or thee dimensional points expected");if(!s(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!s(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!s(r))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!s(n))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return function(e,t,r,n,i,o,a,s,u,c,f,l){var p=C(e,a,c,a,t,s,f,s,r,u,l,u),m=C(c,a,n,e,f,s,i,t,l,u,o,r),h=C(e,a,n,e,t,s,i,t,r,u,o,r),d=C(c,a,c,a,f,s,f,s,l,u,l,u),y=C(n,e,n,e,i,t,i,t,o,r,o,r),g=O(T(S(p,m),S(h,d)),T(S(y,d),S(m,m))),v=O(A(p,S(g,m)),d),x=A(e,S(g,T(n,e))),b=A(t,S(g,T(i,t))),w=A(r,S(g,T(o,r))),N=A(a,S(v,T(c,a))),M=A(s,S(v,T(f,s))),E=A(u,S(v,T(l,u)));return _(x,N)&&_(b,M)&&_(w,E)?[x,b,w]:null}(e[0],e[1],e[2],t[0],t[1],t[2],r[0],r[1],r[2],n[0],n[1],n[2])},"Matrix, Matrix, Matrix":function(e,t,r){return i(o(e.valueOf(),t.valueOf(),r.valueOf()))},"Matrix, Matrix, Matrix, Matrix":function(e,t,r,n){return i(o(e.valueOf(),t.valueOf(),r.valueOf(),n.valueOf()))}});function n(e){return"number"==typeof e||t.isBigNumber(e)}function a(e){return 2===e.length&&n(e[0])&&n(e[1])}function s(e){return 3===e.length&&n(e[0])&&n(e[1])&&n(e[2])}function C(e,t,r,n,i,o,a,s,u,c,f,l){var p=S(T(e,t),T(r,n)),m=S(T(i,o),T(a,s)),h=S(T(u,c),T(f,l));return A(A(p,m),h)}return o}},function(e,t,b){"use strict";t.name="distance",t.factory=function(t,e,r,n){var l=r(b(17)),p=r(b(15)),m=r(b(21)),h=r(b(12)),s=r(b(39)),d=r(b(46)),u=r(b(25));function i(e){return"number"==typeof e||t.isBigNumber(e)}function c(e){return e.constructor!==Array&&(e=f(e)),i(e[0])&&i(e[1])}function o(e){return e.constructor!==Array&&(e=f(e)),i(e[0])&&i(e[1])&&i(e[2])}function a(e){return e.constructor!==Array&&(e=f(e)),i(e[0])&&i(e[1])&&i(e[2])&&i(e[3])&&i(e[4])&&i(e[5])}function f(e){for(var t=Object.keys(e),r=[],n=0;n<t.length;n++)r.push(e[t[n]]);return r}function y(e,t,r,n,i){var o=u(l(l(m(r,e),m(n,t)),i)),a=d(l(m(r,r),m(n,n)));return h(o,a)}function g(e,t,r,n,i,o,a,s,u){var c=[p(m(p(i,t),u),m(p(o,r),s)),p(m(p(o,r),a),m(p(n,e),u)),p(m(p(n,e),s),m(p(i,t),a))];c=d(l(l(m(c[0],c[0]),m(c[1],c[1])),m(c[2],c[2])));var f=d(l(l(m(a,a),m(s,s)),m(u,u)));return h(c,f)}function v(e,t,r,n){var i=p(n,t),o=p(r,e),a=l(m(i,i),m(o,o));return d(a)}function x(e,t,r,n,i,o){var a=p(o,r),s=p(i,t),u=p(n,e),c=l(l(m(a,a),m(s,s)),m(u,u));return d(c)}return n("distance",{"Array, Array, Array":function(e,t,r){if(2!==e.length||2!==t.length||2!==r.length)throw new TypeError("Invalid Arguments: Try again");if(!c(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!c(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!c(r))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");var n=h(p(r[1],r[0]),p(t[1],t[0])),i=m(m(n,n),t[0]),o=s(m(n,t[0])),a=e[1];return y(e[0],e[1],i,o,a)},"Object, Object, Object":function(e,t,r){if(2!==Object.keys(e).length||2!==Object.keys(t).length||2!==Object.keys(r).length)throw new TypeError("Invalid Arguments: Try again");if(!c(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!c(t))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!c(r))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(e.hasOwnProperty("pointX")&&e.hasOwnProperty("pointY")&&t.hasOwnProperty("lineOnePtX")&&t.hasOwnProperty("lineOnePtY")&&r.hasOwnProperty("lineTwoPtX")&&r.hasOwnProperty("lineTwoPtY")){var n=h(p(r.lineTwoPtY,r.lineTwoPtX),p(t.lineOnePtY,t.lineOnePtX)),i=m(m(n,n),t.lineOnePtX),o=s(m(n,t.lineOnePtX)),a=e.pointX;return y(e.pointX,e.pointY,i,o,a)}throw new TypeError("Key names do not match")},"Array, Array":function(e,t){if(2===e.length&&3===t.length){if(!c(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!o(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return y(e[0],e[1],t[0],t[1],t[2])}if(3===e.length&&6===t.length){if(!o(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!a(t))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return g(e[0],e[1],e[2],t[0],t[1],t[2],t[3],t[4],t[5])}if(2===e.length&&2===t.length){if(!c(e))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!c(t))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");return v(e[0],e[1],t[0],t[1])}if(3!==e.length||3!==t.length)throw new TypeError("Invalid Arguments: Try again");if(!o(e))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!o(t))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return x(e[0],e[1],e[2],t[0],t[1],t[2])},"Object, Object":function(e,t){if(2===Object.keys(e).length&&3===Object.keys(t).length){if(!c(e))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!o(t))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if(e.hasOwnProperty("pointX")&&e.hasOwnProperty("pointY")&&t.hasOwnProperty("xCoeffLine")&&t.hasOwnProperty("yCoeffLine")&&t.hasOwnProperty("constant"))return y(e.pointX,e.pointY,t.xCoeffLine,t.yCoeffLine,t.constant);throw new TypeError("Key names do not match")}if(3===Object.keys(e).length&&6===Object.keys(t).length){if(!o(e))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!a(t))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if(e.hasOwnProperty("pointX")&&e.hasOwnProperty("pointY")&&t.hasOwnProperty("x0")&&t.hasOwnProperty("y0")&&t.hasOwnProperty("z0")&&t.hasOwnProperty("a")&&t.hasOwnProperty("b")&&t.hasOwnProperty("c"))return g(e.pointX,e.pointY,e.pointZ,t.x0,t.y0,t.z0,t.a,t.b,t.c);throw new TypeError("Key names do not match")}if(2===Object.keys(e).length&&2===Object.keys(t).length){if(!c(e))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!c(t))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if(e.hasOwnProperty("pointOneX")&&e.hasOwnProperty("pointOneY")&&t.hasOwnProperty("pointTwoX")&&t.hasOwnProperty("pointTwoY"))return v(e.pointOneX,e.pointOneY,t.pointTwoX,t.pointTwoY);throw new TypeError("Key names do not match")}if(3!==Object.keys(e).length||3!==Object.keys(t).length)throw new TypeError("Invalid Arguments: Try again");if(!o(e))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!o(t))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if(e.hasOwnProperty("pointOneX")&&e.hasOwnProperty("pointOneY")&&e.hasOwnProperty("pointOneZ")&&t.hasOwnProperty("pointTwoX")&&t.hasOwnProperty("pointTwoY")&&t.hasOwnProperty("pointTwoZ"))return x(e.pointOneX,e.pointOneY,e.pointOneZ,t.pointTwoX,t.pointTwoY,t.pointTwoZ);throw new TypeError("Key names do not match")},Array:function(e){if(!function(e){if(2===e[0].length&&i(e[0][0])&&i(e[0][1])){for(var t in e)if(2!==e[t].length||!i(e[t][0])||!i(e[t][1]))return!1}else{if(!(3===e[0].length&&i(e[0][0])&&i(e[0][1])&&i(e[0][2])))return!1;for(var r in e)if(3!==e[r].length||!i(e[r][0])||!i(e[r][1])||!i(e[r][2]))return!1}return!0}(e))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return function(e){for(var t=[],r=0;r<e.length-1;r++)for(var n=r+1;n<e.length;n++)2===e[0].length?t.push(v(e[r][0],e[r][1],e[n][0],e[n][1])):3===e[0].length&&t.push(x(e[r][0],e[r][1],e[r][2],e[n][0],e[n][1],e[n][2]));return t}(e)}})}},function(e,t,r){"use strict";e.exports=[r(270),r(142),r(271),r(272)]},function(e,t,h){"use strict";t.name="and",t.factory=function(e,t,r,n){var i=h(4),o=r(h(0)),a=r(h(43)),s=r(h(142)),u=r(h(27)),c=r(h(74)),f=r(h(20)),l=r(h(7)),p=r(h(6)),m=n("and",{"number, number":function(e,t){return!(!e||!t)},"Complex, Complex":function(e,t){return!(0===e.re&&0===e.im||0===t.re&&0===t.im)},"BigNumber, BigNumber":function(e,t){return!(e.isZero()||t.isZero()||e.isNaN()||t.isNaN())},"Unit, Unit":function(e,t){return m(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return c(e,t,m,!1)},"SparseMatrix, DenseMatrix":function(e,t){return u(t,e,m,!0)},"DenseMatrix, SparseMatrix":function(e,t){return u(e,t,m,!1)},"DenseMatrix, DenseMatrix":function(e,t){return l(e,t,m)},"Array, Array":function(e,t){return m(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return m(o(e),t)},"Matrix, Array":function(e,t){return m(e,o(t))},"SparseMatrix, any":function(e,t){return s(t)?a(e.size(),e.storage()):f(e,t,m,!1)},"DenseMatrix, any":function(e,t){return s(t)?a(e.size(),e.storage()):p(e,t,m,!1)},"any, SparseMatrix":function(e,t){return s(e)?a(e.size(),e.storage()):f(t,e,m,!0)},"any, DenseMatrix":function(e,t){return s(e)?a(e.size(),e.storage()):p(t,e,m,!0)},"Array, any":function(e,t){return m(o(e),t).valueOf()},"any, Array":function(e,t){return m(e,o(t)).valueOf()}});return m.toTex={2:"\\left(${args[0]}".concat(i.operators.and,"${args[1]}\\right)")},m}},function(e,t,p){"use strict";t.name="or",t.factory=function(e,t,r,n){var i=p(4),o=r(p(0)),a=r(p(18)),s=r(p(66)),u=r(p(19)),c=r(p(7)),f=r(p(6)),l=n("or",{"number, number":function(e,t){return!(!e&&!t)},"Complex, Complex":function(e,t){return 0!==e.re||0!==e.im||0!==t.re||0!==t.im},"BigNumber, BigNumber":function(e,t){return!e.isZero()&&!e.isNaN()||!t.isZero()&&!t.isNaN()},"Unit, Unit":function(e,t){return l(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,l)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,l,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,l,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,l)},"Array, Array":function(e,t){return l(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return l(o(e),t)},"Matrix, Array":function(e,t){return l(e,o(t))},"SparseMatrix, any":function(e,t){return u(e,t,l,!1)},"DenseMatrix, any":function(e,t){return f(e,t,l,!1)},"any, SparseMatrix":function(e,t){return u(t,e,l,!0)},"any, DenseMatrix":function(e,t){return f(t,e,l,!0)},"Array, any":function(e,t){return f(o(e),t,l,!1).valueOf()},"any, Array":function(e,t){return f(o(t),e,l,!0).valueOf()}});return l.toTex={2:"\\left(${args[0]}".concat(i.operators.or,"${args[1]}\\right)")},l}},function(e,t,p){"use strict";t.name="xor",t.factory=function(e,t,r,n){var i=p(4),o=r(p(0)),a=r(p(18)),s=r(p(29)),u=r(p(19)),c=r(p(7)),f=r(p(6)),l=n("xor",{"number, number":function(e,t){return!!e!=!!t},"Complex, Complex":function(e,t){return(0!==e.re||0!==e.im)!=(0!==t.re||0!==t.im)},"BigNumber, BigNumber":function(e,t){return(!e.isZero()&&!e.isNaN())!=(!t.isZero()&&!t.isNaN())},"Unit, Unit":function(e,t){return l(e.value||0,t.value||0)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,l)},"SparseMatrix, DenseMatrix":function(e,t){return a(t,e,l,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,l,!1)},"DenseMatrix, DenseMatrix":function(e,t){return c(e,t,l)},"Array, Array":function(e,t){return l(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return l(o(e),t)},"Matrix, Array":function(e,t){return l(e,o(t))},"SparseMatrix, any":function(e,t){return u(e,t,l,!1)},"DenseMatrix, any":function(e,t){return f(e,t,l,!1)},"any, SparseMatrix":function(e,t){return u(t,e,l,!0)},"any, DenseMatrix":function(e,t){return f(t,e,l,!0)},"Array, any":function(e,t){return f(o(e),t,l,!1).valueOf()},"any, Array":function(e,t){return f(o(t),e,l,!0).valueOf()}});return l.toTex={2:"\\left(${args[0]}".concat(i.operators.xor,"${args[1]}\\right)")},l}},function(e,t,r){"use strict";e.exports=[r(96),r(143),r(78),r(274),r(275),r(128),r(276),r(277),r(278),r(279),r(280),r(281),r(282),r(50),r(70),r(283),r(145),r(284),r(97),r(77),r(285),r(286),r(146),r(28),r(287),r(289),r(290),r(23),r(291),r(72),r(43),r(292)]},function(e,t,c){"use strict";var f=c(2);t.name="cross",t.factory=function(e,t,r,n){var i=r(c(0)),a=r(c(15)),s=r(c(10)),o=n("cross",{"Matrix, Matrix":function(e,t){return i(u(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return i(u(e.toArray(),t))},"Array, Matrix":function(e,t){return i(u(e,t.toArray()))},"Array, Array":u});return o.toTex={2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},o;function u(e,t){var r=Math.max(f.size(e).length,f.size(t).length);e=f.squeeze(e),t=f.squeeze(t);var n=f.size(e),i=f.size(t);if(1!==n.length||1!==i.length||3!==n[0]||3!==i[0])throw new RangeError("Vectors with length 3 expected (Size A = ["+n.join(", ")+"], B = ["+i.join(", ")+"])");var o=[a(s(e[1],t[2]),s(e[2],t[1])),a(s(e[2],t[0]),s(e[0],t[2])),a(s(e[0],t[1]),s(e[1],t[0]))];return 1<r?[o]:o}}},function(e,t,u){"use strict";t.name="ctranspose",t.factory=function(e,t,r,n){var i=r(u(72)),o=r(u(71)),a=u(4),s=n("ctranspose",{any:function(e){return o(i(e))}});return s.toTex={1:"\\left(${args[0]}\\right)".concat(a.operators.ctranspose)},s}},function(e,t,o){"use strict";var a=o(2),s=o(3).isInteger;t.name="diag",t.factory=function(f,e,t,r){var l=t(o(0)),n=r("diag",{Array:function(e){return i(e,0,a.size(e),null)},"Array, number":function(e,t){return i(e,t,a.size(e),null)},"Array, BigNumber":function(e,t){return i(e,t.toNumber(),a.size(e),null)},"Array, string":function(e,t){return i(e,0,a.size(e),t)},"Array, number, string":function(e,t,r){return i(e,t,a.size(e),r)},"Array, BigNumber, string":function(e,t,r){return i(e,t.toNumber(),a.size(e),r)},Matrix:function(e){return i(e,0,e.size(),e.storage())},"Matrix, number":function(e,t){return i(e,t,e.size(),e.storage())},"Matrix, BigNumber":function(e,t){return i(e,t.toNumber(),e.size(),e.storage())},"Matrix, string":function(e,t){return i(e,0,e.size(),t)},"Matrix, number, string":function(e,t,r){return i(e,t,e.size(),r)},"Matrix, BigNumber, string":function(e,t,r){return i(e,t.toNumber(),e.size(),r)}});return n.toTex=void 0,n;function i(e,t,r,n){if(!s(t))throw new TypeError("Second parameter in function diag must be an integer");var i=0<t?t:0,o=t<0?-t:0;switch(r.length){case 1:return function(e,t,r,n,i,o){var a=[n+i,n+o],s=f.Matrix.storage(r||"dense").diagonal(a,e,t);return null!==r?s:s.valueOf()}(e,t,n,r[0],o,i);case 2:return function(e,t,r,n,i,o){if(f.isMatrix(e)){var a=e.diagonal(t);return null!==r?r!==a.storage()?l(a,r):a:a.valueOf()}for(var s=Math.min(n[0]-i,n[1]-o),u=[],c=0;c<s;c++)u[c]=e[c+i][c+o];return null!==r?l(u):u}(e,t,n,r,o,i)}throw new RangeError("Matrix for function diag must be 2 dimensional")}}},function(e,t,a){"use strict";var c=a(2).size;t.name="dot",t.factory=function(e,t,r,n){var s=r(a(14)),u=r(a(10)),i=n("dot",{"Matrix, Matrix":function(e,t){return o(e.toArray(),t.toArray())},"Matrix, Array":function(e,t){return o(e.toArray(),t)},"Array, Matrix":function(e,t){return o(e,t.toArray())},"Array, Array":o});return i.toTex={2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},i;function o(e,t){var r=c(e),n=c(t),i=r[0];if(1!==r.length||1!==n.length)throw new RangeError("Vector expected");if(r[0]!==n[0])throw new RangeError("Vectors must have equal length ("+r[0]+" != "+n[0]+")");if(0===i)throw new RangeError("Cannot calculate the dot product of empty vectors");for(var o=0,a=0;a<i;a++)o=s(o,u(e[a],t[a]));return o}}},function(e,t){"use strict";t.name="eye",t.factory=function(){return function(){throw new Error('Function "eye" is renamed to "identity" since mathjs version 5.0.0. To keep eye working, create an alias for it using "math.import({eye: math.identity}, {override: true})"')}}},function(e,t,i){"use strict";var M=i(9).format;t.name="expm",t.factory=function(d,e,t,r){var y=t(i(25)),g=t(i(14)),v=t(i(50)),x=t(i(70)),b=t(i(10)),w=d.SparseMatrix,n=r("expm",{Matrix:function(e){var t=e.size();if(2!==t.length||t[0]!==t[1])throw new RangeError("Matrix must be square (size: "+M(t)+")");for(var r=t[0],n=function(e,t){for(var r=0;r<30;r++)for(var n=0;n<=r;n++){var i=r-n;if(N(e,n,i)<t)return{q:n,j:i}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}(function(e){for(var t=e.size()[0],r=0,n=0;n<t;n++){for(var i=0,o=0;o<t;o++)i+=y(e.get([n,o]));r=Math.max(i,r)}return r}(e),1e-15),i=n.q,o=n.j,a=b(e,Math.pow(2,-o)),s=v(r),u=v(r),c=1,f=a,l=-1,p=1;p<=i;p++)1<p&&(f=b(f,a),l=-l),s=g(s,b(c=c*(i-p+1)/((2*i-p+1)*p),f)),u=g(u,b(c*l,f));for(var m=b(x(u),s),h=0;h<o;h++)m=b(m,m);return d.isSparseMatrix(e)?new w(m):m}});function N(e,t,r){for(var n=1,i=2;i<=t;i++)n*=i;for(var o=n,a=t+1;a<=2*t;a++)o*=a;var s=o*(2*t+1);return 8*Math.pow(e/Math.pow(2,r),2*t)*n*n/(o*s)}return n.toTex={1:"\\exp\\left(${args[0]}\\right)"},n}},function(e,t,a){"use strict";var r=a(2).filter,s=a(2).filterRegExp,o=a(36).maxArgumentCount;function u(e,n){var i=o(n);return r(e,function(e,t,r){return 1===i?n(e):2===i?n(e,[t]):n(e,[t],r)})}t.name="filter",t.factory=function(e,t,r,n){var i=r(a(0)),o=n("filter",{"Array, function":u,"Matrix, function":function(e,t){return i(u(e.toArray(),t))},"Array, RegExp":s,"Matrix, RegExp":function(e,t){return i(s(e.toArray(),t))}});return o.toTex=void 0,o}},function(e,t,a){"use strict";var s=a(5).clone,u=a(2).flatten;t.name="flatten",t.factory=function(e,t,r,n){var i=r(a(0)),o=n("flatten",{Array:function(e){return u(s(e))},Matrix:function(e){var t=u(s(e.toArray()));return i(t)}});return o.toTex=void 0,o}},function(e,t,r){"use strict";var n=r(36).maxArgumentCount,a=r(2).forEach;function o(t,i){var o=n(i);!function r(e,n){Array.isArray(e)?a(e,function(e,t){r(e,n.concat(t))}):1===o?i(e):2===o?i(e,n):i(e,n,t)}(t,[])}t.name="forEach",t.factory=function(e,t,r,n){var i=n("forEach",{"Array, function":o,"Matrix, function":function(e,t){return e.forEach(t)}});return i.toTex=void 0,i}},function(e,t,s){"use strict";var u=s(2).size;t.name="kron",t.factory=function(e,t,r,n){var i=r(s(0)),o=r(s(21));return n("kron",{"Matrix, Matrix":function(e,t){return i(a(e.toArray(),t.toArray()))},"Matrix, Array":function(e,t){return i(a(e.toArray(),t))},"Array, Matrix":function(e,t){return i(a(e,t.toArray()))},"Array, Array":a});function a(e,r){if(1===u(e).length&&(e=[e]),1===u(r).length&&(r=[r]),2<u(e).length||2<u(r).length)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 n=[],i=[];return e.map(function(t){return r.map(function(e){return i=[],n.push(i),t.map(function(t){return e.map(function(e){return i.push(o(t,e))})})})})&&n}}},function(e,t,s){"use strict";var u=s(3).isInteger,c=s(2).resize;t.name="ones",t.factory=function(o,r,e,t){var a=e(s(0)),n=t("ones",{"":function(){return"Array"===r.matrix?i([]):i([],"default")},"...number | BigNumber | string":function(e){if("string"!=typeof e[e.length-1])return"Array"===r.matrix?i(e):i(e,"default");var t=e.pop();return i(e,t)},Array:i,Matrix:function(e){var t=e.storage();return i(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return i(e.valueOf(),t)}});return n.toTex=void 0,n;function i(e,t){var r=function(e){var n=!1;return e.forEach(function(e,t,r){o.isBigNumber(e)&&(n=!0,r[t]=e.toNumber())}),n}(e)?new o.BigNumber(1):1;if(function(e){e.forEach(function(e){if("number"!=typeof e||!u(e)||e<0)throw new Error("Parameters in function ones must be positive integers")})}(e),t){var n=a(t);return 0<e.length?n.resize(e,r):n}var i=[];return 0<e.length?c(i,e,r):i}}},function(e,t,s){"use strict";var u=s(2);t.name="reshape",t.factory=function(e,t,r,n){var i=r(s(0)),o=r(s(34)),a=n("reshape",{"Matrix, Array":function(e,t){return e.reshape?e.reshape(t):i(u.reshape(e.valueOf(),t))},"Array, Array":function(e,t){return t.forEach(function(e){if(!o(e))throw new TypeError("Invalid size for dimension: "+e)}),u.reshape(e,t)}});return a.toTex=void 0,a}},function(e,t,r){"use strict";var u=r(8),c=r(57),f=r(3).isInteger,l=r(9).format,p=r(5).clone,m=r(2);t.name="resize",t.factory=function(o,a,e){function t(e,t,r){if(2!==arguments.length&&3!==arguments.length)throw new c("resize",arguments.length,2,3);if(o.isMatrix(t)&&(t=t.valueOf()),o.isBigNumber(t[0])&&(t=t.map(function(e){return o.isBigNumber(e)?e.toNumber():e})),o.isMatrix(e))return e.resize(t,r,!0);if("string"==typeof e)return function(e,t,r){if(void 0!==r){if("string"!=typeof r||1!==r.length)throw new TypeError("Single character expected as defaultValue")}else r=" ";if(1!==t.length)throw new u(t.length,1);var n=t[0];if("number"!=typeof n||!f(n))throw new TypeError("Invalid size, must contain positive integers (size: "+l(t)+")");{if(e.length>n)return e.substring(0,n);if(e.length<n){for(var i=e,o=0,a=n-e.length;o<a;o++)i+=r;return i}return e}}(e,t,r);var n=!Array.isArray(e)&&"Array"!==a.matrix;if(0===t.length){for(;Array.isArray(e);)e=e[0];return p(e)}Array.isArray(e)||(e=[e]),e=p(e);var i=m.resize(e,t,r);return n?s(i):i}var s=e(r(0));return t.toTex=void 0,t}},function(e,t,p){"use strict";var m=p(2).size;t.name="sort",t.factory=function(e,t,r,n){function i(e,t){return-a(e,t)}var o=r(p(0)),a=r(p(55)),s=r(p(30)),u=n("sort",{Array:function(e){return f(e),e.sort(a)},Matrix:function(e){return l(e),o(e.toArray().sort(a),e.storage())},"Array, function":function(e,t){return f(e),e.sort(t)},"Matrix, function":function(e,t){return l(e),o(e.toArray().sort(t),e.storage())},"Array, string":function(e,t){return f(e),e.sort(c(t))},"Matrix, string":function(e,t){return l(e),o(e.toArray().sort(c(t)),e.storage())}});function c(e){if("asc"===e)return a;if("desc"===e)return i;if("natural"===e)return s;throw new Error('String "asc", "desc", or "natural" expected')}function f(e){if(1!==m(e).length)throw new Error("One dimensional array expected")}function l(e){if(1!==e.size().length)throw new Error("One dimensional matrix expected")}return u.toTex=void 0,u}},function(e){e.exports=function t(e,r){"use strict";function n(e){return t.insensitive&&(""+e).toLowerCase()||""+e}var i,o,a=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,s=/(^[ ]*|[ ]*$)/g,u=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,c=/^0x[0-9a-f]+$/i,f=/^0/,l=n(e).replace(s,"")||"",p=n(r).replace(s,"")||"",m=l.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),h=p.replace(a,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),d=parseInt(l.match(c),16)||1!==m.length&&l.match(u)&&Date.parse(l),y=parseInt(p.match(c),16)||d&&p.match(u)&&Date.parse(p)||null;if(y){if(d<y)return-1;if(y<d)return 1}for(var g=0,v=Math.max(m.length,h.length);g<v;g++){if(i=!(m[g]||"").match(f)&&parseFloat(m[g])||m[g]||0,o=!(h[g]||"").match(f)&&parseFloat(h[g])||h[g]||0,isNaN(i)!==isNaN(o))return isNaN(i)?1:-1;if(typeof i!=typeof o&&(i+="",o+=""),i<o)return-1;if(o<i)return 1}return 0}},function(e,t,y){"use strict";var g=y(2),v=y(4),x=y(9);t.name="sqrtm",t.factory=function(r,e,t,n){var a=t(y(25)),s=t(y(14)),u=t(y(10)),i=t(y(46)),c=t(y(15)),f=t(y(70)),l=t(y(28)),p=t(y(98)),m=t(y(50)),o=n("sqrtm",{"Array | Matrix":function(e){var t=r.isMatrix(e)?e.size():g.size(e);switch(t.length){case 1:if(1===t[0])return i(e);throw new RangeError("Matrix must be square (size: "+x.format(t)+")");case 2:if(t[0]===t[1])return function(e){var t,r=0,n=e,i=m(l(e));do{var o=n;if(n=u(.5,s(o,f(i))),i=u(.5,s(i,f(o))),t=p(a(c(n,o))),d<t&&++r>h)throw new Error("computing square root of matrix: iterative method could not converge")}while(d<t);return n}(e);throw new RangeError("Matrix must be square (size: "+x.format(t)+")")}}}),h=1e3,d=1e-6;return o.toTex={1:"{${args[0]}}".concat(v.operators.pow,"{\\frac{1}{2}}")},o}},function(e,t,a){"use strict";var s=a(5),u=a(2);t.name="squeeze",t.factory=function(e,t,r,n){var i=r(a(0)),o=n("squeeze",{Array:function(e){return u.squeeze(s.clone(e))},Matrix:function(e){var t=u.squeeze(e.toArray());return Array.isArray(t)?i(t):t},any:function(e){return s.clone(e)}});return o.toTex=void 0,o}},function(e,t,s){"use strict";var u=s(5).clone,h=s(9).format;t.name="trace",t.factory=function(e,t,r,n){var i=r(s(0)),m=r(s(14)),o=n("trace",{Array:function(e){return a(i(e))},SparseMatrix:function(e){var t=e._values,r=e._index,n=e._ptr,i=e._size,o=i[0],a=i[1];if(o!==a)throw new RangeError("Matrix must be square (size: "+h(i)+")");var s=0;if(0<t.length)for(var u=0;u<a;u++)for(var c=n[u],f=n[u+1],l=c;l<f;l++){var p=r[l];if(p===u){s=m(s,t[l]);break}if(u<p)break}return s},DenseMatrix:a,any:u});function a(e){var t=e._size,r=e._data;switch(t.length){case 1:if(1===t[0])return u(r[0]);throw new RangeError("Matrix must be square (size: "+h(t)+")");case 2:var n=t[0];if(n!==t[1])throw new RangeError("Matrix must be square (size: "+h(t)+")");for(var i=0,o=0;o<n;o++)i=m(i,r[o][o]);return i;default:throw new RangeError("Matrix must be two dimensional (size: "+h(t)+")")}}return o.toTex={1:"\\mathrm{tr}\\left(${args[0]}\\right)"},o}},function(e,t,o){"use strict";t.name="getMatrixDataType",t.factory=function(e,t,r,n){var i=r(o(63));return n("getMatrixDataType",{Array:function(e){return i(e)},Matrix:function(e){return e.getDataType()}})}},function(e,t,r){"use strict";e.exports=[r(76),r(75),r(141),r(294),r(295),r(296),r(297),r(301),r(302)]},function(e,t,a){"use strict";t.name="kldivergence",t.factory=function(e,t,r,n){var i=r(a(0)),s=r(a(45)),u=r(a(99)),c=r(a(10)),f=r(a(138)),l=r(a(91)),p=r(a(52));function o(e,t){var r=t.size().length,n=e.size().length;if(1<r)throw new Error("first object must be one dimensional");if(1<n)throw new Error("second object must be one dimensional");if(r!==n)throw new Error("Length of two vectors must be equal");if(0===u(e))throw new Error("Sum of elements in first object must be non zero");if(0===u(t))throw new Error("Sum of elements in second object must be non zero");var i=s(e,u(e)),o=s(t,u(t)),a=u(c(i,l(f(i,o))));return p(a)?a:Number.NaN}return n("kldivergence",{"Array, Array":function(e,t){return o(i(e),i(t))},"Matrix, Array":function(e,t){return o(e,i(t))},"Array, Matrix":function(e,t){return o(i(e),t)},"Matrix, Matrix":function(e,t){return o(e,t)}})}},function(e,t,f){"use strict";var l=f(47);t.name="multinomial",t.factory=function(e,t,r,n){var i=r(f(14)),o=r(f(10)),a=r(f(45)),s=r(f(75)),u=r(f(34)),c=r(f(73));return n("multinomial",{"Array | Matrix":function(e){var t=0,r=1;return l(e,function(e){if(!u(e)||!c(e))throw new TypeError("Positive integer value expected in function multinomial");t=i(t,e),r=o(r,s(e))}),a(s(t),r)}})}},function(e,t,s){"use strict";var u=s(3).isInteger;function c(e){return e.isInteger()&&e.gte(0)}t.name="permutations",t.factory=function(i,e,t,r){var n=t(s(75)),o=s(95),a=r("permutations",{"number | BigNumber":n,"number, number":function(e,t){if(!u(e)||e<0)throw new TypeError("Positive integer value expected in function permutations");if(!u(t)||t<0)throw new TypeError("Positive integer value expected in function permutations");if(e<t)throw new TypeError("second argument k must be less than or equal to first argument n");return o(e-t+1,e)},"BigNumber, BigNumber":function(e,t){var r,n;if(!c(e)||!c(t))throw new TypeError("Positive integer value expected in function permutations");if(t.gt(e))throw new TypeError("second argument k must be less than or equal to first argument n");for(r=new i.BigNumber(1),n=e.minus(t).plus(1);n.lte(e);n=n.plus(1))r=r.times(n);return r}});return a.toTex=void 0,a}},function(e,t,i){"use strict";t.name="pickRandom",t.factory=function(e,t,r){var n=r(i(100))("uniform").pickRandom;return n.toTex=void 0,n}},function(e,t,r){"use strict";var s=r(299),u=s();t.factory=function(e,t,r,n,i){var o;function a(e){o=null===e?u:s(String(e))}return a(t.randomSeed),i.on("config",function(e,t,r){void 0!==r.randomSeed&&a(e.randomSeed)}),function(){return o()}},t.math=!0},function(p,e,t){"use strict";(function(e){var i=[],o=void 0===e?window:e,a=Math.pow(256,6),s=Math.pow(2,52),u=2*s,t=Math.random;function c(e){var t,r=e.length,a=this,n=0,i=a.i=a.j=0,o=a.S=[];for(r||(e=[r++]);n<256;)o[n]=n++;for(n=0;n<256;n++)o[n]=o[i=255&i+e[n%r]+(t=o[n])],o[i]=t;(a.g=function(e){for(var t,r=0,n=a.i,i=a.j,o=a.S;e--;)t=o[n=255&n+1],r=256*r+o[255&(o[n]=o[i=255&i+t])+(o[i]=t)];return a.i=n,a.j=i,r})(256)}function f(e,t){for(var r,n=e+"",i=0;i<n.length;)t[255&i]=255&(r^=19*t[255&i])+n.charCodeAt(i++);return l(t)}function l(e){return String.fromCharCode.apply(0,e)}p.exports=function(e,t){if(t&&!0===t.global)return t.global=!1,Math.random=p.exports(e,t),t.global=!0,Math.random;var r=[],n=(f(function e(t,r){var n,i=[],o=(typeof t)[0];if(r&&"o"==o)for(n in t)try{i.push(e(t[n],r-1))}catch(e){}return i.length?i:"s"==o?t:t+"\0"}(t&&t.entropy||!1?[e,l(i)]:0 in arguments?e:function(e){try{return o.crypto.getRandomValues(e=new Uint8Array(256)),l(e)}catch(e){return[+new Date,o,o.navigator&&o.navigator.plugins,o.screen,l(i)]}}(),3),r),new c(r));return f(l(n.S),i),function(){for(var e=n.g(6),t=a,r=0;e<s;)e=256*(e+r),t*=256,r=n.g(1);for(;u<=e;)e/=2,t/=2,r>>>=1;return(e+r)/t}},p.exports.resetGlobal=function(){Math.random=t},f(Math.random(),i)}).call(this,t(300))},function(e){var t;t=function(){return this}();try{t=t||new Function("return this")()}catch(e){"object"==typeof window&&(t=window)}e.exports=t},function(e,t,i){"use strict";t.name="random",t.factory=function(e,t,r){var n=r(i(100))("uniform").random;return n.toTex=void 0,n}},function(e,t,i){"use strict";t.name="randomInt",t.factory=function(e,t,r){var n=r(i(100))("uniform").randomInt;return n.toTex=void 0,n}},function(e,t,r){"use strict";e.exports=[r(55),r(30),r(147),r(304),r(51),r(305),r(33),r(89),r(38),r(144),r(130)]},function(e,t,a){"use strict";t.name="deepEqual",t.factory=function(e,t,r,n){var o=r(a(51)),i=n("deepEqual",{"any, any":function(e,t){return function e(t,r){{if(Array.isArray(t)){if(Array.isArray(r)){var n=t.length;if(n!==r.length)return!1;for(var i=0;i<n;i++)if(!e(t[i],r[i]))return!1;return!0}return!1}return!Array.isArray(r)&&o(t,r)}}(e.valueOf(),t.valueOf())}});return i.toTex=void 0,i}},function(e,t,s){"use strict";t.name="equalText",t.factory=function(e,t,r,n){var i=r(s(147)),o=r(s(60)),a=n("equalText",{"any, any":function(e,t){return o(i(e,t))}});return a.toTex=void 0,a}},function(e,t,r){"use strict";e.exports=[r(307),r(148),r(308),r(149),r(309),r(310),r(311),r(312),r(150),r(313)]},function(e,t,i){"use strict";var p=i(2).flatten;t.name="setCartesian",t.factory=function(e,t,r,n){var s=r(i(24)),u=r(i(49)),c=r(i(28)),f=r(i(23)),l=r(i(30));return n("setCartesian",{"Array | Matrix, Array | Matrix":function(e,t){var r=[];if(0!==f(c(e),new s(0))&&0!==f(c(t),new s(0))){var n=p(Array.isArray(e)?e:e.toArray()).sort(l),i=p(Array.isArray(t)?t:t.toArray()).sort(l);r=[];for(var o=0;o<n.length;o++)for(var a=0;a<i.length;a++)r.push([n[o],i[a]])}return Array.isArray(e)&&Array.isArray(t)?r:new u(r)}})}},function(e,t,c){"use strict";var f=c(2).flatten;t.name="setDistinct",t.factory=function(e,t,r,n){var i=r(c(24)),o=r(c(49)),a=r(c(28)),s=r(c(23)),u=r(c(30));return n("setDistinct",{"Array | Matrix":function(e){var t;if(0===s(a(e),new i(0)))t=[];else{var r=f(Array.isArray(e)?e:e.toArray()).sort(u);(t=[]).push(r[0]);for(var n=1;n<r.length;n++)0!==u(r[n],r[n-1])&&t.push(r[n])}return Array.isArray(e)?t:new o(t)}})}},function(e,t,i){"use strict";var l=i(2).flatten,p=i(2).identify;t.name="setIsSubset",t.factory=function(e,t,r,n){var s=r(i(24)),u=r(i(28)),c=r(i(23)),f=r(i(30));return n("setIsSubset",{"Array | Matrix, Array | Matrix":function(e,t){if(0===c(u(e),new s(0)))return!0;if(0===c(u(t),new s(0)))return!1;for(var r,n=p(l(Array.isArray(e)?e:e.toArray()).sort(f)),i=p(l(Array.isArray(t)?t:t.toArray()).sort(f)),o=0;o<n.length;o++){r=!1;for(var a=0;a<i.length;a++)if(0===f(n[o].value,i[a].value)&&n[o].identifier===i[a].identifier){r=!0;break}if(!1===r)return!1}return!0}})}},function(e,t,i){"use strict";var c=i(2).flatten;t.name="setMultiplicity",t.factory=function(e,t,r,n){var o=r(i(30)),a=r(i(24)),s=r(i(28)),u=r(i(23));return n("setMultiplicity",{"number | BigNumber | Fraction | Complex, Array | Matrix":function(e,t){if(0===u(s(t),new a(0)))return 0;for(var r=c(Array.isArray(t)?t:t.toArray()),n=0,i=0;i<r.length;i++)0===o(r[i],e)&&n++;return n}})}},function(e,t,c){"use strict";var f=c(2).flatten;t.name="setPowerset",t.factory=function(e,t,r,n){var i=r(c(24)),o=r(c(28)),a=r(c(23)),s=r(c(30));return n("setPowerset",{"Array | Matrix":function(e){if(0===a(o(e),new i(0)))return[];for(var t=f(Array.isArray(e)?e:e.toArray()).sort(s),r=[],n=0;n.toString(2).length<=t.length;)r.push(u(t,n.toString(2).split("").reverse())),n++;return function(e){for(var t=[],r=e.length-1;0<r;r--)for(var n=0;n<r;n++)e[n].length>e[n+1].length&&(t=e[n],e[n]=e[n+1],e[n+1]=t);return e}(r)}});function u(e,t){for(var r=[],n=0;n<t.length;n++)"1"===t[n]&&r.push(e[n]);return r}}},function(e,t,i){"use strict";var a=i(2).flatten;t.name="setSize",t.factory=function(e,t,r,n){var o=r(i(30));return n("setSize",{"Array | Matrix":function(e){return Array.isArray(e)?a(e).length:a(e.toArray()).length},"Array | Matrix, boolean":function(e,t){if(!1===t||0===e.length)return Array.isArray(e)?a(e).length:a(e.toArray()).length;for(var r=a(Array.isArray(e)?e:e.toArray()).sort(o),n=1,i=1;i<r.length;i++)0!==o(r[i],r[i-1])&&n++;return n}})}},function(e,t,f){"use strict";var l=f(2).flatten;t.name="setUnion",t.factory=function(e,t,r,n){var i=r(f(24)),o=r(f(78)),a=r(f(28)),s=r(f(23)),u=r(f(149)),c=r(f(150));return n("setUnion",{"Array | Matrix, Array | Matrix":function(e,t){if(0===s(a(e),new i(0)))return l(t);if(0===s(a(t),new i(0)))return l(e);var r=l(e),n=l(t);return o(c(r,n),u(r,n))}})}},function(e,t,r){"use strict";e.exports=[r(315)]},function(e,t,r){"use strict";var o=r(1),a=r(3).sign;var s=[[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]],u=[[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]],c=Math.pow(2,53);t.name="erf",t.factory=function(t,e,r,n){var i=n("erf",{number:function(e){var t=Math.abs(e);return c<=t?a(e):t<=.46875?a(e)*function(e){var t,r=e*e,n=s[0][4]*r,i=r;for(t=0;t<3;t+=1)n=(n+s[0][t])*r,i=(i+u[0][t])*r;return e*(n+s[0][3])/(i+u[0][3])}(t):t<=4?a(e)*(1-function(e){var t,r=s[1][8]*e,n=e;for(t=0;t<7;t+=1)r=(r+s[1][t])*e,n=(n+u[1][t])*e;var i=(r+s[1][7])/(n+u[1][7]),o=parseInt(16*e)/16,a=(e-o)*(e+o);return Math.exp(-o*o)*Math.exp(-a)*i}(t)):a(e)*(1-function(e){var t,r=1/(e*e),n=s[2][5]*r,i=r;for(t=0;t<4;t+=1)n=(n+s[2][t])*r,i=(i+u[2][t])*r;var o=r*(n+s[2][4])/(i+u[2][4]);o=(.5641895835477563-o)/e,r=parseInt(16*e)/16;var a=(e-r)*(e+r);return Math.exp(-r*r)*Math.exp(-a)*o}(t))},BigNumber:function(e){return new t.BigNumber(i(e.toNumber()))},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"erf\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";e.exports=[r(317),r(98),r(152),r(151),r(153),r(318),r(319),r(320),r(154),r(99),r(101)]},function(e,t,l){"use strict";var p=l(2).flatten;t.name="mad",t.factory=function(e,t,r,n){var i=r(l(25)),o=r(l(145)),a=r(l(151)),s=r(l(15)),u=r(l(40)),c=n("mad",{"Array | Matrix":f,"...":function(e){return f(e)}});return c.toTex=void 0,c;function f(e){if(0===(e=p(e.valueOf())).length)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var t=a(e);return a(o(e,function(e){return i(s(e,t))}))}catch(e){throw e instanceof TypeError&&-1!==e.message.indexOf("median")?new TypeError(e.message.replace("median","mad")):u(e,"mad")}}}},function(e,t,o){"use strict";var u=o(2).flatten;t.name="mode",t.factory=function(e,t,r,n){var a=r(o(79)),s=r(o(52));return n("mode",{"Array | Matrix":i,"...":function(e){return i(e)}});function i(e){if(0===(e=u(e.valueOf())).length)throw new Error("Cannot calculate mode of an empty array");for(var t={},r=[],n=0,i=0;i<e.length;i++){var o=e[i];if(s(o)&&a(o))throw new Error("Cannot calculate mode of an array containing NaN values");o in t||(t[o]=0),t[o]++,t[o]===n?r.push(o):t[o]>n&&(n=t[o],r=[o])}return r}}},function(e,t,u){"use strict";var c=u(47);t.name="prod",t.factory=function(e,t,r,n){var i=r(u(21)),o=r(u(40)),a=n("prod",{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(){throw new Error("prod(A, dim) is not yet supported")},"...":function(e){return s(e)}});return a.toTex=void 0,a;function s(e){var r;if(c(e,function(t){try{r=void 0===r?t:i(r,t)}catch(e){throw o(e,"prod",t)}}),void 0===r)throw new Error("Cannot calculate prod of an empty array");return r}}},function(e,t,n){"use strict";var d=n(3).isInteger,S=n(3).isNumber,O=n(2).flatten,y=n(35);t.name="quantileSeq",t.factory=function(m,e,t,r){var w=t(n(14)),N=t(n(10)),M=t(n(97)),E=t(n(55));function h(e,t,r){var n=O(e),i=n.length;if(0===i)throw new Error("Cannot calculate quantile of an empty sequence");if(S(t)){var o=t*(i-1),a=o%1;if(0==a){var s=r?n[o]:M(n,o);return A(s),s}var u,c,f=Math.floor(o);if(r)u=n[f],c=n[f+1];else{c=M(n,f+1),u=n[f];for(var l=0;l<f;++l)0<E(n[l],u)&&(u=n[l])}return A(u),A(c),w(N(u,1-a),N(c,a))}var p=t.times(i-1);if(p.isInteger()){p=p.toNumber();var m=r?n[p]:M(n,p);return A(m),m}var h,d,y=p.floor(),g=p.minus(y),v=y.toNumber();if(r)h=n[v],d=n[v+1];else{d=M(n,v+1),h=n[v];for(var x=0;x<v;++x)0<E(n[x],h)&&(h=n[x])}A(h),A(d);var b=new g.constructor(1);return w(N(h,b.minus(g)),N(d,g))}var A=r({"number | BigNumber | Unit":function(e){return e}});return function(e,t,r){var n,i,o;if(arguments.length<2||3<arguments.length)throw new SyntaxError("Function quantileSeq requires two or three parameters");if(y(e)){if("boolean"!=typeof(r=r||!1))throw new TypeError("Unexpected type of argument in function quantileSeq");if(i=e.valueOf(),S(t)){if(t<0)throw new Error("N/prob must be non-negative");if(t<=1)return h(i,t,r);if(1<t){if(!d(t))throw new Error("N must be a positive integer");var a=t+1;n=new Array(t);for(var s=0;s<t;)n[s]=h(i,++s/a,r);return n}}if(m.isBigNumber(t)){if(t.isNegative())throw new Error("N/prob must be non-negative");if(o=new t.constructor(1),t.lte(o))return new m.BigNumber(h(i,t,r));if(t.gt(o)){if(!t.isInteger())throw new Error("N must be a positive integer");var u=t.toNumber();if(4294967295<u)throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var c=new m.BigNumber(u+1);n=new Array(u);for(var f=0;f<u;)n[f]=new m.BigNumber(h(i,new m.BigNumber(++f).div(c),r));return n}}if(Array.isArray(t)){n=new Array(t.length);for(var l=0;l<n.length;++l){var p=t[l];if(S(p)){if(p<0||1<p)throw new Error("Probability must be between 0 and 1, inclusive")}else{if(!m.isBigNumber(p))throw new TypeError("Unexpected type of argument in function quantileSeq");if(o=new p.constructor(1),p.isNegative()||p.gt(o))throw new Error("Probability must be between 0 and 1, inclusive")}n[l]=h(i,p,r)}return n}throw new TypeError("Unexpected type of argument in function quantileSeq")}throw new TypeError("Unexpected type of argument in function quantileSeq")}}},function(e,t,r){"use strict";e.exports=[r(112),r(322)]},function(e,t,r){"use strict";var s=r(9).isString,u=r(9).format;function o(e,o,a){return e.replace(/\$([\w.]+)/g,function(e,t){for(var r=t.split("."),n=o[r.shift()];r.length&&void 0!==n;){var i=r.shift();n=i?n[i]:n+"."}return void 0!==n?s(n)?n:u(n,a):e})}t.name="print",t.factory=function(e,t,r,n){var i=n("print",{"string, Object | Array":o,"string, Object | Array, number | Object":o});return i.toTex=void 0,i}},function(e,t,r){"use strict";e.exports=[r(324),r(325),r(326),r(327),r(328),r(329),r(330),r(331),r(332),r(333),r(334),r(335),r(336),r(337),r(338),r(339),r(340),r(341),r(342),r(343),r(344),r(345),r(346),r(347),r(348)]},function(e,t,r){"use strict";var o=r(1);t.name="acos",t.factory=function(t,r,e,n){var i=n("acos",{number:function(e){return-1<=e&&e<=1||r.predictable?Math.acos(e):new t.Complex(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\cos^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);var a=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)};t.name="acosh",t.factory=function(t,r,e,n){var i=n("acosh",{number:function(e){return 1<=e||r.predictable?a(e):e<=-1?new t.Complex(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new t.Complex(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\cosh^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="acot",t.factory=function(t,e,r,n){var i=n("acot",{number:function(e){return Math.atan(1/e)},Complex:function(e){return e.acot()},BigNumber:function(e){return new t.BigNumber(1).div(e).atan()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\cot^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="acoth",t.factory=function(t,r,e,n){var i=n("acoth",{number:function(e){return 1<=e||e<=-1||r.predictable?isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0:new t.Complex(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new t.BigNumber(1).div(e).atanh()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\coth^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="acsc",t.factory=function(t,r,e,n){var i=n("acsc",{number:function(e){return e<=-1||1<=e||r.predictable?Math.asin(1/e):new t.Complex(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new t.BigNumber(1).div(e).asin()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\csc^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="acsch",t.factory=function(t,e,r,n){var i=n("acsch",{number:function(e){return e=1/e,Math.log(e+Math.sqrt(e*e+1))},Complex:function(e){return e.acsch()},BigNumber:function(e){return new t.BigNumber(1).div(e).asinh()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="asec",t.factory=function(t,r,e,n){var i=n("asec",{number:function(e){return e<=-1||1<=e||r.predictable?Math.acos(1/e):new t.Complex(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new t.BigNumber(1).div(e).acos()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\sec^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="asech",t.factory=function(r,n,e,t){var i=t("asech",{number:function(e){if(e<=1&&-1<=e||n.predictable){e=1/e;var t=Math.sqrt(e*e-1);return 0<e||n.predictable?Math.log(t+e):new r.Complex(Math.log(t-e),Math.PI)}return new r.Complex(e,0).asech()},Complex:function(e){return e.asech()},BigNumber:function(e){return new r.BigNumber(1).div(e).acosh()},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="asin",t.factory=function(t,r,e,n){var i=n("asin",{number:function(e){return-1<=e&&e<=1||r.predictable?Math.asin(e):new t.Complex(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()},"Array | Matrix":function(e){return o(e,i,!0)}});return i.toTex={1:"\\sin^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="asinh",t.factory=function(e,t,r,n){var i=n("asinh",{number:Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()},"Array | Matrix":function(e){return o(e,i,!0)}});return i.toTex={1:"\\sinh^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="atan",t.factory=function(e,t,r,n){var i=n("atan",{number:function(e){return Math.atan(e)},Complex:function(e){return e.atan()},BigNumber:function(e){return e.atan()},"Array | Matrix":function(e){return o(e,i,!0)}});return i.toTex={1:"\\tan^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,m){"use strict";t.name="atan2",t.factory=function(r,e,t,n){var i=t(m(0)),o=t(m(27)),a=t(m(18)),s=t(m(139)),u=t(m(20)),c=t(m(19)),f=t(m(7)),l=t(m(6)),p=n("atan2",{"number, number":Math.atan2,"BigNumber, BigNumber":function(e,t){return r.BigNumber.atan2(e,t)},"SparseMatrix, SparseMatrix":function(e,t){return s(e,t,p,!1)},"SparseMatrix, DenseMatrix":function(e,t){return o(t,e,p,!0)},"DenseMatrix, SparseMatrix":function(e,t){return a(e,t,p,!1)},"DenseMatrix, DenseMatrix":function(e,t){return f(e,t,p)},"Array, Array":function(e,t){return p(i(e),i(t)).valueOf()},"Array, Matrix":function(e,t){return p(i(e),t)},"Matrix, Array":function(e,t){return p(e,i(t))},"SparseMatrix, number | BigNumber":function(e,t){return u(e,t,p,!1)},"DenseMatrix, number | BigNumber":function(e,t){return l(e,t,p,!1)},"number | BigNumber, SparseMatrix":function(e,t){return c(t,e,p,!0)},"number | BigNumber, DenseMatrix":function(e,t){return l(t,e,p,!0)},"Array, number | BigNumber":function(e,t){return l(i(e),t,p,!1).valueOf()},"number | BigNumber, Array":function(e,t){return l(i(t),e,p,!0).valueOf()}});return p.toTex={2:"\\mathrm{atan2}\\left(${args}\\right)"},p}},function(e,t,r){"use strict";var o=r(1);var a=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2};t.name="atanh",t.factory=function(t,r,e,n){var i=n("atanh",{number:function(e){return e<=1&&-1<=e||r.predictable?a(e):new t.Complex(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()},"Array | Matrix":function(e){return o(e,i,!0)}});return i.toTex={1:"\\tanh^{-1}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="cos",t.factory=function(t,e,r,n){var i=n("cos",{number:Math.cos,Complex:function(e){return e.cos()},BigNumber:function(e){return e.cos()},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cos is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\cos\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);var a=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2};t.name="cosh",t.factory=function(t,e,r,n){var i=n("cosh",{number:a,Complex:function(e){return e.cosh()},BigNumber:function(e){return e.cosh()},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cosh is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\cosh\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="cot",t.factory=function(t,e,r,n){var i=n("cot",{number:function(e){return 1/Math.tan(e)},Complex:function(e){return e.cot()},BigNumber:function(e){return new t.BigNumber(1).div(e.tan())},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\cot\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);function a(e){var t=Math.exp(2*e);return(t+1)/(t-1)}t.name="coth",t.factory=function(t,e,r,n){var i=n("coth",{number:a,Complex:function(e){return e.coth()},BigNumber:function(e){return new t.BigNumber(1).div(e.tanh())},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function coth is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\coth\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="csc",t.factory=function(t,e,r,n){var i=n("csc",{number:function(e){return 1/Math.sin(e)},Complex:function(e){return e.csc()},BigNumber:function(e){return new t.BigNumber(1).div(e.sin())},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csc is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\csc\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1),n=r(3).sign;function a(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*n(e)}t.name="csch",t.factory=function(t,e,r,n){var i=n("csch",{number:a,Complex:function(e){return e.csch()},BigNumber:function(e){return new t.BigNumber(1).div(e.sinh())},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function csch is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\mathrm{csch}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="sec",t.factory=function(t,e,r,n){var i=n("sec",{number:function(e){return 1/Math.cos(e)},Complex:function(e){return e.sec()},BigNumber:function(e){return new t.BigNumber(1).div(e.cos())},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sec is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\sec\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);function a(e){return 2/(Math.exp(e)+Math.exp(-e))}t.name="sech",t.factory=function(t,e,r,n){var i=n("sech",{number:a,Complex:function(e){return e.sech()},BigNumber:function(e){return new t.BigNumber(1).div(e.cosh())},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sech is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i)}});return i.toTex={1:"\\mathrm{sech}\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="sin",t.factory=function(t,e,r,n){var i=n("sin",{number:Math.sin,Complex:function(e){return e.sin()},BigNumber:function(e){return e.sin()},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sin is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i,!0)}});return i.toTex={1:"\\sin\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);var a=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2};t.name="sinh",t.factory=function(t,e,r,n){var i=n("sinh",{number:a,Complex:function(e){return e.sinh()},BigNumber:function(e){return e.sinh()},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function sinh is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i,!0)}});return i.toTex={1:"\\sinh\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);t.name="tan",t.factory=function(t,e,r,n){var i=n("tan",{number:Math.tan,Complex:function(e){return e.tan()},BigNumber:function(e){return e.tan()},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tan is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i,!0)}});return i.toTex={1:"\\tan\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";var o=r(1);var a=Math.tanh||function(e){var t=Math.exp(2*e);return(t-1)/(t+1)};t.name="tanh",t.factory=function(t,e,r,n){var i=n("tanh",{number:a,Complex:function(e){return e.tanh()},BigNumber:function(e){return e.tanh()},Unit:function(e){if(!e.hasBase(t.Unit.BASE_UNITS.ANGLE))throw new TypeError("Unit in function tanh is no angle");return i(e.value)},"Array | Matrix":function(e){return o(e,i,!0)}});return i.toTex={1:"\\tanh\\left(${args[0]}\\right)"},i}},function(e,t,r){"use strict";e.exports=[r(350)]},function(e,t,c){"use strict";t.name="to",t.factory=function(e,t,r,n){var i=c(4),o=r(c(0)),a=r(c(7)),s=r(c(6)),u=n("to",{"Unit, Unit | string":function(e,t){return e.to(t)},"Matrix, Matrix":function(e,t){return a(e,t,u)},"Array, Array":function(e,t){return u(o(e),o(t)).valueOf()},"Array, Matrix":function(e,t){return u(o(e),t)},"Matrix, Array":function(e,t){return u(e,o(t))},"Matrix, any":function(e,t){return s(e,t,u,!1)},"any, Matrix":function(e,t){return s(t,e,u,!0)},"Array, any":function(e,t){return s(o(e),t,u,!1).valueOf()},"any, Array":function(e,t){return s(o(t),e,u,!0).valueOf()}});return u.toTex={2:"\\left(${args[0]}".concat(i.operators.to,"${args[1]}\\right)")},u}},function(e,t,r){"use strict";e.exports=[r(352),r(34),r(61),r(52),r(353),r(73),r(354),r(60),r(79),r(26)]},function(e,t,r){"use strict";var o=r(5);t.name="clone",t.factory=function(e,t,r,n){var i=n("clone",{any:o.clone});return i.toTex=void 0,i}},function(e,t,o){"use strict";t.name="hasNumericValue",t.factory=function(e,t,r,n){var i=r(o(52));return n("hasNumericValue",{string:function(e){return 0<e.trim().length&&!isNaN(Number(e))},any:function(e){return i(e)}})}},function(e,t,r){"use strict";var o=r(1);t.name="isPrime",t.factory=function(r,e,t,n){var i=n("isPrime",{number:function(e){if(e<2)return!1;if(2===e)return!0;if(e%2==0)return!1;for(var t=3;t*t<=e;t+=2)if(e%t==0)return!1;return!0},BigNumber:function(e){if(e.lt(2))return!1;if(e.equals(2))return!0;if(e.mod(2).isZero())return!1;for(var t=r.BigNumber(3);t.times(t).lte(e);t=t.plus(1))if(e.mod(t).isZero())return!1;return!0},"Array | Matrix":function(e){return o(e,i)}});return i}},function(e,t,r){"use strict";e.exports=[r(155),r(561),r(565),r(567),r(584),r(44),r(159)]},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(num,den)"],description:"Create a fraction from a number or from a numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]}},function(e){e.exports={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[0:2, 0:2] = ones(2, 2)"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]}},function(e){e.exports={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:[]}},function(e){e.exports={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:[]}},function(e){e.exports={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]}},function(e){e.exports={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]}},function(e){e.exports={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:[]}},function(e){e.exports={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:[]}},function(e){e.exports={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]}},function(e){e.exports={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]}},function(e){e.exports={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:[]}},function(e){e.exports={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:[]}},function(e){e.exports={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]}},function(e){e.exports={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"]}},function(e){e.exports={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]}},function(e){e.exports={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]}},function(e){e.exports={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.eval({x: 3})"],seealso:["simplify","parse","eval"]}},function(e){e.exports={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Solves 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:["lup","lusolve","usolve","matrix","sparse"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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.eval({x: 2})"],seealso:["derivative","parse","eval"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Solves 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:["lup","lusolve","lsolve","matrix","sparse"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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")']}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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([[1, 2], [3, 4]])"],seealso:["sqrt","abs","square","multiply"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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:[]}},function(e){e.exports={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:[]}},function(e){e.exports={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number, number": f(x)=x+x })',"double(2)",'double("hello")'],seealso:[]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"eval",category:"Expression",syntax:["eval(expression)","eval([expr1, expr2, expr3, ...])"],description:"Evaluate an expression or an array with expressions.",examples:['eval("2 + 3")','eval("sqrt(" + 4 + ")")'],seealso:[]}},function(e){e.exports={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]}},function(e){e.exports={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:[]}},function(e){e.exports={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:[]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"transpose",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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["forEach([1, 2, 3], function(val) { console.log(val) })"],seealso:["map","sort","filter"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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)'],seealso:["sort"]}},function(e){e.exports={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")',"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"]}},function(e){e.exports={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"]}},function(e){e.exports={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])"],seealso:["size","squeeze","resize"]}},function(e){e.exports={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"]}},function(e){e.exports={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","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]}},function(e){e.exports={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"])',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of a matrix or string. Indexes are one-based. Both the ranges lower-bound and upper-bound are included.",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]"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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:["permutations","factorial"]}},function(e){e.exports={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","permutations","gamma"]}},function(e){e.exports={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"]}},function(e){e.exports={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:[]}},function(e){e.exports={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"]}},function(e){e.exports={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","factorial"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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 before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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:[]}},function(e){e.exports={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"]}},function(e){e.exports={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dim)"],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","var"]}},function(e){e.exports={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dim)"],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","var"]}},function(e){e.exports={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","var","quantileSeq"]}},function(e){e.exports={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dim)"],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","var"]}},function(e){e.exports={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","var"]}},function(e){e.exports={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","var"]}},function(e){e.exports={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","var"]}},function(e){e.exports={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(var(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","min","prod","sum","var"]}},function(e){e.exports={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)"],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","var"]}},function(e){e.exports={name:"var",category:"Statistics",syntax:["var(a, b, c, ...)","var(A)","var(A, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["var(2, 4, 6)","var([2, 4, 6, 8])",'var([2, 4, 6, 8], "uncorrected")','var([2, 4, 6, 8], "biased")',"var([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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:[]}},function(e){e.exports={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:[]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e){e.exports={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"]}},function(e,t,r){"use strict";e.exports=[r(562),r(563),r(564),r(129),r(158)]},function(e,t,o){"use strict";var a=o(1);t.name="compile",t.factory=function(e,t,r,n){var i=r(o(44));return n("compile",{string:function(e){return i(e).compile()},"Array | Matrix":function(e){return a(e,function(e){return i(e).compile()})}})}},function(e,t,o){"use strict";var a=o(1);t.name="eval",t.factory=function(e,t,r,n){var i=r(o(44));return n("compile",{string:function(e){return i(e).compile().eval({})},"string, Object":function(e,t){return i(e).compile().eval(t)},"Array | Matrix":function(e){var t={};return a(e,function(e){return i(e).compile().eval(t)})},"Array | Matrix, Object":function(e,t){return a(e,function(e){return i(e).compile().eval(t)})}})}},function(e,t,n){"use strict";var s=n(13).getSafeProperty;t.math=!0,t.name="help",t.factory=function(i,e,t,r,o){var a=t(n(155));return r("help",{any:function(e){var t,r=e;if("string"!=typeof e)for(t in o)if(o.hasOwnProperty(t)&&e===o[t]){r=t;break}var n=s(a,r);if(!n)throw new Error('No documentation found on "'+r+'"');return new i.Help(n)}})}},function(e,t,r){"use strict";e.exports=[r(113),r(116),r(117),r(118),r(119),r(58),r(121),r(120),r(69),r(16),r(122),r(59),r(68),r(123),r(124),r(54),r(566)]},function(e,t){"use strict";t.name="UpdateNode",t.path="expression.node",t.factory=function(){return function(){throw new Error("UpdateNode is deprecated. Use AssignmentNode instead.")}}},function(e,t,r){"use strict";e.exports=[r(568),r(569),r(570),r(571),r(572),r(573),r(574),r(575),r(576),r(577),r(578),r(579),r(580),r(581),r(582),r(583)]},function(e,t,o){"use strict";var a=o(22).transform;t.name="apply",t.path="expression.transform",t.factory=function(r,e,t,n){var i=t(o(96));return n("apply",{"...any":function(e){var t=e[1];r.isNumber(t)?e[1]=t-1:r.isBigNumber(t)&&(e[1]=t.minus(1));try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";var a=o(22).transform;t.name="column",t.path="expression.transform",t.factory=function(n,e,t,r){var i=t(o(143));return r("column",{"...any":function(e){var t=e.length-1,r=e[t];n.isNumber(r)&&(e[t]=r-1);try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";var a=o(22).transform;t.name="concat",t.path="expression.transform",t.factory=function(n,e,t,r){var i=t(o(78));return r("concat",{"...any":function(e){var t=e.length-1,r=e[t];n.isNumber(r)?e[t]=r-1:n.isBigNumber(r)&&(e[t]=r.minus(1));try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,u){"use strict";var r=u(2).filter,c=u(2).filterRegExp,o=u(36).maxArgumentCount;function f(e,n){var i=o(n);return r(e,function(e,t,r){return 1===i?n(e):2===i?n(e,[t+1]):n(e,[t+1],r)})}t.name="filter",t.path="expression.transform",t.factory=function(o,e,t,r){var a=t(u(102)),n=t(u(0));function i(e,t,r){var n,i;return e[0]&&(n=e[0].compile().eval(r)),e[1]&&(i=o.isSymbolNode(e[1])||o.isFunctionAssignmentNode(e[1])?e[1].compile().eval(r):a(e[1],t,r)),s(n,i)}i.rawArgs=!0;var s=r("filter",{"Array, function":f,"Matrix, function":function(e,t){return n(f(e.toArray(),t))},"Array, RegExp":c,"Matrix, RegExp":function(e,t){return n(c(e.toArray(),t))}});return s.toTex=void 0,i}},function(e,t,i){"use strict";var u=i(36).maxArgumentCount,c=i(2).forEach;t.name="forEach",t.path="expression.transform",t.factory=function(o,e,t,r){var a=t(i(102));function n(e,t,r){var n,i;return e[0]&&(n=e[0].compile().eval(r)),e[1]&&(i=o.isSymbolNode(e[1])||o.isFunctionAssignmentNode(e[1])?e[1].compile().eval(r):a(e[1],t,r)),s(n,i)}n.rawArgs=!0;var s=r("forEach",{"Array | Matrix, function":function(t,i){var o=u(i);!function r(e,n){Array.isArray(e)?c(e,function(e,t){r(e,n.concat(t+1))}):1===o?i(e):2===o?i(e,n):i(e,n,t)}(t.valueOf(),[])}});return n}},function(e,t){"use strict";t.name="index",t.path="expression.transform",t.factory=function(o){return function(){for(var e=[],t=0,r=arguments.length;t<r;t++){var n=arguments[t];if(o.isRange(n))n.start--,n.end-=0<n.step?0:2;else if(n&&!0===n.isSet)n=n.map(function(e){return e-1});else if(o.isArray(n)||o.isMatrix(n))n=n.map(function(e){return e-1});else if(o.isNumber(n))n--;else if(o.isBigNumber(n))n=n.toNumber()-1;else if("string"!=typeof n)throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");e[t]=n}var i=new o.Index;return o.Index.apply(i,e),i}}},function(e,t,u){"use strict";var r=u(36).maxArgumentCount,a=u(2).map;function c(e,t,i){var o=r(t);return function r(e,n){return Array.isArray(e)?a(e,function(e,t){return r(e,n.concat(t+1))}):1===o?t(e):2===o?t(e,n):t(e,n,i)}(e,[])}t.name="map",t.path="expression.transform",t.factory=function(o,e,t,r){var a=t(u(102)),n=t(u(0));function i(e,t,r){var n,i;return e[0]&&(n=e[0].compile().eval(r)),e[1]&&(i=o.isSymbolNode(e[1])||o.isFunctionAssignmentNode(e[1])?e[1].compile().eval(r):a(e[1],t,r)),s(n,i)}i.rawArgs=!0;var s=r("map",{"Array, function":function(e,t){return c(e,t,e)},"Matrix, function":function(e,t){return n(c(e.valueOf(),t,e))}});return i}},function(e,t,o){"use strict";var a=o(22).transform,s=o(35);t.name="max",t.path="expression.transform",t.factory=function(r,e,t,n){var i=t(o(98));return n("max",{"...any":function(e){if(2===e.length&&s(e[0])){var t=e[1];r.isNumber(t)?e[1]=t-1:r.isBigNumber(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";var a=o(22).transform,s=o(35);t.name="mean",t.path="expression.transform",t.factory=function(r,e,t,n){var i=t(o(152));return n("mean",{"...any":function(e){if(2===e.length&&s(e[0])){var t=e[1];r.isNumber(t)?e[1]=t-1:r.isBigNumber(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";var a=o(22).transform,s=o(35);t.name="min",t.path="expression.transform",t.factory=function(r,e,t,n){var i=t(o(153));return n("min",{"...any":function(e){if(2===e.length&&s(e[0])){var t=e[1];r.isNumber(t)?e[1]=t-1:r.isBigNumber(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";t.name="range",t.path="expression.transform",t.factory=function(e,t,r,n){var i=r(o(77));return n("range",{"...any":function(e){return"boolean"!=typeof e[e.length-1]&&e.push(!0),i.apply(null,e)}})}},function(e,t,o){"use strict";var a=o(22).transform,s=o(35);t.name="std",t.path="expression.transform",t.factory=function(r,e,t,n){var i=t(o(154));return n("std",{"...any":function(e){if(2<=e.length&&s(e[0])){var t=e[1];r.isNumber(t)?e[1]=t-1:r.isBigNumber(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";var a=o(22).transform;t.name="row",t.path="expression.transform",t.factory=function(n,e,t,r){var i=t(o(146));return r("row",{"...any":function(e){var t=e.length-1,r=e[t];n.isNumber(r)&&(e[t]=r-1);try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";var a=o(22).transform;t.name="subset",t.path="expression.transform",t.factory=function(e,t,r,n){var i=r(o(23));return n("subset",{"...any":function(e){try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";var a=o(22).transform,s=o(35);t.name="sum",t.path="expression.transform",t.factory=function(r,e,t,n){var i=t(o(99));return n("sum",{"...any":function(e){if(2===e.length&&s(e[0])){var t=e[1];r.isNumber(t)?e[1]=t-1:r.isBigNumber(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,o){"use strict";var a=o(22).transform,s=o(35);t.name="var",t.path="expression.transform",t.factory=function(r,e,t,n){var i=t(o(101));return n("var",{"...any":function(e){if(2<=e.length&&s(e[0])){var t=e[1];r.isNumber(t)?e[1]=t-1:r.isBigNumber(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw a(e)}}})}},function(e,t,r){"use strict";var i=r(5),s=r(9);t.name="Help",t.path="type",t.factory=function(o,e,t){var a=t(r(158))();function n(e){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(!e)throw new Error('Argument "doc" missing');this.doc=e}return n.prototype.type="Help",n.prototype.isHelp=!0,n.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 r=0;r<e.examples.length;r++){var n=e.examples[r];t+=" "+n+"\n";var i=void 0;try{i=a.eval(n)}catch(e){i=e}void 0===i||o.isHelp(i)||(t+=" "+s.format(i,{precision:14})+"\n")}t+="\n"}return e.seealso&&e.seealso.length&&(t+="See also: "+e.seealso.join(", ")+"\n"),t},n.prototype.toJSON=function(){var e=i.clone(this.doc);return e.mathjs="Help",e},n.fromJSON=function(e){var t={};for(var r in e)"mathjs"!==r&&(t[r]=e[r]);return new n(t)},n.prototype.valueOf=n.prototype.toString,n}},function(e,t,r){"use strict";e.exports=[r(586)]},function(e,t){"use strict";t.name="reviver",t.path="json",t.factory=function(n,e,t,r,i){return function(e,t){var r=n[t&&t.mathjs]||i.expression&&i.expression.node[t&&t.mathjs];return r&&"function"==typeof r.fromJSON?r.fromJSON(t):t}},t.math=!0},function(e,t,r){"use strict";var n=r(57),i=r(8),o=r(48);e.exports=[{name:"ArgumentsError",path:"error",factory:function(){return n}},{name:"DimensionError",path:"error",factory:function(){return i}},{name:"IndexError",path:"error",factory:function(){return o}}]}],i.c=n,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=161);function i(e){if(n[e])return n[e].exports;var t=n[e]={i:e,l:!1,exports:{}};return r[e].call(t.exports,t,t.exports,i),t.l=!0,t.exports}var r,n});
56
56
  //# sourceMappingURL=math.min.map