Skip to content

Commit f647e27

Browse files
committed
Auto-generated commit
1 parent 44d2e0e commit f647e27

File tree

7 files changed

+82
-68
lines changed

7 files changed

+82
-68
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,14 +4,15 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2025-03-24)
7+
## Unreleased (2025-04-29)
88

99
<section class="commits">
1010

1111
### Commits
1212

1313
<details>
1414

15+
- [`7279e43`](https://github.com/stdlib-js/stdlib/commit/7279e433dc1936056560624b5892eea8d9350ef1) - **bench:** update random value generation [(#6853)](https://github.com/stdlib-js/stdlib/pull/6853) _(by Harsh)_
1516
- [`af55f0d`](https://github.com/stdlib-js/stdlib/commit/af55f0d6d6b4d06c36f46357740ea89a4639ab5b) - **bench:** refactor random number generation in `stats/base/dists/binomial` [(#4841)](https://github.com/stdlib-js/stdlib/pull/4841) _(by Karan Anand)_
1617

1718
</details>
@@ -24,8 +25,9 @@
2425

2526
### Contributors
2627

27-
A total of 1 person contributed to this release. Thank you to this contributor:
28+
A total of 2 people contributed to this release. Thank you to the following contributors:
2829

30+
- Harsh
2931
- Karan Anand
3032

3133
</section>

CONTRIBUTORS

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@ Dev Goel <135586571+corsairier@users.noreply.github.com>
4343
Dhanyabad behera <110620935+dhanyabad11@users.noreply.github.com>
4444
Dhruv Arvind Singh <154677013+DhruvArvindSingh@users.noreply.github.com>
4545
Dhruvil Mehta <68022411+dhruvilmehta@users.noreply.github.com>
46+
Dipjyoti Das <126075231+dipexplorer@users.noreply.github.com>
4647
Divyansh Seth <59174836+sethdivyansh@users.noreply.github.com>
4748
Dominic Lim <46486515+domlimm@users.noreply.github.com>
4849
Dominik Moritz <domoritz@gmail.com>
4950
Dorrin Sotoudeh <dorrinsotoudeh123@gmail.com>
5051
EuniceSim142 <77243938+EuniceSim142@users.noreply.github.com>
5152
Frank Kovacs <fran70kk@gmail.com>
5253
GK Bishnoi <gkishan1kyt@gmail.com>
54+
GURU PRASAD SHARMA <168292003+GURUPRASADSHARMA@users.noreply.github.com>
5355
Gaurav <gaurav70380@gmail.com>
5456
Gautam sharma <gautamkrishnasharma1@gmail.com>
5557
Golden Kumar <103646877+AuenKr@users.noreply.github.com>
@@ -75,15 +77,18 @@ Jordan Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com>
7577
Joris Labie <joris.labie1@gmail.com>
7678
Justin Dennison <justin1dennison@gmail.com>
7779
Justyn Shelby <96994781+ShelbyJustyn@users.noreply.github.com>
78-
Karan Anand <119553199+anandkaranubc@users.noreply.github.com>
80+
Karan Anand <anandkarancompsci@gmail.com>
81+
Karan Yadav <77043443+karanBRAVO@users.noreply.github.com>
7982
Karthik Prakash <116057817+skoriop@users.noreply.github.com>
8083
Kaushikgtm <162317291+Kaushikgtm@users.noreply.github.com>
84+
Kavyansh-Bagdi <153486713+Kavyansh-Bagdi@users.noreply.github.com>
8185
Kohantika Nath <145763549+kohantikanath@users.noreply.github.com>
8286
Krishnam Agarwal <83017176+888krishnam@users.noreply.github.com>
8387
Krishnendu Das <86651039+itskdhere@users.noreply.github.com>
8488
Kshitij-Dale <152467202+Kshitij-Dale@users.noreply.github.com>
8589
Lovelin Dhoni J B <100030865+lovelindhoni@users.noreply.github.com>
8690
MANI <77221000+Eternity0207@users.noreply.github.com>
91+
Mahfuza Humayra Mohona <mhmohona@gmail.com>
8792
Manik Sharma <maniksharma.rke@gmail.com>
8893
Manvith M <148960168+manvith2003@users.noreply.github.com>
8994
Marcus Fantham <mfantham@users.noreply.github.com>
@@ -94,10 +99,14 @@ Mohammad Bin Aftab <48010758+MohammadBinAftab@users.noreply.github.com>
9499
Mohammad Kaif <mdkaifprofession@gmail.com>
95100
Momtchil Momtchev <momtchil@momtchev.com>
96101
Muhammad Haris <harriskhan047@outlook.com>
102+
Muhammad Taaha Tariq <166188821+Taaha-Tariq@users.noreply.github.com>
103+
Muhmmad Saad <106260977+saad-imran-dev@users.noreply.github.com>
97104
Naresh Jagadeesan <naresh.naresh000@gmail.com>
98105
Naveen Kumar <stupiddint@gmail.com>
99106
Neeraj Pathak <neerajrpathak710@gmail.com>
107+
NirvedMishra <139633597+NirvedMishra@users.noreply.github.com>
100108
Nishant Shinde <97207366+nishant-s7@users.noreply.github.com>
109+
Nishant singh <38534128+Nishantsingh11@users.noreply.github.com>
101110
Nishchay Rajput <121144841+NishchayRajput@users.noreply.github.com>
102111
Nithin Katta <88046362+nithinkatta@users.noreply.github.com>
103112
Nourhan Hasan <109472010+TheNourhan@users.noreply.github.com>
@@ -110,8 +119,10 @@ Prajwal Kulkarni <prajwalkulkarni76@gmail.com>
110119
Pranav Goswami <pranavchiku11@gmail.com>
111120
Pranjal Jha <97080887+PraneGIT@users.noreply.github.com>
112121
Prashant Kumar Yadav <144602492+0PrashantYadav0@users.noreply.github.com>
122+
PrathamBhamare <164445568+PrathamBhamare@users.noreply.github.com>
113123
Pratik Singh <97464067+Pratik772846@users.noreply.github.com>
114124
Pratyush Kumar Chouhan <pratyushkumar0308@gmail.com>
125+
Pravesh Kunwar <praveshkunwar04@gmail.com>
115126
Priyansh Prajapati <88396544+itsspriyansh@users.noreply.github.com>
116127
Priyanshu Agarwal <113460573+AgPriyanshu18@users.noreply.github.com>
117128
Pulkit Gupta <65711278+pulkitgupta2@users.noreply.github.com>
@@ -125,11 +136,15 @@ Rishav <115060907+rishav2404@users.noreply.github.com>
125136
Rishav Tarway <rishavtarway@gmail.com>
126137
Robert Gislason <gztown2216@yahoo.com>
127138
Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com>
139+
Rupa <102663541+Rupa-Rd@users.noreply.github.com>
128140
Rutam Kathale <138517416+performant23@users.noreply.github.com>
129141
Ruthwik Chikoti <145591715+ruthwikchikoti@users.noreply.github.com>
130142
Ryan Seal <splrk@users.noreply.github.com>
131143
Rylan Yang <137365285+rylany27@users.noreply.github.com>
144+
SAHIL KUMAR <168997976+sahilk45@users.noreply.github.com>
132145
SHIVAM YADAV <120725381+Shivam-1827@users.noreply.github.com>
146+
Sahil Goyal <87982509+sahil20021008@users.noreply.github.com>
147+
Sai Avinash <120403424+nasarobot@users.noreply.github.com>
133148
Sai Srikar Dumpeti <80447788+the-r3aper7@users.noreply.github.com>
134149
Sanchay Ketan Sinha <122982233+satansin123@users.noreply.github.com>
135150
Sarthak Paandey <145528240+SarthakPaandey@users.noreply.github.com>
@@ -164,9 +179,12 @@ Yaswanth Kosuru <116426380+yaswanthkosuru@users.noreply.github.com>
164179
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
165180
Yugal Kaushik <yugalkaushik14@gmail.com>
166181
Yuvi Mittal <128018763+yuvi-mittal@users.noreply.github.com>
182+
devshree-bhati <147095250+devshree-bhati@users.noreply.github.com>
167183
ditsu <170345142+ditsus@users.noreply.github.com>
168184
ekambains <bainsinbusiness@gmail.com>
169185
fadiothman22 <48636283+fadiothman22@users.noreply.github.com>
186+
iraandrushko <71790513+iraandrushko@users.noreply.github.com>
187+
lohithganni <116790357+lohithganni@users.noreply.github.com>
170188
olenkabilonizhka <62379231+olenkabilonizhka@users.noreply.github.com>
171189
pranav-1720 <123018993+pranav-1720@users.noreply.github.com>
172190
rahulrangers <127782777+rahulrangers@users.noreply.github.com>

benchmark/benchmark.js

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

2323
var bench = require( '@stdlib/bench-harness' );
24-
var Float64Array = require( '@stdlib/array-float64' );
25-
var uniform = require( '@stdlib/random-base-uniform' );
26-
var discreteUniform = require( '@stdlib/random-base-discrete-uniform' );
24+
var uniform = require( '@stdlib/random-array-uniform' );
25+
var discreteUniform = require( '@stdlib/random-array-discrete-uniform' );
2726
var isnan = require( '@stdlib/math-base-assert-is-nan' );
2827
var pkg = require( './../package.json' ).name;
2928
var cdf = require( './../lib' );
@@ -32,26 +31,23 @@ var cdf = require( './../lib' );
3231
// MAIN //
3332

3433
bench( pkg, function benchmark( b ) {
35-
var len;
34+
var opts;
3635
var n;
3736
var p;
3837
var x;
3938
var y;
4039
var i;
4140

42-
len = 100;
43-
x = new Float64Array( len );
44-
n = new Float64Array( len );
45-
p = new Float64Array( len );
46-
for ( i = 0; i < len; i++ ) {
47-
x[ i ] = uniform( 0.0, 100.0 );
48-
n[ i ] = discreteUniform( 1, 100 );
49-
p[ i ] = uniform( 0.0, 1.0 );
50-
}
41+
opts = {
42+
'dtype': 'float64'
43+
};
44+
x = uniform( 100, 0.0, 100.0, opts );
45+
n = discreteUniform( 100, 1, 100, opts );
46+
p = uniform( 100, 0, 1, opts );
5147

5248
b.tic();
5349
for ( i = 0; i < b.iterations; i++ ) {
54-
y = cdf( x[ i % len ], n[ i % len ], p[ i % len ] );
50+
y = cdf( x[ i % x.length ], n[ i % n.length ], p[ i % p.length ] );
5551
if ( isnan( y ) ) {
5652
b.fail( 'should not return NaN' );
5753
}
@@ -66,25 +62,25 @@ bench( pkg, function benchmark( b ) {
6662

6763
bench( pkg+':factory', function benchmark( b ) {
6864
var mycdf;
69-
var len;
65+
var opts;
7066
var n;
7167
var p;
7268
var x;
7369
var y;
7470
var i;
7571

72+
opts = {
73+
'dtype': 'float64'
74+
};
75+
x = uniform( 100, 0.0, 80.0, opts );
76+
7677
n = 80;
7778
p = 0.4;
7879
mycdf = cdf.factory( n, p );
79-
len = 100;
80-
x = new Float64Array( len );
81-
for ( i = 0; i < len; i++ ) {
82-
x[ i ] = uniform( 0.0, 80.0 );
83-
}
8480

8581
b.tic();
8682
for ( i = 0; i < b.iterations; i++ ) {
87-
y = mycdf( x[ i % len ] );
83+
y = mycdf( x[ i % x.length ] );
8884
if ( isnan( y ) ) {
8985
b.fail( 'should not return NaN' );
9086
}

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,13 @@
4646
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2"
4747
},
4848
"devDependencies": {
49-
"@stdlib/array-float64": "^0.2.2",
5049
"@stdlib/constants-float64-eps": "^0.2.2",
5150
"@stdlib/constants-float64-ninf": "^0.2.2",
5251
"@stdlib/math-base-special-abs": "^0.2.2",
5352
"@stdlib/math-base-special-round": "^0.3.0",
54-
"@stdlib/random-base-discrete-uniform": "^0.2.1",
53+
"@stdlib/random-array-discrete-uniform": "^0.2.1",
54+
"@stdlib/random-array-uniform": "^0.2.1",
5555
"@stdlib/random-base-randu": "^0.2.1",
56-
"@stdlib/random-base-uniform": "^0.2.1",
5756
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
5857
"istanbul": "^0.4.1",
5958
"tap-min": "git+https://github.com/Planeshifter/tap-min.git",

test/test.cdf.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -47,36 +47,36 @@ tape( 'main export is a function', function test( t ) {
4747

4848
tape( 'if provided `NaN` for any parameter, the function returns `NaN`', function test( t ) {
4949
var y = cdf( NaN, 10, 0.5 );
50-
t.equal( isnan( y ), true, 'returns NaN' );
50+
t.equal( isnan( y ), true, 'returns expected value' );
5151
y = cdf( 0.0, NaN, 0.5 );
52-
t.equal( isnan( y ), true, 'returns NaN' );
52+
t.equal( isnan( y ), true, 'returns expected value' );
5353
y = cdf( 0.0, 10, NaN );
54-
t.equal( isnan( y ), true, 'returns NaN' );
54+
t.equal( isnan( y ), true, 'returns expected value' );
5555
t.end();
5656
});
5757

5858
tape( 'if provided an `x` greater than or equal to `n`, the function returns `1` (provided `n` and `p` are valid)', function test( t ) {
5959
var y = cdf( PINF, 20, 0.5 );
60-
t.equal( y, 1.0, 'returns 1' );
60+
t.equal( y, 1.0, 'returns expected value' );
6161

6262
y = cdf( 200, 20, 0.5 );
63-
t.equal( y, 1.0, 'returns 1' );
63+
t.equal( y, 1.0, 'returns expected value' );
6464

6565
y = cdf( 21, 20, 0.5 );
66-
t.equal( y, 1.0, 'returns 1' );
66+
t.equal( y, 1.0, 'returns expected value' );
6767

6868
t.end();
6969
});
7070

7171
tape( 'if provided a negative number for `x` and a valid `n` and `p`, the function returns `0`', function test( t ) {
7272
var y = cdf( NINF, 20, 0.5 );
73-
t.equal( y, 0.0, 'returns 0' );
73+
t.equal( y, 0.0, 'returns expected value' );
7474

7575
y = cdf( -10.0, 20, 0.5 );
76-
t.equal( y, 0.0, 'returns 0' );
76+
t.equal( y, 0.0, 'returns expected value' );
7777

7878
y = cdf( -1.0, 20, 0.5 );
79-
t.equal( y, 0.0, 'returns 0' );
79+
t.equal( y, 0.0, 'returns expected value' );
8080

8181
t.end();
8282
});
@@ -85,19 +85,19 @@ tape( 'if provided a `n` which is not a nonnegative integer, the function return
8585
var y;
8686

8787
y = cdf( 2.0, 1.5, 0.5 );
88-
t.equal( isnan( y ), true, 'returns NaN' );
88+
t.equal( isnan( y ), true, 'returns expected value' );
8989

9090
y = cdf( 2.0, -2, 0.5 );
91-
t.equal( isnan( y ), true, 'returns NaN' );
91+
t.equal( isnan( y ), true, 'returns expected value' );
9292

9393
y = cdf( 2.0, -1, 0.5 );
94-
t.equal( isnan( y ), true, 'returns NaN' );
94+
t.equal( isnan( y ), true, 'returns expected value' );
9595

9696
y = cdf( 0.0, 2.5, 0.5 );
97-
t.equal( isnan( y ), true, 'returns NaN' );
97+
t.equal( isnan( y ), true, 'returns expected value' );
9898

9999
y = cdf( 0.0, PINF, 0.5 );
100-
t.equal( isnan( y ), true, 'returns NaN' );
100+
t.equal( isnan( y ), true, 'returns expected value' );
101101

102102
t.end();
103103
});
@@ -106,16 +106,16 @@ tape( 'if provided a success probability `p` outside of `[0,1]`, the function re
106106
var y;
107107

108108
y = cdf( 2.0, 20, -1.0 );
109-
t.equal( isnan( y ), true, 'returns NaN' );
109+
t.equal( isnan( y ), true, 'returns expected value' );
110110

111111
y = cdf( 0.0, 20, 1.5 );
112-
t.equal( isnan( y ), true, 'returns NaN' );
112+
t.equal( isnan( y ), true, 'returns expected value' );
113113

114114
y = cdf( 2.0, 20, NINF );
115-
t.equal( isnan( y ), true, 'returns NaN' );
115+
t.equal( isnan( y ), true, 'returns expected value' );
116116

117117
y = cdf( 2.0, 20, PINF );
118-
t.equal( isnan( y ), true, 'returns NaN' );
118+
t.equal( isnan( y ), true, 'returns expected value' );
119119

120120
t.end();
121121
});

0 commit comments

Comments
 (0)