Skip to content

Commit 43200c5

Browse files
chore: stuff from code review
1 parent 4d5ed0a commit 43200c5

File tree

6 files changed

+9
-21
lines changed

6 files changed

+9
-21
lines changed

lib/node_modules/@stdlib/stats/base/dists/beta/logpdf/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ Evaluates the natural logarithm of the probability density function (logPDF) for
201201

202202
```c
203203
double y = stdlib_base_dists_beta_logpdf( 0.5, 1.0, 1.0 );
204-
// returns ~0.0
204+
// returns 0.0
205205
```
206206

207207
The function accepts the following arguments:
@@ -256,7 +256,7 @@ int main( void ) {
256256
alpha = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 5.0 );
257257
beta = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 5.0 );
258258
y = stdlib_base_dists_beta_logpdf( x, alpha, beta );
259-
printf( "x: %1f, α: %1f, β: %1f, ln(f(x;α,β)): %lf\n", x, alpha, beta, y );
259+
printf( "x: %1f. α: %1f. β: %1f. ln(f(x;α,β)): %lf\n", x, alpha, beta, y );
260260
}
261261
}
262262
```

lib/node_modules/@stdlib/stats/base/dists/beta/logpdf/benchmark/benchmark.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,11 @@ bench( pkg, function benchmark( b ) {
4141

4242
len = 100;
4343
alpha = new Float64Array( len );
44-
for ( i = 0; i < len; i++ ) {
45-
alpha[ i ] = uniform( EPS, 100.0 );
46-
}
4744
beta = new Float64Array( len );
48-
for ( i = 0; i < len; i++ ) {
49-
beta[ i ] = uniform( EPS, 100.0 );
50-
}
5145
x = new Float64Array( len );
5246
for ( i = 0; i < len; i++ ) {
47+
alpha[ i ] = uniform( EPS, 100.0 );
48+
beta[ i ] = uniform( EPS, 100.0 );
5349
x[ i ] = uniform( EPS, 2.0 );
5450
}
5551

lib/node_modules/@stdlib/stats/base/dists/beta/logpdf/benchmark/benchmark.native.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,11 @@ bench( pkg+'::native', opts, function benchmark( b ) {
5050

5151
len = 100;
5252
alpha = new Float64Array( len );
53-
for ( i = 0; i < len; i++ ) {
54-
alpha[ i ] = uniform( EPS, 100.0 );
55-
}
5653
beta = new Float64Array( len );
57-
for ( i = 0; i < len; i++ ) {
58-
beta[ i ] = uniform( EPS, 100.0 );
59-
}
6054
x = new Float64Array( len );
6155
for ( i = 0; i < len; i++ ) {
56+
alpha[ i ] = uniform( EPS, 100.0 );
57+
beta[ i ] = uniform( EPS, 100.0 );
6258
x[ i ] = uniform( EPS, 2.0 );
6359
}
6460

lib/node_modules/@stdlib/stats/base/dists/beta/logpdf/benchmark/c/benchmark.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,7 @@ static double benchmark( void ) {
103103

104104
for ( i = 0; i < 100; i++ ) {
105105
alpha[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 100.0 );
106-
}
107-
for ( i = 0; i < 100; i++ ) {
108106
beta[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 100.0 );
109-
}
110-
for ( i = 0; i < 100; i++ ) {
111107
x[ i ] = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 2.0 );
112108
}
113109

lib/node_modules/@stdlib/stats/base/dists/beta/logpdf/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ int main( void ) {
3838
alpha = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 5.0 );
3939
beta = random_uniform( STDLIB_CONSTANT_FLOAT64_EPS, 5.0 );
4040
y = stdlib_base_dists_beta_logpdf( x, alpha, beta );
41-
printf( "x: %1f, α: %1f, β: %1f, ln(f(x;α,β)): %lf\n", x, alpha, beta, y );
41+
printf( "x: %1f. α: %1f. β: %1f. ln(f(x;α,β)): %lf\n", x, alpha, beta, y );
4242
}
4343
}

lib/node_modules/@stdlib/stats/base/dists/beta/logpdf/src/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
* @param x input value
3131
* @param alpha first shape parameter
3232
* @param beta second shape parameter
33-
* @returns evaluated logPDF
33+
* @return evaluated logPDF
3434
*
3535
* @example
3636
* double y = stdlib_base_dists_beta_logpdf( 0.5, 1.0, 1.0 );
37-
* // returns ~0.0
37+
* // returns 0.0
3838
*/
3939
double stdlib_base_dists_beta_logpdf( const double x, double alpha, const double beta ) {
4040
double out;

0 commit comments

Comments
 (0)