Skip to content

Commit 39d41c0

Browse files
authored
Apply suggestions from code review
Co-authored-by: Athan <kgryte@gmail.com> Signed-off-by: Athan <kgryte@gmail.com>
1 parent 55f863f commit 39d41c0

4 files changed

Lines changed: 22 additions & 16 deletions

File tree

lib/node_modules/@stdlib/math/base/tools/chebyshev-series/docs/repl.txt

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
12
{{alias}}( x, c )
23
Evaluates a Chebyshev series using double-precision floating-point
3-
arithmetic. The implementation uses Clenshaw's recurrence algorithm and
4-
follows the Cephes convention where the constant term is halved and
5-
polynomials are evaluated at x/2.
4+
arithmetic.
5+
6+
The implementation uses Clenshaw's recurrence algorithm and follows the
7+
convention where the constant term is halved and polynomials are evaluated
8+
at x/2.
69

710
Parameters
811
----------
@@ -27,9 +30,11 @@
2730

2831
{{alias}}.factory( c )
2932
Returns a function for evaluating a Chebyshev series using double-
30-
precision floating-point arithmetic. The generated function uses
31-
Clenshaw's recurrence algorithm and follows the Cephes convention where
32-
the constant term is halved and polynomials are evaluated at x/2.
33+
precision floating-point arithmetic.
34+
35+
The returned function uses Clenshaw's recurrence algorithm and follows the
36+
convention where the constant term is halved and polynomials are evaluated
37+
at x/2.
3338

3439
Parameters
3540
----------

lib/node_modules/@stdlib/math/base/tools/chebyshev-series/docs/types/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ import chebyshevSeries = require( './index' );
6262

6363
// The function returned by the `factory` method returns a number...
6464
{
65-
var evaluate = chebyshevSeries.factory( [ 1.0, 0.5 ] );
65+
const evaluate = chebyshevSeries.factory( [ 1.0, 0.5 ] );
6666
evaluate( 1.0 ); // $ExpectType number
6767
}
6868

@@ -84,7 +84,7 @@ import chebyshevSeries = require( './index' );
8484

8585
// The compiler throws an error if the function returned by the `factory` method is provided an argument which is not a number...
8686
{
87-
var evaluate = chebyshevSeries.factory( [ 1.0, 0.5 ] );
87+
const evaluate = chebyshevSeries.factory( [ 1.0, 0.5 ] );
8888
evaluate( '5' ); // $ExpectError
8989
evaluate( true ); // $ExpectError
9090
evaluate( false ); // $ExpectError
@@ -97,7 +97,7 @@ import chebyshevSeries = require( './index' );
9797

9898
// The compiler throws an error if the function returned by the `factory` method is provided an unsupported number of arguments...
9999
{
100-
var evaluate = chebyshevSeries.factory( [ 1.0, 0.5 ] );
100+
const evaluate = chebyshevSeries.factory( [ 1.0, 0.5 ] );
101101
evaluate(); // $ExpectError
102102
evaluate( 1.0, 2.0 ); // $ExpectError
103103
}

lib/node_modules/@stdlib/math/base/tools/chebyshev-series/examples/index.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,22 @@
1919
'use strict';
2020

2121
var discreteUniform = require( '@stdlib/random/array/discrete-uniform' );
22-
var runiform = require( '@stdlib/random/array/uniform' );
23-
var uniform = require( '@stdlib/random/base/uniform' );
22+
var uniform = require( '@stdlib/random/array/uniform' );
2423
var logEachMap = require( '@stdlib/console/log-each-map' );
2524
var chebyshevSeries = require( './../lib' );
2625

2726
// Create an array of random coefficients:
2827
var coef = discreteUniform( 10, -100, 100 );
2928

3029
// Evaluate the series at random values using the direct function:
31-
var v;
30+
var v = uniform( 100, -2.0, 2.0 );
3231
var i;
3332
console.log( 'Direct evaluation:' );
3433
for ( i = 0; i < 100; i++ ) {
35-
v = uniform( -2.0, 2.0 );
36-
console.log( 'f(%d) = %d', v, chebyshevSeries( v, coef ) );
34+
console.log( 'f(%d) = %d', v[ i ], chebyshevSeries( v[ i ], coef ) );
3735
}
3836

3937
// Generate a chebyshev series evaluation function:
4038
var evaluate = chebyshevSeries.factory( coef );
41-
var x = runiform( 100, -2.0, 2.0 );
39+
var x = uniform( 100, -2.0, 2.0 );
4240
logEachMap( 'f(%d) = %d', x, evaluate );

lib/node_modules/@stdlib/math/base/tools/chebyshev-series/lib/main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@
3737
/**
3838
* Evaluates a Chebyshev series.
3939
*
40-
* ```text
40+
*
41+
* ## Notes
42+
*
43+
*
4144
* N-1
4245
* - '
4346
* y = > c[i] T (x/2)

0 commit comments

Comments
 (0)