Skip to content

Commit 19ea087

Browse files
committed
Auto-generated commit
1 parent 1d95c90 commit 19ea087

File tree

10 files changed

+59
-36
lines changed

10 files changed

+59
-36
lines changed

.github/.keepalive

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-03-17)
7+
## Unreleased (2025-03-29)
88

99
<section class="reverts">
1010

@@ -22,6 +22,7 @@
2222

2323
<details>
2424

25+
- [`c569d0f`](https://github.com/stdlib-js/stdlib/commit/c569d0ff888bc76a9980f5edb6e1c6f462d6e508) - **bench:** update random value generation [(#6380)](https://github.com/stdlib-js/stdlib/pull/6380) _(by Harsh, Philipp Burckhardt)_
2526
- [`c13062e`](https://github.com/stdlib-js/stdlib/commit/c13062e5b90cbe28ec62f0b690211bd14b626cf3) - **style:** update to use tabs for indentation _(by Philipp Burckhardt)_
2627
- [`ff25e13`](https://github.com/stdlib-js/stdlib/commit/ff25e1324e1507cc076078e82badce7fdf7915f6) - **docs:** remove excess whitespace _(by Philipp Burckhardt)_
2728
- [`b0e68c5`](https://github.com/stdlib-js/stdlib/commit/b0e68c5bc8ee985794eb2ea1791c9337cd15fbd0) - **chore:** update to modern benchmark Makefile _(by Philipp Burckhardt)_
@@ -38,8 +39,9 @@
3839

3940
### Contributors
4041

41-
A total of 1 person contributed to this release. Thank you to this contributor:
42+
A total of 2 people contributed to this release. Thank you to the following contributors:
4243

44+
- Harsh
4345
- Philipp Burckhardt
4446

4547
</section>

CONTRIBUTORS

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
# Contributors listed in alphabetical order.
44

55
Aadish Jain <[email protected]>
6+
Aarya Balwadkar <[email protected]>
67
Aayush Khanna <[email protected]>
78
Abdelrahman Samir <[email protected]>
9+
Abdul Kaium <[email protected]>
810
Abhay Punia <[email protected]>
911
Abhijit Raut <[email protected]>
1012
Abhishek Jain <[email protected]>
@@ -16,6 +18,7 @@ Ahmed Khaled <[email protected]>
1618
Aksshay Balasubramanian <[email protected]>
1719
Aleksandr <[email protected]>
1820
Ali Salesi <[email protected]>
21+
AlyAbdelmoneim <[email protected]>
1922
Aman Bhansali <[email protected]>
2023
AmanBhadkariya <[email protected]>
2124
Amit Jimiwal <[email protected]>
@@ -24,6 +27,7 @@ Anshu Kumar <[email protected]>
2427
Anudeep Sanapala <[email protected]>
2528
Athan Reines <[email protected]>
2629
30+
Bhavishy Agrawal <[email protected]>
2731
Brendan Graetz <[email protected]>
2832
Bruno Fenzl <[email protected]>
2933
Bryan Elee <[email protected]>
@@ -61,6 +65,7 @@ Jaimin Godhani <[email protected]>
6165
Jaison D Souza <[email protected]>
6266
Jalaj Kumar <[email protected]>
6367
James Gelok <[email protected]>
68+
6469
Jaysukh Makvana <[email protected]>
6570
Jenish Thapa <[email protected]>
6671
Jithin KS <[email protected]>
@@ -73,11 +78,13 @@ Justyn Shelby <[email protected]>
7378
Karan Anand <[email protected]>
7479
Karthik Prakash <[email protected]>
7580
Kaushikgtm <[email protected]>
81+
Kavyansh-Bagdi <[email protected]>
7682
Kohantika Nath <[email protected]>
7783
Krishnam Agarwal <[email protected]>
7884
Krishnendu Das <[email protected]>
7985
Kshitij-Dale <[email protected]>
8086
Lovelin Dhoni J B <[email protected]>
87+
8188
Manik Sharma <[email protected]>
8289
Manvith M <[email protected]>
8390
Marcus Fantham <[email protected]>
@@ -99,6 +106,7 @@ Ognjen Jevremović <[email protected]>
99106
Oneday12323 <[email protected]>
100107
Ori Miles <[email protected]>
101108
Philipp Burckhardt <[email protected]>
109+
Prajjwal Bajpai <[email protected]>
102110
Prajwal Kulkarni <[email protected]>
103111
Pranav Goswami <[email protected]>
104112
Pranjal Jha <[email protected]>
@@ -107,7 +115,9 @@ Pratik Singh <[email protected]>
107115
Pratyush Kumar Chouhan <[email protected]>
108116
Priyansh Prajapati <[email protected]>
109117
Priyanshu Agarwal <[email protected]>
118+
Pulkit Gupta <[email protected]>
110119
Pushpendra Chandravanshi <[email protected]>
120+
Rahul Kumar <[email protected]>
111121
Raunak Kumar Gupta <[email protected]>
112122
Rejoan Sardar <[email protected]>
113123
Ricky Reusser <[email protected]>
@@ -120,8 +130,10 @@ Rutam Kathale <[email protected]>
120130
Ruthwik Chikoti <[email protected]>
121131
Ryan Seal <[email protected]>
122132
Rylan Yang <[email protected]>
133+
SAHIL KUMAR <[email protected]>
123134
SHIVAM YADAV <[email protected]>
124135
Sai Srikar Dumpeti <[email protected]>
136+
Sanchay Ketan Sinha <[email protected]>
125137
Sarthak Paandey <[email protected]>
126138
Saurabh Singh <[email protected]>
127139
Seyyed Parsa Neshaei <[email protected]>

benchmark/benchmark.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
// MODULES //
2222

2323
var bench = require( '@stdlib/bench-harness' );
24-
var randu = require( '@stdlib/random-base-randu' );
24+
var uniform = require( '@stdlib/random-array-uniform' );
2525
var isnan = require( '@stdlib/math-base-assert-is-nan' );
2626
var pkg = require( './../package.json' ).name;
2727
var minabs = require( './../lib' );
@@ -35,11 +35,12 @@ bench( pkg, function benchmark( b ) {
3535
var z;
3636
var i;
3737

38+
x = uniform( 100, -500.0, 500.0 );
39+
y = uniform( 100, -500.0, 500.0 );
40+
3841
b.tic();
3942
for ( i = 0; i < b.iterations; i++ ) {
40-
x = ( randu()*1000.0 ) - 500.0;
41-
y = ( randu()*1000.0 ) - 500.0;
42-
z = minabs( x, y );
43+
z = minabs( x[ i%x.length ], y[ i%y.length ] );
4344
if ( isnan( z ) ) {
4445
b.fail( 'should not return NaN' );
4546
}
@@ -58,11 +59,12 @@ bench( pkg+'::built-in', function benchmark( b ) {
5859
var z;
5960
var i;
6061

62+
x = uniform( 100, -500.0, 500.0 );
63+
y = uniform( 100, -500.0, 500.0 );
64+
6165
b.tic();
6266
for ( i = 0; i < b.iterations; i++ ) {
63-
x = ( randu()*1000.0 ) - 500.0;
64-
y = ( randu()*1000.0 ) - 500.0;
65-
z = Math.min( Math.abs( x ), Math.abs( y ) ); // eslint-disable-line stdlib/no-builtin-math
67+
z = Math.min( Math.abs( x[ i%x.length ] ), Math.abs( y[ i%y.length ] ) ); // eslint-disable-line stdlib/no-builtin-math
6668
if ( isnan( z ) ) {
6769
b.fail( 'should not return NaN' );
6870
}

benchmark/benchmark.native.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var bench = require( '@stdlib/bench-harness' );
25-
var randu = require( '@stdlib/random-base-randu' );
25+
var uniform = require( '@stdlib/random-array-uniform' );
2626
var isnan = require( '@stdlib/math-base-assert-is-nan' );
2727
var tryRequire = require( '@stdlib/utils-try-require' );
2828
var pkg = require( './../package.json' ).name;
@@ -44,11 +44,12 @@ bench( pkg+'::native', opts, function benchmark( b ) {
4444
var z;
4545
var i;
4646

47+
x = uniform( 100, -500.0, 500.0 );
48+
y = uniform( 100, -500.0, 500.0 );
49+
4750
b.tic();
4851
for ( i = 0; i < b.iterations; i++ ) {
49-
x = ( randu()*1000.0 ) - 500.0;
50-
y = ( randu()*1000.0 ) - 500.0;
51-
z = minabs( x, y );
52+
z = minabs( x[ i%x.length ], y[ i%y.length ] );
5253
if ( isnan( z ) ) {
5354
b.fail( 'should not return NaN' );
5455
}

benchmark/c/benchmark.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,17 +90,20 @@ static double rand_double( void ) {
9090
*/
9191
static double benchmark( void ) {
9292
double elapsed;
93-
double x;
94-
double y;
93+
double x[ 100 ];
94+
double y[ 100 ];
9595
double z;
9696
double t;
9797
int i;
9898

99+
for ( i = 0; i < 100; i++ ) {
100+
x[ i ] = ( 1000.0*rand_double() ) - 500.0;
101+
y[ i ] = ( 1000.0*rand_double() ) - 500.0;
102+
}
103+
99104
t = tic();
100105
for ( i = 0; i < ITERATIONS; i++ ) {
101-
x = ( 1000.0*rand_double() ) - 500.0;
102-
y = ( 1000.0*rand_double() ) - 500.0;
103-
z = fmin( fabs(x), fabs(y) );
106+
z = fmin( fabs( x[ i%100 ] ), fabs( y[ i%100 ] ) );
104107
if ( z != z ) {
105108
printf( "should not return NaN\n" );
106109
break;

benchmark/c/native/benchmark.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,19 @@ static double rand_double( void ) {
9292
static double benchmark( void ) {
9393
double elapsed;
9494
double t;
95-
double x;
96-
double y;
95+
double x[ 100 ];
96+
double y[ 100 ];
9797
double z;
9898
int i;
9999

100+
for ( i = 0; i < 100; i++ ) {
101+
x[ i ] = ( 1000.0*rand_double() ) - 500.0;
102+
y[ i ] = ( 1000.0*rand_double() ) - 500.0;
103+
}
104+
100105
t = tic();
101106
for ( i = 0; i < ITERATIONS; i++ ) {
102-
x = ( 1000.0*rand_double() ) - 500.0;
103-
y = ( 1000.0*rand_double() ) - 500.0;
104-
z = stdlib_base_minabs( x, y );
107+
z = stdlib_base_minabs( x[ i%100 ], y[ i%100 ] );
105108
if ( z != z ) {
106109
printf( "should not return NaN\n" );
107110
break;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"@stdlib/constants-float64-pinf": "^0.2.2",
5050
"@stdlib/math-base-assert-is-nan": "^0.2.2",
5151
"@stdlib/math-base-assert-is-positive-zero": "^0.2.2",
52+
"@stdlib/random-array-uniform": "^0.2.1",
5253
"@stdlib/random-base-randu": "^0.2.1",
5354
"@stdlib/utils-try-require": "^0.2.2",
5455
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",

test/test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ tape( 'the function returns `NaN` if provided a `NaN`', function test( t ) {
3939
var v;
4040

4141
v = minabs( NaN, 3.14 );
42-
t.strictEqual( isnan( v ), true, 'returns NaN' );
42+
t.strictEqual( isnan( v ), true, 'returns expected value' );
4343

4444
v = minabs( 3.14, NaN );
45-
t.strictEqual( isnan( v ), true, 'returns NaN' );
45+
t.strictEqual( isnan( v ), true, 'returns expected value' );
4646

4747
t.end();
4848
});
@@ -51,16 +51,16 @@ tape( 'the function returns a correctly signed zero', function test( t ) {
5151
var v;
5252

5353
v = minabs( +0.0, -0.0 );
54-
t.strictEqual( isPositiveZero( v ), true, 'returns +0' );
54+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
5555

5656
v = minabs( -0.0, +0.0 );
57-
t.strictEqual( isPositiveZero( v ), true, 'returns +0' );
57+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
5858

5959
v = minabs( -0.0, -0.0 );
60-
t.strictEqual( isPositiveZero( v ), true, 'returns +0' );
60+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
6161

6262
v = minabs( +0.0, +0.0 );
63-
t.strictEqual( isPositiveZero( v ), true, 'returns +0' );
63+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
6464

6565
t.end();
6666
});

test/test.native.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ tape( 'the function returns `NaN` if provided a `NaN`', opts, function test( t )
4848
var v;
4949

5050
v = minabs( NaN, 3.14 );
51-
t.strictEqual( isnan( v ), true, 'returns NaN' );
51+
t.strictEqual( isnan( v ), true, 'returns expected value' );
5252

5353
v = minabs( 3.14, NaN );
54-
t.strictEqual( isnan( v ), true, 'returns NaN' );
54+
t.strictEqual( isnan( v ), true, 'returns expected value' );
5555

5656
t.end();
5757
});
@@ -60,16 +60,16 @@ tape( 'the function returns a correctly signed zero', opts, function test( t ) {
6060
var v;
6161

6262
v = minabs( +0.0, -0.0 );
63-
t.strictEqual( isPositiveZero( v ), true, 'returns +0' );
63+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
6464

6565
v = minabs( -0.0, +0.0 );
66-
t.strictEqual( isPositiveZero( v ), true, 'returns +0' );
66+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
6767

6868
v = minabs( -0.0, -0.0 );
69-
t.strictEqual( isPositiveZero( v ), true, 'returns +0' );
69+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
7070

7171
v = minabs( +0.0, +0.0 );
72-
t.strictEqual( isPositiveZero( v ), true, 'returns +0' );
72+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
7373

7474
t.end();
7575
});

0 commit comments

Comments
 (0)