@stdlib/math-base-tools 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -5
- package/dist/index.js +1 -1
- package/dist/index.js.map +2 -2
- package/docs/types/index.d.ts +80 -6
- package/lib/index.js +18 -0
- package/package.json +15 -59
package/README.md
CHANGED
|
@@ -67,12 +67,14 @@ var o = tools;
|
|
|
67
67
|
<div class="namespace-toc">
|
|
68
68
|
|
|
69
69
|
- <span class="signature">[`continuedFraction( generator[, options ] )`][@stdlib/math/base/tools/continued-fraction]</span><span class="delimiter">: </span><span class="description">continued fraction approximation.</span>
|
|
70
|
-
- <span class="signature">[`evalpoly( c, x )`][@stdlib/math/base/tools/evalpoly]</span><span class="delimiter">: </span><span class="description">evaluate a polynomial.</span>
|
|
71
|
-
- <span class="signature">[`
|
|
70
|
+
- <span class="signature">[`evalpoly( c, x )`][@stdlib/math/base/tools/evalpoly]</span><span class="delimiter">: </span><span class="description">evaluate a polynomial using double-precision floating-point arithmetic.</span>
|
|
71
|
+
- <span class="signature">[`evalpolyf( c, x )`][@stdlib/math/base/tools/evalpolyf]</span><span class="delimiter">: </span><span class="description">evaluate a polynomial using single-precision floating-point arithmetic.</span>
|
|
72
|
+
- <span class="signature">[`evalrational( P, Q, x )`][@stdlib/math/base/tools/evalrational]</span><span class="delimiter">: </span><span class="description">evaluate a rational function using double-precision floating-point arithmetic.</span>
|
|
73
|
+
- <span class="signature">[`evalrationalf( P, Q, x )`][@stdlib/math/base/tools/evalrationalf]</span><span class="delimiter">: </span><span class="description">evaluate a rational function using single-precision floating-point arithmetic.</span>
|
|
72
74
|
- <span class="signature">[`fibpoly( n, x )`][@stdlib/math/base/tools/fibpoly]</span><span class="delimiter">: </span><span class="description">evaluate a Fibonacci polynomial.</span>
|
|
73
75
|
- <span class="signature">[`hermitepoly( n, x )`][@stdlib/math/base/tools/hermitepoly]</span><span class="delimiter">: </span><span class="description">evaluate a physicist's Hermite polynomial.</span>
|
|
74
76
|
- <span class="signature">[`lucaspoly( n, x )`][@stdlib/math/base/tools/lucaspoly]</span><span class="delimiter">: </span><span class="description">evaluate a Lucas polynomial.</span>
|
|
75
|
-
- <span class="signature">[`normhermitepoly( n, x )`][@stdlib/math/base/tools/normhermitepoly]</span><span class="delimiter">: </span><span class="description">evaluate a normalized Hermite polynomial.</span>
|
|
77
|
+
- <span class="signature">[`normhermitepoly( n, x )`][@stdlib/math/base/tools/normhermitepoly]</span><span class="delimiter">: </span><span class="description">evaluate a normalized Hermite polynomial using double-precision floating-point arithmetic.</span>
|
|
76
78
|
- <span class="signature">[`sumSeries( generator[, options ] )`][@stdlib/math/base/tools/sum-series]</span><span class="delimiter">: </span><span class="description">compute the sum of an infinite series.</span>
|
|
77
79
|
|
|
78
80
|
</div>
|
|
@@ -149,8 +151,8 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
149
151
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/math-base-tools.svg
|
|
150
152
|
[npm-url]: https://npmjs.org/package/@stdlib/math-base-tools
|
|
151
153
|
|
|
152
|
-
[test-image]: https://github.com/stdlib-js/math-base-tools/actions/workflows/test.yml/badge.svg?branch=v0.
|
|
153
|
-
[test-url]: https://github.com/stdlib-js/math-base-tools/actions/workflows/test.yml?query=branch:v0.
|
|
154
|
+
[test-image]: https://github.com/stdlib-js/math-base-tools/actions/workflows/test.yml/badge.svg?branch=v0.3.0
|
|
155
|
+
[test-url]: https://github.com/stdlib-js/math-base-tools/actions/workflows/test.yml?query=branch:v0.3.0
|
|
154
156
|
|
|
155
157
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/math-base-tools/main.svg
|
|
156
158
|
[coverage-url]: https://codecov.io/github/stdlib-js/math-base-tools?branch=main
|
|
@@ -188,8 +190,12 @@ Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
|
188
190
|
|
|
189
191
|
[@stdlib/math/base/tools/evalpoly]: https://www.npmjs.com/package/@stdlib/math-base-tools-evalpoly
|
|
190
192
|
|
|
193
|
+
[@stdlib/math/base/tools/evalpolyf]: https://www.npmjs.com/package/@stdlib/math-base-tools-evalpolyf
|
|
194
|
+
|
|
191
195
|
[@stdlib/math/base/tools/evalrational]: https://www.npmjs.com/package/@stdlib/math-base-tools-evalrational
|
|
192
196
|
|
|
197
|
+
[@stdlib/math/base/tools/evalrationalf]: https://www.npmjs.com/package/@stdlib/math-base-tools-evalrationalf
|
|
198
|
+
|
|
193
199
|
[@stdlib/math/base/tools/fibpoly]: https://www.npmjs.com/package/@stdlib/math-base-tools-fibpoly
|
|
194
200
|
|
|
195
201
|
[@stdlib/math/base/tools/hermitepoly]: https://www.npmjs.com/package/@stdlib/math-base-tools-hermitepoly
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var r=require('@stdlib/utils-define-read-only-property/dist'),e={};r(e,"continuedFraction",require('@stdlib/math-base-tools-continued-fraction/dist'));r(e,"evalpoly",require('@stdlib/math-base-tools-evalpoly/dist'));r(e,"evalrational",require('@stdlib/math-base-tools-evalrational/dist'));r(e,"fibpoly",require('@stdlib/math-base-tools-fibpoly/dist'));r(e,"hermitepoly",require('@stdlib/math-base-tools-hermitepoly/dist'));r(e,"lucaspoly",require('@stdlib/math-base-tools-lucaspoly/dist'));r(e,"normhermitepoly",require('@stdlib/math-base-tools-normhermitepoly/dist'));r(e,"sumSeries",require('@stdlib/math-base-tools-sum-series/dist'));module.exports=e;
|
|
1
|
+
"use strict";var r=require('@stdlib/utils-define-read-only-property/dist'),e={};r(e,"continuedFraction",require('@stdlib/math-base-tools-continued-fraction/dist'));r(e,"evalpoly",require('@stdlib/math-base-tools-evalpoly/dist'));r(e,"evalpolyf",require('@stdlib/math-base-tools-evalpolyf/dist'));r(e,"evalrational",require('@stdlib/math-base-tools-evalrational/dist'));r(e,"evalrationalf",require('@stdlib/math-base-tools-evalrationalf/dist'));r(e,"fibpoly",require('@stdlib/math-base-tools-fibpoly/dist'));r(e,"hermitepoly",require('@stdlib/math-base-tools-hermitepoly/dist'));r(e,"lucaspoly",require('@stdlib/math-base-tools-lucaspoly/dist'));r(e,"normhermitepoly",require('@stdlib/math-base-tools-normhermitepoly/dist'));r(e,"sumSeries",require('@stdlib/math-base-tools-sum-series/dist'));module.exports=e;
|
|
2
2
|
/** @license Apache-2.0 */
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../lib/index.js"],
|
|
4
|
-
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n/*\n* The following modules are intentionally not exported: evalpoly-compile, evalpoly-compile-c, evalrational-compile, evalrational-compile-c\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name continuedFraction\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/continued-fraction}\n*/\nsetReadOnly( ns, 'continuedFraction', require( '@stdlib/math-base-tools-continued-fraction' ) );\n\n/**\n* @name evalpoly\n* @memberof tools\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/evalpoly}\n*/\nsetReadOnly( ns, 'evalpoly', require( '@stdlib/math-base-tools-evalpoly' ) );\n\n/**\n* @name evalrational\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/evalrational}\n*/\nsetReadOnly( ns, 'evalrational', require( '@stdlib/math-base-tools-evalrational' ) );\n\n/**\n* @name fibpoly\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/fibpoly}\n*/\nsetReadOnly( ns, 'fibpoly', require( '@stdlib/math-base-tools-fibpoly' ) );\n\n/**\n* @name hermitepoly\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/hermitepoly}\n*/\nsetReadOnly( ns, 'hermitepoly', require( '@stdlib/math-base-tools-hermitepoly' ) );\n\n/**\n* @name lucaspoly\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/lucaspoly}\n*/\nsetReadOnly( ns, 'lucaspoly', require( '@stdlib/math-base-tools-lucaspoly' ) );\n\n/**\n* @name normhermitepoly\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/normhermitepoly}\n*/\nsetReadOnly( ns, 'normhermitepoly', require( '@stdlib/math-base-tools-normhermitepoly' ) );\n\n/**\n* @name sumSeries\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/sum-series}\n*/\nsetReadOnly( ns, 'sumSeries', require( '@stdlib/math-base-tools-sum-series' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n"],
|
|
5
|
-
"mappings": "aA8BA,IAAIA,EAAc,QAAS,yCAA0C,EAUjEC,EAAK,CAAC,EASVD,EAAaC,EAAI,oBAAqB,QAAS,4CAA6C,CAAE,EAS9FD,EAAaC,EAAI,WAAY,QAAS,kCAAmC,CAAE,EAS3ED,EAAaC,EAAI,eAAgB,QAAS,sCAAuC,CAAE,EASnFD,EAAaC,EAAI,UAAW,QAAS,iCAAkC,CAAE,EASzED,EAAaC,EAAI,cAAe,QAAS,qCAAsC,CAAE,EASjFD,EAAaC,EAAI,YAAa,QAAS,mCAAoC,CAAE,EAS7ED,EAAaC,EAAI,kBAAmB,QAAS,yCAA0C,CAAE,EASzFD,EAAaC,EAAI,YAAa,QAAS,oCAAqC,CAAE,EAK9E,OAAO,QAAUA",
|
|
4
|
+
"sourcesContent": ["/**\n* @license Apache-2.0\n*\n* Copyright (c) 2018 The Stdlib Authors.\n*\n* Licensed under the Apache License, Version 2.0 (the \"License\");\n* you may not use this file except in compliance with the License.\n* You may obtain a copy of the License at\n*\n* http://www.apache.org/licenses/LICENSE-2.0\n*\n* Unless required by applicable law or agreed to in writing, software\n* distributed under the License is distributed on an \"AS IS\" BASIS,\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n* See the License for the specific language governing permissions and\n* limitations under the License.\n*/\n\n'use strict';\n\n/*\n* When adding modules to the namespace, ensure that they are added in alphabetical order according to module name.\n*/\n\n/*\n* The following modules are intentionally not exported: evalpoly-compile, evalpoly-compile-c, evalrational-compile, evalrational-compile-c\n*/\n\n// MODULES //\n\nvar setReadOnly = require( '@stdlib/utils-define-read-only-property' );\n\n\n// MAIN //\n\n/**\n* Top-level namespace.\n*\n* @namespace ns\n*/\nvar ns = {};\n\n/**\n* @name continuedFraction\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/continued-fraction}\n*/\nsetReadOnly( ns, 'continuedFraction', require( '@stdlib/math-base-tools-continued-fraction' ) );\n\n/**\n* @name evalpoly\n* @memberof tools\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/evalpoly}\n*/\nsetReadOnly( ns, 'evalpoly', require( '@stdlib/math-base-tools-evalpoly' ) );\n\n/**\n* @name evalpolyf\n* @memberof tools\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/evalpolyf}\n*/\nsetReadOnly( ns, 'evalpolyf', require( '@stdlib/math-base-tools-evalpolyf' ) );\n\n/**\n* @name evalrational\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/evalrational}\n*/\nsetReadOnly( ns, 'evalrational', require( '@stdlib/math-base-tools-evalrational' ) );\n\n/**\n* @name evalrationalf\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/evalrationalf}\n*/\nsetReadOnly( ns, 'evalrationalf', require( '@stdlib/math-base-tools-evalrationalf' ) );\n\n/**\n* @name fibpoly\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/fibpoly}\n*/\nsetReadOnly( ns, 'fibpoly', require( '@stdlib/math-base-tools-fibpoly' ) );\n\n/**\n* @name hermitepoly\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/hermitepoly}\n*/\nsetReadOnly( ns, 'hermitepoly', require( '@stdlib/math-base-tools-hermitepoly' ) );\n\n/**\n* @name lucaspoly\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/lucaspoly}\n*/\nsetReadOnly( ns, 'lucaspoly', require( '@stdlib/math-base-tools-lucaspoly' ) );\n\n/**\n* @name normhermitepoly\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/normhermitepoly}\n*/\nsetReadOnly( ns, 'normhermitepoly', require( '@stdlib/math-base-tools-normhermitepoly' ) );\n\n/**\n* @name sumSeries\n* @memberof ns\n* @readonly\n* @type {Function}\n* @see {@link module:@stdlib/math/base/tools/sum-series}\n*/\nsetReadOnly( ns, 'sumSeries', require( '@stdlib/math-base-tools-sum-series' ) );\n\n\n// EXPORTS //\n\nmodule.exports = ns;\n"],
|
|
5
|
+
"mappings": "aA8BA,IAAIA,EAAc,QAAS,yCAA0C,EAUjEC,EAAK,CAAC,EASVD,EAAaC,EAAI,oBAAqB,QAAS,4CAA6C,CAAE,EAS9FD,EAAaC,EAAI,WAAY,QAAS,kCAAmC,CAAE,EAS3ED,EAAaC,EAAI,YAAa,QAAS,mCAAoC,CAAE,EAS7ED,EAAaC,EAAI,eAAgB,QAAS,sCAAuC,CAAE,EASnFD,EAAaC,EAAI,gBAAiB,QAAS,uCAAwC,CAAE,EASrFD,EAAaC,EAAI,UAAW,QAAS,iCAAkC,CAAE,EASzED,EAAaC,EAAI,cAAe,QAAS,qCAAsC,CAAE,EASjFD,EAAaC,EAAI,YAAa,QAAS,mCAAoC,CAAE,EAS7ED,EAAaC,EAAI,kBAAmB,QAAS,yCAA0C,CAAE,EASzFD,EAAaC,EAAI,YAAa,QAAS,oCAAqC,CAAE,EAK9E,OAAO,QAAUA",
|
|
6
6
|
"names": ["setReadOnly", "ns"]
|
|
7
7
|
}
|
package/docs/types/index.d.ts
CHANGED
|
@@ -22,7 +22,9 @@
|
|
|
22
22
|
|
|
23
23
|
import continuedFraction = require( '@stdlib/math-base-tools-continued-fraction' );
|
|
24
24
|
import evalpoly = require( '@stdlib/math-base-tools-evalpoly' );
|
|
25
|
+
import evalpolyf = require( '@stdlib/math-base-tools-evalpolyf' );
|
|
25
26
|
import evalrational = require( '@stdlib/math-base-tools-evalrational' );
|
|
27
|
+
import evalrationalf = require( '@stdlib/math-base-tools-evalrationalf' );
|
|
26
28
|
import fibpoly = require( '@stdlib/math-base-tools-fibpoly' );
|
|
27
29
|
import hermitepoly = require( '@stdlib/math-base-tools-hermitepoly' );
|
|
28
30
|
import lucaspoly = require( '@stdlib/math-base-tools-lucaspoly' );
|
|
@@ -64,7 +66,7 @@ interface Namespace {
|
|
|
64
66
|
continuedFraction: typeof continuedFraction;
|
|
65
67
|
|
|
66
68
|
/**
|
|
67
|
-
* Evaluates a polynomial.
|
|
69
|
+
* Evaluates a polynomial using double-precision floating-point arithmetic.
|
|
68
70
|
*
|
|
69
71
|
* ## Notes
|
|
70
72
|
*
|
|
@@ -78,11 +80,11 @@ interface Namespace {
|
|
|
78
80
|
* @returns evaluated polynomial
|
|
79
81
|
*
|
|
80
82
|
* @example
|
|
81
|
-
* var v = ns.evalpoly( [3.0,2.0,1.0], 10.0 ); // 3*10^0 + 2*10^1 + 1*10^2
|
|
83
|
+
* var v = ns.evalpoly( [ 3.0, 2.0, 1.0 ], 10.0 ); // 3*10^0 + 2*10^1 + 1*10^2
|
|
82
84
|
* // returns 123.0
|
|
83
85
|
*
|
|
84
86
|
* @example
|
|
85
|
-
* var polyval = ns.evalpoly.factory( [3.0,2.0,1.0] );
|
|
87
|
+
* var polyval = ns.evalpoly.factory( [ 3.0, 2.0, 1.0 ] );
|
|
86
88
|
*
|
|
87
89
|
* var v = polyval( 10.0 ); // => 3*10^0 + 2*10^1 + 1*10^2
|
|
88
90
|
* // returns 123.0
|
|
@@ -93,16 +95,48 @@ interface Namespace {
|
|
|
93
95
|
evalpoly: typeof evalpoly;
|
|
94
96
|
|
|
95
97
|
/**
|
|
96
|
-
* Evaluates a
|
|
98
|
+
* Evaluates a polynomial using single-precision floating-point arithmetic.
|
|
97
99
|
*
|
|
98
100
|
* ## Notes
|
|
99
101
|
*
|
|
100
|
-
* - Coefficients should be sorted in ascending degree.
|
|
101
102
|
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
|
|
102
103
|
*
|
|
103
104
|
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
|
|
104
105
|
*
|
|
105
106
|
*
|
|
107
|
+
* @param c - polynomial coefficients sorted in ascending degree
|
|
108
|
+
* @param x - value at which to evaluate the polynomial
|
|
109
|
+
* @returns evaluated polynomial
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* var Float32Array = require( '@stdlib/array-float32' );
|
|
113
|
+
*
|
|
114
|
+
* var v = ns.evalpolyf( new Float32Array( [ 3.0, 2.0, 1.0 ] ), 10.0 ); // 3*10^0 + 2*10^1 + 1*10^2
|
|
115
|
+
* // returns 123.0
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* var Float32Array = require( '@stdlib/array-float32' );
|
|
119
|
+
*
|
|
120
|
+
* var polyval = ns.evalpolyf.factory( new Float32Array( [ 3.0, 2.0, 1.0 ] ) );
|
|
121
|
+
*
|
|
122
|
+
* var v = polyval( 10.0 ); // => 3*10^0 + 2*10^1 + 1*10^2
|
|
123
|
+
* // returns 123.0
|
|
124
|
+
*
|
|
125
|
+
* v = polyval( 5.0 ); // => 3*5^0 + 2*5^1 + 1*5^2
|
|
126
|
+
* // returns 38.0
|
|
127
|
+
*/
|
|
128
|
+
evalpolyf: typeof evalpolyf;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Evaluates a rational function (i.e., the ratio of two polynomials described by the coefficients stored in \\(P\\) and \\(Q\\)) using double-precision floating-point arithmetic.
|
|
132
|
+
*
|
|
133
|
+
* ## Notes
|
|
134
|
+
*
|
|
135
|
+
* - Coefficients should be sorted in ascending degree.
|
|
136
|
+
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
|
|
137
|
+
*
|
|
138
|
+
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
|
|
139
|
+
*
|
|
106
140
|
* @param P - numerator polynomial coefficients sorted in ascending degree
|
|
107
141
|
* @param Q - denominator polynomial coefficients sorted in ascending degree
|
|
108
142
|
* @param x - value at which to evaluate the rational function
|
|
@@ -129,6 +163,46 @@ interface Namespace {
|
|
|
129
163
|
*/
|
|
130
164
|
evalrational: typeof evalrational;
|
|
131
165
|
|
|
166
|
+
/**
|
|
167
|
+
* Evaluates a rational function (i.e., the ratio of two polynomials described by the coefficients stored in \\(P\\) and \\(Q\\)) using single-precision floating-point arithmetic.
|
|
168
|
+
*
|
|
169
|
+
* ## Notes
|
|
170
|
+
*
|
|
171
|
+
* - Coefficients should be sorted in ascending degree.
|
|
172
|
+
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
|
|
173
|
+
*
|
|
174
|
+
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
|
|
175
|
+
*
|
|
176
|
+
* @param P - numerator polynomial coefficients sorted in ascending degree
|
|
177
|
+
* @param Q - denominator polynomial coefficients sorted in ascending degree
|
|
178
|
+
* @param x - value at which to evaluate the rational function
|
|
179
|
+
* @returns evaluated rational function
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* var Float32Array = require( '@stdlib/array-float32' );
|
|
183
|
+
*
|
|
184
|
+
* var P = new Float32Array( [ -6.0, -5.0 ] );
|
|
185
|
+
* var Q = new Float32Array( [ 3.0, 0.5 ] );
|
|
186
|
+
*
|
|
187
|
+
* var v = ns.evalrationalf( P, Q, 6.0 ); // => ( -6*6^0 - 5*6^1 ) / ( 3*6^0 + 0.5*6^1 ) = (-6-30)/(3+3)
|
|
188
|
+
* // returns -6.0
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* var Float32Array = require( '@stdlib/array-float32' );
|
|
192
|
+
*
|
|
193
|
+
* var P = new Float32Array( [ 20.0, 8.0, 3.0 ] );
|
|
194
|
+
* var Q = new Float32Array( [ 10.0, 9.0, 1.0 ] );
|
|
195
|
+
*
|
|
196
|
+
* var rational = ns.evalrationalf.factory( P, Q );
|
|
197
|
+
*
|
|
198
|
+
* var v = rational( 10.0 ); // => (20*10^0 + 8*10^1 + 3*10^2) / (10*10^0 + 9*10^1 + 1*10^2) = (20+80+300)/(10+90+100)
|
|
199
|
+
* // returns 2.0
|
|
200
|
+
*
|
|
201
|
+
* v = rational( 2.0 ); // => (20*2^0 + 8*2^1 + 3*2^2) / (10*2^0 + 9*2^1 + 1*2^2) = (20+16+12)/(10+18+4)
|
|
202
|
+
* // returns 1.5
|
|
203
|
+
*/
|
|
204
|
+
evalrationalf: typeof evalrationalf;
|
|
205
|
+
|
|
132
206
|
/**
|
|
133
207
|
* Evaluates a Fibonacci polynomial.
|
|
134
208
|
*
|
|
@@ -197,7 +271,7 @@ interface Namespace {
|
|
|
197
271
|
lucaspoly: typeof lucaspoly;
|
|
198
272
|
|
|
199
273
|
/**
|
|
200
|
-
* Evaluates a normalized Hermite polynomial.
|
|
274
|
+
* Evaluates a normalized Hermite polynomial using double-precision floating-point arithmetic.
|
|
201
275
|
*
|
|
202
276
|
* @param n - nonnegative polynomial degree
|
|
203
277
|
* @param x - evaluation point
|
package/lib/index.js
CHANGED
|
@@ -58,6 +58,15 @@ setReadOnly( ns, 'continuedFraction', require( '@stdlib/math-base-tools-continue
|
|
|
58
58
|
*/
|
|
59
59
|
setReadOnly( ns, 'evalpoly', require( '@stdlib/math-base-tools-evalpoly' ) );
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* @name evalpolyf
|
|
63
|
+
* @memberof tools
|
|
64
|
+
* @readonly
|
|
65
|
+
* @type {Function}
|
|
66
|
+
* @see {@link module:@stdlib/math/base/tools/evalpolyf}
|
|
67
|
+
*/
|
|
68
|
+
setReadOnly( ns, 'evalpolyf', require( '@stdlib/math-base-tools-evalpolyf' ) );
|
|
69
|
+
|
|
61
70
|
/**
|
|
62
71
|
* @name evalrational
|
|
63
72
|
* @memberof ns
|
|
@@ -67,6 +76,15 @@ setReadOnly( ns, 'evalpoly', require( '@stdlib/math-base-tools-evalpoly' ) );
|
|
|
67
76
|
*/
|
|
68
77
|
setReadOnly( ns, 'evalrational', require( '@stdlib/math-base-tools-evalrational' ) );
|
|
69
78
|
|
|
79
|
+
/**
|
|
80
|
+
* @name evalrationalf
|
|
81
|
+
* @memberof ns
|
|
82
|
+
* @readonly
|
|
83
|
+
* @type {Function}
|
|
84
|
+
* @see {@link module:@stdlib/math/base/tools/evalrationalf}
|
|
85
|
+
*/
|
|
86
|
+
setReadOnly( ns, 'evalrationalf', require( '@stdlib/math-base-tools-evalrationalf' ) );
|
|
87
|
+
|
|
70
88
|
/**
|
|
71
89
|
* @name fibpoly
|
|
72
90
|
* @memberof ns
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/math-base-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Base math tools.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -16,17 +16,11 @@
|
|
|
16
16
|
"main": "./lib",
|
|
17
17
|
"directories": {
|
|
18
18
|
"doc": "./docs",
|
|
19
|
-
"example": "./examples",
|
|
20
19
|
"lib": "./lib",
|
|
21
|
-
"
|
|
20
|
+
"dist": "./dist"
|
|
22
21
|
},
|
|
23
22
|
"types": "./docs/types",
|
|
24
|
-
"scripts": {
|
|
25
|
-
"test": "make test",
|
|
26
|
-
"test-cov": "make test-cov",
|
|
27
|
-
"examples": "make examples",
|
|
28
|
-
"benchmark": "make benchmark"
|
|
29
|
-
},
|
|
23
|
+
"scripts": {},
|
|
30
24
|
"homepage": "https://stdlib.io",
|
|
31
25
|
"repository": {
|
|
32
26
|
"type": "git",
|
|
@@ -36,57 +30,19 @@
|
|
|
36
30
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
37
31
|
},
|
|
38
32
|
"dependencies": {
|
|
39
|
-
"@stdlib/math-base-tools-continued-fraction": "^0.2.
|
|
40
|
-
"@stdlib/math-base-tools-evalpoly": "^0.2.
|
|
41
|
-
"@stdlib/math-base-tools-
|
|
42
|
-
"@stdlib/math-base-tools-
|
|
43
|
-
"@stdlib/math-base-tools-
|
|
44
|
-
"@stdlib/math-base-tools-
|
|
45
|
-
"@stdlib/math-base-tools-
|
|
46
|
-
"@stdlib/math-base-tools-
|
|
47
|
-
"@stdlib/
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"@stdlib/array-float64": "^0.1.1",
|
|
51
|
-
"@stdlib/assert-has-generator-support": "^0.1.1",
|
|
52
|
-
"@stdlib/assert-is-browser": "^0.1.1",
|
|
53
|
-
"@stdlib/assert-is-integer": "^0.1.0",
|
|
54
|
-
"@stdlib/assert-is-string": "^0.1.1",
|
|
55
|
-
"@stdlib/constants-float32-smallest-normal": "^0.2.0",
|
|
56
|
-
"@stdlib/constants-float64-eps": "^0.1.1",
|
|
57
|
-
"@stdlib/constants-float64-sqrt-two": "^0.2.0",
|
|
58
|
-
"@stdlib/fs-read-file": "^0.1.1",
|
|
59
|
-
"@stdlib/function-ctor": "^0.2.0",
|
|
60
|
-
"@stdlib/math-base-assert-is-integer": "^0.1.1",
|
|
61
|
-
"@stdlib/math-base-assert-is-nan": "^0.1.1",
|
|
62
|
-
"@stdlib/math-base-special-abs": "^0.1.1",
|
|
63
|
-
"@stdlib/math-base-special-binomcoef": "^0.2.0",
|
|
64
|
-
"@stdlib/math-base-special-ceil": "^0.1.1",
|
|
65
|
-
"@stdlib/math-base-special-fibonacci": "^0.1.0",
|
|
66
|
-
"@stdlib/math-base-special-floor": "^0.1.1",
|
|
67
|
-
"@stdlib/math-base-special-log1p": "^0.2.0",
|
|
68
|
-
"@stdlib/math-base-special-lucas": "^0.2.0",
|
|
69
|
-
"@stdlib/math-base-special-negafibonacci": "^0.1.0",
|
|
70
|
-
"@stdlib/math-base-special-negalucas": "^0.1.0",
|
|
71
|
-
"@stdlib/math-base-special-pow": "^0.1.0",
|
|
72
|
-
"@stdlib/math-base-special-round": "^0.1.1",
|
|
73
|
-
"@stdlib/math-base-special-tan": "^0.1.0",
|
|
74
|
-
"@stdlib/random-base-discrete-uniform": "^0.1.0",
|
|
75
|
-
"@stdlib/random-base-randu": "^0.1.0",
|
|
76
|
-
"@stdlib/string-base-uppercase": "^0.2.0",
|
|
77
|
-
"@stdlib/string-replace": "^0.1.1",
|
|
78
|
-
"@stdlib/utils-constant-function": "^0.2.0",
|
|
79
|
-
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.0",
|
|
80
|
-
"@stdlib/utils-eval": "^0.2.0",
|
|
81
|
-
"@stdlib/utils-keys": "^0.1.0",
|
|
82
|
-
"@stdlib/utils-try-require": "^0.2.0",
|
|
83
|
-
"proxyquire": "^2.0.0",
|
|
84
|
-
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
|
|
85
|
-
"istanbul": "^0.4.1",
|
|
86
|
-
"tap-min": "git+https://github.com/Planeshifter/tap-min.git",
|
|
87
|
-
"@stdlib/bench-harness": "^0.2.0",
|
|
88
|
-
"@stdlib/bench": "^0.3.1"
|
|
33
|
+
"@stdlib/math-base-tools-continued-fraction": "^0.2.2",
|
|
34
|
+
"@stdlib/math-base-tools-evalpoly": "^0.2.2",
|
|
35
|
+
"@stdlib/math-base-tools-evalpolyf": "^0.1.1",
|
|
36
|
+
"@stdlib/math-base-tools-evalrational": "^0.2.2",
|
|
37
|
+
"@stdlib/math-base-tools-evalrationalf": "^0.1.1",
|
|
38
|
+
"@stdlib/math-base-tools-fibpoly": "^0.2.1",
|
|
39
|
+
"@stdlib/math-base-tools-hermitepoly": "^0.2.2",
|
|
40
|
+
"@stdlib/math-base-tools-lucaspoly": "^0.2.2",
|
|
41
|
+
"@stdlib/math-base-tools-normhermitepoly": "^0.2.2",
|
|
42
|
+
"@stdlib/math-base-tools-sum-series": "^0.2.2",
|
|
43
|
+
"@stdlib/utils-define-read-only-property": "^0.2.2"
|
|
89
44
|
},
|
|
45
|
+
"devDependencies": {},
|
|
90
46
|
"engines": {
|
|
91
47
|
"node": ">=0.10.0",
|
|
92
48
|
"npm": ">2.7.0"
|