Skip to content

Commit 6945d05

Browse files
committed
Auto-generated commit
1 parent 914e351 commit 6945d05

File tree

5 files changed

+77
-8
lines changed

5 files changed

+77
-8
lines changed

.github/.keepalive

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

CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,52 @@
22

33
> Package changelog.
44
5+
<section class="release" id="unreleased">
6+
7+
## Unreleased (2025-03-05)
8+
9+
<section class="issues">
10+
11+
### Closed Issues
12+
13+
This release closes the following issue:
14+
15+
[#4976](https://github.com/stdlib-js/stdlib/issues/4976)
16+
17+
</section>
18+
19+
<!-- /.issues -->
20+
21+
<section class="commits">
22+
23+
### Commits
24+
25+
<details>
26+
27+
- [`e5238bb`](https://github.com/stdlib-js/stdlib/commit/e5238bb96b7138d346ea0db8b535aec64c8a856c) - **bench:** refactor random number generation in `stats/base/dists/laplace` [(#5270)](https://github.com/stdlib-js/stdlib/pull/5270) _(by GK Bishnoi)_
28+
29+
</details>
30+
31+
</section>
32+
33+
<!-- /.commits -->
34+
35+
<section class="contributors">
36+
37+
### Contributors
38+
39+
A total of 1 person contributed to this release. Thank you to this contributor:
40+
41+
- GK Bishnoi
42+
43+
</section>
44+
45+
<!-- /.contributors -->
46+
47+
</section>
48+
49+
<!-- /.release -->
50+
551
<section class="release" id="v0.2.2">
652

753
## 0.2.2 (2024-07-28)

CONTRIBUTORS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Aditya Sapra <adityaework@gmail.com>
1111
Ahmed Atwa <Ahmedatwa866@yahoo.com>
1212
Ahmed Kashkoush <ahmedkashkoush464@gmail.com>
1313
Ahmed Khaled <kahmd1444@gmail.com>
14+
Aksshay Balasubramanian <119944779+Aksshay88@users.noreply.github.com>
1415
Aleksandr <112382387+alextes90@users.noreply.github.com>
1516
Ali Salesi <ali_sal1381@yahoo.com>
1617
Aman Bhansali <bhansali.1@iitj.ac.in>
@@ -38,6 +39,7 @@ EuniceSim142 <77243938+EuniceSim142@users.noreply.github.com>
3839
Frank Kovacs <fran70kk@gmail.com>
3940
GK Bishnoi <gkishan1kyt@gmail.com>
4041
Gaurav <gaurav70380@gmail.com>
42+
Gautam sharma <gautamkrishnasharma1@gmail.com>
4143
Golden Kumar <103646877+AuenKr@users.noreply.github.com>
4244
Gunj Joshi <gunjjoshi8372@gmail.com>
4345
Gururaj Gurram <gururajgurram1512@gmail.com>
@@ -46,6 +48,7 @@ HarshaNP <96897754+GittyHarsha@users.noreply.github.com>
4648
Harshita Kalani <harshitakalani02@gmail.com>
4749
Hridyanshu <124202756+HRIDYANSHU054@users.noreply.github.com>
4850
Jaimin Godhani <112328542+Jai0401@users.noreply.github.com>
51+
Jalaj Kumar <142599224+jalajk3004@users.noreply.github.com>
4952
James Gelok <jdgelok@gmail.com>
5053
Jaysukh Makvana <jaysukhmakvana2004@gmail.com>
5154
Jenish Thapa <141203631+jenish-thapa@users.noreply.github.com>
@@ -55,6 +58,7 @@ Joey Reed <joeyrreed@gmail.com>
5558
Jordan Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com>
5659
Joris Labie <joris.labie1@gmail.com>
5760
Justin Dennison <justin1dennison@gmail.com>
61+
Justyn Shelby <96994781+ShelbyJustyn@users.noreply.github.com>
5862
Karan Anand <119553199+anandkaranubc@users.noreply.github.com>
5963
Karthik Prakash <116057817+skoriop@users.noreply.github.com>
6064
Kohantika Nath <145763549+kohantikanath@users.noreply.github.com>
@@ -133,9 +137,13 @@ Vivek Maurya <vm8118134@gmail.com>
133137
Xiaochuan Ye <tap91624@gmail.com>
134138
Yaswanth Kosuru <116426380+yaswanthkosuru@users.noreply.github.com>
135139
Yernar Yergaziyev <yernar.yergaziyev@erg.kz>
140+
Yugal Kaushik <yugalkaushik14@gmail.com>
136141
Yuvi Mittal <128018763+yuvi-mittal@users.noreply.github.com>
142+
ditsu <170345142+ditsus@users.noreply.github.com>
137143
ekambains <bainsinbusiness@gmail.com>
144+
fadiothman22 <48636283+fadiothman22@users.noreply.github.com>
138145
olenkabilonizhka <62379231+olenkabilonizhka@users.noreply.github.com>
139146
pranav-1720 <123018993+pranav-1720@users.noreply.github.com>
147+
rahulrangers <127782777+rahulrangers@users.noreply.github.com>
140148
rainn <88160429+AmCodesLame@users.noreply.github.com>
141149
rei2hu <reimu@reimu.ws>

benchmark/benchmark.js

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

2323
var bench = require( '@stdlib/bench-harness' );
24-
var randu = require( '@stdlib/random-base-randu' );
24+
var Float64Array = require( '@stdlib/array-float64' );
25+
var uniform = require( '@stdlib/random-base-uniform' );
2526
var isnan = require( '@stdlib/math-base-assert-is-nan' );
2627
var EPS = require( '@stdlib/constants-float64-eps' );
2728
var pkg = require( './../package.json' ).name;
@@ -32,17 +33,25 @@ var logcdf = require( './../lib' );
3233

3334
bench( pkg, function benchmark( b ) {
3435
var scale;
36+
var len;
3537
var mu;
3638
var x;
3739
var y;
3840
var i;
3941

42+
len = 100;
43+
x = new Float64Array( len );
44+
mu = new Float64Array( len );
45+
scale = new Float64Array( len );
46+
for ( i = 0; i < len; i++ ) {
47+
x[ i ] = uniform( -100.0, 100.0 );
48+
mu[ i ] = uniform( -50.0, 50.0 );
49+
scale[ i ] = uniform( EPS, 20.0 );
50+
}
51+
4052
b.tic();
4153
for ( i = 0; i < b.iterations; i++ ) {
42-
x = ( randu()*200.0 ) - 100;
43-
mu = ( randu()*100.0 ) - 50.0;
44-
scale = ( randu()*20.0 ) + EPS;
45-
y = logcdf( x, mu, scale );
54+
y = logcdf( x[ i % len ], mu[ i % len ], scale[ i % len ] );
4655
if ( isnan( y ) ) {
4756
b.fail( 'should not return NaN' );
4857
}
@@ -58,19 +67,24 @@ bench( pkg, function benchmark( b ) {
5867
bench( pkg+':factory', function benchmark( b ) {
5968
var mylogcdf;
6069
var scale;
70+
var len;
6171
var mu;
6272
var x;
6373
var y;
6474
var i;
6575

6676
mu = 0.0;
6777
scale = 1.5;
78+
len = 100;
79+
x = new Float64Array( len );
6880
mylogcdf = logcdf.factory( mu, scale );
81+
for ( i = 0; i < len; i++ ) {
82+
x[ i ] = uniform( -2.0, 2.0 );
83+
}
6984

7085
b.tic();
7186
for ( i = 0; i < b.iterations; i++ ) {
72-
x = ( randu()*4.0 ) - 2.0;
73-
y = mylogcdf( x );
87+
y = mylogcdf( x[ i % len ] );
7488
if ( isnan( y ) ) {
7589
b.fail( 'should not return NaN' );
7690
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@
4545
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.2"
4646
},
4747
"devDependencies": {
48+
"@stdlib/array-float64": "^0.2.2",
4849
"@stdlib/constants-float64-eps": "^0.2.2",
4950
"@stdlib/constants-float64-ninf": "^0.2.2",
5051
"@stdlib/constants-float64-pinf": "^0.2.2",
5152
"@stdlib/math-base-special-abs": "^0.2.2",
5253
"@stdlib/random-base-randu": "^0.2.1",
54+
"@stdlib/random-base-uniform": "^0.2.1",
5355
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
5456
"istanbul": "^0.4.1",
5557
"tap-min": "git+https://github.com/Planeshifter/tap-min.git",

0 commit comments

Comments
 (0)