Skip to content

Commit a3855ac

Browse files
committed
Auto-generated commit
1 parent fb4b3db commit a3855ac

File tree

7 files changed

+50
-31
lines changed

7 files changed

+50
-31
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+
- [`07b51a4`](https://github.com/stdlib-js/stdlib/commit/07b51a4996fa515e6a2595413027b1fa670f7503) - **bench:** update random value generation [(#6378)](https://github.com/stdlib-js/stdlib/pull/6378) _(by Harsh, Philipp Burckhardt)_
2526
- [`bf5643f`](https://github.com/stdlib-js/stdlib/commit/bf5643fb1a3f32a60903d8e210f71571e609119f) - **docs:** update related packages sections [(#3404)](https://github.com/stdlib-js/stdlib/pull/3404) _(by stdlib-bot)_
2627
- [`b0e68c5`](https://github.com/stdlib-js/stdlib/commit/b0e68c5bc8ee985794eb2ea1791c9337cd15fbd0) - **chore:** update to modern benchmark Makefile _(by Philipp Burckhardt)_
2728
- [`d8a4cfb`](https://github.com/stdlib-js/stdlib/commit/d8a4cfb578a949ed07c7a18749e48096f4f9b488) - **revert:** chore: update to modern benchmark Makefile _(by Philipp Burckhardt)_
@@ -37,8 +38,9 @@
3738

3839
### Contributors
3940

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

43+
- Harsh
4244
- Philipp Burckhardt
4345

4446
</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 <jain.aadishj@gmail.com>
6+
Aarya Balwadkar <142713127+AaryaBalwadkar@users.noreply.github.com>
67
Aayush Khanna <aayushiitbhu23@gmail.com>
78
Abdelrahman Samir <60700731+abdelrahman04@users.noreply.github.com>
9+
Abdul Kaium <97376242+impawstarlight@users.noreply.github.com>
810
Abhay Punia <156515195+Hecker165@users.noreply.github.com>
911
Abhijit Raut <abhijitmraut8010@gmail.com>
1012
Abhishek Jain <40913033+abhishekblue@users.noreply.github.com>
@@ -16,6 +18,7 @@ Ahmed Khaled <kahmd1444@gmail.com>
1618
Aksshay Balasubramanian <119944779+Aksshay88@users.noreply.github.com>
1719
Aleksandr <112382387+alextes90@users.noreply.github.com>
1820
Ali Salesi <ali_sal1381@yahoo.com>
21+
AlyAbdelmoneim <148393799+AlyAbdelmoneim@users.noreply.github.com>
1922
Aman Bhansali <bhansali.1@iitj.ac.in>
2023
AmanBhadkariya <140033975+AmanBhadkariya@users.noreply.github.com>
2124
Amit Jimiwal <amitjimiwal45@gmail.com>
@@ -24,6 +27,7 @@ Anshu Kumar <contact.anshukumar@protonmail.com>
2427
Anudeep Sanapala <anudeep0306@gmail.com>
2528
Athan Reines <kgryte@gmail.com>
2629
Ayaka <73595362+USERSATOSHI@users.noreply.github.com>
30+
Bhavishy Agrawal <90029607+bhavishy2801@users.noreply.github.com>
2731
Brendan Graetz <bguiz@users.noreply.github.com>
2832
Bruno Fenzl <brunofenzl@gmail.com>
2933
Bryan Elee <rxbryn@gmail.com>
@@ -61,6 +65,7 @@ Jaimin Godhani <112328542+Jai0401@users.noreply.github.com>
6165
Jaison D Souza <123267719+jsndz@users.noreply.github.com>
6266
Jalaj Kumar <142599224+jalajk3004@users.noreply.github.com>
6367
James Gelok <jdgelok@gmail.com>
68+
Jay Soni <jaygsoni14@gmail.com>
6469
Jaysukh Makvana <jaysukhmakvana2004@gmail.com>
6570
Jenish Thapa <141203631+jenish-thapa@users.noreply.github.com>
6671
Jithin KS <jithinks112@gmail.com>
@@ -73,11 +78,13 @@ Justyn Shelby <96994781+ShelbyJustyn@users.noreply.github.com>
7378
Karan Anand <119553199+anandkaranubc@users.noreply.github.com>
7479
Karthik Prakash <116057817+skoriop@users.noreply.github.com>
7580
Kaushikgtm <162317291+Kaushikgtm@users.noreply.github.com>
81+
Kavyansh-Bagdi <153486713+Kavyansh-Bagdi@users.noreply.github.com>
7682
Kohantika Nath <145763549+kohantikanath@users.noreply.github.com>
7783
Krishnam Agarwal <83017176+888krishnam@users.noreply.github.com>
7884
Krishnendu Das <86651039+itskdhere@users.noreply.github.com>
7985
Kshitij-Dale <152467202+Kshitij-Dale@users.noreply.github.com>
8086
Lovelin Dhoni J B <100030865+lovelindhoni@users.noreply.github.com>
87+
MANI <77221000+Eternity0207@users.noreply.github.com>
8188
Manik Sharma <maniksharma.rke@gmail.com>
8289
Manvith M <148960168+manvith2003@users.noreply.github.com>
8390
Marcus Fantham <mfantham@users.noreply.github.com>
@@ -99,6 +106,7 @@ Ognjen Jevremović <ognjenjevremovic@users.noreply.github.com>
99106
Oneday12323 <107678750+Oneday12323@users.noreply.github.com>
100107
Ori Miles <97595296+orimiles5@users.noreply.github.com>
101108
Philipp Burckhardt <pburckhardt@outlook.com>
109+
Prajjwal Bajpai <142303989+prajjwalbajpai@users.noreply.github.com>
102110
Prajwal Kulkarni <prajwalkulkarni76@gmail.com>
103111
Pranav Goswami <pranavchiku11@gmail.com>
104112
Pranjal Jha <97080887+PraneGIT@users.noreply.github.com>
@@ -107,7 +115,9 @@ Pratik Singh <97464067+Pratik772846@users.noreply.github.com>
107115
Pratyush Kumar Chouhan <pratyushkumar0308@gmail.com>
108116
Priyansh Prajapati <88396544+itsspriyansh@users.noreply.github.com>
109117
Priyanshu Agarwal <113460573+AgPriyanshu18@users.noreply.github.com>
118+
Pulkit Gupta <65711278+pulkitgupta2@users.noreply.github.com>
110119
Pushpendra Chandravanshi <pushpendrachandravanshi4@gmail.com>
120+
Rahul Kumar <132570066+rahulptl165@users.noreply.github.com>
111121
Raunak Kumar Gupta <raunakmodanwal321@gmail.com>
112122
Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
113123
Ricky Reusser <rsreusser@gmail.com>
@@ -120,8 +130,10 @@ Rutam Kathale <138517416+performant23@users.noreply.github.com>
120130
Ruthwik Chikoti <145591715+ruthwikchikoti@users.noreply.github.com>
121131
Ryan Seal <splrk@users.noreply.github.com>
122132
Rylan Yang <137365285+rylany27@users.noreply.github.com>
133+
SAHIL KUMAR <168997976+sahilk45@users.noreply.github.com>
123134
SHIVAM YADAV <120725381+Shivam-1827@users.noreply.github.com>
124135
Sai Srikar Dumpeti <80447788+the-r3aper7@users.noreply.github.com>
136+
Sanchay Ketan Sinha <122982233+satansin123@users.noreply.github.com>
125137
Sarthak Paandey <145528240+SarthakPaandey@users.noreply.github.com>
126138
Saurabh Singh <saurabhsraghuvanshi@gmail.com>
127139
Seyyed Parsa Neshaei <spneshaei@users.noreply.github.com>

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 maxabsn = 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 = maxabsn( x, y );
43+
z = maxabsn( 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.max( Math.abs( x ), Math.abs( y ) ); // eslint-disable-line stdlib/no-builtin-math
67+
z = Math.max( 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/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 = fmax( fabs(x), fabs(y) );
106+
z = fmax( fabs( x[ i%100 ] ), fabs( y[ i%100 ] ) );
104107
if ( z != z ) {
105108
printf( "should not return NaN\n" );
106109
break;

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"@stdlib/constants-float64-ninf": "^0.2.2",
4646
"@stdlib/math-base-assert-is-nan": "^0.2.2",
4747
"@stdlib/math-base-assert-is-positive-zero": "^0.2.2",
48+
"@stdlib/random-array-uniform": "^0.2.1",
4849
"@stdlib/random-base-randu": "^0.2.1",
4950
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
5051
"istanbul": "^0.4.1",

test/test.js

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

4242
v = maxabsn( NaN, 3.14 );
43-
t.strictEqual( isnan( v ), true, 'returns NaN' );
43+
t.strictEqual( isnan( v ), true, 'returns expected value' );
4444

4545
v = maxabsn( 3.14, NaN );
46-
t.strictEqual( isnan( v ), true, 'returns NaN' );
46+
t.strictEqual( isnan( v ), true, 'returns expected value' );
4747

4848
v = maxabsn( NaN );
49-
t.strictEqual( isnan( v ), true, 'returns NaN' );
49+
t.strictEqual( isnan( v ), true, 'returns expected value' );
5050

5151
v = maxabsn( 3.14, 4.2, NaN );
52-
t.strictEqual( isnan( v ), true, 'returns NaN' );
52+
t.strictEqual( isnan( v ), true, 'returns expected value' );
5353

5454
t.end();
5555
});
@@ -58,49 +58,49 @@ tape( 'the function returns `+Infinity` if provided `+Infinity`', function test(
5858
var v;
5959

6060
v = maxabsn( PINF, 3.14 );
61-
t.strictEqual( v, PINF, 'returns +infinity' );
61+
t.strictEqual( v, PINF, 'returns expected value' );
6262

6363
v = maxabsn( 3.14, PINF );
64-
t.strictEqual( v, PINF, 'returns +infinity' );
64+
t.strictEqual( v, PINF, 'returns expected value' );
6565

6666
v = maxabsn( PINF );
67-
t.strictEqual( v, PINF, 'returns +infinity' );
67+
t.strictEqual( v, PINF, 'returns expected value' );
6868

6969
v = maxabsn( 3.14, 4.2, PINF );
70-
t.strictEqual( v, PINF, 'returns +infinity' );
70+
t.strictEqual( v, PINF, 'returns expected value' );
7171

7272
t.end();
7373
});
7474

7575
tape( 'the function returns `+infinity` if not provided any arguments', function test( t ) {
7676
var v = maxabsn();
77-
t.strictEqual( v, PINF, 'returns +infinity' );
77+
t.strictEqual( v, PINF, 'returns expected value' );
7878
t.end();
7979
});
8080

8181
tape( 'the function returns a correctly signed zero', function test( t ) {
8282
var v;
8383

8484
v = maxabsn( +0.0, -0.0 );
85-
t.strictEqual( isPositiveZero( v ), true, 'returns +0' );
85+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
8686

8787
v = maxabsn( -0.0, +0.0 );
88-
t.strictEqual( isPositiveZero( v ), true, 'returns +0' );
88+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
8989

9090
v = maxabsn( -0.0, -0.0 );
91-
t.strictEqual( isPositiveZero( v ), true, 'returns +0' );
91+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
9292

9393
v = maxabsn( +0.0, +0.0 );
94-
t.strictEqual( isPositiveZero( v ), true, 'returns +0' );
94+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
9595

9696
v = maxabsn( -0.0 );
97-
t.strictEqual( isPositiveZero( v ), true, 'returns +0' );
97+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
9898

9999
v = maxabsn( +0.0 );
100-
t.strictEqual( isPositiveZero( v ), true, 'returns +0' );
100+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
101101

102102
v = maxabsn( +0.0, -0.0, +0.0 );
103-
t.strictEqual( isPositiveZero( v ), true, 'returns +0' );
103+
t.strictEqual( isPositiveZero( v ), true, 'returns expected value' );
104104

105105
t.end();
106106
});

0 commit comments

Comments
 (0)