Skip to content

Commit ec140d7

Browse files
committed
Refactor random number generation in JS benchmarks
--- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent 328cf68 commit ec140d7

File tree

7 files changed

+99
-98
lines changed

7 files changed

+99
-98
lines changed

lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ for ( i = 0; i < lambda.length; i++ ) {
158158

159159
#### stdlib_base_dists_planck_logcdf( x, lambda )
160160

161-
Evaluates the logarithm of cumulative distribution function (logcdf) for an planck distribution.
161+
Evaluates the logarithm of cumulative distribution function (logcdf) for an planck distribution with shape parameter `lambda`.
162162

163163
```c
164164
double out = stdlib_base_dists_planck_logcdf( 2, 0.5,);

lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/benchmark/benchmark.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,17 @@ bench( pkg, function benchmark( b ) {
6363

6464
bench( pkg+':factory', function benchmark( b ) {
6565
var mylogcdf;
66+
var len;
6667
var x;
6768
var y;
6869
var i;
6970

70-
x = discreteUniform( 100, 0, 40 );
71+
len = 100;
7172
mylogcdf = logcdf.factory( 0.3 );
73+
x = new Float64Array( len );
74+
for ( i = 0; i < len; i++ ) {
75+
x[i] = discreteUniform( 0, 40 );
76+
}
7277

7378
b.tic();
7479
for ( i = 0; i < b.iterations; i++ ) {

lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/benchmark/benchmark.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ bench( pkg+'::native', opts, function benchmark( b ) {
5252
x = new Float64Array( len );
5353
for ( i = 0; i < len; i++ ) {
5454
x[i] = discreteUniform(0, 40);
55-
lambda[i] = uniform(1.0, 11.0);
55+
lambda[i] = uniform(1.0, 10.0);
5656
}
5757

5858
b.tic();

lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/include/stdlib/stats/base/dists/planck/logcdf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern "C" {
2727
#endif
2828

2929
/**
30-
* Evaluates the logarithmic cumulative distribution function for an planck distribution with shape parameter 'lambda' at value 'x'.
30+
*Evaluates the logarithm of cumulative distribution function (logcdf) for an planck distribution with shape parameter `lambda`.
3131
*/
3232
double stdlib_base_dists_planck_logcdf( const double x, const double lambda );
3333

lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/lib/native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ var addon = require( './../src/addon.node' );
2626
// MAIN //
2727

2828
/**
29-
* Evaluates the logarithm of the cumulative distribution function (logCDF) for a Planck (discrete exponential) distribution with shape parameter `lambda` at a value `x`.
29+
*Evaluates the logarithm of cumulative distribution function (logcdf) for an planck distribution with shape parameter `lambda`.
3030
*
3131
* @private
3232
* @param {number} x - input value
Lines changed: 88 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,91 @@
11
{
2-
"options": {
2+
"options": {
3+
"task": "build",
4+
"wasm": false
5+
},
6+
"fields": [
7+
{
8+
"field": "src",
9+
"resolve": true,
10+
"relative": true
11+
},
12+
{
13+
"field": "include",
14+
"resolve": true,
15+
"relative": true
16+
},
17+
{
18+
"field": "libraries",
19+
"resolve": false,
20+
"relative": false
21+
},
22+
{
23+
"field": "libpath",
24+
"resolve": true,
25+
"relative": false
26+
}
27+
],
28+
"confs": [
29+
{
330
"task": "build",
4-
"wasm": false
31+
"wasm": false,
32+
"src": [
33+
"./src/main.c"
34+
],
35+
"include": [
36+
"./include"
37+
],
38+
"libraries": [],
39+
"libpath": [],
40+
"dependencies": [
41+
"@stdlib/math/base/napi/binary",
42+
"@stdlib/math/base/assert/is-nan",
43+
"@stdlib/math/base/special/floor",
44+
"@stdlib/math/base/special/expm1",
45+
"@stdlib/math/base/special/ln",
46+
"@stdlib/constants/float64/ninf",
47+
"@stdlib/constants/float64/pinf"
48+
]
49+
},
50+
{
51+
"task": "benchmark",
52+
"wasm": false,
53+
"src": [
54+
"./src/main.c"
55+
],
56+
"include": [
57+
"./include"
58+
],
59+
"libraries": [],
60+
"libpath": [],
61+
"dependencies": [
62+
"@stdlib/math/base/assert/is-nan",
63+
"@stdlib/math/base/special/floor",
64+
"@stdlib/math/base/special/expm1",
65+
"@stdlib/math/base/special/ln",
66+
"@stdlib/constants/float64/ninf",
67+
"@stdlib/constants/float64/pinf"
68+
]
569
},
6-
"fields": [
7-
{
8-
"field": "src",
9-
"resolve": true,
10-
"relative": true
11-
},
12-
{
13-
"field": "include",
14-
"resolve": true,
15-
"relative": true
16-
},
17-
{
18-
"field": "libraries",
19-
"resolve": false,
20-
"relative": false
21-
},
22-
{
23-
"field": "libpath",
24-
"resolve": true,
25-
"relative": false
26-
}
27-
],
28-
"confs": [
29-
{
30-
"task": "build",
31-
"wasm": false,
32-
"src": [
33-
"./src/main.c"
34-
],
35-
"include": [
36-
"./include"
37-
],
38-
"libraries": [],
39-
"libpath": [],
40-
"dependencies": [
41-
"@stdlib/math/base/napi/binary",
42-
"@stdlib/math/base/assert/is-nan",
43-
"@stdlib/math/base/special/floor",
44-
"@stdlib/math/base/special/expm1",
45-
"@stdlib/math/base/special/ln",
46-
"@stdlib/constants/float64/ninf",
47-
"@stdlib/constants/float64/pi",
48-
"@stdlib/constants/float64/pinf"
49-
50-
]
51-
},
52-
{
53-
"task": "benchmark",
54-
"wasm": false,
55-
"src": [
56-
"./src/main.c"
57-
],
58-
"include": [
59-
"./include"
60-
],
61-
"libraries": [],
62-
"libpath": [],
63-
"dependencies": [
64-
"@stdlib/math/base/assert/is-nan",
65-
"@stdlib/math/base/special/floor",
66-
"@stdlib/math/base/special/expm1",
67-
"@stdlib/math/base/special/ln",
68-
"@stdlib/constants/float64/ninf",
69-
"@stdlib/constants/float64/pi",
70-
"@stdlib/constants/float64/pinf"
71-
]
72-
},
73-
{
74-
"task": "examples",
75-
"wasm": false,
76-
"src": [
77-
"./src/main.c"
78-
],
79-
"include": [
80-
"./include"
81-
],
82-
"libraries": [],
83-
"libpath": [],
84-
"dependencies": [
85-
"@stdlib/math/base/assert/is-nan",
86-
"@stdlib/math/base/special/floor",
87-
"@stdlib/math/base/special/expm1",
88-
"@stdlib/math/base/special/ln",
89-
"@stdlib/constants/float64/ninf",
90-
"@stdlib/constants/float64/pi",
91-
"@stdlib/constants/float64/pinf"
92-
]
93-
}
94-
]
95-
}
70+
{
71+
"task": "examples",
72+
"wasm": false,
73+
"src": [
74+
"./src/main.c"
75+
],
76+
"include": [
77+
"./include"
78+
],
79+
"libraries": [],
80+
"libpath": [],
81+
"dependencies": [
82+
"@stdlib/math/base/assert/is-nan",
83+
"@stdlib/math/base/special/floor",
84+
"@stdlib/math/base/special/expm1",
85+
"@stdlib/math/base/special/ln",
86+
"@stdlib/constants/float64/ninf",
87+
"@stdlib/constants/float64/pinf"
88+
]
89+
}
90+
]
91+
}

lib/node_modules/@stdlib/stats/base/dists/planck/logcdf/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
#include "stdlib/constants/float64/pinf.h"
2626

2727
/**
28-
* Evaluates the logarithm of the cumulative distribution function (logCDF) for a Planck distribution with shape parameter `lambda` at a value `x`.
28+
* Evaluates the logarithm of the cumulative distribution function (logCDF) for a Planck distribution with shape parameter `lambda` .
2929
*
3030
* @param x input value
3131
* @param lambda shape parameter

0 commit comments

Comments
 (0)