Skip to content

Commit 6affd28

Browse files
stdlib-botkgryte
andauthored
feat: update namespace TypeScript declarations
PR-URL: #2032 Co-authored-by: Athan Reines <kgryte@gmail.com> Reviewed-by: Athan Reines <kgryte@gmail.com> Signed-off-by: stdlib-bot <82920195+stdlib-bot@users.noreply.github.com>
1 parent 0038b4b commit 6affd28

File tree

1 file changed

+80
-6
lines changed
  • lib/node_modules/@stdlib/math/base/tools/docs/types

1 file changed

+80
-6
lines changed

lib/node_modules/@stdlib/math/base/tools/docs/types/index.d.ts

Lines changed: 80 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222

2323
import continuedFraction = require( '@stdlib/math/base/tools/continued-fraction' );
2424
import evalpoly = require( '@stdlib/math/base/tools/evalpoly' );
25+
import evalpolyf = require( '@stdlib/math/base/tools/evalpolyf' );
2526
import evalrational = require( '@stdlib/math/base/tools/evalrational' );
27+
import evalrationalf = require( '@stdlib/math/base/tools/evalrationalf' );
2628
import fibpoly = require( '@stdlib/math/base/tools/fibpoly' );
2729
import hermitepoly = require( '@stdlib/math/base/tools/hermitepoly' );
2830
import lucaspoly = require( '@stdlib/math/base/tools/lucaspoly' );
@@ -64,7 +66,7 @@ interface Namespace {
6466
continuedFraction: typeof continuedFraction;
6567

6668
/**
67-
* Evaluates a polynomial.
69+
* Evaluates a polynomial using double-precision floating-point arithmetic.
6870
*
6971
* ## Notes
7072
*
@@ -78,11 +80,11 @@ interface Namespace {
7880
* @returns evaluated polynomial
7981
*
8082
* @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
8284
* // returns 123.0
8385
*
8486
* @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 ] );
8688
*
8789
* var v = polyval( 10.0 ); // => 3*10^0 + 2*10^1 + 1*10^2
8890
* // returns 123.0
@@ -93,16 +95,48 @@ interface Namespace {
9395
evalpoly: typeof evalpoly;
9496

9597
/**
96-
* Evaluates a rational function, i.e., the ratio of two polynomials described by the coefficients stored in \\(P\\) and \\(Q\\).
98+
* Evaluates a polynomial using single-precision floating-point arithmetic.
9799
*
98100
* ## Notes
99101
*
100-
* - Coefficients should be sorted in ascending degree.
101102
* - The implementation uses [Horner's rule][horners-method] for efficient computation.
102103
*
103104
* [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method
104105
*
105106
*
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+
*
106140
* @param P - numerator polynomial coefficients sorted in ascending degree
107141
* @param Q - denominator polynomial coefficients sorted in ascending degree
108142
* @param x - value at which to evaluate the rational function
@@ -129,6 +163,46 @@ interface Namespace {
129163
*/
130164
evalrational: typeof evalrational;
131165

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+
132206
/**
133207
* Evaluates a Fibonacci polynomial.
134208
*
@@ -197,7 +271,7 @@ interface Namespace {
197271
lucaspoly: typeof lucaspoly;
198272

199273
/**
200-
* Evaluates a normalized Hermite polynomial.
274+
* Evaluates a normalized Hermite polynomial using double-precision floating-point arithmetic.
201275
*
202276
* @param n - nonnegative polynomial degree
203277
* @param x - evaluation point

0 commit comments

Comments
 (0)