From 7bf1ca0369b2770b6ec3d9b73b14a17148a9b5d3 Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Mon, 25 Mar 2024 10:12:29 +0000 Subject: [PATCH] Auto-generated commit --- base/tools/docs/types/index.d.ts | 86 +++++++++++++++++++++++++++++--- 1 file changed, 80 insertions(+), 6 deletions(-) diff --git a/base/tools/docs/types/index.d.ts b/base/tools/docs/types/index.d.ts index c2a24ab8b..7dd181a84 100644 --- a/base/tools/docs/types/index.d.ts +++ b/base/tools/docs/types/index.d.ts @@ -22,7 +22,9 @@ import continuedFraction = require( './../../../../base/tools/continued-fraction' ); import evalpoly = require( './../../../../base/tools/evalpoly' ); +import evalpolyf = require( './../../../../base/tools/evalpolyf' ); import evalrational = require( './../../../../base/tools/evalrational' ); +import evalrationalf = require( './../../../../base/tools/evalrationalf' ); import fibpoly = require( './../../../../base/tools/fibpoly' ); import hermitepoly = require( './../../../../base/tools/hermitepoly' ); import lucaspoly = require( './../../../../base/tools/lucaspoly' ); @@ -64,7 +66,7 @@ interface Namespace { continuedFraction: typeof continuedFraction; /** - * Evaluates a polynomial. + * Evaluates a polynomial using double-precision floating-point arithmetic. * * ## Notes * @@ -78,11 +80,11 @@ interface Namespace { * @returns evaluated polynomial * * @example - * var v = ns.evalpoly( [3.0,2.0,1.0], 10.0 ); // 3*10^0 + 2*10^1 + 1*10^2 + * var v = ns.evalpoly( [ 3.0, 2.0, 1.0 ], 10.0 ); // 3*10^0 + 2*10^1 + 1*10^2 * // returns 123.0 * * @example - * var polyval = ns.evalpoly.factory( [3.0,2.0,1.0] ); + * var polyval = ns.evalpoly.factory( [ 3.0, 2.0, 1.0 ] ); * * var v = polyval( 10.0 ); // => 3*10^0 + 2*10^1 + 1*10^2 * // returns 123.0 @@ -93,16 +95,48 @@ interface Namespace { evalpoly: typeof evalpoly; /** - * Evaluates a rational function, i.e., the ratio of two polynomials described by the coefficients stored in \\(P\\) and \\(Q\\). + * Evaluates a polynomial using single-precision floating-point arithmetic. * * ## Notes * - * - Coefficients should be sorted in ascending degree. * - The implementation uses [Horner's rule][horners-method] for efficient computation. * * [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method * * + * @param c - polynomial coefficients sorted in ascending degree + * @param x - value at which to evaluate the polynomial + * @returns evaluated polynomial + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var v = ns.evalpolyf( new Float32Array( [ 3.0, 2.0, 1.0 ] ), 10.0 ); // 3*10^0 + 2*10^1 + 1*10^2 + * // returns 123.0 + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var polyval = ns.evalpolyf.factory( new Float32Array( [ 3.0, 2.0, 1.0 ] ) ); + * + * var v = polyval( 10.0 ); // => 3*10^0 + 2*10^1 + 1*10^2 + * // returns 123.0 + * + * v = polyval( 5.0 ); // => 3*5^0 + 2*5^1 + 1*5^2 + * // returns 38.0 + */ + evalpolyf: typeof evalpolyf; + + /** + * 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. + * + * ## Notes + * + * - Coefficients should be sorted in ascending degree. + * - The implementation uses [Horner's rule][horners-method] for efficient computation. + * + * [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method + * * @param P - numerator polynomial coefficients sorted in ascending degree * @param Q - denominator polynomial coefficients sorted in ascending degree * @param x - value at which to evaluate the rational function @@ -129,6 +163,46 @@ interface Namespace { */ evalrational: typeof evalrational; + /** + * 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. + * + * ## Notes + * + * - Coefficients should be sorted in ascending degree. + * - The implementation uses [Horner's rule][horners-method] for efficient computation. + * + * [horners-method]: https://en.wikipedia.org/wiki/Horner%27s_method + * + * @param P - numerator polynomial coefficients sorted in ascending degree + * @param Q - denominator polynomial coefficients sorted in ascending degree + * @param x - value at which to evaluate the rational function + * @returns evaluated rational function + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var P = new Float32Array( [ -6.0, -5.0 ] ); + * var Q = new Float32Array( [ 3.0, 0.5 ] ); + * + * 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) + * // returns -6.0 + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var P = new Float32Array( [ 20.0, 8.0, 3.0 ] ); + * var Q = new Float32Array( [ 10.0, 9.0, 1.0 ] ); + * + * var rational = ns.evalrationalf.factory( P, Q ); + * + * 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) + * // returns 2.0 + * + * 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) + * // returns 1.5 + */ + evalrationalf: typeof evalrationalf; + /** * Evaluates a Fibonacci polynomial. * @@ -197,7 +271,7 @@ interface Namespace { lucaspoly: typeof lucaspoly; /** - * Evaluates a normalized Hermite polynomial. + * Evaluates a normalized Hermite polynomial using double-precision floating-point arithmetic. * * @param n - nonnegative polynomial degree * @param x - evaluation point