@stdlib/esm
Version:
ES module distribution for Stdlib, a standard library for JavaScript and Node.js.
3 lines • 794 B
JavaScript
// This file is a part of stdlib. License is Apache-2.0: http://www.apache.org/licenses/LICENSE-2.0
import r from"./../../../utils/define-nonenumerable-read-only-property.js";function e(r,e){var n,t;if((t=r.length)<2||0===e)return 0===t?0:r[0];for(n=r[t-=1]*e+r[t-1],t-=2;t>=0;)n=n*e+r[t],t-=1;return n}var n=e;function t(r){var e,t,o,u;if(r.length>500)return function(e){return n(r,e)};if(e="return function evalpoly(x){",0===(t=r.length))e+="return 0.0;";else if(1===t)e+="return "+r[0]+";";else{for(e+="if(x===0.0){return "+r[0]+";}",e+="return "+r[0],o=t-1,u=1;u<t;u++)e+="+x*",u<o&&(e+="("),e+=r[u];for(u=0;u<o-1;u++)e+=")";e+=";"}return e+="}",e+="//# sourceURL=evalpoly.factory.js",new Function(e)()}var o=r,u=e,f=t;o(u,"factory",f);export default u;
//# sourceMappingURL=evalpoly.js.map